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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ...core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from ...types.date_definition_params_field_configuration import DateDefinitionParamsFieldConfiguration
from ...types.number_definition_params_field_configuration import NumberDefinitionParamsFieldConfiguration
from ...types.rating_definition_params_field_configuration import RatingDefinitionParamsFieldConfiguration
from ...types.select_definition_params_field_configuration import SelectDefinitionParamsFieldConfiguration
from ...types.select_multi_definition_params_field_configuration import SelectMultiDefinitionParamsFieldConfiguration
from ...types.toggle_definition_params_field_configuration import ToggleDefinitionParamsFieldConfiguration
from ...types.user_multi_definition_params_field_configuration import UserMultiDefinitionParamsFieldConfiguration
from ...types.user_single_definition_params_field_configuration import UserSingleDefinitionParamsFieldConfiguration


class CreateFieldDefinitionParamsData_Date(UncheckedBaseModel):
    field_type: typing.Literal["date"] = "date"
    field_configuration: DateDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_LongText(UncheckedBaseModel):
    field_type: typing.Literal["long_text"] = "long_text"
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_Number(UncheckedBaseModel):
    field_type: typing.Literal["number"] = "number"
    field_configuration: NumberDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_Rating(UncheckedBaseModel):
    field_type: typing.Literal["rating"] = "rating"
    field_configuration: RatingDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_Select(UncheckedBaseModel):
    field_type: typing.Literal["select"] = "select"
    field_configuration: SelectDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_SelectMulti(UncheckedBaseModel):
    field_type: typing.Literal["select_multi"] = "select_multi"
    field_configuration: SelectMultiDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_Text(UncheckedBaseModel):
    field_type: typing.Literal["text"] = "text"
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_Toggle(UncheckedBaseModel):
    field_type: typing.Literal["toggle"] = "toggle"
    field_configuration: typing.Optional[ToggleDefinitionParamsFieldConfiguration] = None
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_UserMulti(UncheckedBaseModel):
    field_type: typing.Literal["user_multi"] = "user_multi"
    field_configuration: UserMultiDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


class CreateFieldDefinitionParamsData_UserSingle(UncheckedBaseModel):
    field_type: typing.Literal["user_single"] = "user_single"
    field_configuration: UserSingleDefinitionParamsFieldConfiguration
    name: str

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)


CreateFieldDefinitionParamsData = typing_extensions.Annotated[
    typing.Union[
        CreateFieldDefinitionParamsData_Date,
        CreateFieldDefinitionParamsData_LongText,
        CreateFieldDefinitionParamsData_Number,
        CreateFieldDefinitionParamsData_Rating,
        CreateFieldDefinitionParamsData_Select,
        CreateFieldDefinitionParamsData_SelectMulti,
        CreateFieldDefinitionParamsData_Text,
        CreateFieldDefinitionParamsData_Toggle,
        CreateFieldDefinitionParamsData_UserMulti,
        CreateFieldDefinitionParamsData_UserSingle,
    ],
    UnionMetadata(discriminant="field_type"),
]
