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

from __future__ import annotations
from .benefitcustomcreate import BenefitCustomCreate, BenefitCustomCreateTypedDict
from .benefitdiscordcreate import BenefitDiscordCreate, BenefitDiscordCreateTypedDict
from .benefitdownloadablescreate import (
    BenefitDownloadablesCreate,
    BenefitDownloadablesCreateTypedDict,
)
from .benefitgithubrepositorycreate import (
    BenefitGitHubRepositoryCreate,
    BenefitGitHubRepositoryCreateTypedDict,
)
from .benefitlicensekeyscreate import (
    BenefitLicenseKeysCreate,
    BenefitLicenseKeysCreateTypedDict,
)
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


BenefitCreateTypedDict = TypeAliasType(
    "BenefitCreateTypedDict",
    Union[
        BenefitCustomCreateTypedDict,
        BenefitDiscordCreateTypedDict,
        BenefitGitHubRepositoryCreateTypedDict,
        BenefitDownloadablesCreateTypedDict,
        BenefitLicenseKeysCreateTypedDict,
    ],
)


BenefitCreate = Annotated[
    Union[
        Annotated[BenefitCustomCreate, Tag("custom")],
        Annotated[BenefitDiscordCreate, Tag("discord")],
        Annotated[BenefitDownloadablesCreate, Tag("downloadables")],
        Annotated[BenefitGitHubRepositoryCreate, Tag("github_repository")],
        Annotated[BenefitLicenseKeysCreate, Tag("license_keys")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
