# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .alert_object_driver_response_body import AlertObjectDriverResponseBody
from .alert_object_vehicle_response_body import AlertObjectVehicleResponseBody
from .event_location_response_body import EventLocationResponseBody


class SuddenFuelLevelDropResponseBody(UniversalBaseModel):
    """
    Details specific to Sudden Fuel Level Drop.
    """

    change_end_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="changeEndTime"),
        pydantic.Field(alias="changeEndTime", description="The end time of the fuel level change in RFC 3339 format."),
    ] = None
    change_start_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="changeStartTime"),
        pydantic.Field(
            alias="changeStartTime", description="The start time of the fuel level change in RFC 3339 format."
        ),
    ] = None
    driver: typing.Optional[AlertObjectDriverResponseBody] = None
    fuel_level_after_millipercent: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="fuelLevelAfterMillipercent"),
        pydantic.Field(
            alias="fuelLevelAfterMillipercent",
            description="The fuel level after the sudden fuel level drop in millipercents.",
        ),
    ] = None
    fuel_level_before_millipercent: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="fuelLevelBeforeMillipercent"),
        pydantic.Field(
            alias="fuelLevelBeforeMillipercent",
            description="The fuel level before the sudden fuel level drop in millipercents.",
        ),
    ] = None
    location: typing.Optional[EventLocationResponseBody] = None
    vehicle: typing.Optional[AlertObjectVehicleResponseBody] = 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
