# 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 .circle_request_body import CircleRequestBody
from .location_object_request_body_address_types_item import LocationObjectRequestBodyAddressTypesItem
from .polygon_request_body import PolygonRequestBody


class LocationObjectRequestBody(UniversalBaseModel):
    """
    A location. Polygon and Circle is deprecated, but may be set for old Alerts. At least one location must be selected.
    """

    address_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="addressIds"),
        pydantic.Field(alias="addressIds", description="All locations with selected address IDs will trigger."),
    ] = None
    address_types: typing_extensions.Annotated[
        typing.Optional[typing.List[LocationObjectRequestBodyAddressTypesItem]],
        FieldMetadata(alias="addressTypes"),
        pydantic.Field(alias="addressTypes", description="All locations with the selected address types will trigger."),
    ] = None
    circle: typing.Optional[CircleRequestBody] = None
    polygon: typing.Optional[PolygonRequestBody] = None
    tag_ids: typing_extensions.Annotated[
        typing.Optional[typing.List[str]],
        FieldMetadata(alias="tagIds"),
        pydantic.Field(alias="tagIds", description="All locations with selected tag will trigger."),
    ] = 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
