# 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 .notion_database import NotionDatabase
from .notion_page import NotionPage


class NotionDataInput(UniversalBaseModel):
    """
    Complete Notion sandbox data structure.

    Hierarchical structure for initialization:
    - Databases contain Data Sources
    - Data Sources contain Pages (with properties matching the schema)
    - Standalone Pages exist at top level (not in databases)
    - Pages contain Blocks (content) and Comments

    Relational structure:
    - Pages refer to Data Sources (via parent_source)
    - Data Sources are nested in Databases
    """

    databases: typing.Optional[typing.List[NotionDatabase]] = pydantic.Field(default=None)
    """
    List of databases with their data sources and pages
    """

    pages: typing.Optional[typing.List[NotionPage]] = pydantic.Field(default=None)
    """
    List of standalone pages (not in databases)
    """

    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
