# 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 .equipment_engine_rpm import EquipmentEngineRpm
from .equipment_engine_seconds import EquipmentEngineSeconds
from .equipment_engine_state import EquipmentEngineState
from .equipment_engine_total_idle_time_minutes import EquipmentEngineTotalIdleTimeMinutes
from .equipment_fuel_percent import EquipmentFuelPercent
from .equipment_gateway_engine_seconds import EquipmentGatewayEngineSeconds
from .equipment_gateway_engine_state import EquipmentGatewayEngineState
from .equipment_gps_odometer_meters import EquipmentGpsOdometerMeters
from .equipment_id import EquipmentId
from .equipment_name import EquipmentName
from .equipment_obd_engine_seconds import EquipmentObdEngineSeconds
from .equipment_obd_engine_state import EquipmentObdEngineState
from .equipment_stats_gps import EquipmentStatsGps


class EquipmentStatsResponseData(UniversalBaseModel):
    """
    A unit of equipment and its most recent stat.
    """

    engine_rpm: typing_extensions.Annotated[
        typing.Optional[EquipmentEngineRpm], FieldMetadata(alias="engineRpm"), pydantic.Field(alias="engineRpm")
    ] = None
    engine_seconds: typing_extensions.Annotated[
        typing.Optional[EquipmentEngineSeconds],
        FieldMetadata(alias="engineSeconds"),
        pydantic.Field(alias="engineSeconds"),
    ] = None
    engine_state: typing_extensions.Annotated[
        typing.Optional[EquipmentEngineState], FieldMetadata(alias="engineState"), pydantic.Field(alias="engineState")
    ] = None
    engine_total_idle_time_minutes: typing_extensions.Annotated[
        typing.Optional[EquipmentEngineTotalIdleTimeMinutes],
        FieldMetadata(alias="engineTotalIdleTimeMinutes"),
        pydantic.Field(alias="engineTotalIdleTimeMinutes"),
    ] = None
    fuel_percent: typing_extensions.Annotated[
        typing.Optional[EquipmentFuelPercent], FieldMetadata(alias="fuelPercent"), pydantic.Field(alias="fuelPercent")
    ] = None
    gateway_engine_seconds: typing_extensions.Annotated[
        typing.Optional[EquipmentGatewayEngineSeconds],
        FieldMetadata(alias="gatewayEngineSeconds"),
        pydantic.Field(alias="gatewayEngineSeconds"),
    ] = None
    gateway_engine_state: typing_extensions.Annotated[
        typing.Optional[EquipmentGatewayEngineState],
        FieldMetadata(alias="gatewayEngineState"),
        pydantic.Field(alias="gatewayEngineState"),
    ] = None
    gps: typing.Optional[EquipmentStatsGps] = None
    gps_odometer_meters: typing_extensions.Annotated[
        typing.Optional[EquipmentGpsOdometerMeters],
        FieldMetadata(alias="gpsOdometerMeters"),
        pydantic.Field(alias="gpsOdometerMeters"),
    ] = None
    id: EquipmentId
    name: EquipmentName
    obd_engine_seconds: typing_extensions.Annotated[
        typing.Optional[EquipmentObdEngineSeconds],
        FieldMetadata(alias="obdEngineSeconds"),
        pydantic.Field(alias="obdEngineSeconds"),
    ] = None
    obd_engine_state: typing_extensions.Annotated[
        typing.Optional[EquipmentObdEngineState],
        FieldMetadata(alias="obdEngineState"),
        pydantic.Field(alias="obdEngineState"),
    ] = 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
