# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = [
    'GetMemberRoleResult',
    'AwaitableGetMemberRoleResult',
    'get_member_role',
    'get_member_role_output',
]

@pulumi.output_type
class GetMemberRoleResult:
    """
    A collection of values returned by getMemberRole.
    """
    def __init__(__self__, base_access_level=None, created_at=None, description=None, edit_path=None, enabled_permissions=None, id=None, iid=None, name=None):
        if base_access_level and not isinstance(base_access_level, str):
            raise TypeError("Expected argument 'base_access_level' to be a str")
        pulumi.set(__self__, "base_access_level", base_access_level)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if edit_path and not isinstance(edit_path, str):
            raise TypeError("Expected argument 'edit_path' to be a str")
        pulumi.set(__self__, "edit_path", edit_path)
        if enabled_permissions and not isinstance(enabled_permissions, list):
            raise TypeError("Expected argument 'enabled_permissions' to be a list")
        pulumi.set(__self__, "enabled_permissions", enabled_permissions)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if iid and not isinstance(iid, int):
            raise TypeError("Expected argument 'iid' to be a int")
        pulumi.set(__self__, "iid", iid)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter(name="baseAccessLevel")
    def base_access_level(self) -> _builtins.str:
        """
        The base access level of the custom role.
        """
        return pulumi.get(self, "base_access_level")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> _builtins.str:
        """
        Timestamp of when the member role was created.
        """
        return pulumi.get(self, "created_at")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        Description of the member role.
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter(name="editPath")
    def edit_path(self) -> _builtins.str:
        """
        The Web UI path to edit the member role
        """
        return pulumi.get(self, "edit_path")

    @_builtins.property
    @pulumi.getter(name="enabledPermissions")
    def enabled_permissions(self) -> Sequence[_builtins.str]:
        """
        All permissions enabled for the custom role.
        """
        return pulumi.get(self, "enabled_permissions")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        Globally unique ID of the member role. In the format of `gid://gitlab/MemberRole/1`
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def iid(self) -> _builtins.int:
        """
        The member role ID integer value extracted from the `id` attribute
        """
        return pulumi.get(self, "iid")

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


class AwaitableGetMemberRoleResult(GetMemberRoleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetMemberRoleResult(
            base_access_level=self.base_access_level,
            created_at=self.created_at,
            description=self.description,
            edit_path=self.edit_path,
            enabled_permissions=self.enabled_permissions,
            id=self.id,
            iid=self.iid,
            name=self.name)


def get_member_role(id: Optional[_builtins.str] = None,
                    opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetMemberRoleResult:
    """
    The `MemberRole` data source allows details of a custom member role to be retrieved.

    **Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/api/graphql/reference/#querymemberrole)

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    example = gitlab.get_member_role(id="gid://gitlab/MemberRole/1")
    ```


    :param _builtins.str id: Globally unique ID of the member role. In the format of `gid://gitlab/MemberRole/1`
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('gitlab:index/getMemberRole:getMemberRole', __args__, opts=opts, typ=GetMemberRoleResult).value

    return AwaitableGetMemberRoleResult(
        base_access_level=pulumi.get(__ret__, 'base_access_level'),
        created_at=pulumi.get(__ret__, 'created_at'),
        description=pulumi.get(__ret__, 'description'),
        edit_path=pulumi.get(__ret__, 'edit_path'),
        enabled_permissions=pulumi.get(__ret__, 'enabled_permissions'),
        id=pulumi.get(__ret__, 'id'),
        iid=pulumi.get(__ret__, 'iid'),
        name=pulumi.get(__ret__, 'name'))
def get_member_role_output(id: Optional[pulumi.Input[_builtins.str]] = None,
                           opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetMemberRoleResult]:
    """
    The `MemberRole` data source allows details of a custom member role to be retrieved.

    **Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/api/graphql/reference/#querymemberrole)

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    example = gitlab.get_member_role(id="gid://gitlab/MemberRole/1")
    ```


    :param _builtins.str id: Globally unique ID of the member role. In the format of `gid://gitlab/MemberRole/1`
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('gitlab:index/getMemberRole:getMemberRole', __args__, opts=opts, typ=GetMemberRoleResult)
    return __ret__.apply(lambda __response__: GetMemberRoleResult(
        base_access_level=pulumi.get(__response__, 'base_access_level'),
        created_at=pulumi.get(__response__, 'created_at'),
        description=pulumi.get(__response__, 'description'),
        edit_path=pulumi.get(__response__, 'edit_path'),
        enabled_permissions=pulumi.get(__response__, 'enabled_permissions'),
        id=pulumi.get(__response__, 'id'),
        iid=pulumi.get(__response__, 'iid'),
        name=pulumi.get(__response__, 'name')))
