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

from __future__ import annotations
from .topics_union import TopicsUnion, TopicsUnionTypedDict
from .webhookconfig import WebhookConfig, WebhookConfigTypedDict
from .webhookcredentials import WebhookCredentials, WebhookCredentialsTypedDict
from enum import Enum
from outpost_sdk.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class DestinationCreateWebhookType(str, Enum):
    r"""Type of the destination. Must be 'webhook'."""

    WEBHOOK = "webhook"


class DestinationCreateWebhookTypedDict(TypedDict):
    type: DestinationCreateWebhookType
    r"""Type of the destination. Must be 'webhook'."""
    topics: TopicsUnionTypedDict
    r"""\"*\" or an array of enabled topics."""
    config: WebhookConfigTypedDict
    id: NotRequired[str]
    r"""Optional user-provided ID. A UUID will be generated if empty."""
    credentials: NotRequired[WebhookCredentialsTypedDict]


class DestinationCreateWebhook(BaseModel):
    type: DestinationCreateWebhookType
    r"""Type of the destination. Must be 'webhook'."""

    topics: TopicsUnion
    r"""\"*\" or an array of enabled topics."""

    config: WebhookConfig

    id: Optional[str] = None
    r"""Optional user-provided ID. A UUID will be generated if empty."""

    credentials: Optional[WebhookCredentials] = None
