# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.api_version_enum import ApiVersionEnum
from ..types.webhook_endpoint_event_type import WebhookEndpointEventType
from ..types.webhook_endpoint_status import WebhookEndpointStatus
from .webhook_advanced_options import WebhookAdvancedOptionsParams


class WebhookEndpointCreateParams(typing_extensions.TypedDict):
    """
    The response when creating a webhook endpoint. Includes the `signingSecret`, which is only returned on creation and cannot be retrieved again.
    """

    object: typing.Literal["webhook_endpoint"]
    id: str
    """
    Unique identifier for the webhook endpoint.
    """

    url: str
    """
    The URL that webhook events are sent to.
    """

    name: str
    """
    A human-readable name for the webhook endpoint.
    """

    status: WebhookEndpointStatus
    enabled_events: typing_extensions.Annotated[
        typing.Sequence[WebhookEndpointEventType], FieldMetadata(alias="enabledEvents")
    ]
    """
    The list of event types this endpoint is subscribed to at the global level. These are events that are not scoped to a specific resource.
    """

    api_version: typing_extensions.Annotated[ApiVersionEnum, FieldMetadata(alias="apiVersion")]
    advanced_options: typing_extensions.Annotated[
        typing.Optional[WebhookAdvancedOptionsParams], FieldMetadata(alias="advancedOptions")
    ]
    """
    Advanced configuration options for the webhook endpoint, including custom headers and payload delivery settings.
    """

    signing_secret: typing_extensions.Annotated[str, FieldMetadata(alias="signingSecret")]
    """
    The signing secret used to verify webhook payloads. This is only returned when creating the endpoint and cannot be retrieved again.
    
    Store it securely — you will need it to verify webhook signatures.
    """

    created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")]
    """
    The date and time the webhook endpoint was created.
    """
