# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = [
    'GetDatabasePermissionsPermissionResult',
    'GetDatabaseRoleMemberResult',
    'GetDatabaseRolesRoleResult',
    'GetDatabasesDatabaseResult',
    'GetSchemaPermissionsPermissionResult',
    'GetSchemasSchemaResult',
    'GetServerPermissionsPermissionResult',
    'GetServerRoleMemberResult',
    'GetServerRolesRoleResult',
    'GetSqlLoginsLoginResult',
    'GetSqlUsersUserResult',
]

@pulumi.output_type
class GetDatabasePermissionsPermissionResult(dict):
    def __init__(__self__, *,
                 permission: str,
                 with_grant_option: bool):
        """
        :param str permission: Name of database-level SQL permission. For full list of supported permissions, see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-database-permissions-transact-sql?view=azuresqldb-current#remarks)
        :param bool with_grant_option: When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        pulumi.set(__self__, "permission", permission)
        pulumi.set(__self__, "with_grant_option", with_grant_option)

    @property
    @pulumi.getter
    def permission(self) -> str:
        """
        Name of database-level SQL permission. For full list of supported permissions, see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-database-permissions-transact-sql?view=azuresqldb-current#remarks)
        """
        return pulumi.get(self, "permission")

    @property
    @pulumi.getter(name="withGrantOption")
    def with_grant_option(self) -> bool:
        """
        When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        return pulumi.get(self, "with_grant_option")


@pulumi.output_type
class GetDatabaseRoleMemberResult(dict):
    def __init__(__self__, *,
                 id: str,
                 name: str,
                 type: str):
        """
        :param str id: `<database_id>/<member_id>`. Member ID can be retrieved using `SELECT DATABASE*PRINCIPAL*ID('\\n\\n')
        :param str name: Name of the database principal.
        :param str type: One of: `SQL_USER`, `DATABASE_ROLE`, `AZUREAD_USER`
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        `<database_id>/<member_id>`. Member ID can be retrieved using `SELECT DATABASE*PRINCIPAL*ID('\\n\\n')
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name of the database principal.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        One of: `SQL_USER`, `DATABASE_ROLE`, `AZUREAD_USER`
        """
        return pulumi.get(self, "type")


@pulumi.output_type
class GetDatabaseRolesRoleResult(dict):
    def __init__(__self__, *,
                 database_id: str,
                 id: str,
                 name: str,
                 owner_id: str):
        """
        :param str database_id: ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        :param str id: `<database_id>/<role_id>`. Role ID can be retrieved using `SELECT DATABASE_PRINCIPAL_ID('<role_name>')`
        :param str name: Role name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot be longer than 128 chars.
        :param str owner_id: ID of another database role or user owning this role. Can be retrieved using `DatabaseRole` or `SqlUser`.
        """
        pulumi.set(__self__, "database_id", database_id)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "owner_id", owner_id)

    @property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> str:
        """
        ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        """
        return pulumi.get(self, "database_id")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        `<database_id>/<role_id>`. Role ID can be retrieved using `SELECT DATABASE_PRINCIPAL_ID('<role_name>')`
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Role name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot be longer than 128 chars.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> str:
        """
        ID of another database role or user owning this role. Can be retrieved using `DatabaseRole` or `SqlUser`.
        """
        return pulumi.get(self, "owner_id")


