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

from __future__ import annotations

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from .date_definition_field_configuration import DateDefinitionFieldConfiguration
from .long_text_definition_field_configuration import LongTextDefinitionFieldConfiguration
from .number_definition_field_configuration import NumberDefinitionFieldConfiguration
from .rating_definition_field_configuration import RatingDefinitionFieldConfiguration
from .select_definition_field_configuration import SelectDefinitionFieldConfiguration
from .select_multi_definition_field_configuration import SelectMultiDefinitionFieldConfiguration
from .text_definition_field_configuration import TextDefinitionFieldConfiguration
from .toggle_definition_field_configuration import ToggleDefinitionFieldConfiguration
from .user_multi_definition_field_configuration import UserMultiDefinitionFieldConfiguration
from .user_single_definition_field_configuration import UserSingleDefinitionFieldConfiguration


class FieldDefinition_Date(UncheckedBaseModel):
    field_type: typing.Literal["date"] = "date"
    created_at: dt.datetime
    creator_id: str
    field_configuration: DateDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_LongText(UncheckedBaseModel):
    field_type: typing.Literal["long_text"] = "long_text"
    created_at: dt.datetime
    creator_id: str
    field_configuration: LongTextDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_Number(UncheckedBaseModel):
    field_type: typing.Literal["number"] = "number"
    created_at: dt.datetime
    creator_id: str
    field_configuration: NumberDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_Rating(UncheckedBaseModel):
    field_type: typing.Literal["rating"] = "rating"
    created_at: dt.datetime
    creator_id: str
    field_configuration: RatingDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_Select(UncheckedBaseModel):
    field_type: typing.Literal["select"] = "select"
    created_at: dt.datetime
    creator_id: str
    field_configuration: SelectDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_SelectMulti(UncheckedBaseModel):
    field_type: typing.Literal["select_multi"] = "select_multi"
    created_at: dt.datetime
    creator_id: str
    field_configuration: SelectMultiDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_Text(UncheckedBaseModel):
    field_type: typing.Literal["text"] = "text"
    created_at: dt.datetime
    creator_id: str
    field_configuration: TextDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_Toggle(UncheckedBaseModel):
    field_type: typing.Literal["toggle"] = "toggle"
    created_at: dt.datetime
    creator_id: str
    field_configuration: ToggleDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_UserMulti(UncheckedBaseModel):
    field_type: typing.Literal["user_multi"] = "user_multi"
    created_at: dt.datetime
    creator_id: str
    field_configuration: UserMultiDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


class FieldDefinition_UserSingle(UncheckedBaseModel):
    field_type: typing.Literal["user_single"] = "user_single"
    created_at: dt.datetime
    creator_id: str
    field_configuration: UserSingleDefinitionFieldConfiguration
    id: str
    mutable: bool
    name: str
    updated_at: dt.datetime

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


FieldDefinition = typing_extensions.Annotated[
    typing.Union[
        FieldDefinition_Date,
        FieldDefinition_LongText,
        FieldDefinition_Number,
        FieldDefinition_Rating,
        FieldDefinition_Select,
        FieldDefinition_SelectMulti,
        FieldDefinition_Text,
        FieldDefinition_Toggle,
        FieldDefinition_UserMulti,
        FieldDefinition_UserSingle,
    ],
    UnionMetadata(discriminant="field_type"),
]
