# 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 .reverse_geo import ReverseGeo
from .time import Time
from .vehicle_location_heading import VehicleLocationHeading
from .vehicle_location_latitude import VehicleLocationLatitude
from .vehicle_location_longitude import VehicleLocationLongitude
from .vehicle_location_speed import VehicleLocationSpeed


class VehicleLocation(UniversalBaseModel):
    """
    Vehicle location event.
    """

    heading: typing.Optional[VehicleLocationHeading] = None
    latitude: VehicleLocationLatitude
    longitude: VehicleLocationLongitude
    reverse_geo: typing_extensions.Annotated[
        typing.Optional[ReverseGeo], FieldMetadata(alias="reverseGeo"), pydantic.Field(alias="reverseGeo")
    ] = None
    speed: typing.Optional[VehicleLocationSpeed] = None
    time: Time

    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
