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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .default165enum import Default165Enum
from .options165enum import Options165Enum
from .role9e7enum import Role9E7Enum


class OrganizationPermission(UncheckedBaseModel):
    default: typing.Optional[typing.List[Default165Enum]] = None
    group: typing.Optional[str] = None
    id: typing.Optional[int] = None
    label: typing.Optional[str] = None
    options: typing.Optional[typing.List[Options165Enum]] = None
    organization: typing.Optional[int] = None
    permission: str
    roles: typing.Optional[typing.List[Role9E7Enum]] = pydantic.Field(default=None)
    """
    Explicit roles that have this permission within the organization.
    """

    tooltip: typing.Optional[str] = None

    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
