// *** 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.Gaap
{
    [TctestResourceType("tctest:Gaap/httpRule:HttpRule")]
    public partial class HttpRule : Pulumi.CustomResource
    {
        /// <summary>
        /// Timeout of the health check response, default value is 2s.
        /// </summary>
        [Output("connectTimeout")]
        public Output<int?> ConnectTimeout { get; private set; } = null!;

        /// <summary>
        /// Forward domain of the forward rule.
        /// </summary>
        [Output("domain")]
        public Output<string> Domain { get; private set; } = null!;

        /// <summary>
        /// The default value of requested host which is forwarded to the realserver by the listener is `default`.
        /// </summary>
        [Output("forwardHost")]
        public Output<string?> ForwardHost { get; private set; } = null!;

        /// <summary>
        /// Indicates whether health check is enable.
        /// </summary>
        [Output("healthCheck")]
        public Output<bool> HealthCheck { get; private set; } = null!;

        /// <summary>
        /// Method of the health check. Valid value: `GET` and `HEAD`.
        /// </summary>
        [Output("healthCheckMethod")]
        public Output<string?> HealthCheckMethod { get; private set; } = null!;

        /// <summary>
        /// Path of health check. Maximum length is 80.
        /// </summary>
        [Output("healthCheckPath")]
        public Output<string?> HealthCheckPath { get; private set; } = null!;

        /// <summary>
        /// Return code of confirmed normal. Valid value: `100`, `200`, `300`, `400` and `500`.
        /// </summary>
        [Output("healthCheckStatusCodes")]
        public Output<ImmutableArray<int>> HealthCheckStatusCodes { get; private set; } = null!;

        /// <summary>
        /// Interval of the health check, default value is 5s.
        /// </summary>
        [Output("interval")]
        public Output<int?> Interval { get; private set; } = null!;

        /// <summary>
        /// ID of the layer7 listener.
        /// </summary>
        [Output("listenerId")]
        public Output<string> ListenerId { get; private set; } = null!;

        /// <summary>
        /// Path of the forward rule. Maximum length is 80.
        /// </summary>
        [Output("path")]
        public Output<string> Path { get; private set; } = null!;

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`.
        /// </summary>
        [Output("realserverType")]
        public Output<string> RealserverType { get; private set; } = null!;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        [Output("realservers")]
        public Output<ImmutableArray<Outputs.HttpRuleRealserver>> Realservers { get; private set; } = null!;

        /// <summary>
        /// Scheduling policy of the forward rule, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Output("scheduler")]
        public Output<string?> Scheduler { get; private set; } = null!;

        /// <summary>
        /// ServerNameIndication (SNI) is required when the SNI switch is turned on.
        /// </summary>
        [Output("sni")]
        public Output<string> Sni { get; private set; } = null!;

        /// <summary>
        /// ServerNameIndication (SNI) switch. ON means on and OFF means off.
        /// </summary>
        [Output("sniSwitch")]
        public Output<string> SniSwitch { get; private set; } = null!;


        /// <summary>
        /// Create a HttpRule 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 HttpRule(string name, HttpRuleArgs args, CustomResourceOptions? options = null)
            : base("tctest:Gaap/httpRule:HttpRule", name, args ?? new HttpRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class HttpRuleArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Timeout of the health check response, default value is 2s.
        /// </summary>
        [Input("connectTimeout")]
        public Input<int>? ConnectTimeout { get; set; }

        /// <summary>
        /// Forward domain of the forward rule.
        /// </summary>
        [Input("domain", required: true)]
        public Input<string> Domain { get; set; } = null!;

        /// <summary>
        /// The default value of requested host which is forwarded to the realserver by the listener is `default`.
        /// </summary>
        [Input("forwardHost")]
        public Input<string>? ForwardHost { get; set; }

        /// <summary>
        /// Indicates whether health check is enable.
        /// </summary>
        [Input("healthCheck", required: true)]
        public Input<bool> HealthCheck { get; set; } = null!;

        /// <summary>
        /// Method of the health check. Valid value: `GET` and `HEAD`.
        /// </summary>
        [Input("healthCheckMethod")]
        public Input<string>? HealthCheckMethod { get; set; }

        /// <summary>
        /// Path of health check. Maximum length is 80.
        /// </summary>
        [Input("healthCheckPath")]
        public Input<string>? HealthCheckPath { get; set; }

        [Input("healthCheckStatusCodes")]
        private InputList<int>? _healthCheckStatusCodes;

        /// <summary>
        /// Return code of confirmed normal. Valid value: `100`, `200`, `300`, `400` and `500`.
        /// </summary>
        public InputList<int> HealthCheckStatusCodes
        {
            get => _healthCheckStatusCodes ?? (_healthCheckStatusCodes = new InputList<int>());
            set => _healthCheckStatusCodes = value;
        }

        /// <summary>
        /// Interval of the health check, default value is 5s.
        /// </summary>
        [Input("interval")]
        public Input<int>? Interval { get; set; }

        /// <summary>
        /// ID of the layer7 listener.
        /// </summary>
        [Input("listenerId", required: true)]
        public Input<string> ListenerId { get; set; } = null!;

        /// <summary>
        /// Path of the forward rule. Maximum length is 80.
        /// </summary>
        [Input("path", required: true)]
        public Input<string> Path { get; set; } = null!;

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`.
        /// </summary>
        [Input("realserverType", required: true)]
        public Input<string> RealserverType { get; set; } = null!;

        [Input("realservers")]
        private InputList<Inputs.HttpRuleRealserverArgs>? _realservers;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        public InputList<Inputs.HttpRuleRealserverArgs> Realservers
        {
            get => _realservers ?? (_realservers = new InputList<Inputs.HttpRuleRealserverArgs>());
            set => _realservers = value;
        }

        /// <summary>
        /// Scheduling policy of the forward rule, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// ServerNameIndication (SNI) is required when the SNI switch is turned on.
        /// </summary>
        [Input("sni")]
        public Input<string>? Sni { get; set; }

        /// <summary>
        /// ServerNameIndication (SNI) switch. ON means on and OFF means off.
        /// </summary>
        [Input("sniSwitch")]
        public Input<string>? SniSwitch { get; set; }

        public HttpRuleArgs()
        {
        }
    }

    public sealed class HttpRuleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Timeout of the health check response, default value is 2s.
        /// </summary>
        [Input("connectTimeout")]
        public Input<int>? ConnectTimeout { get; set; }

        /// <summary>
        /// Forward domain of the forward rule.
        /// </summary>
        [Input("domain")]
        public Input<string>? Domain { get; set; }

        /// <summary>
        /// The default value of requested host which is forwarded to the realserver by the listener is `default`.
        /// </summary>
        [Input("forwardHost")]
        public Input<string>? ForwardHost { get; set; }

        /// <summary>
        /// Indicates whether health check is enable.
        /// </summary>
        [Input("healthCheck")]
        public Input<bool>? HealthCheck { get; set; }

        /// <summary>
        /// Method of the health check. Valid value: `GET` and `HEAD`.
        /// </summary>
        [Input("healthCheckMethod")]
        public Input<string>? HealthCheckMethod { get; set; }

        /// <summary>
        /// Path of health check. Maximum length is 80.
        /// </summary>
        [Input("healthCheckPath")]
        public Input<string>? HealthCheckPath { get; set; }

        [Input("healthCheckStatusCodes")]
        private InputList<int>? _healthCheckStatusCodes;

        /// <summary>
        /// Return code of confirmed normal. Valid value: `100`, `200`, `300`, `400` and `500`.
        /// </summary>
        public InputList<int> HealthCheckStatusCodes
        {
            get => _healthCheckStatusCodes ?? (_healthCheckStatusCodes = new InputList<int>());
            set => _healthCheckStatusCodes = value;
        }

        /// <summary>
        /// Interval of the health check, default value is 5s.
        /// </summary>
        [Input("interval")]
        public Input<int>? Interval { get; set; }

        /// <summary>
        /// ID of the layer7 listener.
        /// </summary>
        [Input("listenerId")]
        public Input<string>? ListenerId { get; set; }

        /// <summary>
        /// Path of the forward rule. Maximum length is 80.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Type of the realserver. Valid value: `IP` and `DOMAIN`.
        /// </summary>
        [Input("realserverType")]
        public Input<string>? RealserverType { get; set; }

        [Input("realservers")]
        private InputList<Inputs.HttpRuleRealserverGetArgs>? _realservers;

        /// <summary>
        /// An information list of GAAP realserver.
        /// </summary>
        public InputList<Inputs.HttpRuleRealserverGetArgs> Realservers
        {
            get => _realservers ?? (_realservers = new InputList<Inputs.HttpRuleRealserverGetArgs>());
            set => _realservers = value;
        }

        /// <summary>
        /// Scheduling policy of the forward rule, default value is `rr`. Valid value: `rr`, `wrr` and `lc`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// ServerNameIndication (SNI) is required when the SNI switch is turned on.
        /// </summary>
        [Input("sni")]
        public Input<string>? Sni { get; set; }

        /// <summary>
        /// ServerNameIndication (SNI) switch. ON means on and OFF means off.
        /// </summary>
        [Input("sniSwitch")]
        public Input<string>? SniSwitch { get; set; }

        public HttpRuleState()
        {
        }
    }
}