@pulumi.output_type
class GetDatabasesDatabaseResult(dict):
    def __init__(__self__, *,
                 collation: str,
                 id: str,
                 name: str):
        """
        :param str collation: Default collation name. Can be either a Windows collation name or a SQL collation name.
        :param str id: Database ID. Can be retrieved using `SELECT DB_ID('<db_name>')`.
        :param str name: Database name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers).
        """
        pulumi.set(__self__, "collation", collation)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def collation(self) -> str:
        """
        Default collation name. Can be either a Windows collation name or a SQL collation name.
        """
        return pulumi.get(self, "collation")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        Database ID. Can be retrieved using `SELECT DB_ID('<db_name>')`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Database name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers).
        """
        return pulumi.get(self, "name")


@pulumi.output_type
class GetSchemaPermissionsPermissionResult(dict):
    def __init__(__self__, *,
                 permission: str,
                 with_grant_option: bool):
        """
        :param str permission: Name of schema SQL permission. For full list of supported permissions, see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-schema-permissions-transact-sql?view=azuresqldb-current#remarks)
        :param bool with_grant_option: When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        pulumi.set(__self__, "permission", permission)
        pulumi.set(__self__, "with_grant_option", with_grant_option)

    @property
    @pulumi.getter
    def permission(self) -> str:
        """
        Name of schema SQL permission. For full list of supported permissions, see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-schema-permissions-transact-sql?view=azuresqldb-current#remarks)
        """
        return pulumi.get(self, "permission")

    @property
    @pulumi.getter(name="withGrantOption")
    def with_grant_option(self) -> bool:
        """
        When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        return pulumi.get(self, "with_grant_option")


@pulumi.output_type
class GetSchemasSchemaResult(dict):
    def __init__(__self__, *,
                 database_id: str,
                 id: str,
                 name: str,
                 owner_id: str):
        """
        :param str database_id: ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        :param str id: `<database_id>/<schema_id>`. Schema ID can be retrieved using `SELECT SCHEMA_ID('<schema_name>')`.
        :param str name: Schema name.
        :param str owner_id: ID of database role or user owning this schema. Can be retrieved using `DatabaseRole`, `SqlUser`, `AzureadUser` or `AzureadServicePrincipal`
        """
        pulumi.set(__self__, "database_id", database_id)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "owner_id", owner_id)

    @property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> str:
        """
        ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        """
        return pulumi.get(self, "database_id")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        `<database_id>/<schema_id>`. Schema ID can be retrieved using `SELECT SCHEMA_ID('<schema_name>')`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Schema name.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> str:
        """
        ID of database role or user owning this schema. Can be retrieved using `DatabaseRole`, `SqlUser`, `AzureadUser` or `AzureadServicePrincipal`
        """
        return pulumi.get(self, "owner_id")


@pulumi.output_type
class GetServerPermissionsPermissionResult(dict):
    def __init__(__self__, *,
                 permission: str,
                 with_grant_option: bool):
        """
        :param str permission: Name of server-level SQL permission. For full list of supported permissions see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-server-permissions-transact-sql?view=azuresqldb-current#remarks)
        :param bool with_grant_option: When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        pulumi.set(__self__, "permission", permission)
        pulumi.set(__self__, "with_grant_option", with_grant_option)

    @property
    @pulumi.getter
    def permission(self) -> str:
        """
        Name of server-level SQL permission. For full list of supported permissions see [docs](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-server-permissions-transact-sql?view=azuresqldb-current#remarks)
        """
        return pulumi.get(self, "permission")

    @property
    @pulumi.getter(name="withGrantOption")
    def with_grant_option(self) -> bool:
        """
        When set to `true`, `principal_id` will be allowed to grant the `permission` to other principals.
        """
        return pulumi.get(self, "with_grant_option")


@pulumi.output_type
class GetServerRoleMemberResult(dict):
    def __init__(__self__, *,
                 id: str,
                 name: str,
                 type: str):
        """
        :param str id: ID of the member principal
        :param str name: Name of the server principal
        :param str type: One of: `SQL_LOGIN`, `SERVER_ROLE`
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        ID of the member principal
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name of the server principal
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        One of: `SQL_LOGIN`, `SERVER_ROLE`
        """
        return pulumi.get(self, "type")


