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

from __future__ import annotations
from .productpricecustom import ProductPriceCustom, ProductPriceCustomTypedDict
from .productpricefixed import ProductPriceFixed, ProductPriceFixedTypedDict
from .productpricefree import ProductPriceFree, ProductPriceFreeTypedDict
from .productpricemeteredunit import (
    ProductPriceMeteredUnit,
    ProductPriceMeteredUnitTypedDict,
)
from .productpriceseatbased import ProductPriceSeatBased, ProductPriceSeatBasedTypedDict
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


ProductPriceTypedDict = TypeAliasType(
    "ProductPriceTypedDict",
    Union[
        ProductPriceFreeTypedDict,
        ProductPriceFixedTypedDict,
        ProductPriceSeatBasedTypedDict,
        ProductPriceCustomTypedDict,
        ProductPriceMeteredUnitTypedDict,
    ],
)


ProductPrice = Annotated[
    Union[
        Annotated[ProductPriceCustom, Tag("custom")],
        Annotated[ProductPriceFixed, Tag("fixed")],
        Annotated[ProductPriceFree, Tag("free")],
        Annotated[ProductPriceMeteredUnit, Tag("metered_unit")],
        Annotated[ProductPriceSeatBased, Tag("seat_based")],
    ],
    Discriminator(lambda m: get_discriminator(m, "amount_type", "amount_type")),
]
