"""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 WebhookMemberUpdatedPayloadTypedDict(TypedDict):
    r"""Sent when a member is updated.

    This event is triggered when member details are updated,
    such as their name or role within the customer.

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

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


class WebhookMemberUpdatedPayload(BaseModel):
    r"""Sent when a member is updated.

    This event is triggered when member details are updated,
    such as their name or role within the customer.

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

    timestamp: datetime

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

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