<filename>sdk/dotnet/Ddos/SchedulerRule.cs// *** 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.AliCloud.Ddos
{
    /// <summary>
    /// Provides a DdosCoo Scheduler Rule resource. For information about DdosCoo Scheduler Rule and how to use it, see[What is DdosCoo Scheduler Rule](https://www.alibabacloud.com/help/en/doc-detail/157481.htm).
    /// 
    /// &gt; **NOTE:** Available in 1.86.0+
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.Ddos.SchedulerRule("example", new()
    ///     {
    ///         RuleName = "tf-testacc7929727",
    ///         RuleType = 3,
    ///         Rules = new[]
    ///         {
    ///             new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
    ///             {
    ///                 Priority = 100,
    ///                 RegionId = "cn-hangzhou",
    ///                 Type = "A",
    ///                 Value = "127.0.0.1",
    ///                 ValueType = 3,
    ///             },
    ///             new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
    ///             {
    ///                 Priority = 50,
    ///                 RegionId = "cn-hangzhou",
    ///                 Type = "A",
    ///                 Value = "127.0.0.0",
    ///                 ValueType = 1,
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// DdosCoo Scheduler Rule can be imported using the id or the rule name, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ddos/schedulerRule:SchedulerRule example fbb20dc77e8fc******
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ddos/schedulerRule:SchedulerRule")]
    public partial class SchedulerRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The cname is the traffic scheduler corresponding to rules.
        /// </summary>
        [Output("cname")]
        public Output<string> Cname { get; private set; } = null!;

        /// <summary>
        /// The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
        /// </summary>
        [Output("param")]
        public Output<string?> Param { get; private set; } = null!;

        /// <summary>
        /// The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string?> ResourceGroupId { get; private set; } = null!;

        /// <summary>
        /// The name of the rule.
        /// </summary>
        [Output("ruleName")]
        public Output<string> RuleName { get; private set; } = null!;

        /// <summary>
        /// The rule type. Valid values:
        /// `2`: tiered protection.
        /// `3`: globalization acceleration.
        /// `6`: Cloud product interaction.
        /// </summary>
        [Output("ruleType")]
        public Output<int> RuleType { get; private set; } = null!;

        /// <summary>
        /// The information about the scheduling rules. See the following `Block rules`.
        /// </summary>
        [Output("rules")]
        public Output<ImmutableArray<Outputs.SchedulerRuleRule>> Rules { get; private set; } = null!;


        /// <summary>
        /// Create a SchedulerRule 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 SchedulerRule(string name, SchedulerRuleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ddos/schedulerRule:SchedulerRule", name, args ?? new SchedulerRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private SchedulerRule(string name, Input<string> id, SchedulerRuleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:ddos/schedulerRule:SchedulerRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            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 SchedulerRule 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 SchedulerRule Get(string name, Input<string> id, SchedulerRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new SchedulerRule(name, id, state, options);
        }
    }

    public sealed class SchedulerRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
        /// </summary>
        [Input("param")]
        public Input<string>? Param { get; set; }

        /// <summary>
        /// The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

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

        /// <summary>
        /// The rule type. Valid values:
        /// `2`: tiered protection.
        /// `3`: globalization acceleration.
        /// `6`: Cloud product interaction.
        /// </summary>
        [Input("ruleType", required: true)]
        public Input<int> RuleType { get; set; } = null!;

        [Input("rules", required: true)]
        private InputList<Inputs.SchedulerRuleRuleArgs>? _rules;

        /// <summary>
        /// The information about the scheduling rules. See the following `Block rules`.
        /// </summary>
        public InputList<Inputs.SchedulerRuleRuleArgs> Rules
        {
            get => _rules ?? (_rules = new InputList<Inputs.SchedulerRuleRuleArgs>());
            set => _rules = value;
        }

        public SchedulerRuleArgs()
        {
        }
        public static new SchedulerRuleArgs Empty => new SchedulerRuleArgs();
    }

    public sealed class SchedulerRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The cname is the traffic scheduler corresponding to rules.
        /// </summary>
        [Input("cname")]
        public Input<string>? Cname { get; set; }

        /// <summary>
        /// The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
        /// </summary>
        [Input("param")]
        public Input<string>? Param { get; set; }

        /// <summary>
        /// The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The name of the rule.
        /// </summary>
        [Input("ruleName")]
        public Input<string>? RuleName { get; set; }

        /// <summary>
        /// The rule type. Valid values:
        /// `2`: tiered protection.
        /// `3`: globalization acceleration.
        /// `6`: Cloud product interaction.
        /// </summary>
        [Input("ruleType")]
        public Input<int>? RuleType { get; set; }

        [Input("rules")]
        private InputList<Inputs.SchedulerRuleRuleGetArgs>? _rules;

        /// <summary>
        /// The information about the scheduling rules. See the following `Block rules`.
        /// </summary>
        public InputList<Inputs.SchedulerRuleRuleGetArgs> Rules
        {
            get => _rules ?? (_rules = new InputList<Inputs.SchedulerRuleRuleGetArgs>());
            set => _rules = value;
        }

        public SchedulerRuleState()
        {
        }
        public static new SchedulerRuleState Empty => new SchedulerRuleState();
    }
}
