# 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 .defect_photo_response_response_body import DefectPhotoResponseResponseBody
from .defect_trailer_response_response_body import DefectTrailerResponseResponseBody
from .defect_vehicle_response_response_body import DefectVehicleResponseResponseBody
from .dvir_resolved_by_object_response_body import DvirResolvedByObjectResponseBody


class DefectsResponseDataResponseBody(UniversalBaseModel):
    """
    DVIR defects data.
    """

    comment: str = pydantic.Field()
    """
    Comment on the defect.
    """

    created_at_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(alias="createdAtTime", description="Time when defect was created in RFC 3339 format."),
    ] = None
    defect_photos: typing_extensions.Annotated[
        typing.Optional[typing.List[DefectPhotoResponseResponseBody]],
        FieldMetadata(alias="defectPhotos"),
        pydantic.Field(alias="defectPhotos", description="List of DVIR defect's photos"),
    ] = None
    defect_type_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="defectTypeId"),
        pydantic.Field(alias="defectTypeId", description="The unique ID of the defect type."),
    ] = None
    dvir_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="dvirId"),
        pydantic.Field(alias="dvirId", description="The unique ID of the defect's DVIR."),
    ]
    id: str = pydantic.Field()
    """
    The unique ID of the DVIR defect.
    """

    is_resolved: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isResolved"),
        pydantic.Field(alias="isResolved", description="Signifies if this defect is resolved."),
    ]
    mechanic_notes: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="mechanicNotes"),
        pydantic.Field(alias="mechanicNotes", description="The mechanics notes on the defect."),
    ] = None
    resolved_at_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="resolvedAtTime"),
        pydantic.Field(
            alias="resolvedAtTime",
            description="Time when this defect was resolved in RFC 3339 format. Will not be returned if the defect is unresolved.",
        ),
    ] = None
    resolved_by: typing_extensions.Annotated[
        typing.Optional[DvirResolvedByObjectResponseBody],
        FieldMetadata(alias="resolvedBy"),
        pydantic.Field(alias="resolvedBy"),
    ] = None
    trailer: typing.Optional[DefectTrailerResponseResponseBody] = None
    updated_at_time: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(alias="updatedAtTime", description="Time when defect was last updated in RFC 3339 format."),
    ] = None
    vehicle: typing.Optional[DefectVehicleResponseResponseBody] = 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
