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

from __future__ import annotations
from .order import Order, OrderTypedDict
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 WebhookOrderPaidPayloadTypedDict(TypedDict):
    r"""Sent when an order is paid.

    When you receive this event, the order is fully processed and payment has been received.

    **Discord & Slack support:** Full
    """

    data: OrderTypedDict
    type: Literal["order.paid"]


class WebhookOrderPaidPayload(BaseModel):
    r"""Sent when an order is paid.

    When you receive this event, the order is fully processed and payment has been received.

    **Discord & Slack support:** Full
    """

    data: Order

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