# 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 .authorized_operation_type import AuthorizedOperationType
from .principal_request import PrincipalRequest
from .terminal_use_resource import TerminalUseResource


class AuthzRequest(UniversalBaseModel):
    """
    Base authorization request schema.
    """

    operation: AuthorizedOperationType
    principal: PrincipalRequest
    resource: TerminalUseResource

    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
