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

@pulumi.output_type
class GetDatabaseResult:
    """
    A collection of values returned by getDatabase.
    """
    def __init__(__self__, character_set_name=None, databases_privileges=None, db_desc=None, db_name=None, id=None, instance_id=None):
        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 databases_privileges and not isinstance(databases_privileges, list):
            raise TypeError("Expected argument 'databases_privileges' to be a list")
        pulumi.set(__self__, "databases_privileges", databases_privileges)
        if db_desc and not isinstance(db_desc, str):
            raise TypeError("Expected argument 'db_desc' to be a str")
        pulumi.set(__self__, "db_desc", db_desc)
        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 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)

    @property
    @pulumi.getter(name="characterSetName")
    def character_set_name(self) -> builtins.str:
        """
        数据库字符集，可选值：utf8mb4（默认）、utf8、latin1、ascii
        """
        return pulumi.get(self, "character_set_name")

    @property
    @pulumi.getter(name="databasesPrivileges")
    def databases_privileges(self) -> Sequence['outputs.GetDatabaseDatabasesPrivilegeResult']:
        """
        数据库的权限信息
        """
        return pulumi.get(self, "databases_privileges")

    @property
    @pulumi.getter(name="dbDesc")
    def db_desc(self) -> builtins.str:
        """
        数据库描述信息，长度0~256字符，可包含数字、中文、英文、下划线(_)、中划线(-)
        """
        return pulumi.get(self, "db_desc")

    @property
    @pulumi.getter(name="dbName")
    def db_name(self) -> builtins.str:
        """
        数据库名称。命名规则：当前实例下唯一；长度2~64字符；以字母开头，字母/数字结尾；由字母、数字、下划线(_)、中划线(-)组成；不能使用预留字
        """
        return pulumi.get(self, "db_name")

    @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")


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


def get_database(id: Optional[builtins.str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatabaseResult:
    """
    Data Source schema for Byteplus::VEDBM::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:vedbm/getDatabase:getDatabase', __args__, opts=opts, typ=GetDatabaseResult).value

    return AwaitableGetDatabaseResult(
        character_set_name=pulumi.get(__ret__, 'character_set_name'),
        databases_privileges=pulumi.get(__ret__, 'databases_privileges'),
        db_desc=pulumi.get(__ret__, 'db_desc'),
        db_name=pulumi.get(__ret__, 'db_name'),
        id=pulumi.get(__ret__, 'id'),
        instance_id=pulumi.get(__ret__, 'instance_id'))
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::VEDBM::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:vedbm/getDatabase:getDatabase', __args__, opts=opts, typ=GetDatabaseResult)
    return __ret__.apply(lambda __response__: GetDatabaseResult(
        character_set_name=pulumi.get(__response__, 'character_set_name'),
        databases_privileges=pulumi.get(__response__, 'databases_privileges'),
        db_desc=pulumi.get(__response__, 'db_desc'),
        db_name=pulumi.get(__response__, 'db_name'),
        id=pulumi.get(__response__, 'id'),
        instance_id=pulumi.get(__response__, 'instance_id')))
