# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .address_geofence_circle import AddressGeofenceCircle
from .address_geofence_polygon import AddressGeofencePolygon
from .address_geofence_settings import AddressGeofenceSettings


class AddressGeofence(UniversalBaseModel):
    """
    The geofence that defines this address and its bounds. This can either be a circle or a polygon, but not both.
    """

    circle: typing.Optional[AddressGeofenceCircle] = None
    polygon: typing.Optional[AddressGeofencePolygon] = None
    settings: typing.Optional[AddressGeofenceSettings] = 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
