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

from __future__ import annotations
from .refund import Refund, RefundTypedDict
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 WebhookRefundCreatedPayloadTypedDict(TypedDict):
    r"""Sent when a refund is created regardless of status.

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

    data: RefundTypedDict
    type: Literal["refund.created"]


class WebhookRefundCreatedPayload(BaseModel):
    r"""Sent when a refund is created regardless of status.

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

    data: Refund

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