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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from .line_string_coordinates_item import LineStringCoordinatesItem
from .multi_line_string_coordinates_item_item import MultiLineStringCoordinatesItemItem
from .multi_point_coordinates_item import MultiPointCoordinatesItem
from .multi_polygon_coordinates_item_item_item import MultiPolygonCoordinatesItemItemItem
from .point_coordinates import PointCoordinates
from .polygon_coordinates_item_item import PolygonCoordinatesItemItem
from ..core.pydantic_utilities import update_forward_refs


class GeometryCollectionGeometriesItem_GeometryCollection(UniversalBaseModel):
    type: typing.Literal["GeometryCollection"] = "GeometryCollection"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    geometries: typing.List["GeometryCollectionGeometriesItem"]

    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


from .geometry_collection import GeometryCollection  # noqa: E402


class GeometryCollectionGeometriesItem_LineString(UniversalBaseModel):
    type: typing.Literal["LineString"] = "LineString"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: typing.List[LineStringCoordinatesItem]

    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


class GeometryCollectionGeometriesItem_MultiLineString(UniversalBaseModel):
    type: typing.Literal["MultiLineString"] = "MultiLineString"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: typing.List[typing.List[MultiLineStringCoordinatesItemItem]]

    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


class GeometryCollectionGeometriesItem_MultiPoint(UniversalBaseModel):
    type: typing.Literal["MultiPoint"] = "MultiPoint"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: typing.List[MultiPointCoordinatesItem]

    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


class GeometryCollectionGeometriesItem_MultiPolygon(UniversalBaseModel):
    type: typing.Literal["MultiPolygon"] = "MultiPolygon"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: typing.List[typing.List[typing.List[MultiPolygonCoordinatesItemItemItem]]]

    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


class GeometryCollectionGeometriesItem_Point(UniversalBaseModel):
    type: typing.Literal["Point"] = "Point"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: PointCoordinates

    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


class GeometryCollectionGeometriesItem_Polygon(UniversalBaseModel):
    type: typing.Literal["Polygon"] = "Polygon"
    bbox: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None
    coordinates: typing.List[typing.List[PolygonCoordinatesItemItem]]

    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


GeometryCollectionGeometriesItem = typing.Union[
    GeometryCollectionGeometriesItem_GeometryCollection,
    GeometryCollectionGeometriesItem_LineString,
    GeometryCollectionGeometriesItem_MultiLineString,
    GeometryCollectionGeometriesItem_MultiPoint,
    GeometryCollectionGeometriesItem_MultiPolygon,
    GeometryCollectionGeometriesItem_Point,
    GeometryCollectionGeometriesItem_Polygon,
]
update_forward_refs(GeometryCollectionGeometriesItem_GeometryCollection)
