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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ...entity_types.types.entity_user_id import EntityUserId
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class ApprovalRequest(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.invoice_types import ApprovalRequest

    ApprovalRequest(
        text="This is a reason for my action",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    )
    """

    text: typing.Optional[str] = pydantic.Field(default=None)
    """
    Comment associated with this approval action.
    """

    user_id: EntityUserId = pydantic.Field(alias="userId")
    """
    The ID or the Foreign ID of the user
    """

    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
