# 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 .session_config_v1proxy import SessionConfigV1Proxy
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class SessionConfigV1(UniversalBaseModel):
    base_profile_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="baseProfileId")] = (
        pydantic.Field(default=None)
    )
    """
    Deprecated: Use profileName instead.
    """

    persist_profile: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="persistProfile")] = (
        pydantic.Field(default=None)
    )
    """
    Deprecated: use Save Profile On Termination API instead.
    """

    profile_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="profileName")] = (
        pydantic.Field(default=None)
    )
    """
    Name of a profile to load into the session.
    """

    proxy: typing.Optional[SessionConfigV1Proxy] = pydantic.Field(default=None)
    """
    Proxy configuration.
    """

    timeout_minutes: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="timeoutMinutes")] = (
        pydantic.Field(default=None)
    )
    """
    Number of minutes of inactivity (idle timeout) after which the session will terminate. The idle timeout is reset when a user makes an incoming HTTP request, AI request, or new WebSocket connection to the session. Thus, when using drivers like Puppeteer, Selenium or Playwright, the timeout reset depends on the nature of the driver request. If not specified, defaults to 10 minutes.
    """

    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
