UNPKG

@lomi./sdk

Version:

Official TypeScript SDK for the lomi. API

108 lines 3.24 kB
import { OpenAPI } from '../core/OpenAPI.js'; import { request as __request } from '../core/request.js'; export class WebhookService { /** * List webhooks * Retrieve a paginated list of webhooks * @returns any Successful response * @throws ApiError */ static getWebhooks({ limit = 20, offset, sort, }) { return __request(OpenAPI, { method: 'GET', url: '/webhooks', query: { 'limit': limit, 'offset': offset, 'sort': sort, }, errors: { 401: `Unauthorized - Invalid or missing API key`, 500: `Internal server error`, }, }); } /** * Create webhook * Create a new webhook * @returns webhooks Successfully created * @throws ApiError */ static postWebhooks({ requestBody, }) { return __request(OpenAPI, { method: 'POST', url: '/webhooks', body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - Invalid input`, 401: `Unauthorized - Invalid or missing API key`, 500: `Internal server error`, }, }); } /** * Get webhook * Retrieve a specific webhook by ID * @returns webhooks Successful response * @throws ApiError */ static getWebhooks1({ webhookId, }) { return __request(OpenAPI, { method: 'GET', url: '/webhooks/{webhook_id}', path: { 'webhook_id': webhookId, }, errors: { 401: `Unauthorized - Invalid or missing API key`, 404: `Not found - Resource does not exist`, 500: `Internal server error`, }, }); } /** * Update webhook * Update a specific webhook * @returns webhooks Successfully updated * @throws ApiError */ static patchWebhooks({ webhookId, requestBody, }) { return __request(OpenAPI, { method: 'PATCH', url: '/webhooks/{webhook_id}', path: { 'webhook_id': webhookId, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad request - Invalid input`, 401: `Unauthorized - Invalid or missing API key`, 404: `Not found - Resource does not exist`, 500: `Internal server error`, }, }); } /** * Delete webhook * Delete a specific webhook * @returns void * @throws ApiError */ static deleteWebhooks({ webhookId, }) { return __request(OpenAPI, { method: 'DELETE', url: '/webhooks/{webhook_id}', path: { 'webhook_id': webhookId, }, errors: { 401: `Unauthorized - Invalid or missing API key`, 404: `Not found - Resource does not exist`, 500: `Internal server error`, }, }); } } //# sourceMappingURL=WebhookService.js.map