/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { webhookCreate } from "../funcs/webhookCreate.js"; import { webhookDelete } from "../funcs/webhookDelete.js"; import { webhookGet } from "../funcs/webhookGet.js"; import { webhookGetAll } from "../funcs/webhookGetAll.js"; import { webhookGetLog } from "../funcs/webhookGetLog.js"; import { webhookGetLogs } from "../funcs/webhookGetLogs.js"; import { webhookResendLog } from "../funcs/webhookResendLog.js"; import { webhookUpdate } from "../funcs/webhookUpdate.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 Webhook extends ClientSDK { /** * Retrieve a Webhook */ async getAll( options?: RequestOptions, ): Promise { return unwrapAsync(webhookGetAll( this, options, )); } /** * Create a webhook * * @remarks * To create a new webhook, you need to make an API call with the events you want to listen for and the URL that will be called when those events occur. */ async create( request: components.WebhookInput, options?: RequestOptions, ): Promise { return unwrapAsync(webhookCreate( this, request, options, )); } /** * Retrieve a webhook */ async get( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookGet( this, id, options, )); } /** * Update a webhook */ async update( webhook: components.WebhookInput, id: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookUpdate( this, webhook, id, options, )); } /** * Delete a webhook */ async delete( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookDelete( this, id, options, )); } /** * Retrieve webhook logs */ async getLogs( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookGetLogs( this, id, options, )); } /** * Retrieve a webhook log */ async getLog( id: string, logId: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookGetLog( this, id, logId, options, )); } /** * Resend a webhook * * @remarks * Use this API to resend the same webhook request. This is useful when * developing and debugging, allowing you to easily repeat the same webhook * to check or fix the behaviour in your handler. */ async resendLog( id: string, logId: string, options?: RequestOptions, ): Promise { return unwrapAsync(webhookResendLog( this, id, logId, options, )); } }