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

from __future__ import annotations
from ...core.unchecked_base_model import UncheckedBaseModel
import typing
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
import typing_extensions
from ...core.unchecked_base_model import UnionMetadata


class BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchSecretsItem_New(UncheckedBaseModel):
    type: typing.Literal["new"] = "new"
    name: str
    value: str

    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


class BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchSecretsItem_Stored(UncheckedBaseModel):
    type: typing.Literal["stored"] = "stored"
    secret_id: str
    name: str

    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


BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchSecretsItem = typing_extensions.Annotated[
    typing.Union[
        BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchSecretsItem_New,
        BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchSecretsItem_Stored,
    ],
    UnionMetadata(discriminant="type"),
]
