# 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 .multi_user_value_member_options_type import MultiUserValueMemberOptionsType
from .select_option import SelectOption
from .single_user_value_member_options_type import SingleUserValueMemberOptionsType
from .user_value import UserValue


class MetadataField_Date(UncheckedBaseModel):
    field_type: typing.Literal["date"] = "date"
    value: typing.Optional[str] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_LongText(UncheckedBaseModel):
    field_type: typing.Literal["long_text"] = "long_text"
    value: typing.Optional[str] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Number(UncheckedBaseModel):
    field_type: typing.Literal["number"] = "number"
    value: typing.Optional[float] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Rating(UncheckedBaseModel):
    field_type: typing.Literal["rating"] = "rating"
    value: typing.Optional[int] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Select(UncheckedBaseModel):
    field_type: typing.Literal["select"] = "select"
    field_options: typing.Optional[typing.List[SelectOption]] = None
    value: typing.Optional[typing.List[SelectOption]] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_SelectMulti(UncheckedBaseModel):
    field_type: typing.Literal["select_multi"] = "select_multi"
    field_options: typing.Optional[typing.List[SelectOption]] = None
    value: typing.Optional[typing.List[SelectOption]] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Text(UncheckedBaseModel):
    field_type: typing.Literal["text"] = "text"
    value: typing.Optional[str] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Toggle(UncheckedBaseModel):
    field_type: typing.Literal["toggle"] = "toggle"
    value: typing.Optional[bool] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_UserMulti(UncheckedBaseModel):
    field_type: typing.Literal["user_multi"] = "user_multi"
    custom_members: typing.Optional[typing.List[UserValue]] = None
    member_options_type: typing.Optional[MultiUserValueMemberOptionsType] = None
    value: typing.Optional[typing.List[UserValue]] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_UserSingle(UncheckedBaseModel):
    field_type: typing.Literal["user_single"] = "user_single"
    custom_members: typing.Optional[typing.List[UserValue]] = None
    member_options_type: typing.Optional[SingleUserValueMemberOptionsType] = None
    value: typing.Optional[typing.List[UserValue]] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


class MetadataField_Users(UncheckedBaseModel):
    field_type: typing.Literal["users"] = "users"
    custom_members: typing.Optional[typing.List[UserValue]] = None
    member_options_type: typing.Optional[MultiUserValueMemberOptionsType] = None
    value: typing.Optional[typing.List[UserValue]] = None
    field_definition_id: str
    field_definition_name: str
    mutable: bool

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


MetadataField = typing_extensions.Annotated[
    typing.Union[
        MetadataField_Date,
        MetadataField_LongText,
        MetadataField_Number,
        MetadataField_Rating,
        MetadataField_Select,
        MetadataField_SelectMulti,
        MetadataField_Text,
        MetadataField_Toggle,
        MetadataField_UserMulti,
        MetadataField_UserSingle,
        MetadataField_Users,
    ],
    UnionMetadata(discriminant="field_type"),
]
