# 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__ = [
    'GetDatabaseResult',
    'AwaitableGetDatabaseResult',
    'get_database',
    'get_database_output',
]

@pulumi.output_type
class GetDatabaseResult:
    """
    A collection of values returned by getDatabase.
    """
    def __init__(__self__, c_type=None, character_set_name=None, collate=None, db_name=None, db_status=None, id=None, instance_id=None, owner=None):
        if c_type and not isinstance(c_type, str):
            raise TypeError("Expected argument 'c_type' to be a str")
        pulumi.set(__self__, "c_type", c_type)
        if character_set_name and not isinstance(character_set_name, str):
            raise TypeError("Expected argument 'character_set_name' to be a str")
        pulumi.set(__self__, "character_set_name", character_set_name)
        if collate and not isinstance(collate, str):
            raise TypeError("Expected argument 'collate' to be a str")
        pulumi.set(__self__, "collate", collate)
        if db_name and not isinstance(db_name, str):
            raise TypeError("Expected argument 'db_name' to be a str")
        pulumi.set(__self__, "db_name", db_name)
        if db_status and not isinstance(db_status, str):
            raise TypeError("Expected argument 'db_status' to be a str")
        pulumi.set(__self__, "db_status", db_status)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        if owner and not isinstance(owner, str):
            raise TypeError("Expected argument 'owner' to be a str")
        pulumi.set(__self__, "owner", owner)

    @property
    @pulumi.getter(name="cType")
    def c_type(self) -> builtins.str:
        """
        字符分类。取值范围： C（默认）、C.UTF-8、en*US.utf8、zh*CN.utf8 和 POSIX。
        """
        return pulumi.get(self, "c_type")

    @property
    @pulumi.getter(name="characterSetName")
    def character_set_name(self) -> builtins.str:
        """
        数据库字符集。目前支持的字符集包含：utf8（默认）、latin1、ascii
        """
        return pulumi.get(self, "character_set_name")

    @property
    @pulumi.getter
    def collate(self) -> builtins.str:
        """
        排序规则。取值范围：C（默认）、C.UTF-8、en*US.utf8、zh*CN.utf8 和 POSIX
        """
        return pulumi.get(self, "collate")

    @property
    @pulumi.getter(name="dbName")
    def db_name(self) -> builtins.str:
        """
        数据库名称。命名规则如下：长度 2~63 个字符。由字母、数字、下划线或中划线组成。以字母开头，字母或数字结尾。不能使用保留关键字，所有被禁用的关键词请参见禁用关键词。
        """
        return pulumi.get(self, "db_name")

    @property
    @pulumi.getter(name="dbStatus")
    def db_status(self) -> builtins.str:
        """
        数据库状态：Unavailable：不可用。Available：可用。
        """
        return pulumi.get(self, "db_status")

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

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> builtins.str:
        """
        实例 ID
        """
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter
    def owner(self) -> builtins.str:
        """
        数据库的 owner。说明：实例只读账号、被禁用了 DDL 权限的高权限账号或被禁用了 DDL 权限的普通账号不能作为数据库的 owner。不传值或传空值时，会为该字段取值为 rds superuser
        """
        return pulumi.get(self, "owner")


class AwaitableGetDatabaseResult(GetDatabaseResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDatabaseResult(
            c_type=self.c_type,
            character_set_name=self.character_set_name,
            collate=self.collate,
            db_name=self.db_name,
            db_status=self.db_status,
            id=self.id,
            instance_id=self.instance_id,
            owner=self.owner)


def get_database(id: Optional[builtins.str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatabaseResult:
    """
    Data Source schema for Byteplus::RDSPostgreSQL::Database


    :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:rdspostgresql/getDatabase:getDatabase', __args__, opts=opts, typ=GetDatabaseResult).value

    return AwaitableGetDatabaseResult(
        c_type=pulumi.get(__ret__, 'c_type'),
        character_set_name=pulumi.get(__ret__, 'character_set_name'),
        collate=pulumi.get(__ret__, 'collate'),
        db_name=pulumi.get(__ret__, 'db_name'),
        db_status=pulumi.get(__ret__, 'db_status'),
        id=pulumi.get(__ret__, 'id'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        owner=pulumi.get(__ret__, 'owner'))
def get_database_output(id: Optional[pulumi.Input[builtins.str]] = None,
                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDatabaseResult]:
    """
    Data Source schema for Byteplus::RDSPostgreSQL::Database


    :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:rdspostgresql/getDatabase:getDatabase', __args__, opts=opts, typ=GetDatabaseResult)
    return __ret__.apply(lambda __response__: GetDatabaseResult(
        c_type=pulumi.get(__response__, 'c_type'),
        character_set_name=pulumi.get(__response__, 'character_set_name'),
        collate=pulumi.get(__response__, 'collate'),
        db_name=pulumi.get(__response__, 'db_name'),
        db_status=pulumi.get(__response__, 'db_status'),
        id=pulumi.get(__response__, 'id'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        owner=pulumi.get(__response__, 'owner')))
