# 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 .error_ellipse import ErrorEllipse
from .t_mat_3 import TMat3


class LocationUncertainty(UniversalBaseModel):
    """
    Uncertainty of entity position and velocity, if available.
    """

    position_enu_cov: typing_extensions.Annotated[typing.Optional[TMat3], FieldMetadata(alias="positionEnuCov")] = (
        pydantic.Field(default=None)
    )
    """
    Positional covariance represented by the upper triangle of the covariance matrix. It is valid to populate
     only the diagonal of the matrix if the full covariance matrix is unknown.
    """

    velocity_enu_cov: typing_extensions.Annotated[typing.Optional[TMat3], FieldMetadata(alias="velocityEnuCov")] = (
        pydantic.Field(default=None)
    )
    """
    Velocity covariance represented by the upper triangle of the covariance matrix. It is valid to populate
     only the diagonal of the matrix if the full covariance matrix is unknown.
    """

    position_error_ellipse: typing_extensions.Annotated[
        typing.Optional[ErrorEllipse], FieldMetadata(alias="positionErrorEllipse")
    ] = pydantic.Field(default=None)
    """
    An ellipse that describes the certainty probability and error boundary for a given geolocation.
    """

    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
