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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .forms_action_object_response_body_type import FormsActionObjectResponseBodyType


class FormsActionObjectResponseBody(UniversalBaseModel):
    """
    Action object.
    """

    field_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="fieldId"),
        pydantic.Field(
            alias="fieldId",
            description="Identifier of the followup question that will be shown if the condition is met. Only returned when the action type is `askFollowupQuestion`.",
        ),
    ] = None
    section_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="sectionId"),
        pydantic.Field(
            alias="sectionId",
            description="Identifier of the conditional section that will be shown if the condition is met. Only returned when the action type is `showSection`.",
        ),
    ] = None
    type: FormsActionObjectResponseBodyType = pydantic.Field()
    """
    Type of action to take if corresponding condition is met.  Valid values: `askFollowupQuestion`, `showSection`, `requirePhoto`, `requireNote`, `createIssue`
    """

    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
