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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .role_permissions import RolePermissions


class RoleManifest(UniversalBaseModel):
    type: typing.Literal["role"] = pydantic.Field(default="role")
    """
    +value=role
    """

    name: str = pydantic.Field()
    """
    Unique identifier of the role across the organization
    """

    display_name: typing_extensions.Annotated[str, FieldMetadata(alias="displayName")] = pydantic.Field()
    """
    Human-readable name for the role
    """

    description: str = pydantic.Field()
    """
    Description of the role that explains its purpose and permissions
    """

    resource_type: typing_extensions.Annotated[str, FieldMetadata(alias="resourceType")] = pydantic.Field()
    """
    Type of resource this role applies to
    """

    permissions: typing.List[RolePermissions] = pydantic.Field()
    """
    Define the resource type and the corresponding actions this role can perform on the resource
    """

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

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