# 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
from . import outputs

__all__ = [
    'GetCertificateResult',
    'AwaitableGetCertificateResult',
    'get_certificate',
    'get_certificate_output',
]

@pulumi.output_type
class GetCertificateResult:
    """
    A collection of values returned by getCertificate.
    """
    def __init__(__self__, certificate_id=None, certificate_name=None, certificate_type=None, created_time=None, description=None, domain_name=None, expired_at=None, id=None, listeners=None, private_key=None, project_name=None, public_key=None, san=None, status=None, tags=None):
        if certificate_id and not isinstance(certificate_id, str):
            raise TypeError("Expected argument 'certificate_id' to be a str")
        pulumi.set(__self__, "certificate_id", certificate_id)
        if certificate_name and not isinstance(certificate_name, str):
            raise TypeError("Expected argument 'certificate_name' to be a str")
        pulumi.set(__self__, "certificate_name", certificate_name)
        if certificate_type and not isinstance(certificate_type, str):
            raise TypeError("Expected argument 'certificate_type' to be a str")
        pulumi.set(__self__, "certificate_type", certificate_type)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if domain_name and not isinstance(domain_name, str):
            raise TypeError("Expected argument 'domain_name' to be a str")
        pulumi.set(__self__, "domain_name", domain_name)
        if expired_at and not isinstance(expired_at, str):
            raise TypeError("Expected argument 'expired_at' to be a str")
        pulumi.set(__self__, "expired_at", expired_at)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if listeners and not isinstance(listeners, list):
            raise TypeError("Expected argument 'listeners' to be a list")
        pulumi.set(__self__, "listeners", listeners)
        if private_key and not isinstance(private_key, str):
            raise TypeError("Expected argument 'private_key' to be a str")
        pulumi.set(__self__, "private_key", private_key)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if public_key and not isinstance(public_key, str):
            raise TypeError("Expected argument 'public_key' to be a str")
        pulumi.set(__self__, "public_key", public_key)
        if san and not isinstance(san, str):
            raise TypeError("Expected argument 'san' to be a str")
        pulumi.set(__self__, "san", san)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> builtins.str:
        """
        证书ID。
        """
        return pulumi.get(self, "certificate_id")

    @property
    @pulumi.getter(name="certificateName")
    def certificate_name(self) -> builtins.str:
        """
        证书名称，长度限制为1 ～ 128个字符，必须以字母或中文开头，可包含数字、点号（.）、下划线（_）和短横线（-）。
        """
        return pulumi.get(self, "certificate_name")

    @property
    @pulumi.getter(name="certificateType")
    def certificate_type(self) -> builtins.str:
        """
        证书类型，取值：CA：CA证书、Server：服务器证书。
        """
        return pulumi.get(self, "certificate_type")

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

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        证书描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="domainName")
    def domain_name(self) -> builtins.str:
        """
        证书域名。
        """
        return pulumi.get(self, "domain_name")

    @property
    @pulumi.getter(name="expiredAt")
    def expired_at(self) -> builtins.str:
        """
        证书过期时间。
        """
        return pulumi.get(self, "expired_at")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def listeners(self) -> Sequence[builtins.str]:
        """
        证书关联的监听器列表。
        """
        return pulumi.get(self, "listeners")

    @property
    @pulumi.getter(name="privateKey")
    def private_key(self) -> builtins.str:
        """
        服务器证书的私钥，当证书类型为Server时必填。
        """
        return pulumi.get(self, "private_key")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        项目名称。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="publicKey")
    def public_key(self) -> builtins.str:
        """
        服务器证书的公钥。
        """
        return pulumi.get(self, "public_key")

    @property
    @pulumi.getter
    def san(self) -> builtins.str:
        """
        证书扩展域名列表，用英文',' 分隔多个域名， 包含(commonName,DnsName,IP)。
        """
        return pulumi.get(self, "san")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        证书的状态，取值为：Creating：创建中。Active：运行中。Deleting：删除中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetCertificateTagResult']:
        """
        标签列表。
        """
        return pulumi.get(self, "tags")


class AwaitableGetCertificateResult(GetCertificateResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetCertificateResult(
            certificate_id=self.certificate_id,
            certificate_name=self.certificate_name,
            certificate_type=self.certificate_type,
            created_time=self.created_time,
            description=self.description,
            domain_name=self.domain_name,
            expired_at=self.expired_at,
            id=self.id,
            listeners=self.listeners,
            private_key=self.private_key,
            project_name=self.project_name,
            public_key=self.public_key,
            san=self.san,
            status=self.status,
            tags=self.tags)


def get_certificate(id: Optional[builtins.str] = None,
                    opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCertificateResult:
    """
    Data Source schema for Byteplus::ALB::Certificate


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:alb/getCertificate:getCertificate', __args__, opts=opts, typ=GetCertificateResult).value

    return AwaitableGetCertificateResult(
        certificate_id=pulumi.get(__ret__, 'certificate_id'),
        certificate_name=pulumi.get(__ret__, 'certificate_name'),
        certificate_type=pulumi.get(__ret__, 'certificate_type'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        domain_name=pulumi.get(__ret__, 'domain_name'),
        expired_at=pulumi.get(__ret__, 'expired_at'),
        id=pulumi.get(__ret__, 'id'),
        listeners=pulumi.get(__ret__, 'listeners'),
        private_key=pulumi.get(__ret__, 'private_key'),
        project_name=pulumi.get(__ret__, 'project_name'),
        public_key=pulumi.get(__ret__, 'public_key'),
        san=pulumi.get(__ret__, 'san'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'))
def get_certificate_output(id: Optional[pulumi.Input[builtins.str]] = None,
                           opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetCertificateResult]:
    """
    Data Source schema for Byteplus::ALB::Certificate


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:alb/getCertificate:getCertificate', __args__, opts=opts, typ=GetCertificateResult)
    return __ret__.apply(lambda __response__: GetCertificateResult(
        certificate_id=pulumi.get(__response__, 'certificate_id'),
        certificate_name=pulumi.get(__response__, 'certificate_name'),
        certificate_type=pulumi.get(__response__, 'certificate_type'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        domain_name=pulumi.get(__response__, 'domain_name'),
        expired_at=pulumi.get(__response__, 'expired_at'),
        id=pulumi.get(__response__, 'id'),
        listeners=pulumi.get(__response__, 'listeners'),
        private_key=pulumi.get(__response__, 'private_key'),
        project_name=pulumi.get(__response__, 'project_name'),
        public_key=pulumi.get(__response__, 'public_key'),
        san=pulumi.get(__response__, 'san'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags')))
