# 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_device_object_response_body import Dvir2DeviceObjectResponseBody
from .dvir_2_related_device_object_response_body_asset_type import Dvir2RelatedDeviceObjectResponseBodyAssetType


class Dvir2RelatedDeviceObjectResponseBody(UniversalBaseModel):
    """
    A device (vehicle or trailer) related to the DVIR.
    """

    asset_type: typing_extensions.Annotated[
        Dvir2RelatedDeviceObjectResponseBodyAssetType,
        FieldMetadata(alias="assetType"),
        pydantic.Field(alias="assetType", description="The type of asset.  Valid values: `Vehicle`, `Trailer`"),
    ]
    device: typing.Optional[Dvir2DeviceObjectResponseBody] = None
    device_id: typing_extensions.Annotated[
        int, FieldMetadata(alias="deviceId"), pydantic.Field(alias="deviceId", description="The ID of the device.")
    ]

    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
