# 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 .dvir_signature_signatory_user import DvirSignatureSignatoryUser
from .dvir_signature_type import DvirSignatureType


class DvirSignature(UniversalBaseModel):
    """
    DVIR Signure.
    """

    signatory_user: typing_extensions.Annotated[
        typing.Optional[DvirSignatureSignatoryUser],
        FieldMetadata(alias="signatoryUser"),
        pydantic.Field(alias="signatoryUser"),
    ] = None
    signed_at_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="signedAtTime"),
        pydantic.Field(
            alias="signedAtTime",
            description="The time when the DVIR was signed. UTC timestamp in RFC 3339 format. Example: `2020-01-27T07:06:25Z`.",
        ),
    ] = None
    type: typing.Optional[DvirSignatureType] = pydantic.Field(default=None)
    """
    Whether the DVIR was submitted by a `driver` or `mechanic`. Valid values: `driver`, `mechanic`.
    """

    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
