# 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 .goa_vehicle_tiny_response_response_body import GoaVehicleTinyResponseResponseBody
from .idling_report_event_address_response_body import IdlingReportEventAddressResponseBody


class IdlingReportEventResponseBody(UniversalBaseModel):
    """
    A summary of the idling event.
    """

    address: IdlingReportEventAddressResponseBody
    duration_ms: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="durationMs"),
        pydantic.Field(alias="durationMs", description="The duration of this idling event in milliseconds."),
    ]
    end_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="endTime"),
        pydantic.Field(alias="endTime", description="The end time of this idling event in RFC 3339 format."),
    ]
    fuel_consumption_ml: typing_extensions.Annotated[
        float,
        FieldMetadata(alias="fuelConsumptionMl"),
        pydantic.Field(
            alias="fuelConsumptionMl",
            description="The amount of fuel consumed in milliliters during this idling event.",
        ),
    ]
    is_pto_active: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isPtoActive"),
        pydantic.Field(
            alias="isPtoActive", description="Whether or not power take-off was active during this idling event."
        ),
    ]
    start_time: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="startTime"),
        pydantic.Field(alias="startTime", description="The start time of this idling event in RFC 3339 format."),
    ]
    vehicle: GoaVehicleTinyResponseResponseBody

    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
