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

__all__ = [
    'GetServerRolesResult',
    'AwaitableGetServerRolesResult',
    'get_server_roles',
    'get_server_roles_output',
]

@pulumi.output_type
class GetServerRolesResult:
    """
    A collection of values returned by getServerRoles.
    """
    def __init__(__self__, id=None, roles=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if roles and not isinstance(roles, list):
            raise TypeError("Expected argument 'roles' to be a list")
        pulumi.set(__self__, "roles", roles)

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

    @property
    @pulumi.getter
    def roles(self) -> Sequence['outputs.GetServerRolesRoleResult']:
        """
        Set of all roles found in the server
        """
        return pulumi.get(self, "roles")


class AwaitableGetServerRolesResult(GetServerRolesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServerRolesResult(
            id=self.id,
            roles=self.roles)


def get_server_roles(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServerRolesResult:
    """
    Obtains information about all roles defined in the server.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_mssql as mssql

    all = mssql.get_server_roles()
    pulumi.export("roles", all.roles)
    ```
    """
    __args__ = dict()
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('mssql:index/getServerRoles:getServerRoles', __args__, opts=opts, typ=GetServerRolesResult).value

    return AwaitableGetServerRolesResult(
        id=pulumi.get(__ret__, 'id'),
        roles=pulumi.get(__ret__, 'roles'))


@_utilities.lift_output_func(get_server_roles)
def get_server_roles_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServerRolesResult]:
    """
    Obtains information about all roles defined in the server.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_mssql as mssql

    all = mssql.get_server_roles()
    pulumi.export("roles", all.roles)
    ```
    """
    ...
