# 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
from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from ...types.environment_variable_auth_connection_value_request import EnvironmentVariableAuthConnectionValueRequest
from ...types.environment_variable_secret_value_request import EnvironmentVariableSecretValueRequest


class EnvironmentVariablesCreateRequestBody_String(UncheckedBaseModel):
    type: typing.Literal["string"] = "string"
    label: str
    values: typing.Dict[str, 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 EnvironmentVariablesCreateRequestBody_Secret(UncheckedBaseModel):
    type: typing.Literal["secret"] = "secret"
    label: str
    values: typing.Dict[str, EnvironmentVariableSecretValueRequest]

    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 EnvironmentVariablesCreateRequestBody_AuthConnection(UncheckedBaseModel):
    type: typing.Literal["auth_connection"] = "auth_connection"
    label: str
    values: typing.Dict[str, EnvironmentVariableAuthConnectionValueRequest]

    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


EnvironmentVariablesCreateRequestBody = typing_extensions.Annotated[
    typing.Union[
        EnvironmentVariablesCreateRequestBody_String,
        EnvironmentVariablesCreateRequestBody_Secret,
        EnvironmentVariablesCreateRequestBody_AuthConnection,
    ],
    UnionMetadata(discriminant="type"),
]
