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

from __future__ import annotations
from .benefitads import BenefitAds, BenefitAdsTypedDict
from .benefitarticles import BenefitArticles, BenefitArticlesTypedDict
from .benefitcustom import BenefitCustom, BenefitCustomTypedDict
from .benefitdiscord_input import BenefitDiscordInput, BenefitDiscordInputTypedDict
from .benefitdownloadables import BenefitDownloadables, BenefitDownloadablesTypedDict
from .benefitgithubrepository import BenefitGitHubRepository, BenefitGitHubRepositoryTypedDict
from .benefitlicensekeys_input import BenefitLicenseKeysInput, BenefitLicenseKeysInputTypedDict
from enum import Enum
from polar_sdk.types import BaseModel
import pydantic
from typing import Final, TypedDict, Union
from typing_extensions import Annotated


class WebhookBenefitCreatedPayloadType(str, Enum):
    BENEFIT_CREATED = "benefit.created"

WebhookBenefitCreatedPayloadBenefitTypedDict = Union[BenefitArticlesTypedDict, BenefitAdsTypedDict, BenefitDiscordInputTypedDict, BenefitGitHubRepositoryTypedDict, BenefitDownloadablesTypedDict, BenefitLicenseKeysInputTypedDict, BenefitCustomTypedDict]


WebhookBenefitCreatedPayloadBenefit = Union[BenefitArticles, BenefitAds, BenefitDiscordInput, BenefitGitHubRepository, BenefitDownloadables, BenefitLicenseKeysInput, BenefitCustom]


class WebhookBenefitCreatedPayloadTypedDict(TypedDict):
    r"""Sent when a new benefit is created.

    **Discord & Slack support:** Basic
    """
    
    data: WebhookBenefitCreatedPayloadBenefitTypedDict
    

class WebhookBenefitCreatedPayload(BaseModel):
    r"""Sent when a new benefit is created.

    **Discord & Slack support:** Basic
    """
    
    data: WebhookBenefitCreatedPayloadBenefit
    TYPE: Annotated[Final[WebhookBenefitCreatedPayloadType], pydantic.Field(alias="type")] = WebhookBenefitCreatedPayloadType.BENEFIT_CREATED # type: ignore
    
