# 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


class Position(UniversalBaseModel):
    """
    WGS84 position. Position includes four altitude references.
     The data model does not currently support Mean Sea Level (MSL) references,
     such as the Earth Gravitational Model 1996 (EGM-96) and the Earth Gravitational Model 2008 (EGM-08).
     If the only altitude reference available to your integration is MSL, convert it to
     Height Above Ellipsoid (HAE) and populate the altitude_hae_meters field.
    """

    latitude_degrees: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="latitudeDegrees")] = (
        pydantic.Field(default=None)
    )
    """
    WGS84 geodetic latitude in decimal degrees.
    """

    longitude_degrees: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="longitudeDegrees")] = (
        pydantic.Field(default=None)
    )
    """
    WGS84 longitude in decimal degrees.
    """

    altitude_hae_meters: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="altitudeHaeMeters")
    ] = pydantic.Field(default=None)
    """
    altitude as height above ellipsoid (WGS84) in meters. DoubleValue wrapper is used to distinguish optional from
     default 0.
    """

    altitude_agl_meters: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="altitudeAglMeters")
    ] = pydantic.Field(default=None)
    """
    Altitude as AGL (Above Ground Level) if the upstream data source has this value set. This value represents the
     entity's height above the terrain. This is typically measured with a radar altimeter or by using a terrain tile
     set lookup. If the value is not set from the upstream, this value is not set.
    """

    altitude_asf_meters: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="altitudeAsfMeters")
    ] = pydantic.Field(default=None)
    """
    Altitude as ASF (Above Sea Floor) if the upstream data source has this value set. If the value is not set from the upstream, this value is
     not set.
    """

    pressure_depth_meters: typing_extensions.Annotated[
        typing.Optional[float], FieldMetadata(alias="pressureDepthMeters")
    ] = pydantic.Field(default=None)
    """
    The depth of the entity from the surface of the water through sensor measurements based on differential pressure
     between the interior and exterior of the vessel. If the value is not set from the upstream, this value is not set.
    """

    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
