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

from __future__ import annotations
from .customerbenefitgrantcustomupdate import (
    CustomerBenefitGrantCustomUpdate,
    CustomerBenefitGrantCustomUpdateTypedDict,
)
from .customerbenefitgrantdiscordupdate import (
    CustomerBenefitGrantDiscordUpdate,
    CustomerBenefitGrantDiscordUpdateTypedDict,
)
from .customerbenefitgrantdownloadablesupdate import (
    CustomerBenefitGrantDownloadablesUpdate,
    CustomerBenefitGrantDownloadablesUpdateTypedDict,
)
from .customerbenefitgrantgithubrepositoryupdate import (
    CustomerBenefitGrantGitHubRepositoryUpdate,
    CustomerBenefitGrantGitHubRepositoryUpdateTypedDict,
)
from .customerbenefitgrantlicensekeysupdate import (
    CustomerBenefitGrantLicenseKeysUpdate,
    CustomerBenefitGrantLicenseKeysUpdateTypedDict,
)
from .customerbenefitgrantmetercreditupdate import (
    CustomerBenefitGrantMeterCreditUpdate,
    CustomerBenefitGrantMeterCreditUpdateTypedDict,
)
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


CustomerBenefitGrantUpdateTypedDict = TypeAliasType(
    "CustomerBenefitGrantUpdateTypedDict",
    Union[
        CustomerBenefitGrantDownloadablesUpdateTypedDict,
        CustomerBenefitGrantLicenseKeysUpdateTypedDict,
        CustomerBenefitGrantCustomUpdateTypedDict,
        CustomerBenefitGrantMeterCreditUpdateTypedDict,
        CustomerBenefitGrantDiscordUpdateTypedDict,
        CustomerBenefitGrantGitHubRepositoryUpdateTypedDict,
    ],
)


CustomerBenefitGrantUpdate = Annotated[
    Union[
        Annotated[CustomerBenefitGrantCustomUpdate, Tag("custom")],
        Annotated[CustomerBenefitGrantDiscordUpdate, Tag("discord")],
        Annotated[CustomerBenefitGrantDownloadablesUpdate, Tag("downloadables")],
        Annotated[CustomerBenefitGrantGitHubRepositoryUpdate, Tag("github_repository")],
        Annotated[CustomerBenefitGrantLicenseKeysUpdate, Tag("license_keys")],
        Annotated[CustomerBenefitGrantMeterCreditUpdate, Tag("meter_credit")],
    ],
    Discriminator(lambda m: get_discriminator(m, "benefit_type", "benefit_type")),
]
