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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
from .page_query_experimental_config import PageQueryExperimentalConfig
import pydantic
import typing_extensions
from ..core.serialization import FieldMetadata
from .scrape_config import ScrapeConfig
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class PageQueryConfig(UniversalBaseModel):
    experimental: typing.Optional[PageQueryExperimentalConfig] = pydantic.Field(default=None)
    """
    Experimental configuration options. These may be subject to change and are not guaranteed to be stable across versions.
    """

    output_schema: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="outputSchema")] = (
        pydantic.Field(default=None)
    )
    """
    JSON schema defining the structure of the output. If not provided, the format of the output might vary.
    """

    scrape: typing.Optional[ScrapeConfig] = pydantic.Field(default=None)
    """
    Optional configuration to customize and tweak how the web page is scraped.
    """

    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
