// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Tctest.Monitor
{
    [TctestResourceType("tctest:Monitor/alarmPolicy:AlarmPolicy")]
    public partial class AlarmPolicy : Pulumi.CustomResource
    {
        /// <summary>
        /// A list of metric trigger condition.
        /// </summary>
        [Output("conditions")]
        public Output<Outputs.AlarmPolicyConditions> Conditions { get; private set; } = null!;

        /// <summary>
        /// ID of trigger condition template.
        /// </summary>
        [Output("conditonTemplateId")]
        public Output<int?> ConditonTemplateId { get; private set; } = null!;

        /// <summary>
        /// The alarm policy create time.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Whether to enable, default is `1`.
        /// </summary>
        [Output("enable")]
        public Output<int?> Enable { get; private set; } = null!;

        /// <summary>
        /// A list of event trigger condition.
        /// </summary>
        [Output("eventConditions")]
        public Output<ImmutableArray<Outputs.AlarmPolicyEventCondition>> EventConditions { get; private set; } = null!;

        /// <summary>
        /// The type of monitor.
        /// </summary>
        [Output("monitorType")]
        public Output<string> MonitorType { get; private set; } = null!;

        /// <summary>
        /// The type of alarm.
        /// </summary>
        [Output("namespace")]
        public Output<string> Namespace { get; private set; } = null!;

        /// <summary>
        /// List of notification rule IDs.
        /// </summary>
        [Output("noticeIds")]
        public Output<ImmutableArray<string>> NoticeIds { get; private set; } = null!;

        /// <summary>
        /// The name of policy.
        /// </summary>
        [Output("policyName")]
        public Output<string> PolicyName { get; private set; } = null!;

        /// <summary>
        /// Policy tag to bind object.
        /// </summary>
        [Output("policyTags")]
        public Output<ImmutableArray<Outputs.AlarmPolicyPolicyTag>> PolicyTags { get; private set; } = null!;

        /// <summary>
        /// Project ID. For products with different projects, a value other than -1 must be passed in.
        /// </summary>
        [Output("projectId")]
        public Output<int?> ProjectId { get; private set; } = null!;

        /// <summary>
        /// The remark of policy group.
        /// </summary>
        [Output("remark")]
        public Output<string?> Remark { get; private set; } = null!;

        /// <summary>
        /// Triggered task list.
        /// </summary>
        [Output("triggerTasks")]
        public Output<ImmutableArray<Outputs.AlarmPolicyTriggerTask>> TriggerTasks { get; private set; } = null!;

        /// <summary>
        /// The alarm policy update time.
        /// </summary>
        [Output("updateTime")]
        public Output<string> UpdateTime { get; private set; } = null!;


        /// <summary>
        /// Create a AlarmPolicy resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public AlarmPolicy(string name, AlarmPolicyArgs args, CustomResourceOptions? options = null)
            : base("tctest:Monitor/alarmPolicy:AlarmPolicy", name, args ?? new AlarmPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AlarmPolicy(string name, Input<string> id, AlarmPolicyState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Monitor/alarmPolicy:AlarmPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing AlarmPolicy resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static AlarmPolicy Get(string name, Input<string> id, AlarmPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new AlarmPolicy(name, id, state, options);
        }
    }

    public sealed class AlarmPolicyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// A list of metric trigger condition.
        /// </summary>
        [Input("conditions")]
        public Input<Inputs.AlarmPolicyConditionsArgs>? Conditions { get; set; }

        /// <summary>
        /// ID of trigger condition template.
        /// </summary>
        [Input("conditonTemplateId")]
        public Input<int>? ConditonTemplateId { get; set; }

        /// <summary>
        /// Whether to enable, default is `1`.
        /// </summary>
        [Input("enable")]
        public Input<int>? Enable { get; set; }

        [Input("eventConditions")]
        private InputList<Inputs.AlarmPolicyEventConditionArgs>? _eventConditions;

        /// <summary>
        /// A list of event trigger condition.
        /// </summary>
        public InputList<Inputs.AlarmPolicyEventConditionArgs> EventConditions
        {
            get => _eventConditions ?? (_eventConditions = new InputList<Inputs.AlarmPolicyEventConditionArgs>());
            set => _eventConditions = value;
        }

        /// <summary>
        /// The type of monitor.
        /// </summary>
        [Input("monitorType", required: true)]
        public Input<string> MonitorType { get; set; } = null!;

        /// <summary>
        /// The type of alarm.
        /// </summary>
        [Input("namespace", required: true)]
        public Input<string> Namespace { get; set; } = null!;

        [Input("noticeIds")]
        private InputList<string>? _noticeIds;

        /// <summary>
        /// List of notification rule IDs.
        /// </summary>
        public InputList<string> NoticeIds
        {
            get => _noticeIds ?? (_noticeIds = new InputList<string>());
            set => _noticeIds = value;
        }

        /// <summary>
        /// The name of policy.
        /// </summary>
        [Input("policyName", required: true)]
        public Input<string> PolicyName { get; set; } = null!;

        [Input("policyTags")]
        private InputList<Inputs.AlarmPolicyPolicyTagArgs>? _policyTags;

        /// <summary>
        /// Policy tag to bind object.
        /// </summary>
        public InputList<Inputs.AlarmPolicyPolicyTagArgs> PolicyTags
        {
            get => _policyTags ?? (_policyTags = new InputList<Inputs.AlarmPolicyPolicyTagArgs>());
            set => _policyTags = value;
        }

        /// <summary>
        /// Project ID. For products with different projects, a value other than -1 must be passed in.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// The remark of policy group.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        [Input("triggerTasks")]
        private InputList<Inputs.AlarmPolicyTriggerTaskArgs>? _triggerTasks;

        /// <summary>
        /// Triggered task list.
        /// </summary>
        public InputList<Inputs.AlarmPolicyTriggerTaskArgs> TriggerTasks
        {
            get => _triggerTasks ?? (_triggerTasks = new InputList<Inputs.AlarmPolicyTriggerTaskArgs>());
            set => _triggerTasks = value;
        }

        public AlarmPolicyArgs()
        {
        }
    }

    public sealed class AlarmPolicyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// A list of metric trigger condition.
        /// </summary>
        [Input("conditions")]
        public Input<Inputs.AlarmPolicyConditionsGetArgs>? Conditions { get; set; }

        /// <summary>
        /// ID of trigger condition template.
        /// </summary>
        [Input("conditonTemplateId")]
        public Input<int>? ConditonTemplateId { get; set; }

        /// <summary>
        /// The alarm policy create time.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Whether to enable, default is `1`.
        /// </summary>
        [Input("enable")]
        public Input<int>? Enable { get; set; }

        [Input("eventConditions")]
        private InputList<Inputs.AlarmPolicyEventConditionGetArgs>? _eventConditions;

        /// <summary>
        /// A list of event trigger condition.
        /// </summary>
        public InputList<Inputs.AlarmPolicyEventConditionGetArgs> EventConditions
        {
            get => _eventConditions ?? (_eventConditions = new InputList<Inputs.AlarmPolicyEventConditionGetArgs>());
            set => _eventConditions = value;
        }

        /// <summary>
        /// The type of monitor.
        /// </summary>
        [Input("monitorType")]
        public Input<string>? MonitorType { get; set; }

        /// <summary>
        /// The type of alarm.
        /// </summary>
        [Input("namespace")]
        public Input<string>? Namespace { get; set; }

        [Input("noticeIds")]
        private InputList<string>? _noticeIds;

        /// <summary>
        /// List of notification rule IDs.
        /// </summary>
        public InputList<string> NoticeIds
        {
            get => _noticeIds ?? (_noticeIds = new InputList<string>());
            set => _noticeIds = value;
        }

        /// <summary>
        /// The name of policy.
        /// </summary>
        [Input("policyName")]
        public Input<string>? PolicyName { get; set; }

        [Input("policyTags")]
        private InputList<Inputs.AlarmPolicyPolicyTagGetArgs>? _policyTags;

        /// <summary>
        /// Policy tag to bind object.
        /// </summary>
        public InputList<Inputs.AlarmPolicyPolicyTagGetArgs> PolicyTags
        {
            get => _policyTags ?? (_policyTags = new InputList<Inputs.AlarmPolicyPolicyTagGetArgs>());
            set => _policyTags = value;
        }

        /// <summary>
        /// Project ID. For products with different projects, a value other than -1 must be passed in.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// The remark of policy group.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        [Input("triggerTasks")]
        private InputList<Inputs.AlarmPolicyTriggerTaskGetArgs>? _triggerTasks;

        /// <summary>
        /// Triggered task list.
        /// </summary>
        public InputList<Inputs.AlarmPolicyTriggerTaskGetArgs> TriggerTasks
        {
            get => _triggerTasks ?? (_triggerTasks = new InputList<Inputs.AlarmPolicyTriggerTaskGetArgs>());
            set => _triggerTasks = value;
        }

        /// <summary>
        /// The alarm policy update time.
        /// </summary>
        [Input("updateTime")]
        public Input<string>? UpdateTime { get; set; }

        public AlarmPolicyState()
        {
        }
    }
}
