<filename>sdk/dotnet/Dayu/CCHttpPolicy.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.Tctest.Dayu
{
    [TctestResourceType("tctest:Dayu/cCHttpPolicy:CCHttpPolicy")]
    public partial class CCHttpPolicy : Pulumi.CustomResource
    {
        /// <summary>
        /// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
        /// </summary>
        [Output("action")]
        public Output<string> Action { get; private set; } = null!;

        /// <summary>
        /// Create time of the CC self-define http policy.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
        /// </summary>
        [Output("frequency")]
        public Output<int> Frequency { get; private set; } = null!;

        /// <summary>
        /// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
        /// set one.
        /// </summary>
        [Output("ip")]
        public Output<string> Ip { get; private set; } = null!;

        /// <summary>
        /// Name of the CC self-define http policy. Length should between 1 and 20.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Id of the CC self-define http policy.
        /// </summary>
        [Output("policyId")]
        public Output<string> PolicyId { get; private set; } = null!;

        /// <summary>
        /// ID of the resource that the CC self-define http policy works for.
        /// </summary>
        [Output("resourceId")]
        public Output<string> ResourceId { get; private set; } = null!;

        /// <summary>
        /// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
        /// `net`.
        /// </summary>
        [Output("resourceType")]
        public Output<string> ResourceType { get; private set; } = null!;

        /// <summary>
        /// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
        /// </summary>
        [Output("ruleLists")]
        public Output<ImmutableArray<Outputs.CCHttpPolicyRuleList>> RuleLists { get; private set; } = null!;

        /// <summary>
        /// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
        /// one.
        /// </summary>
        [Output("smode")]
        public Output<string?> Smode { get; private set; } = null!;

        /// <summary>
        /// Indicate the CC self-define http policy takes effect or not.
        /// </summary>
        [Output("switch")]
        public Output<bool?> Switch { get; private set; } = null!;


        /// <summary>
        /// Create a CCHttpPolicy 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 CCHttpPolicy(string name, CCHttpPolicyArgs args, CustomResourceOptions? options = null)
            : base("tctest:Dayu/cCHttpPolicy:CCHttpPolicy", name, args ?? new CCHttpPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class CCHttpPolicyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        /// <summary>
        /// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
        /// </summary>
        [Input("frequency")]
        public Input<int>? Frequency { get; set; }

        /// <summary>
        /// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
        /// set one.
        /// </summary>
        [Input("ip")]
        public Input<string>? Ip { get; set; }

        /// <summary>
        /// Name of the CC self-define http policy. Length should between 1 and 20.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// ID of the resource that the CC self-define http policy works for.
        /// </summary>
        [Input("resourceId", required: true)]
        public Input<string> ResourceId { get; set; } = null!;

        /// <summary>
        /// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
        /// `net`.
        /// </summary>
        [Input("resourceType", required: true)]
        public Input<string> ResourceType { get; set; } = null!;

        [Input("ruleLists")]
        private InputList<Inputs.CCHttpPolicyRuleListArgs>? _ruleLists;

        /// <summary>
        /// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
        /// </summary>
        public InputList<Inputs.CCHttpPolicyRuleListArgs> RuleLists
        {
            get => _ruleLists ?? (_ruleLists = new InputList<Inputs.CCHttpPolicyRuleListArgs>());
            set => _ruleLists = value;
        }

        /// <summary>
        /// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
        /// one.
        /// </summary>
        [Input("smode")]
        public Input<string>? Smode { get; set; }

        /// <summary>
        /// Indicate the CC self-define http policy takes effect or not.
        /// </summary>
        [Input("switch")]
        public Input<bool>? Switch { get; set; }

        public CCHttpPolicyArgs()
        {
        }
    }

    public sealed class CCHttpPolicyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        /// <summary>
        /// Create time of the CC self-define http policy.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
        /// </summary>
        [Input("frequency")]
        public Input<int>? Frequency { get; set; }

        /// <summary>
        /// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
        /// set one.
        /// </summary>
        [Input("ip")]
        public Input<string>? Ip { get; set; }

        /// <summary>
        /// Name of the CC self-define http policy. Length should between 1 and 20.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Id of the CC self-define http policy.
        /// </summary>
        [Input("policyId")]
        public Input<string>? PolicyId { get; set; }

        /// <summary>
        /// ID of the resource that the CC self-define http policy works for.
        /// </summary>
        [Input("resourceId")]
        public Input<string>? ResourceId { get; set; }

        /// <summary>
        /// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
        /// `net`.
        /// </summary>
        [Input("resourceType")]
        public Input<string>? ResourceType { get; set; }

        [Input("ruleLists")]
        private InputList<Inputs.CCHttpPolicyRuleListGetArgs>? _ruleLists;

        /// <summary>
        /// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
        /// </summary>
        public InputList<Inputs.CCHttpPolicyRuleListGetArgs> RuleLists
        {
            get => _ruleLists ?? (_ruleLists = new InputList<Inputs.CCHttpPolicyRuleListGetArgs>());
            set => _ruleLists = value;
        }

        /// <summary>
        /// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
        /// one.
        /// </summary>
        [Input("smode")]
        public Input<string>? Smode { get; set; }

        /// <summary>
        /// Indicate the CC self-define http policy takes effect or not.
        /// </summary>
        [Input("switch")]
        public Input<bool>? Switch { get; set; }

        public CCHttpPolicyState()
        {
        }
    }
}
