# 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_2_form_submission_object_response_body import Dvir2FormSubmissionObjectResponseBody
from .dvir_2_related_device_object_response_body import Dvir2RelatedDeviceObjectResponseBody
from .dvir_2_submission_response_object_response_body_inspection_type import (
    Dvir2SubmissionResponseObjectResponseBodyInspectionType,
)


class Dvir2SubmissionResponseObjectResponseBody(UniversalBaseModel):
    """
    A DVIR description.
    """

    base_form_submission: typing_extensions.Annotated[
        typing.Optional[Dvir2FormSubmissionObjectResponseBody],
        FieldMetadata(alias="baseFormSubmission"),
        pydantic.Field(alias="baseFormSubmission"),
    ] = None
    inspection_type: typing_extensions.Annotated[
        Dvir2SubmissionResponseObjectResponseBodyInspectionType,
        FieldMetadata(alias="inspectionType"),
        pydantic.Field(
            alias="inspectionType",
            description="Inspection type of the DVIR.  Valid values: `preTrip`, `postTrip`, `mechanic`, `unset`",
        ),
    ]
    related_devices: typing_extensions.Annotated[
        typing.List[Dvir2RelatedDeviceObjectResponseBody],
        FieldMetadata(alias="relatedDevices"),
        pydantic.Field(
            alias="relatedDevices", description="List of devices (vehicles/trailers) associated with the DVIR."
        ),
    ]
    uuid_: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="uuid"),
        pydantic.Field(alias="uuid", description="The unique UUID of the DVIR2 submission"),
    ]

    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
