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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .table_view_settings import TableViewSettings
from .view_filter import ViewFilter
from .view_query_input import ViewQueryInput
from .view_visibility import ViewVisibility


class TableViewInput(UncheckedBaseModel):
    id: str
    name: str
    emoji: typing.Optional[str] = None
    table_id: typing.Optional[str] = None
    collection_id: str
    created_at: typing.Optional[dt.datetime] = None
    updated_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[str] = None
    last_updated_by: typing.Optional[str] = None
    visibility: typing.Optional[ViewVisibility] = None
    shared_with: typing.Optional[typing.List[str]] = None
    filters: typing.Optional[typing.List[ViewFilter]] = None
    query: typing.Optional[ViewQueryInput] = None
    type: typing.Literal["table"] = "table"
    settings: TableViewSettings

    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
