# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .organization_member_effective_role_source import OrganizationMemberEffectiveRoleSource


class OrganizationMemberEffectiveRole(UniversalBaseModel):
    id: str = pydantic.Field()
    """
    Role ID
    """

    name: str = pydantic.Field()
    """
    Role name
    """

    description: str = pydantic.Field()
    """
    Role description
    """

    sources: typing.List[OrganizationMemberEffectiveRoleSource] = pydantic.Field()
    """
    Sources of the role assignment (direct or through group membership)
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
