# coding=utf-8
# *** 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! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities

__all__ = ['CustomDomainArgs', 'CustomDomain']

@pulumi.input_type
class CustomDomainArgs:
    def __init__(__self__, *,
                 domain: pulumi.Input[builtins.str],
                 protocols: pulumi.Input[Sequence[pulumi.Input[builtins.str]]],
                 service_id: pulumi.Input[builtins.str],
                 certificate_id: Optional[pulumi.Input[builtins.str]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 ssl_redirect: Optional[pulumi.Input[builtins.bool]] = None):
        """
        The set of arguments for constructing a CustomDomain resource.
        :param pulumi.Input[builtins.str] domain: 自定义域名。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] protocols: 协议，取值：HTTP。HTTPS。
        :param pulumi.Input[builtins.str] service_id: 服务ID。
        :param pulumi.Input[builtins.str] certificate_id: 自定义域名证书ID。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.bool] ssl_redirect: 重定向到HTTPS。
        """
        pulumi.set(__self__, "domain", domain)
        pulumi.set(__self__, "protocols", protocols)
        pulumi.set(__self__, "service_id", service_id)
        if certificate_id is not None:
            pulumi.set(__self__, "certificate_id", certificate_id)
        if comments is not None:
            pulumi.set(__self__, "comments", comments)
        if ssl_redirect is not None:
            pulumi.set(__self__, "ssl_redirect", ssl_redirect)

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Input[builtins.str]:
        """
        自定义域名。
        """
        return pulumi.get(self, "domain")

    @domain.setter
    def domain(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter
    def protocols(self) -> pulumi.Input[Sequence[pulumi.Input[builtins.str]]]:
        """
        协议，取值：HTTP。HTTPS。
        """
        return pulumi.get(self, "protocols")

    @protocols.setter
    def protocols(self, value: pulumi.Input[Sequence[pulumi.Input[builtins.str]]]):
        pulumi.set(self, "protocols", value)

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> pulumi.Input[builtins.str]:
        """
        服务ID。
        """
        return pulumi.get(self, "service_id")

    @service_id.setter
    def service_id(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "service_id", value)

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义域名证书ID。
        """
        return pulumi.get(self, "certificate_id")

    @certificate_id.setter
    def certificate_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "certificate_id", value)

    @property
    @pulumi.getter
    def comments(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

    @comments.setter
    def comments(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "comments", value)

    @property
    @pulumi.getter(name="sslRedirect")
    def ssl_redirect(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        重定向到HTTPS。
        """
        return pulumi.get(self, "ssl_redirect")

    @ssl_redirect.setter
    def ssl_redirect(self, value: Optional[pulumi.Input[builtins.bool]]):
        pulumi.set(self, "ssl_redirect", value)


@pulumi.input_type
class _CustomDomainState:
    def __init__(__self__, *,
                 certificate_id: Optional[pulumi.Input[builtins.str]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 custom_domain_id: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 protocols: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 service_id: Optional[pulumi.Input[builtins.str]] = None,
                 ssl_redirect: Optional[pulumi.Input[builtins.bool]] = None,
                 status: Optional[pulumi.Input[builtins.str]] = None,
                 updated_time: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering CustomDomain resources.
        :param pulumi.Input[builtins.str] certificate_id: 自定义域名证书ID。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] created_time: 创建时间。
        :param pulumi.Input[builtins.str] custom_domain_id: 自定义域名ID。
        :param pulumi.Input[builtins.str] domain: 自定义域名。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] protocols: 协议，取值：HTTP。HTTPS。
        :param pulumi.Input[builtins.str] service_id: 服务ID。
        :param pulumi.Input[builtins.bool] ssl_redirect: 重定向到HTTPS。
        :param pulumi.Input[builtins.str] status: 状态，取值：Creating：配置中。CreationFailed：配置失败。Deleting：删除中。DeletionFailed：删除失败。Verified：正常。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        if certificate_id is not None:
            pulumi.set(__self__, "certificate_id", certificate_id)
        if comments is not None:
            pulumi.set(__self__, "comments", comments)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if custom_domain_id is not None:
            pulumi.set(__self__, "custom_domain_id", custom_domain_id)
        if domain is not None:
            pulumi.set(__self__, "domain", domain)
        if protocols is not None:
            pulumi.set(__self__, "protocols", protocols)
        if service_id is not None:
            pulumi.set(__self__, "service_id", service_id)
        if ssl_redirect is not None:
            pulumi.set(__self__, "ssl_redirect", ssl_redirect)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义域名证书ID。
        """
        return pulumi.get(self, "certificate_id")

    @certificate_id.setter
    def certificate_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "certificate_id", value)

    @property
    @pulumi.getter
    def comments(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

    @comments.setter
    def comments(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "comments", value)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "created_time", value)

    @property
    @pulumi.getter(name="customDomainId")
    def custom_domain_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义域名ID。
        """
        return pulumi.get(self, "custom_domain_id")

    @custom_domain_id.setter
    def custom_domain_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "custom_domain_id", value)

    @property
    @pulumi.getter
    def domain(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义域名。
        """
        return pulumi.get(self, "domain")

    @domain.setter
    def domain(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter
    def protocols(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
        """
        协议，取值：HTTP。HTTPS。
        """
        return pulumi.get(self, "protocols")

    @protocols.setter
    def protocols(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]):
        pulumi.set(self, "protocols", value)

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        服务ID。
        """
        return pulumi.get(self, "service_id")

    @service_id.setter
    def service_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "service_id", value)

    @property
    @pulumi.getter(name="sslRedirect")
    def ssl_redirect(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        重定向到HTTPS。
        """
        return pulumi.get(self, "ssl_redirect")

    @ssl_redirect.setter
    def ssl_redirect(self, value: Optional[pulumi.Input[builtins.bool]]):
        pulumi.set(self, "ssl_redirect", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        状态，取值：Creating：配置中。CreationFailed：配置失败。Deleting：删除中。DeletionFailed：删除失败。Verified：正常。
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @updated_time.setter
    def updated_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "updated_time", value)


@pulumi.type_token("bytepluscc:apig/customDomain:CustomDomain")
class CustomDomain(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 certificate_id: Optional[pulumi.Input[builtins.str]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 protocols: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 service_id: Optional[pulumi.Input[builtins.str]] = None,
                 ssl_redirect: Optional[pulumi.Input[builtins.bool]] = None,
                 __props__=None):
        """
        服务作为业务对外暴露的入口，可以通过绑定域名功能，将您的自定义域名绑定至服务。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        apig_custom_domain_demo = bytepluscc.apig.CustomDomain("ApigCustomDomainDemo",
            service_id="sd50d3h5xxxm0t5xxxxx",
            domain="www.****.com",
            protocols=[
                "HTTP",
                "HTTPS",
            ],
            certificate_id="cert-775906d873xxx5bc9d1d372b5dxxxxx",
            comments="ApigCustomDomainDemo custom domain",
            ssl_redirect=True)
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:apig/customDomain:CustomDomain example "custom_domain_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] certificate_id: 自定义域名证书ID。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] domain: 自定义域名。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] protocols: 协议，取值：HTTP。HTTPS。
        :param pulumi.Input[builtins.str] service_id: 服务ID。
        :param pulumi.Input[builtins.bool] ssl_redirect: 重定向到HTTPS。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: CustomDomainArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        服务作为业务对外暴露的入口，可以通过绑定域名功能，将您的自定义域名绑定至服务。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        apig_custom_domain_demo = bytepluscc.apig.CustomDomain("ApigCustomDomainDemo",
            service_id="sd50d3h5xxxm0t5xxxxx",
            domain="www.****.com",
            protocols=[
                "HTTP",
                "HTTPS",
            ],
            certificate_id="cert-775906d873xxx5bc9d1d372b5dxxxxx",
            comments="ApigCustomDomainDemo custom domain",
            ssl_redirect=True)
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:apig/customDomain:CustomDomain example "custom_domain_id"
        ```

        :param str resource_name: The name of the resource.
        :param CustomDomainArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(CustomDomainArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 certificate_id: Optional[pulumi.Input[builtins.str]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 protocols: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 service_id: Optional[pulumi.Input[builtins.str]] = None,
                 ssl_redirect: Optional[pulumi.Input[builtins.bool]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = CustomDomainArgs.__new__(CustomDomainArgs)

            __props__.__dict__["certificate_id"] = certificate_id
            __props__.__dict__["comments"] = comments
            if domain is None and not opts.urn:
                raise TypeError("Missing required property 'domain'")
            __props__.__dict__["domain"] = domain
            if protocols is None and not opts.urn:
                raise TypeError("Missing required property 'protocols'")
            __props__.__dict__["protocols"] = protocols
            if service_id is None and not opts.urn:
                raise TypeError("Missing required property 'service_id'")
            __props__.__dict__["service_id"] = service_id
            __props__.__dict__["ssl_redirect"] = ssl_redirect
            __props__.__dict__["created_time"] = None
            __props__.__dict__["custom_domain_id"] = None
            __props__.__dict__["status"] = None
            __props__.__dict__["updated_time"] = None
        super(CustomDomain, __self__).__init__(
            'bytepluscc:apig/customDomain:CustomDomain',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            certificate_id: Optional[pulumi.Input[builtins.str]] = None,
            comments: Optional[pulumi.Input[builtins.str]] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            custom_domain_id: Optional[pulumi.Input[builtins.str]] = None,
            domain: Optional[pulumi.Input[builtins.str]] = None,
            protocols: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
            service_id: Optional[pulumi.Input[builtins.str]] = None,
            ssl_redirect: Optional[pulumi.Input[builtins.bool]] = None,
            status: Optional[pulumi.Input[builtins.str]] = None,
            updated_time: Optional[pulumi.Input[builtins.str]] = None) -> 'CustomDomain':
        """
        Get an existing CustomDomain resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] certificate_id: 自定义域名证书ID。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] created_time: 创建时间。
        :param pulumi.Input[builtins.str] custom_domain_id: 自定义域名ID。
        :param pulumi.Input[builtins.str] domain: 自定义域名。
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] protocols: 协议，取值：HTTP。HTTPS。
        :param pulumi.Input[builtins.str] service_id: 服务ID。
        :param pulumi.Input[builtins.bool] ssl_redirect: 重定向到HTTPS。
        :param pulumi.Input[builtins.str] status: 状态，取值：Creating：配置中。CreationFailed：配置失败。Deleting：删除中。DeletionFailed：删除失败。Verified：正常。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _CustomDomainState.__new__(_CustomDomainState)

        __props__.__dict__["certificate_id"] = certificate_id
        __props__.__dict__["comments"] = comments
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["custom_domain_id"] = custom_domain_id
        __props__.__dict__["domain"] = domain
        __props__.__dict__["protocols"] = protocols
        __props__.__dict__["service_id"] = service_id
        __props__.__dict__["ssl_redirect"] = ssl_redirect
        __props__.__dict__["status"] = status
        __props__.__dict__["updated_time"] = updated_time
        return CustomDomain(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> pulumi.Output[builtins.str]:
        """
        自定义域名证书ID。
        """
        return pulumi.get(self, "certificate_id")

    @property
    @pulumi.getter
    def comments(self) -> pulumi.Output[builtins.str]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="customDomainId")
    def custom_domain_id(self) -> pulumi.Output[builtins.str]:
        """
        自定义域名ID。
        """
        return pulumi.get(self, "custom_domain_id")

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Output[builtins.str]:
        """
        自定义域名。
        """
        return pulumi.get(self, "domain")

    @property
    @pulumi.getter
    def protocols(self) -> pulumi.Output[Sequence[builtins.str]]:
        """
        协议，取值：HTTP。HTTPS。
        """
        return pulumi.get(self, "protocols")

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> pulumi.Output[builtins.str]:
        """
        服务ID。
        """
        return pulumi.get(self, "service_id")

    @property
    @pulumi.getter(name="sslRedirect")
    def ssl_redirect(self) -> pulumi.Output[builtins.bool]:
        """
        重定向到HTTPS。
        """
        return pulumi.get(self, "ssl_redirect")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[builtins.str]:
        """
        状态，取值：Creating：配置中。CreationFailed：配置失败。Deleting：删除中。DeletionFailed：删除失败。Verified：正常。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.str]:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

