# 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 .space_response import SpaceResponse


class SpaceListResponse(UniversalBaseModel):
    """
    Response schema for paginated space list.

    Field is named 'spaces' (not 'data') for clarity since this is the
    top-level spaces list endpoint. Sub-resource lists use domain-specific
    names (e.g., 'vector_stores') or generic 'data' for consistency with
    the broader API.
    """

    object: typing.Optional[str] = pydantic.Field(default=None)
    """
    Object type
    """

    spaces: typing.List[SpaceResponse] = pydantic.Field()
    """
    List of spaces
    """

    has_more: bool = pydantic.Field()
    """
    Whether more results are available
    """

    next_cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cursor for next page
    """

    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
