/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { webhookEndpointsCreate } from "../funcs/webhookEndpointsCreate.js"; import { webhookEndpointsDelete } from "../funcs/webhookEndpointsDelete.js"; import { webhookEndpointsGet } from "../funcs/webhookEndpointsGet.js"; import { webhookEndpointsList } from "../funcs/webhookEndpointsList.js"; import { webhookEndpointsUpdate } from "../funcs/webhookEndpointsUpdate.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"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class WebhookEndpoints extends ClientSDK { /** * List Webhook Endpoints * * @remarks * List all webhook endpoints sorted by created_at in descending order. Results are paginated with a max limit of 100. When more endpoints are available, a `cursor` will be provided. Use the `cursor` parameter to retrieve the subsequent page. */ async list( request?: operations.ListWebhookEndpointsRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(webhookEndpointsList( this, request, options, )); } /** * Create Webhook Endpoint * * @remarks * Create a webhook endpoint to receive notifications about document status updates, connection sync progress, partition limits, and other tenant events. */ async create( request: components.CreateWebhookEndpointPayload, options?: RequestOptions, ): Promise { return unwrapAsync(webhookEndpointsCreate( this, request, options, )); } /** * Get Webhook Endpoint * * @remarks * Get a webhook endpoint by its id. */ async get( request: operations.GetWebhookEndpointRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhookEndpointsGet( this, request, options, )); } /** * Update Webhook Endpoint * * @remarks * Update a webhook endpoint's name, URL, or active status. Use this to rotate endpoints or temporarily disable delivery without deleting the endpoint. */ async update( request: operations.UpdateWebhookEndpointRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhookEndpointsUpdate( this, request, options, )); } /** * Delete Webhook Endpoint * * @remarks * Delete a webhook endpoint to stop delivering webhook notifications to its URL. */ async delete( request: operations.DeleteWebhookEndpointRequest, options?: RequestOptions, ): Promise { return unwrapAsync(webhookEndpointsDelete( this, request, options, )); } }