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

from __future__ import annotations
from .action_base import ActionBase
from .precondition_group import PreconditionGroup
import typing_extensions
from .entity_id import EntityId
from ...core.serialization import FieldMetadata
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import typing
from ...core.pydantic_utilities import update_forward_refs


class ActionResponse(ActionBase):
    """
    Examples
    --------
    from mavenagi.commons import (
        ActionResponse,
        EntityId,
        Precondition_Group,
        Precondition_User,
    )

    ActionResponse(
        action_id=EntityId(
            reference_id="get-balance",
            app_id="my-billing-system",
            organization_id="acme",
            agent_id="support",
            type="ACTION",
        ),
        name="Get the user's balance",
        description="This action calls an API to get the user's current balance.",
        user_interaction_required=False,
        user_form_parameters=[],
        precondition=Precondition_Group(
            operator="AND",
            preconditions=[
                Precondition_User(
                    key="userKey",
                ),
                Precondition_User(
                    key="userKey2",
                ),
            ],
        ),
    )
    """

    action_id: typing_extensions.Annotated[EntityId, FieldMetadata(alias="actionId")] = pydantic.Field()
    """
    ID that uniquely identifies this action
    """

    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


update_forward_refs(PreconditionGroup, ActionResponse=ActionResponse)
