# 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 .generate_template_previews_request_format_opts_format import GenerateTemplatePreviewsRequestFormatOptsFormat


class GenerateTemplatePreviewsRequestFormatOpts(UniversalBaseModel):
    """
    Format options for the rendered document
    """

    from_page: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="fromPage")] = None
    to_page: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="toPage")] = None
    format: typing.Optional[GenerateTemplatePreviewsRequestFormatOptsFormat] = None
    wait_for_selector: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="waitForSelector")] = (
        pydantic.Field(default=None)
    )
    """
    Selector to wait for to know when the page is loaded and can be saved as pdf, png, etc.
    """

    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
