"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .customfieldcreatecheckbox import (
    CustomFieldCreateCheckbox,
    CustomFieldCreateCheckboxTypedDict,
)
from .customfieldcreatedate import CustomFieldCreateDate, CustomFieldCreateDateTypedDict
from .customfieldcreatenumber import (
    CustomFieldCreateNumber,
    CustomFieldCreateNumberTypedDict,
)
from .customfieldcreateselect import (
    CustomFieldCreateSelect,
    CustomFieldCreateSelectTypedDict,
)
from .customfieldcreatetext import CustomFieldCreateText, CustomFieldCreateTextTypedDict
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


CustomFieldCreateTypedDict = TypeAliasType(
    "CustomFieldCreateTypedDict",
    Union[
        CustomFieldCreateTextTypedDict,
        CustomFieldCreateNumberTypedDict,
        CustomFieldCreateDateTypedDict,
        CustomFieldCreateCheckboxTypedDict,
        CustomFieldCreateSelectTypedDict,
    ],
)


CustomFieldCreate = Annotated[
    Union[
        Annotated[CustomFieldCreateCheckbox, Tag("checkbox")],
        Annotated[CustomFieldCreateDate, Tag("date")],
        Annotated[CustomFieldCreateNumber, Tag("number")],
        Annotated[CustomFieldCreateSelect, Tag("select")],
        Annotated[CustomFieldCreateText, Tag("text")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
