// *** 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/policyGroup:PolicyGroup")]
    public partial class PolicyGroup : Pulumi.CustomResource
    {
        /// <summary>
        /// A list binding objects(list only those in the `provider.region`). Each element contains the following attributes:
        /// </summary>
        [Output("bindingObjects")]
        public Output<ImmutableArray<Outputs.PolicyGroupBindingObject>> BindingObjects { get; private set; } = null!;

        /// <summary>
        /// A list of threshold rules. Each element contains the following attributes:
        /// </summary>
        [Output("conditions")]
        public Output<ImmutableArray<Outputs.PolicyGroupCondition>> Conditions { get; private set; } = null!;

        /// <summary>
        /// A list of dimensions for this policy group.
        /// </summary>
        [Output("dimensionGroups")]
        public Output<ImmutableArray<string>> DimensionGroups { get; private set; } = null!;

        /// <summary>
        /// A list of event rules. Each element contains the following attributes:
        /// </summary>
        [Output("eventConditions")]
        public Output<ImmutableArray<Outputs.PolicyGroupEventCondition>> EventConditions { get; private set; } = null!;

        /// <summary>
        /// Policy group name, length should between 1 and 20.
        /// </summary>
        [Output("groupName")]
        public Output<string> GroupName { get; private set; } = null!;

        /// <summary>
        /// The and or relation of indicator alarm rule. Valid values: `0`, `1`. `0` represents or rule (if any rule is met, the
        /// alarm will be raised), `1` represents and rule (if all rules are met, the alarm will be raised).The default is 0.
        /// </summary>
        [Output("isUnionRule")]
        public Output<int?> IsUnionRule { get; private set; } = null!;

        /// <summary>
        /// Recently edited user uin.
        /// </summary>
        [Output("lastEditUin")]
        public Output<string> LastEditUin { get; private set; } = null!;

        /// <summary>
        /// Policy view name, eg:`cvm_device`,`BANDWIDTHPACKAGE`, refer to
        /// `data.tencentcloud_monitor_policy_conditions(policy_view_name)`.
        /// </summary>
        [Output("policyViewName")]
        public Output<string> PolicyViewName { get; private set; } = null!;

        /// <summary>
        /// The project id to which the policy group belongs, default is `0`.
        /// </summary>
        [Output("projectId")]
        public Output<int?> ProjectId { get; private set; } = null!;

        /// <summary>
        /// A list of receivers. Each element contains the following attributes:
        /// </summary>
        [Output("receivers")]
        public Output<ImmutableArray<Outputs.PolicyGroupReceiver>> Receivers { get; private set; } = null!;

        /// <summary>
        /// Policy group's remark information.
        /// </summary>
        [Output("remark")]
        public Output<string> Remark { get; private set; } = null!;

        /// <summary>
        /// Support regions this policy group.
        /// </summary>
        [Output("supportRegions")]
        public Output<ImmutableArray<string>> SupportRegions { get; private set; } = null!;

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


        /// <summary>
        /// Create a PolicyGroup 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 PolicyGroup(string name, PolicyGroupArgs args, CustomResourceOptions? options = null)
            : base("tctest:Monitor/policyGroup:PolicyGroup", name, args ?? new PolicyGroupArgs(), MakeResourceOptions(options, ""))
        {
        }

        private PolicyGroup(string name, Input<string> id, PolicyGroupState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Monitor/policyGroup:PolicyGroup", 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 PolicyGroup 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 PolicyGroup Get(string name, Input<string> id, PolicyGroupState? state = null, CustomResourceOptions? options = null)
        {
            return new PolicyGroup(name, id, state, options);
        }
    }

    public sealed class PolicyGroupArgs : Pulumi.ResourceArgs
    {
        [Input("conditions")]
        private InputList<Inputs.PolicyGroupConditionArgs>? _conditions;

        /// <summary>
        /// A list of threshold rules. Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupConditionArgs> Conditions
        {
            get => _conditions ?? (_conditions = new InputList<Inputs.PolicyGroupConditionArgs>());
            set => _conditions = value;
        }

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

        /// <summary>
        /// A list of event rules. Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupEventConditionArgs> EventConditions
        {
            get => _eventConditions ?? (_eventConditions = new InputList<Inputs.PolicyGroupEventConditionArgs>());
            set => _eventConditions = value;
        }

        /// <summary>
        /// Policy group name, length should between 1 and 20.
        /// </summary>
        [Input("groupName", required: true)]
        public Input<string> GroupName { get; set; } = null!;

        /// <summary>
        /// The and or relation of indicator alarm rule. Valid values: `0`, `1`. `0` represents or rule (if any rule is met, the
        /// alarm will be raised), `1` represents and rule (if all rules are met, the alarm will be raised).The default is 0.
        /// </summary>
        [Input("isUnionRule")]
        public Input<int>? IsUnionRule { get; set; }

        /// <summary>
        /// Policy view name, eg:`cvm_device`,`BANDWIDTHPACKAGE`, refer to
        /// `data.tencentcloud_monitor_policy_conditions(policy_view_name)`.
        /// </summary>
        [Input("policyViewName", required: true)]
        public Input<string> PolicyViewName { get; set; } = null!;

        /// <summary>
        /// The project id to which the policy group belongs, default is `0`.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Policy group's remark information.
        /// </summary>
        [Input("remark", required: true)]
        public Input<string> Remark { get; set; } = null!;

        public PolicyGroupArgs()
        {
        }
    }

    public sealed class PolicyGroupState : Pulumi.ResourceArgs
    {
        [Input("bindingObjects")]
        private InputList<Inputs.PolicyGroupBindingObjectGetArgs>? _bindingObjects;

        /// <summary>
        /// A list binding objects(list only those in the `provider.region`). Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupBindingObjectGetArgs> BindingObjects
        {
            get => _bindingObjects ?? (_bindingObjects = new InputList<Inputs.PolicyGroupBindingObjectGetArgs>());
            set => _bindingObjects = value;
        }

        [Input("conditions")]
        private InputList<Inputs.PolicyGroupConditionGetArgs>? _conditions;

        /// <summary>
        /// A list of threshold rules. Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupConditionGetArgs> Conditions
        {
            get => _conditions ?? (_conditions = new InputList<Inputs.PolicyGroupConditionGetArgs>());
            set => _conditions = value;
        }

        [Input("dimensionGroups")]
        private InputList<string>? _dimensionGroups;

        /// <summary>
        /// A list of dimensions for this policy group.
        /// </summary>
        public InputList<string> DimensionGroups
        {
            get => _dimensionGroups ?? (_dimensionGroups = new InputList<string>());
            set => _dimensionGroups = value;
        }

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

        /// <summary>
        /// A list of event rules. Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupEventConditionGetArgs> EventConditions
        {
            get => _eventConditions ?? (_eventConditions = new InputList<Inputs.PolicyGroupEventConditionGetArgs>());
            set => _eventConditions = value;
        }

        /// <summary>
        /// Policy group name, length should between 1 and 20.
        /// </summary>
        [Input("groupName")]
        public Input<string>? GroupName { get; set; }

        /// <summary>
        /// The and or relation of indicator alarm rule. Valid values: `0`, `1`. `0` represents or rule (if any rule is met, the
        /// alarm will be raised), `1` represents and rule (if all rules are met, the alarm will be raised).The default is 0.
        /// </summary>
        [Input("isUnionRule")]
        public Input<int>? IsUnionRule { get; set; }

        /// <summary>
        /// Recently edited user uin.
        /// </summary>
        [Input("lastEditUin")]
        public Input<string>? LastEditUin { get; set; }

        /// <summary>
        /// Policy view name, eg:`cvm_device`,`BANDWIDTHPACKAGE`, refer to
        /// `data.tencentcloud_monitor_policy_conditions(policy_view_name)`.
        /// </summary>
        [Input("policyViewName")]
        public Input<string>? PolicyViewName { get; set; }

        /// <summary>
        /// The project id to which the policy group belongs, default is `0`.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        [Input("receivers")]
        private InputList<Inputs.PolicyGroupReceiverGetArgs>? _receivers;

        /// <summary>
        /// A list of receivers. Each element contains the following attributes:
        /// </summary>
        public InputList<Inputs.PolicyGroupReceiverGetArgs> Receivers
        {
            get => _receivers ?? (_receivers = new InputList<Inputs.PolicyGroupReceiverGetArgs>());
            set => _receivers = value;
        }

        /// <summary>
        /// Policy group's remark information.
        /// </summary>
        [Input("remark")]
        public Input<string>? Remark { get; set; }

        [Input("supportRegions")]
        private InputList<string>? _supportRegions;

        /// <summary>
        /// Support regions this policy group.
        /// </summary>
        public InputList<string> SupportRegions
        {
            get => _supportRegions ?? (_supportRegions = new InputList<string>());
            set => _supportRegions = value;
        }

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

        public PolicyGroupState()
        {
        }
    }
}
