# 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 .geo_line_string import GeoLineString


class GeoPolygon(UniversalBaseModel):
    """
    Geo filter request  Matches coordinates inside the polygon, defined by `exterior` and `interiors`
    """

    exterior: GeoLineString = pydantic.Field()
    """
    Geo filter request  Matches coordinates inside the polygon, defined by `exterior` and `interiors`
    """

    interiors: typing.Optional[typing.List[GeoLineString]] = pydantic.Field(default=None)
    """
    Interior lines (if present) bound holes within the surface each GeoLineString must consist of a minimum of 4 points, and the first and last points must be the same.
    """

    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
