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

from __future__ import annotations
from .member import Member, MemberTypedDict
from datetime import datetime
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 WebhookMemberDeletedPayloadTypedDict(TypedDict):
    r"""Sent when a member is deleted.

    This event is triggered when a member is removed from a customer.
    Any active seats assigned to the member will be automatically revoked.

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

    timestamp: datetime
    data: MemberTypedDict
    r"""A member of a customer."""
    type: Literal["member.deleted"]


class WebhookMemberDeletedPayload(BaseModel):
    r"""Sent when a member is deleted.

    This event is triggered when a member is removed from a customer.
    Any active seats assigned to the member will be automatically revoked.

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

    timestamp: datetime

    data: Member
    r"""A member of a customer."""

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