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

from __future__ import annotations
from .organization import Organization, OrganizationTypedDict
from enum import Enum
from polar_sdk.types import BaseModel
from polar_sdk.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing_extensions import Annotated, TypedDict


class WebhookOrganizationUpdatedPayloadType(str, Enum):
    ORGANIZATION_UPDATED = "organization.updated"


class WebhookOrganizationUpdatedPayloadTypedDict(TypedDict):
    r"""Sent when a organization is updated.

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

    data: OrganizationTypedDict
    type: WebhookOrganizationUpdatedPayloadType


class WebhookOrganizationUpdatedPayload(BaseModel):
    r"""Sent when a organization is updated.

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

    data: Organization

    TYPE: Annotated[
        Annotated[
            WebhookOrganizationUpdatedPayloadType,
            AfterValidator(
                validate_const(
                    WebhookOrganizationUpdatedPayloadType.ORGANIZATION_UPDATED
                )
            ),
        ],
        pydantic.Field(alias="type"),
    ] = WebhookOrganizationUpdatedPayloadType.ORGANIZATION_UPDATED
