# 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 .author_signature_object_response_body import AuthorSignatureObjectResponseBody
from .dvir_get_dvir_response_body_safety_status import DvirGetDvirResponseBodySafetyStatus
from .dvir_get_dvir_response_body_type import DvirGetDvirResponseBodyType
from .trailer_dvir_object_response_body import TrailerDvirObjectResponseBody
from .vehicle_dvir_object_response_body import VehicleDvirObjectResponseBody
from .walkaround_photo_object_response_body import WalkaroundPhotoObjectResponseBody


class DvirGetDvirResponseBody(UniversalBaseModel):
    author_signature: typing_extensions.Annotated[
        AuthorSignatureObjectResponseBody,
        FieldMetadata(alias="authorSignature"),
        pydantic.Field(alias="authorSignature"),
    ]
    defect_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="defectIds"),
        pydantic.Field(alias="defectIds", description="IDs of defects registered for the DVIR."),
    ] = None
    dvir_submission_begin_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="dvirSubmissionBeginTime"),
        pydantic.Field(
            alias="dvirSubmissionBeginTime",
            description="Time when driver created DVIR. UTC timestamp in RFC 3339 format.",
        ),
    ]
    dvir_submission_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="dvirSubmissionTime"),
        pydantic.Field(
            alias="dvirSubmissionTime",
            description="Time when driver submitted the DVIR. UTC timestamp in RFC 3339 format.",
        ),
    ]
    formatted_address: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="formattedAddress"), pydantic.Field(alias="formattedAddress")
    ] = None
    id: str = pydantic.Field()
    """
    The unique id of the DVIR
    """

    mechanic_notes: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="mechanicNotes"),
        pydantic.Field(alias="mechanicNotes", description="The mechanics notes on the DVIR."),
    ] = None
    odometer_meters: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="odometerMeters"),
        pydantic.Field(alias="odometerMeters", description="The odometer reading in meters."),
    ] = None
    safety_status: typing_extensions.Annotated[
        typing.Optional[DvirGetDvirResponseBodySafetyStatus],
        FieldMetadata(alias="safetyStatus"),
        pydantic.Field(
            alias="safetyStatus",
            description="The condition of vehicle on which DVIR was done.  Valid values: `unknown`, `safe`, `unsafe`, `resolved`",
        ),
    ] = None
    second_signature: typing_extensions.Annotated[
        typing.Optional[AuthorSignatureObjectResponseBody],
        FieldMetadata(alias="secondSignature"),
        pydantic.Field(alias="secondSignature"),
    ] = None
    third_signature: typing_extensions.Annotated[
        typing.Optional[AuthorSignatureObjectResponseBody],
        FieldMetadata(alias="thirdSignature"),
        pydantic.Field(alias="thirdSignature"),
    ] = None
    trailer: typing.Optional[TrailerDvirObjectResponseBody] = None
    type: DvirGetDvirResponseBodyType = pydantic.Field()
    """
    Inspection type of the DVIR.  Valid values: `preTrip`, `postTrip`, `mechanic`, `unspecified`
    """

    updated_at_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(
            alias="updatedAtTime", description="Time of any DVIR updates. UTC timestamp in RFC 3339 format."
        ),
    ]
    vehicle: typing.Optional[VehicleDvirObjectResponseBody] = None
    walkaround_photos: typing_extensions.Annotated[
        typing.Optional[typing.List[WalkaroundPhotoObjectResponseBody]],
        FieldMetadata(alias="walkaroundPhotos"),
        pydantic.Field(alias="walkaroundPhotos", description="List of walkaround photos"),
    ] = 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
