/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { webhooksCreateWebhook } from "../funcs/webhooksCreateWebhook.js"; import { webhooksDeleteWebhook } from "../funcs/webhooksDeleteWebhook.js"; import { webhooksGetWebhook } from "../funcs/webhooksGetWebhook.js"; import { webhooksListWebhooks } from "../funcs/webhooksListWebhooks.js"; import { webhooksUpdateWebhook } from "../funcs/webhooksUpdateWebhook.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Webhooks extends ClientSDK { /** * Create a new webhook * * @remarks * Creates a new webhook to send notifications to a URL when a specific event occurs. */ async createWebhook( request: components.WebhookUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksCreateWebhook( this, request, options, )); } /** * List all webhooks * * @remarks * Returns a list of all webhooks you have created. */ async listWebhooks( options?: RequestOptions, ): Promise { return unwrapAsync(webhooksListWebhooks( this, options, )); } /** * Retrieve a specific webhook * * @remarks * Returns the details of a specific webhook using the webhook object ID. */ async getWebhook( webhookId: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksGetWebhook( this, webhookId, options, )); } /** * Update an existing webhook * * @remarks * Updates an existing webhook using the webhook object ID. */ async updateWebhook( webhookUpdateRequest: components.WebhookUpdateRequest, webhookId: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksUpdateWebhook( this, webhookUpdateRequest, webhookId, options, )); } /** * Delete a specific webhook * * @remarks * Deletes a specific webhook using the webhook object ID. */ async deleteWebhook( webhookId: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhooksDeleteWebhook( this, webhookId, options, )); } }