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

from __future__ import annotations
from .formfieldoptiongroup import FormFieldOptionGroup, FormFieldOptionGroupTypedDict
from .simpleformfieldoption import SimpleFormFieldOption, SimpleFormFieldOptionTypedDict
from apideck_unify.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


FormFieldOptionTypedDict = TypeAliasType(
    "FormFieldOptionTypedDict",
    Union[SimpleFormFieldOptionTypedDict, FormFieldOptionGroupTypedDict],
)


FormFieldOption = Annotated[
    Union[
        Annotated[SimpleFormFieldOption, Tag("simple")],
        Annotated[FormFieldOptionGroup, Tag("group")],
    ],
    Discriminator(lambda m: get_discriminator(m, "option_type", "option_type")),
]
