// *** 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.Cdn
{
    [TctestResourceType("tctest:Cdn/cdnDomain:CdnDomain")]
    public partial class CdnDomain : Pulumi.CustomResource
    {
        /// <summary>
        /// Domain name acceleration region. `mainland`: acceleration inside mainland China, `overseas`: acceleration outside
        /// mainland China, `global`: global acceleration. Overseas acceleration service must be enabled to use overseas
        /// acceleration and global acceleration.
        /// </summary>
        [Output("area")]
        public Output<string?> Area { get; private set; } = null!;

        /// <summary>
        /// CNAME address of domain name.
        /// </summary>
        [Output("cname")]
        public Output<string> Cname { get; private set; } = null!;

        /// <summary>
        /// Creation time of domain name.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

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

        /// <summary>
        /// Whether to enable full-path cache. Default value is `true`.
        /// </summary>
        [Output("fullUrlCache")]
        public Output<bool?> FullUrlCache { get; private set; } = null!;

        /// <summary>
        /// HTTPS acceleration configuration. It's a list and consist of at most one item.
        /// </summary>
        [Output("httpsConfig")]
        public Output<Outputs.CdnDomainHttpsConfig> HttpsConfig { get; private set; } = null!;

        /// <summary>
        /// ipv6 access configuration switch. Only available when area set to `mainland`. Valid values are `on` and `off`. Default
        /// value is `off`.
        /// </summary>
        [Output("ipv6AccessSwitch")]
        public Output<string?> Ipv6AccessSwitch { get; private set; } = null!;

        /// <summary>
        /// Origin server configuration. It's a list and consist of at most one item.
        /// </summary>
        [Output("origin")]
        public Output<Outputs.CdnDomainOrigin> Origin { get; private set; } = null!;

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

        /// <summary>
        /// Sharding back to source configuration switch. Valid values are `on` and `off`. Default value is `on`.
        /// </summary>
        [Output("rangeOriginSwitch")]
        public Output<string?> RangeOriginSwitch { get; private set; } = null!;

        /// <summary>
        /// Request header configuration. It's a list and consist of at most one item.
        /// </summary>
        [Output("requestHeader")]
        public Output<Outputs.CdnDomainRequestHeader> RequestHeader { get; private set; } = null!;

        /// <summary>
        /// Advanced path cache configuration.
        /// </summary>
        [Output("ruleCaches")]
        public Output<ImmutableArray<Outputs.CdnDomainRuleCach>> RuleCaches { get; private set; } = null!;

        /// <summary>
        /// Acceleration domain name service type. `web`: static acceleration, `download`: download acceleration, `media`: streaming
        /// media VOD acceleration.
        /// </summary>
        [Output("serviceType")]
        public Output<string> ServiceType { get; private set; } = null!;

        /// <summary>
        /// Acceleration service status.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// Tags of cdn domain.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;


        /// <summary>
        /// Create a CdnDomain 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 CdnDomain(string name, CdnDomainArgs args, CustomResourceOptions? options = null)
            : base("tctest:Cdn/cdnDomain:CdnDomain", name, args ?? new CdnDomainArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class CdnDomainArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Domain name acceleration region. `mainland`: acceleration inside mainland China, `overseas`: acceleration outside
        /// mainland China, `global`: global acceleration. Overseas acceleration service must be enabled to use overseas
        /// acceleration and global acceleration.
        /// </summary>
        [Input("area")]
        public Input<string>? Area { get; set; }

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

        /// <summary>
        /// Whether to enable full-path cache. Default value is `true`.
        /// </summary>
        [Input("fullUrlCache")]
        public Input<bool>? FullUrlCache { get; set; }

        /// <summary>
        /// HTTPS acceleration configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("httpsConfig")]
        public Input<Inputs.CdnDomainHttpsConfigArgs>? HttpsConfig { get; set; }

        /// <summary>
        /// ipv6 access configuration switch. Only available when area set to `mainland`. Valid values are `on` and `off`. Default
        /// value is `off`.
        /// </summary>
        [Input("ipv6AccessSwitch")]
        public Input<string>? Ipv6AccessSwitch { get; set; }

        /// <summary>
        /// Origin server configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("origin", required: true)]
        public Input<Inputs.CdnDomainOriginArgs> Origin { get; set; } = null!;

        /// <summary>
        /// The project CDN belongs to, default to 0.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Sharding back to source configuration switch. Valid values are `on` and `off`. Default value is `on`.
        /// </summary>
        [Input("rangeOriginSwitch")]
        public Input<string>? RangeOriginSwitch { get; set; }

        /// <summary>
        /// Request header configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("requestHeader")]
        public Input<Inputs.CdnDomainRequestHeaderArgs>? RequestHeader { get; set; }

        [Input("ruleCaches")]
        private InputList<Inputs.CdnDomainRuleCachArgs>? _ruleCaches;

        /// <summary>
        /// Advanced path cache configuration.
        /// </summary>
        public InputList<Inputs.CdnDomainRuleCachArgs> RuleCaches
        {
            get => _ruleCaches ?? (_ruleCaches = new InputList<Inputs.CdnDomainRuleCachArgs>());
            set => _ruleCaches = value;
        }

        /// <summary>
        /// Acceleration domain name service type. `web`: static acceleration, `download`: download acceleration, `media`: streaming
        /// media VOD acceleration.
        /// </summary>
        [Input("serviceType", required: true)]
        public Input<string> ServiceType { get; set; } = null!;

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags of cdn domain.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public CdnDomainArgs()
        {
        }
    }

    public sealed class CdnDomainState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Domain name acceleration region. `mainland`: acceleration inside mainland China, `overseas`: acceleration outside
        /// mainland China, `global`: global acceleration. Overseas acceleration service must be enabled to use overseas
        /// acceleration and global acceleration.
        /// </summary>
        [Input("area")]
        public Input<string>? Area { get; set; }

        /// <summary>
        /// CNAME address of domain name.
        /// </summary>
        [Input("cname")]
        public Input<string>? Cname { get; set; }

        /// <summary>
        /// Creation time of domain name.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

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

        /// <summary>
        /// Whether to enable full-path cache. Default value is `true`.
        /// </summary>
        [Input("fullUrlCache")]
        public Input<bool>? FullUrlCache { get; set; }

        /// <summary>
        /// HTTPS acceleration configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("httpsConfig")]
        public Input<Inputs.CdnDomainHttpsConfigGetArgs>? HttpsConfig { get; set; }

        /// <summary>
        /// ipv6 access configuration switch. Only available when area set to `mainland`. Valid values are `on` and `off`. Default
        /// value is `off`.
        /// </summary>
        [Input("ipv6AccessSwitch")]
        public Input<string>? Ipv6AccessSwitch { get; set; }

        /// <summary>
        /// Origin server configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("origin")]
        public Input<Inputs.CdnDomainOriginGetArgs>? Origin { get; set; }

        /// <summary>
        /// The project CDN belongs to, default to 0.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Sharding back to source configuration switch. Valid values are `on` and `off`. Default value is `on`.
        /// </summary>
        [Input("rangeOriginSwitch")]
        public Input<string>? RangeOriginSwitch { get; set; }

        /// <summary>
        /// Request header configuration. It's a list and consist of at most one item.
        /// </summary>
        [Input("requestHeader")]
        public Input<Inputs.CdnDomainRequestHeaderGetArgs>? RequestHeader { get; set; }

        [Input("ruleCaches")]
        private InputList<Inputs.CdnDomainRuleCachGetArgs>? _ruleCaches;

        /// <summary>
        /// Advanced path cache configuration.
        /// </summary>
        public InputList<Inputs.CdnDomainRuleCachGetArgs> RuleCaches
        {
            get => _ruleCaches ?? (_ruleCaches = new InputList<Inputs.CdnDomainRuleCachGetArgs>());
            set => _ruleCaches = value;
        }

        /// <summary>
        /// Acceleration domain name service type. `web`: static acceleration, `download`: download acceleration, `media`: streaming
        /// media VOD acceleration.
        /// </summary>
        [Input("serviceType")]
        public Input<string>? ServiceType { get; set; }

        /// <summary>
        /// Acceleration service status.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags of cdn domain.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public CdnDomainState()
        {
        }
    }
}
