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

__all__ = [
    'GetRoleAssignmentsResult',
    'AwaitableGetRoleAssignmentsResult',
    'get_role_assignments',
    'get_role_assignments_output',
]

@pulumi.output_type
class GetRoleAssignmentsResult:
    """
    A collection of values returned by getRoleAssignments.
    """
    def __init__(__self__, disabled=None, id=None, identifier=None, managed=None, org_id=None, principals=None, project_id=None, resource_group_identifier=None, role_identifier=None):
        if disabled and not isinstance(disabled, bool):
            raise TypeError("Expected argument 'disabled' to be a bool")
        pulumi.set(__self__, "disabled", disabled)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if identifier and not isinstance(identifier, str):
            raise TypeError("Expected argument 'identifier' to be a str")
        pulumi.set(__self__, "identifier", identifier)
        if managed and not isinstance(managed, bool):
            raise TypeError("Expected argument 'managed' to be a bool")
        pulumi.set(__self__, "managed", managed)
        if org_id and not isinstance(org_id, str):
            raise TypeError("Expected argument 'org_id' to be a str")
        pulumi.set(__self__, "org_id", org_id)
        if principals and not isinstance(principals, list):
            raise TypeError("Expected argument 'principals' to be a list")
        pulumi.set(__self__, "principals", principals)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if resource_group_identifier and not isinstance(resource_group_identifier, str):
            raise TypeError("Expected argument 'resource_group_identifier' to be a str")
        pulumi.set(__self__, "resource_group_identifier", resource_group_identifier)
        if role_identifier and not isinstance(role_identifier, str):
            raise TypeError("Expected argument 'role_identifier' to be a str")
        pulumi.set(__self__, "role_identifier", role_identifier)

    @_builtins.property
    @pulumi.getter
    def disabled(self) -> _builtins.bool:
        """
        Disabled or not.
        """
        return pulumi.get(self, "disabled")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def identifier(self) -> _builtins.str:
        """
        Identifier for role assignment.
        """
        return pulumi.get(self, "identifier")

    @_builtins.property
    @pulumi.getter
    def managed(self) -> _builtins.bool:
        """
        Managed or not.
        """
        return pulumi.get(self, "managed")

    @_builtins.property
    @pulumi.getter(name="orgId")
    def org_id(self) -> Optional[_builtins.str]:
        """
        Org identifier.
        """
        return pulumi.get(self, "org_id")

    @_builtins.property
    @pulumi.getter
    def principals(self) -> Sequence['outputs.GetRoleAssignmentsPrincipalResult']:
        """
        Principal.
        """
        return pulumi.get(self, "principals")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[_builtins.str]:
        """
        Project Identifier
        """
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter(name="resourceGroupIdentifier")
    def resource_group_identifier(self) -> _builtins.str:
        """
        Resource group identifier.
        """
        return pulumi.get(self, "resource_group_identifier")

    @_builtins.property
    @pulumi.getter(name="roleIdentifier")
    def role_identifier(self) -> _builtins.str:
        """
        Role identifier.
        """
        return pulumi.get(self, "role_identifier")


class AwaitableGetRoleAssignmentsResult(GetRoleAssignmentsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRoleAssignmentsResult(
            disabled=self.disabled,
            id=self.id,
            identifier=self.identifier,
            managed=self.managed,
            org_id=self.org_id,
            principals=self.principals,
            project_id=self.project_id,
            resource_group_identifier=self.resource_group_identifier,
            role_identifier=self.role_identifier)


def get_role_assignments(identifier: Optional[_builtins.str] = None,
                         org_id: Optional[_builtins.str] = None,
                         project_id: Optional[_builtins.str] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRoleAssignmentsResult:
    """
    Data source for retrieving role assignment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_harness as harness

    example = harness.platform.get_role_assignments(identifier="identifier",
        org_id="org_id",
        project_id="project_id")
    ```


    :param _builtins.str identifier: Identifier for role assignment.
    :param _builtins.str org_id: Org identifier.
    :param _builtins.str project_id: Project Identifier
    """
    __args__ = dict()
    __args__['identifier'] = identifier
    __args__['orgId'] = org_id
    __args__['projectId'] = project_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('harness:platform/getRoleAssignments:getRoleAssignments', __args__, opts=opts, typ=GetRoleAssignmentsResult).value

    return AwaitableGetRoleAssignmentsResult(
        disabled=pulumi.get(__ret__, 'disabled'),
        id=pulumi.get(__ret__, 'id'),
        identifier=pulumi.get(__ret__, 'identifier'),
        managed=pulumi.get(__ret__, 'managed'),
        org_id=pulumi.get(__ret__, 'org_id'),
        principals=pulumi.get(__ret__, 'principals'),
        project_id=pulumi.get(__ret__, 'project_id'),
        resource_group_identifier=pulumi.get(__ret__, 'resource_group_identifier'),
        role_identifier=pulumi.get(__ret__, 'role_identifier'))
def get_role_assignments_output(identifier: Optional[pulumi.Input[_builtins.str]] = None,
                                org_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                project_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRoleAssignmentsResult]:
    """
    Data source for retrieving role assignment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_harness as harness

    example = harness.platform.get_role_assignments(identifier="identifier",
        org_id="org_id",
        project_id="project_id")
    ```


    :param _builtins.str identifier: Identifier for role assignment.
    :param _builtins.str org_id: Org identifier.
    :param _builtins.str project_id: Project Identifier
    """
    __args__ = dict()
    __args__['identifier'] = identifier
    __args__['orgId'] = org_id
    __args__['projectId'] = project_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('harness:platform/getRoleAssignments:getRoleAssignments', __args__, opts=opts, typ=GetRoleAssignmentsResult)
    return __ret__.apply(lambda __response__: GetRoleAssignmentsResult(
        disabled=pulumi.get(__response__, 'disabled'),
        id=pulumi.get(__response__, 'id'),
        identifier=pulumi.get(__response__, 'identifier'),
        managed=pulumi.get(__response__, 'managed'),
        org_id=pulumi.get(__response__, 'org_id'),
        principals=pulumi.get(__response__, 'principals'),
        project_id=pulumi.get(__response__, 'project_id'),
        resource_group_identifier=pulumi.get(__response__, 'resource_group_identifier'),
        role_identifier=pulumi.get(__response__, 'role_identifier')))
