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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .attachment_status import AttachmentStatus


class ActionExecutionParamValue_Primitive(UniversalBaseModel):
    value: typing.Optional[typing.Any] = None
    value_type: typing_extensions.Annotated[typing.Literal["primitive"], FieldMetadata(alias="valueType")] = "primitive"

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True


class ActionExecutionParamValue_Attachment(UniversalBaseModel):
    value_type: typing_extensions.Annotated[typing.Literal["attachment"], FieldMetadata(alias="valueType")] = (
        "attachment"
    )
    url: typing.Optional[str] = None
    size_bytes: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="sizeBytes")] = None
    status: AttachmentStatus
    type: str
    name: 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


ActionExecutionParamValue = typing.Union[ActionExecutionParamValue_Primitive, ActionExecutionParamValue_Attachment]
