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

from __future__ import annotations
from .checkout import Checkout, CheckoutTypedDict
from polar_sdk.types import BaseModel
from polar_sdk.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal
from typing_extensions import Annotated, TypedDict


class WebhookCheckoutUpdatedPayloadTypedDict(TypedDict):
    r"""Sent when a checkout is updated.

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

    data: CheckoutTypedDict
    r"""Checkout session data retrieved using an access token."""
    type: Literal["checkout.updated"]


class WebhookCheckoutUpdatedPayload(BaseModel):
    r"""Sent when a checkout is updated.

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

    data: Checkout
    r"""Checkout session data retrieved using an access token."""

    TYPE: Annotated[
        Annotated[
            Literal["checkout.updated"],
            AfterValidator(validate_const("checkout.updated")),
        ],
        pydantic.Field(alias="type"),
    ] = "checkout.updated"
