/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { webhooksCreate } from "../funcs/webhooksCreate.js"; import { webhooksDisable } from "../funcs/webhooksDisable.js"; import { webhooksGet } from "../funcs/webhooksGet.js"; import { webhooksGetSecret } from "../funcs/webhooksGetSecret.js"; import { webhooksList } from "../funcs/webhooksList.js"; import { webhooksListEventTypes } from "../funcs/webhooksListEventTypes.js"; import { webhooksPing } from "../funcs/webhooksPing.js"; import { webhooksUpdate } from "../funcs/webhooksUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Webhooks extends ClientSDK { /** * List all available event types that can be subscribed to. */ async listEventTypes( request: operations.ListEventTypesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksListEventTypes( this, request, options, )); } /** * List all webhooks configured for the account. */ async list( request: operations.ListWebhooksRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksList( this, request, options, )); } /** * Create a new webhook for the account. */ async create( request: components.CreateWebhook, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksCreate( this, request, options, )); } /** * Get details of a specific webhook. */ async get( request: operations.GetWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksGet( this, request, options, )); } /** * Update an existing webhook. */ async update( request: operations.UpdateWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksUpdate( this, request, options, )); } /** * Disable a webhook. Disabled webhooks will no longer receive events. */ async disable( request: operations.DisableWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksDisable( this, request, options, )); } /** * Send a test ping to a webhook to verify it is configured correctly. */ async ping( request: operations.PingWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksPing( this, request, options, )); } /** * Get the secret key for verifying webhook payloads. */ async getSecret( request: operations.GetWebhookSecretRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksGetSecret( this, request, options, )); } }