# 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 .address_tiny_response import AddressTinyResponse
from .asset_location_heading import AssetLocationHeading
from .asset_location_speed import AssetLocationSpeed
from .reverse_geo import ReverseGeo
from .time import Time


class EquipmentStatsGps(UniversalBaseModel):
    """
    GPS location of equipment.
    """

    address: typing.Optional[AddressTinyResponse] = None
    heading_degrees: typing_extensions.Annotated[
        typing.Optional[AssetLocationHeading],
        FieldMetadata(alias="headingDegrees"),
        pydantic.Field(alias="headingDegrees"),
    ] = None
    latitude: float = pydantic.Field()
    """
    GPS latitude represented in degrees
    """

    longitude: float = pydantic.Field()
    """
    GPS longitude represented in degrees
    """

    reverse_geo: typing_extensions.Annotated[
        typing.Optional[ReverseGeo], FieldMetadata(alias="reverseGeo"), pydantic.Field(alias="reverseGeo")
    ] = None
    speed_miles_per_hour: typing_extensions.Annotated[
        typing.Optional[AssetLocationSpeed],
        FieldMetadata(alias="speedMilesPerHour"),
        pydantic.Field(alias="speedMilesPerHour"),
    ] = 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
