# 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
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .block_metadata_page import BlockMetadataPage
from .block_metadata_text_direction import BlockMetadataTextDirection


class BlockMetadata(UncheckedBaseModel):
    """
    Metadata about the block.
    """

    page: typing.Optional[BlockMetadataPage] = pydantic.Field(default=None)
    """
    Information about the page this block appears on.
    """

    text_direction: typing_extensions.Annotated[
        typing.Optional[BlockMetadataTextDirection], FieldMetadata(alias="textDirection")
    ] = pydantic.Field(alias="textDirection", default=None)
    """
    Text direction for this block's content ("ltr" for left-to-right, "rtl" for right-to-left).
    """

    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
