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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .action_data import ActionData


class ActionResponse(UniversalBaseModel):
    """
    Response model for browser actions.

    Inherits from Response for unified API format, with backward compatibility:
    - Old format: resp.json()['status'], resp.json()['action_performed']
    - New format: resp.json()['success'], resp.json()['message'], resp.json()['data']
    """

    success: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the operation was successful
    """

    message: typing.Optional[str] = None
    data: typing.Optional[ActionData] = pydantic.Field(default=None)
    """
    Data returned from the operation
    """

    status: typing.Optional[typing.Literal["success"]] = None
    action_performed: 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
