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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .action_status import ActionStatus
from .action_type import ActionType
from .click_context import ClickContext
from .input_or_select_context import InputOrSelectContext
from .select_option import SelectOption
from .user_defined_error import UserDefinedError


class Action(UniversalBaseModel):
    action_type: ActionType
    status: typing.Optional[ActionStatus] = None
    action_id: typing.Optional[str] = None
    source_action_id: typing.Optional[str] = None
    organization_id: typing.Optional[str] = None
    workflow_run_id: typing.Optional[str] = None
    task_id: typing.Optional[str] = None
    step_id: typing.Optional[str] = None
    step_order: typing.Optional[int] = None
    action_order: typing.Optional[int] = None
    confidence_float: typing.Optional[float] = None
    description: typing.Optional[str] = None
    reasoning: typing.Optional[str] = None
    intention: typing.Optional[str] = None
    response: typing.Optional[str] = None
    element_id: typing.Optional[str] = None
    skyvern_element_hash: typing.Optional[str] = None
    skyvern_element_data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    screenshot_artifact_id: typing.Optional[str] = None
    tool_call_id: typing.Optional[str] = None
    xpath: typing.Optional[str] = None
    errors: typing.Optional[typing.List[UserDefinedError]] = None
    data_extraction_goal: typing.Optional[str] = None
    file_name: typing.Optional[str] = None
    file_url: typing.Optional[str] = None
    download: typing.Optional[bool] = None
    download_triggered: typing.Optional[bool] = None
    downloaded_files: typing.Optional[typing.List[str]] = None
    is_upload_file_tag: typing.Optional[bool] = None
    text: typing.Optional[str] = None
    input_or_select_context: typing.Optional[InputOrSelectContext] = None
    option: typing.Optional[SelectOption] = None
    is_checked: typing.Optional[bool] = None
    verified: typing.Optional[bool] = None
    click_context: typing.Optional[ClickContext] = None
    totp_timing_info: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    has_mini_agent: typing.Optional[bool] = None
    skip_auto_complete_tab: typing.Optional[bool] = None
    created_at: typing.Optional[dt.datetime] = None
    modified_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[str] = None

    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
