# 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 .latitude import Latitude
from .longitude import Longitude


class AssetLocation(UniversalBaseModel):
    """
    For locationType "point", latitude and longitude are required. For "address", formattedAddress must be provided, and lat/long can be optionally included for displaying a dot on the assets map. For "dataInput", this object should not be passed in.
    """

    formatted_address: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="formattedAddress"),
        pydantic.Field(alias="formattedAddress", description="Formatted address of the location"),
    ] = None
    latitude: typing.Optional[Latitude] = None
    longitude: typing.Optional[Longitude] = 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
