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

import typing

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


class GrantPathEntryResponse(UniversalBaseModel):
    """
    Describes how access was derived.
    """

    type: str = pydantic.Field()
    """
    Type of grant path entry (e.g. 'direct', 'inherited')
    """

    access_level: typing.Optional[str] = pydantic.Field(default=None)
    """
    Access level at this path entry: 'read', 'write', or 'admin'
    """

    department_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Department ID if access was granted via department membership
    """

    role_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Role ID if access was granted via role assignment
    """

    composite_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Composite slice ID if access was inherited from a composite
    """

    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
