# 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 .vertex_response_body import VertexResponseBody


class PolygonResponseBody(UniversalBaseModel):
    """
    Information about a polygon geofence. This field is only needed if the geofence is a polygon.
    """

    name: str = pydantic.Field()
    """
    The name of the polygon.
    """

    vertices: typing.Optional[typing.List[VertexResponseBody]] = pydantic.Field(default=None)
    """
    The vertices of the polygon geofence. These geofence vertices describe the perimeter of the polygon, and must consist of at least 3 vertices and less than 40.
    """

    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
