<gh_stars>0// *** 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.APIGateway
{
    [TctestResourceType("tctest:APIGateway/aPI:API")]
    public partial class API : Pulumi.CustomResource
    {
        /// <summary>
        /// Custom API description.
        /// </summary>
        [Output("apiDesc")]
        public Output<string?> ApiDesc { get; private set; } = null!;

        /// <summary>
        /// Custom API name.
        /// </summary>
        [Output("apiName")]
        public Output<string> ApiName { get; private set; } = null!;

        /// <summary>
        /// API authentication type. Valid values: `SECRET` (key pair authentication),`NONE` (no authentication). Default value:
        /// `NONE`.
        /// </summary>
        [Output("authType")]
        public Output<string?> AuthType { get; private set; } = null!;

        /// <summary>
        /// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Whether to enable CORS. Default value: `true`.
        /// </summary>
        [Output("enableCors")]
        public Output<bool?> EnableCors { get; private set; } = null!;

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Output("preLimit")]
        public Output<int> PreLimit { get; private set; } = null!;

        /// <summary>
        /// API frontend request type. Valid values: `HTTP`, `WEBSOCKET`. Default value: `HTTP`.
        /// </summary>
        [Output("protocol")]
        public Output<string?> Protocol { get; private set; } = null!;

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Output("releaseLimit")]
        public Output<int> ReleaseLimit { get; private set; } = null!;

        /// <summary>
        /// Request frontend method configuration. Valid values: `GET`,`POST`,`PUT`,`DELETE`,`HEAD`,`ANY`. Default value: `GET`.
        /// </summary>
        [Output("requestConfigMethod")]
        public Output<string?> RequestConfigMethod { get; private set; } = null!;

        /// <summary>
        /// Request frontend path configuration. Like `/user/getinfo`.
        /// </summary>
        [Output("requestConfigPath")]
        public Output<string> RequestConfigPath { get; private set; } = null!;

        /// <summary>
        /// Frontend request parameters.
        /// </summary>
        [Output("requestParameters")]
        public Output<ImmutableArray<Outputs.APIRequestParameter>> RequestParameters { get; private set; } = null!;

        /// <summary>
        /// Custom error code configuration. Must keep at least one after set.
        /// </summary>
        [Output("responseErrorCodes")]
        public Output<ImmutableArray<Outputs.APIResponseErrorCode>> ResponseErrorCodes { get; private set; } = null!;

        /// <summary>
        /// Response failure sample of custom response configuration.
        /// </summary>
        [Output("responseFailExample")]
        public Output<string?> ResponseFailExample { get; private set; } = null!;

        /// <summary>
        /// Successful response sample of custom response configuration.
        /// </summary>
        [Output("responseSuccessExample")]
        public Output<string?> ResponseSuccessExample { get; private set; } = null!;

        /// <summary>
        /// Return type. Valid values: `HTML`, `JSON`, `TEXT`, `BINARY`, `XML`. Default value: `HTML`.
        /// </summary>
        [Output("responseType")]
        public Output<string> ResponseType { get; private set; } = null!;

        /// <summary>
        /// API backend service request method, such as `GET`. If `service_config_type` is `HTTP`, this parameter will be required.
        /// The frontend `request_config_method` and backend method `service_config_method` can be different.
        /// </summary>
        [Output("serviceConfigMethod")]
        public Output<string?> ServiceConfigMethod { get; private set; } = null!;

        /// <summary>
        /// Returned information of API backend mocking. This parameter is required when `service_config_type` is `MOCK`.
        /// </summary>
        [Output("serviceConfigMockReturnMessage")]
        public Output<string?> ServiceConfigMockReturnMessage { get; private set; } = null!;

        /// <summary>
        /// API backend service path, such as /path. If `service_config_type` is `HTTP`, this parameter will be required. The
        /// frontend `request_config_path` and backend path `service_config_path` can be different.
        /// </summary>
        [Output("serviceConfigPath")]
        public Output<string?> ServiceConfigPath { get; private set; } = null!;

        /// <summary>
        /// Backend type. This parameter takes effect when VPC is enabled. Currently, only `clb` is supported.
        /// </summary>
        [Output("serviceConfigProduct")]
        public Output<string?> ServiceConfigProduct { get; private set; } = null!;

        /// <summary>
        /// SCF function name. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Output("serviceConfigScfFunctionName")]
        public Output<string?> ServiceConfigScfFunctionName { get; private set; } = null!;

        /// <summary>
        /// SCF function namespace. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Output("serviceConfigScfFunctionNamespace")]
        public Output<string?> ServiceConfigScfFunctionNamespace { get; private set; } = null!;

        /// <summary>
        /// SCF function version. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Output("serviceConfigScfFunctionQualifier")]
        public Output<string?> ServiceConfigScfFunctionQualifier { get; private set; } = null!;

        /// <summary>
        /// API backend service timeout period in seconds. Default value: `5`.
        /// </summary>
        [Output("serviceConfigTimeout")]
        public Output<int?> ServiceConfigTimeout { get; private set; } = null!;

        /// <summary>
        /// API backend service type. Valid values: `WEBSOCKET`, `HTTP`, `SCF`, `MOCK`. Default value: `HTTP`.
        /// </summary>
        [Output("serviceConfigType")]
        public Output<string?> ServiceConfigType { get; private set; } = null!;

        /// <summary>
        /// API backend service url. This parameter is required when `service_config_type` is `HTTP`.
        /// </summary>
        [Output("serviceConfigUrl")]
        public Output<string?> ServiceConfigUrl { get; private set; } = null!;

        /// <summary>
        /// Unique VPC ID.
        /// </summary>
        [Output("serviceConfigVpcId")]
        public Output<string?> ServiceConfigVpcId { get; private set; } = null!;

        /// <summary>
        /// Which service this API belongs. Refer to resource `tencentcloud_api_gateway_service`.
        /// </summary>
        [Output("serviceId")]
        public Output<string> ServiceId { get; private set; } = null!;

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Output("testLimit")]
        public Output<int> TestLimit { get; private set; } = null!;

        /// <summary>
        /// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
        /// </summary>
        [Output("updateTime")]
        public Output<string> UpdateTime { get; private set; } = null!;


        /// <summary>
        /// Create a API 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 API(string name, APIArgs args, CustomResourceOptions? options = null)
            : base("tctest:APIGateway/aPI:API", name, args ?? new APIArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class APIArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Custom API description.
        /// </summary>
        [Input("apiDesc")]
        public Input<string>? ApiDesc { get; set; }

        /// <summary>
        /// Custom API name.
        /// </summary>
        [Input("apiName", required: true)]
        public Input<string> ApiName { get; set; } = null!;

        /// <summary>
        /// API authentication type. Valid values: `SECRET` (key pair authentication),`NONE` (no authentication). Default value:
        /// `NONE`.
        /// </summary>
        [Input("authType")]
        public Input<string>? AuthType { get; set; }

        /// <summary>
        /// Whether to enable CORS. Default value: `true`.
        /// </summary>
        [Input("enableCors")]
        public Input<bool>? EnableCors { get; set; }

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("preLimit")]
        public Input<int>? PreLimit { get; set; }

        /// <summary>
        /// API frontend request type. Valid values: `HTTP`, `WEBSOCKET`. Default value: `HTTP`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("releaseLimit")]
        public Input<int>? ReleaseLimit { get; set; }

        /// <summary>
        /// Request frontend method configuration. Valid values: `GET`,`POST`,`PUT`,`DELETE`,`HEAD`,`ANY`. Default value: `GET`.
        /// </summary>
        [Input("requestConfigMethod")]
        public Input<string>? RequestConfigMethod { get; set; }

        /// <summary>
        /// Request frontend path configuration. Like `/user/getinfo`.
        /// </summary>
        [Input("requestConfigPath", required: true)]
        public Input<string> RequestConfigPath { get; set; } = null!;

        [Input("requestParameters")]
        private InputList<Inputs.APIRequestParameterArgs>? _requestParameters;

        /// <summary>
        /// Frontend request parameters.
        /// </summary>
        public InputList<Inputs.APIRequestParameterArgs> RequestParameters
        {
            get => _requestParameters ?? (_requestParameters = new InputList<Inputs.APIRequestParameterArgs>());
            set => _requestParameters = value;
        }

        [Input("responseErrorCodes")]
        private InputList<Inputs.APIResponseErrorCodeArgs>? _responseErrorCodes;

        /// <summary>
        /// Custom error code configuration. Must keep at least one after set.
        /// </summary>
        public InputList<Inputs.APIResponseErrorCodeArgs> ResponseErrorCodes
        {
            get => _responseErrorCodes ?? (_responseErrorCodes = new InputList<Inputs.APIResponseErrorCodeArgs>());
            set => _responseErrorCodes = value;
        }

        /// <summary>
        /// Response failure sample of custom response configuration.
        /// </summary>
        [Input("responseFailExample")]
        public Input<string>? ResponseFailExample { get; set; }

        /// <summary>
        /// Successful response sample of custom response configuration.
        /// </summary>
        [Input("responseSuccessExample")]
        public Input<string>? ResponseSuccessExample { get; set; }

        /// <summary>
        /// Return type. Valid values: `HTML`, `JSON`, `TEXT`, `BINARY`, `XML`. Default value: `HTML`.
        /// </summary>
        [Input("responseType")]
        public Input<string>? ResponseType { get; set; }

        /// <summary>
        /// API backend service request method, such as `GET`. If `service_config_type` is `HTTP`, this parameter will be required.
        /// The frontend `request_config_method` and backend method `service_config_method` can be different.
        /// </summary>
        [Input("serviceConfigMethod")]
        public Input<string>? ServiceConfigMethod { get; set; }

        /// <summary>
        /// Returned information of API backend mocking. This parameter is required when `service_config_type` is `MOCK`.
        /// </summary>
        [Input("serviceConfigMockReturnMessage")]
        public Input<string>? ServiceConfigMockReturnMessage { get; set; }

        /// <summary>
        /// API backend service path, such as /path. If `service_config_type` is `HTTP`, this parameter will be required. The
        /// frontend `request_config_path` and backend path `service_config_path` can be different.
        /// </summary>
        [Input("serviceConfigPath")]
        public Input<string>? ServiceConfigPath { get; set; }

        /// <summary>
        /// Backend type. This parameter takes effect when VPC is enabled. Currently, only `clb` is supported.
        /// </summary>
        [Input("serviceConfigProduct")]
        public Input<string>? ServiceConfigProduct { get; set; }

        /// <summary>
        /// SCF function name. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionName")]
        public Input<string>? ServiceConfigScfFunctionName { get; set; }

        /// <summary>
        /// SCF function namespace. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionNamespace")]
        public Input<string>? ServiceConfigScfFunctionNamespace { get; set; }

        /// <summary>
        /// SCF function version. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionQualifier")]
        public Input<string>? ServiceConfigScfFunctionQualifier { get; set; }

        /// <summary>
        /// API backend service timeout period in seconds. Default value: `5`.
        /// </summary>
        [Input("serviceConfigTimeout")]
        public Input<int>? ServiceConfigTimeout { get; set; }

        /// <summary>
        /// API backend service type. Valid values: `WEBSOCKET`, `HTTP`, `SCF`, `MOCK`. Default value: `HTTP`.
        /// </summary>
        [Input("serviceConfigType")]
        public Input<string>? ServiceConfigType { get; set; }

        /// <summary>
        /// API backend service url. This parameter is required when `service_config_type` is `HTTP`.
        /// </summary>
        [Input("serviceConfigUrl")]
        public Input<string>? ServiceConfigUrl { get; set; }

        /// <summary>
        /// Unique VPC ID.
        /// </summary>
        [Input("serviceConfigVpcId")]
        public Input<string>? ServiceConfigVpcId { get; set; }

        /// <summary>
        /// Which service this API belongs. Refer to resource `tencentcloud_api_gateway_service`.
        /// </summary>
        [Input("serviceId", required: true)]
        public Input<string> ServiceId { get; set; } = null!;

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("testLimit")]
        public Input<int>? TestLimit { get; set; }

        public APIArgs()
        {
        }
    }

    public sealed class APIState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Custom API description.
        /// </summary>
        [Input("apiDesc")]
        public Input<string>? ApiDesc { get; set; }

        /// <summary>
        /// Custom API name.
        /// </summary>
        [Input("apiName")]
        public Input<string>? ApiName { get; set; }

        /// <summary>
        /// API authentication type. Valid values: `SECRET` (key pair authentication),`NONE` (no authentication). Default value:
        /// `NONE`.
        /// </summary>
        [Input("authType")]
        public Input<string>? AuthType { get; set; }

        /// <summary>
        /// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Whether to enable CORS. Default value: `true`.
        /// </summary>
        [Input("enableCors")]
        public Input<bool>? EnableCors { get; set; }

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("preLimit")]
        public Input<int>? PreLimit { get; set; }

        /// <summary>
        /// API frontend request type. Valid values: `HTTP`, `WEBSOCKET`. Default value: `HTTP`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("releaseLimit")]
        public Input<int>? ReleaseLimit { get; set; }

        /// <summary>
        /// Request frontend method configuration. Valid values: `GET`,`POST`,`PUT`,`DELETE`,`HEAD`,`ANY`. Default value: `GET`.
        /// </summary>
        [Input("requestConfigMethod")]
        public Input<string>? RequestConfigMethod { get; set; }

        /// <summary>
        /// Request frontend path configuration. Like `/user/getinfo`.
        /// </summary>
        [Input("requestConfigPath")]
        public Input<string>? RequestConfigPath { get; set; }

        [Input("requestParameters")]
        private InputList<Inputs.APIRequestParameterGetArgs>? _requestParameters;

        /// <summary>
        /// Frontend request parameters.
        /// </summary>
        public InputList<Inputs.APIRequestParameterGetArgs> RequestParameters
        {
            get => _requestParameters ?? (_requestParameters = new InputList<Inputs.APIRequestParameterGetArgs>());
            set => _requestParameters = value;
        }

        [Input("responseErrorCodes")]
        private InputList<Inputs.APIResponseErrorCodeGetArgs>? _responseErrorCodes;

        /// <summary>
        /// Custom error code configuration. Must keep at least one after set.
        /// </summary>
        public InputList<Inputs.APIResponseErrorCodeGetArgs> ResponseErrorCodes
        {
            get => _responseErrorCodes ?? (_responseErrorCodes = new InputList<Inputs.APIResponseErrorCodeGetArgs>());
            set => _responseErrorCodes = value;
        }

        /// <summary>
        /// Response failure sample of custom response configuration.
        /// </summary>
        [Input("responseFailExample")]
        public Input<string>? ResponseFailExample { get; set; }

        /// <summary>
        /// Successful response sample of custom response configuration.
        /// </summary>
        [Input("responseSuccessExample")]
        public Input<string>? ResponseSuccessExample { get; set; }

        /// <summary>
        /// Return type. Valid values: `HTML`, `JSON`, `TEXT`, `BINARY`, `XML`. Default value: `HTML`.
        /// </summary>
        [Input("responseType")]
        public Input<string>? ResponseType { get; set; }

        /// <summary>
        /// API backend service request method, such as `GET`. If `service_config_type` is `HTTP`, this parameter will be required.
        /// The frontend `request_config_method` and backend method `service_config_method` can be different.
        /// </summary>
        [Input("serviceConfigMethod")]
        public Input<string>? ServiceConfigMethod { get; set; }

        /// <summary>
        /// Returned information of API backend mocking. This parameter is required when `service_config_type` is `MOCK`.
        /// </summary>
        [Input("serviceConfigMockReturnMessage")]
        public Input<string>? ServiceConfigMockReturnMessage { get; set; }

        /// <summary>
        /// API backend service path, such as /path. If `service_config_type` is `HTTP`, this parameter will be required. The
        /// frontend `request_config_path` and backend path `service_config_path` can be different.
        /// </summary>
        [Input("serviceConfigPath")]
        public Input<string>? ServiceConfigPath { get; set; }

        /// <summary>
        /// Backend type. This parameter takes effect when VPC is enabled. Currently, only `clb` is supported.
        /// </summary>
        [Input("serviceConfigProduct")]
        public Input<string>? ServiceConfigProduct { get; set; }

        /// <summary>
        /// SCF function name. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionName")]
        public Input<string>? ServiceConfigScfFunctionName { get; set; }

        /// <summary>
        /// SCF function namespace. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionNamespace")]
        public Input<string>? ServiceConfigScfFunctionNamespace { get; set; }

        /// <summary>
        /// SCF function version. This parameter takes effect when `service_config_type` is `SCF`.
        /// </summary>
        [Input("serviceConfigScfFunctionQualifier")]
        public Input<string>? ServiceConfigScfFunctionQualifier { get; set; }

        /// <summary>
        /// API backend service timeout period in seconds. Default value: `5`.
        /// </summary>
        [Input("serviceConfigTimeout")]
        public Input<int>? ServiceConfigTimeout { get; set; }

        /// <summary>
        /// API backend service type. Valid values: `WEBSOCKET`, `HTTP`, `SCF`, `MOCK`. Default value: `HTTP`.
        /// </summary>
        [Input("serviceConfigType")]
        public Input<string>? ServiceConfigType { get; set; }

        /// <summary>
        /// API backend service url. This parameter is required when `service_config_type` is `HTTP`.
        /// </summary>
        [Input("serviceConfigUrl")]
        public Input<string>? ServiceConfigUrl { get; set; }

        /// <summary>
        /// Unique VPC ID.
        /// </summary>
        [Input("serviceConfigVpcId")]
        public Input<string>? ServiceConfigVpcId { get; set; }

        /// <summary>
        /// Which service this API belongs. Refer to resource `tencentcloud_api_gateway_service`.
        /// </summary>
        [Input("serviceId")]
        public Input<string>? ServiceId { get; set; }

        /// <summary>
        /// API QPS value. Enter a positive number to limit the API query rate per second `QPS`.
        /// </summary>
        [Input("testLimit")]
        public Input<int>? TestLimit { get; set; }

        /// <summary>
        /// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
        /// </summary>
        [Input("updateTime")]
        public Input<string>? UpdateTime { get; set; }

        public APIState()
        {
        }
    }
}
