# 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__ = [
    'GetDbAccountResult',
    'AwaitableGetDbAccountResult',
    'get_db_account',
    'get_db_account_output',
]

@pulumi.output_type
class GetDbAccountResult:
    """
    A collection of values returned by getDbAccount.
    """
    def __init__(__self__, account_name=None, account_password=None, account_privileges=None, account_type=None, id=None, instance_id=None, not_allow_privileges=None):
        if account_name and not isinstance(account_name, str):
            raise TypeError("Expected argument 'account_name' to be a str")
        pulumi.set(__self__, "account_name", account_name)
        if account_password and not isinstance(account_password, str):
            raise TypeError("Expected argument 'account_password' to be a str")
        pulumi.set(__self__, "account_password", account_password)
        if account_privileges and not isinstance(account_privileges, str):
            raise TypeError("Expected argument 'account_privileges' to be a str")
        pulumi.set(__self__, "account_privileges", account_privileges)
        if account_type and not isinstance(account_type, str):
            raise TypeError("Expected argument 'account_type' to be a str")
        pulumi.set(__self__, "account_type", account_type)
        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 not_allow_privileges and not isinstance(not_allow_privileges, list):
            raise TypeError("Expected argument 'not_allow_privileges' to be a list")
        pulumi.set(__self__, "not_allow_privileges", not_allow_privileges)

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

    @property
    @pulumi.getter(name="accountPassword")
    def account_password(self) -> builtins.str:
        """
        数据库账号的密码。数据库账号密码的设置规则如下：长度为 8~32 个字符。由大写字母、小写字母、数字、特殊字符中的任意三种组成。特殊字符为 !@#$%^*()&_+-=。
        """
        return pulumi.get(self, "account_password")

    @property
    @pulumi.getter(name="accountPrivileges")
    def account_privileges(self) -> builtins.str:
        """
        账号权限信息。多个权限中间以英文逗号（,）分隔。取值：Login：登录权限。Inherit：继承权限。CreateRole：创建角色权限。CreateDB：创建数据库权限。说明当账号类型为高权限账号时，无需传入该参数，默认支持全部权限。当账号类型为普通账号时，支持传入该参数，默认值为 Login 和 Inherit。账号类型为实例只读账号时，即 AccountType 取值为 InstanceReadOnly 时，不支持传入该参数
        """
        return pulumi.get(self, "account_privileges")

    @property
    @pulumi.getter(name="accountType")
    def account_type(self) -> builtins.str:
        """
        数据库账号类型，取值范围如下：Super：高权限账号。Normal：普通账号。InstanceReadOnly：实例只读账号。
        """
        return pulumi.get(self, "account_type")

    @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(name="notAllowPrivileges")
    def not_allow_privileges(self) -> Sequence[builtins.str]:
        """
        为账号禁用的权限。当前仅支持取值为 DDL。说明仅支持为高权限账号或普通账号传入此字段，即 AccountType 取值为 Super 或 Normal 时。
        """
        return pulumi.get(self, "not_allow_privileges")


class AwaitableGetDbAccountResult(GetDbAccountResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDbAccountResult(
            account_name=self.account_name,
            account_password=self.account_password,
            account_privileges=self.account_privileges,
            account_type=self.account_type,
            id=self.id,
            instance_id=self.instance_id,
            not_allow_privileges=self.not_allow_privileges)


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


    :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/getDbAccount:getDbAccount', __args__, opts=opts, typ=GetDbAccountResult).value

    return AwaitableGetDbAccountResult(
        account_name=pulumi.get(__ret__, 'account_name'),
        account_password=pulumi.get(__ret__, 'account_password'),
        account_privileges=pulumi.get(__ret__, 'account_privileges'),
        account_type=pulumi.get(__ret__, 'account_type'),
        id=pulumi.get(__ret__, 'id'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        not_allow_privileges=pulumi.get(__ret__, 'not_allow_privileges'))
def get_db_account_output(id: Optional[pulumi.Input[builtins.str]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDbAccountResult]:
    """
    Data Source schema for Byteplus::RDSPostgreSQL::DBAccount


    :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/getDbAccount:getDbAccount', __args__, opts=opts, typ=GetDbAccountResult)
    return __ret__.apply(lambda __response__: GetDbAccountResult(
        account_name=pulumi.get(__response__, 'account_name'),
        account_password=pulumi.get(__response__, 'account_password'),
        account_privileges=pulumi.get(__response__, 'account_privileges'),
        account_type=pulumi.get(__response__, 'account_type'),
        id=pulumi.get(__response__, 'id'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        not_allow_privileges=pulumi.get(__response__, 'not_allow_privileges')))