@pulumi.output_type
class GetServerRolesRoleResult(dict):
    def __init__(__self__, *,
                 id: str,
                 name: str,
                 owner_id: str):
        """
        :param str id: Role principal ID.
        :param str name: Role name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot be longer than 128 chars.
        :param str owner_id: ID of another server role or login owning this role. Can be retrieved using `ServerRole` or `SqlLogin`.
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "owner_id", owner_id)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        Role principal ID.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Role name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot be longer than 128 chars.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> str:
        """
        ID of another server role or login owning this role. Can be retrieved using `ServerRole` or `SqlLogin`.
        """
        return pulumi.get(self, "owner_id")


@pulumi.output_type
class GetSqlLoginsLoginResult(dict):
    def __init__(__self__, *,
                 check_password_expiration: bool,
                 check_password_policy: bool,
                 default_database_id: str,
                 default_language: str,
                 id: str,
                 must_change_password: bool,
                 name: str,
                 principal_id: str):
        """
        :param bool check_password_expiration: When `true`, password expiration policy is enforced for this login.
        :param bool check_password_policy: When `true`, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
        :param str default_database_id: ID of login's default DB. The ID can be retrieved using `Database` data resource.
        :param str default_language: Default language assigned to login.
        :param str id: Login SID. Can be retrieved using `SELECT SUSER_SID('<login_name>')`.
        :param bool must_change_password: When true, password change will be forced on first logon.
        :param str name: Login name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot contain `\\`
        :param str principal_id: ID used to reference SQL Login in other resources, e.g. `server_role`. Can be retrieved from `sys.sql_logins`.
        """
        pulumi.set(__self__, "check_password_expiration", check_password_expiration)
        pulumi.set(__self__, "check_password_policy", check_password_policy)
        pulumi.set(__self__, "default_database_id", default_database_id)
        pulumi.set(__self__, "default_language", default_language)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "must_change_password", must_change_password)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "principal_id", principal_id)

    @property
    @pulumi.getter(name="checkPasswordExpiration")
    def check_password_expiration(self) -> bool:
        """
        When `true`, password expiration policy is enforced for this login.
        """
        return pulumi.get(self, "check_password_expiration")

    @property
    @pulumi.getter(name="checkPasswordPolicy")
    def check_password_policy(self) -> bool:
        """
        When `true`, the Windows password policies of the computer on which SQL Server is running are enforced on this login.
        """
        return pulumi.get(self, "check_password_policy")

    @property
    @pulumi.getter(name="defaultDatabaseId")
    def default_database_id(self) -> str:
        """
        ID of login's default DB. The ID can be retrieved using `Database` data resource.
        """
        return pulumi.get(self, "default_database_id")

    @property
    @pulumi.getter(name="defaultLanguage")
    def default_language(self) -> str:
        """
        Default language assigned to login.
        """
        return pulumi.get(self, "default_language")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        Login SID. Can be retrieved using `SELECT SUSER_SID('<login_name>')`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="mustChangePassword")
    def must_change_password(self) -> bool:
        """
        When true, password change will be forced on first logon.
        """
        return pulumi.get(self, "must_change_password")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Login name. Must follow [Regular Identifiers rules](https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers#rules-for-regular-identifiers) and cannot contain `\\`
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> str:
        """
        ID used to reference SQL Login in other resources, e.g. `server_role`. Can be retrieved from `sys.sql_logins`.
        """
        return pulumi.get(self, "principal_id")


@pulumi.output_type
class GetSqlUsersUserResult(dict):
    def __init__(__self__, *,
                 database_id: str,
                 id: str,
                 login_id: str,
                 name: str):
        """
        :param str database_id: ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        :param str id: `<database_id>/<user_id>`. User ID can be retrieved using `SELECT DATABASE_PRINCIPAL_ID('<user_name>')`.
        :param str login_id: SID of SQL login. Can be retrieved using `SqlLogin` or `SELECT SUSER_SID('<login_name>')`.
        :param str name: User name. Cannot be longer than 128 chars.
        """
        pulumi.set(__self__, "database_id", database_id)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "login_id", login_id)
        pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> str:
        """
        ID of database. Can be retrieved using `Database` or `SELECT DB_ID('<db_name>')`.
        """
        return pulumi.get(self, "database_id")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        `<database_id>/<user_id>`. User ID can be retrieved using `SELECT DATABASE_PRINCIPAL_ID('<user_name>')`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="loginId")
    def login_id(self) -> str:
        """
        SID of SQL login. Can be retrieved using `SqlLogin` or `SELECT SUSER_SID('<login_name>')`.
        """
        return pulumi.get(self, "login_id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        User name. Cannot be longer than 128 chars.
        """
        return pulumi.get(self, "name")


