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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .proxy_location import ProxyLocation
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class WorkflowRunRequest(UniversalBaseModel):
    workflow_id: str = pydantic.Field()
    """
    ID of the workflow to run
    """

    title: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional title for this workflow run
    """

    parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Parameters to pass to the workflow
    """

    proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
    """
    Location of proxy to use for this workflow run
    """

    webhook_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL to send workflow status updates to after a run is finished
    """

    totp_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL for TOTP authentication setup if Skyvern should be polling endpoint for 2FA codes
    """

    totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
    """
    Identifier for TOTP (Time-based One-Time Password) authentication if codes are being pushed to Skyvern
    """

    browser_session_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of an existing browser session to reuse, having it continue from the current screen state
    """

    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
