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

from __future__ import annotations
from .legacyrecurringproductpricecustom import (
    LegacyRecurringProductPriceCustom,
    LegacyRecurringProductPriceCustomTypedDict,
)
from .legacyrecurringproductpricefixed import (
    LegacyRecurringProductPriceFixed,
    LegacyRecurringProductPriceFixedTypedDict,
)
from .legacyrecurringproductpricefree import (
    LegacyRecurringProductPriceFree,
    LegacyRecurringProductPriceFreeTypedDict,
)
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


LegacyRecurringProductPriceTypedDict = TypeAliasType(
    "LegacyRecurringProductPriceTypedDict",
    Union[
        LegacyRecurringProductPriceFreeTypedDict,
        LegacyRecurringProductPriceFixedTypedDict,
        LegacyRecurringProductPriceCustomTypedDict,
    ],
)


LegacyRecurringProductPrice = Annotated[
    Union[
        Annotated[LegacyRecurringProductPriceCustom, Tag("custom")],
        Annotated[LegacyRecurringProductPriceFixed, Tag("fixed")],
        Annotated[LegacyRecurringProductPriceFree, Tag("free")],
    ],
    Discriminator(lambda m: get_discriminator(m, "amount_type", "amount_type")),
]
