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

from __future__ import annotations
from .customfieldupdatecheckbox import (
    CustomFieldUpdateCheckbox,
    CustomFieldUpdateCheckboxTypedDict,
)
from .customfieldupdatedate import CustomFieldUpdateDate, CustomFieldUpdateDateTypedDict
from .customfieldupdatenumber import (
    CustomFieldUpdateNumber,
    CustomFieldUpdateNumberTypedDict,
)
from .customfieldupdateselect import (
    CustomFieldUpdateSelect,
    CustomFieldUpdateSelectTypedDict,
)
from .customfieldupdatetext import CustomFieldUpdateText, CustomFieldUpdateTextTypedDict
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


CustomFieldUpdateTypedDict = TypeAliasType(
    "CustomFieldUpdateTypedDict",
    Union[
        CustomFieldUpdateTextTypedDict,
        CustomFieldUpdateNumberTypedDict,
        CustomFieldUpdateDateTypedDict,
        CustomFieldUpdateCheckboxTypedDict,
        CustomFieldUpdateSelectTypedDict,
    ],
)


CustomFieldUpdate = Annotated[
    Union[
        Annotated[CustomFieldUpdateCheckbox, Tag("checkbox")],
        Annotated[CustomFieldUpdateDate, Tag("date")],
        Annotated[CustomFieldUpdateNumber, Tag("number")],
        Annotated[CustomFieldUpdateSelect, Tag("select")],
        Annotated[CustomFieldUpdateText, Tag("text")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
