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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .google_sheets_cell import GoogleSheetsCell


class GoogleSheetsSheet(UniversalBaseModel):
    """
    A sheet within a spreadsheet
    """

    title: str = pydantic.Field()
    """
    Sheet title
    """

    index: typing.Optional[int] = pydantic.Field(default=None)
    """
    Sheet index position
    """

    row_count: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="rowCount")] = pydantic.Field(
        default=None
    )
    """
    Number of rows in the sheet
    """

    column_count: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="columnCount")] = (
        pydantic.Field(default=None)
    )
    """
    Number of columns in the sheet
    """

    cells: typing.Optional[typing.List[GoogleSheetsCell]] = pydantic.Field(default=None)
    """
    List of cells with data
    """

    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
