@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
97 lines (96 loc) • 3.28 kB
TypeScript
import BaseResource from '../../BaseResource';
import type * as SchemaTypes from '../SchemaTypes';
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
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: SimpleSchemaTypes.WebhookCreateSchema): Promise<SimpleSchemaTypes.Webhook>;
/**
* Create a new webhook
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawCreate(body: SchemaTypes.WebhookCreateSchema): Promise<SchemaTypes.WebhookCreateTargetSchema>;
/**
* Update a webhook
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
update(webhookId: string | SimpleSchemaTypes.WebhookData, body: SimpleSchemaTypes.WebhookUpdateSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.WebhookUpdateSchema): Promise<SchemaTypes.WebhookUpdateTargetSchema>;
/**
* List all webhooks
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
list(): Promise<SimpleSchemaTypes.WebhookInstancesTargetSchema>;
/**
* List all webhooks
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawList(): Promise<SchemaTypes.WebhookInstancesTargetSchema>;
/**
* Retrieve a webhook
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find(webhookId: string | SimpleSchemaTypes.WebhookData): Promise<SimpleSchemaTypes.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<SchemaTypes.WebhookSelfTargetSchema>;
/**
* Delete a webhook
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/webhook/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
destroy(webhookId: string | SimpleSchemaTypes.WebhookData): Promise<SimpleSchemaTypes.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<SchemaTypes.WebhookDestroyTargetSchema>;
}