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

from ..core.pydantic_utilities import UniversalBaseModel
import typing_extensions
import typing
from ..core.serialization import FieldMetadata
import pydantic
from .browser_wait_navigation_config_wait_until import BrowserWaitNavigationConfigWaitUntil
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class BrowserWaitNavigationConfig(UniversalBaseModel):
    timeout_seconds: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="timeoutSeconds")] = (
        pydantic.Field(default=None)
    )
    """
    The maximum time to wait for the navigation to complete, in seconds. Defaults to 30 (30 seconds).
    """

    wait_until: typing_extensions.Annotated[
        typing.Optional[BrowserWaitNavigationConfigWaitUntil], FieldMetadata(alias="waitUntil")
    ] = pydantic.Field(default=None)
    """
    The condition to wait for the navigation to complete. Defaults to 'load'.
    """

    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
