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

from __future__ import annotations
from .subscription_input import SubscriptionInput, SubscriptionInputTypedDict
from enum import Enum
from polar_sdk.types import BaseModel
import pydantic
from typing import Final, TypedDict
from typing_extensions import Annotated


class WebhookSubscriptionUpdatedPayloadType(str, Enum):
    SUBSCRIPTION_UPDATED = "subscription.updated"


class WebhookSubscriptionUpdatedPayloadTypedDict(TypedDict):
    r"""Sent when a new subscription is updated. This event fires if the subscription is cancelled, both immediately and if the subscription is cancelled at the end of the current period.

    **Discord & Slack support:** On cancellation
    """

    data: SubscriptionInputTypedDict
    type: WebhookSubscriptionUpdatedPayloadType


class WebhookSubscriptionUpdatedPayload(BaseModel):
    r"""Sent when a new subscription is updated. This event fires if the subscription is cancelled, both immediately and if the subscription is cancelled at the end of the current period.

    **Discord & Slack support:** On cancellation
    """

    data: SubscriptionInput

    # fmt: off
    TYPE: Annotated[Final[WebhookSubscriptionUpdatedPayloadType], pydantic.Field(alias="type")] = WebhookSubscriptionUpdatedPayloadType.SUBSCRIPTION_UPDATED # type: ignore
    # fmt: on
