UNPKG

@datocms/cma-client

Version:
97 lines (96 loc) 3.17 kB
import BaseResource from '../../BaseResource'; import type * as ApiTypes from '../ApiTypes'; import type * as RawApiTypes from '../RawApiTypes'; export default class Webhook extends BaseResource { static readonly TYPE: "webhook"; /** * Create a new webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/create * * @throws {ApiError} * @throws {TimeoutError} */ create(body: ApiTypes.WebhookCreateSchema): Promise<ApiTypes.Webhook>; /** * Create a new webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/create * * @throws {ApiError} * @throws {TimeoutError} */ rawCreate(body: RawApiTypes.WebhookCreateSchema): Promise<RawApiTypes.WebhookCreateTargetSchema>; /** * Update a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/update * * @throws {ApiError} * @throws {TimeoutError} */ update(webhookId: string | ApiTypes.WebhookData, body: ApiTypes.WebhookUpdateSchema): Promise<ApiTypes.Webhook>; /** * Update a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/update * * @throws {ApiError} * @throws {TimeoutError} */ rawUpdate(webhookId: string, body: RawApiTypes.WebhookUpdateSchema): Promise<RawApiTypes.WebhookUpdateTargetSchema>; /** * List all webhooks * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(): Promise<ApiTypes.WebhookInstancesTargetSchema>; /** * List all webhooks * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(): Promise<RawApiTypes.WebhookInstancesTargetSchema>; /** * Retrieve a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/self * * @throws {ApiError} * @throws {TimeoutError} */ find(webhookId: string | ApiTypes.WebhookData): Promise<ApiTypes.Webhook>; /** * Retrieve a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(webhookId: string): Promise<RawApiTypes.WebhookSelfTargetSchema>; /** * Delete a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(webhookId: string | ApiTypes.WebhookData): Promise<ApiTypes.Webhook>; /** * Delete a webhook * * Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/destroy * * @throws {ApiError} * @throws {TimeoutError} */ rawDestroy(webhookId: string): Promise<RawApiTypes.WebhookDestroyTargetSchema>; }