cloudflare
Version:
The official TypeScript library for the Cloudflare API
62 lines • 2.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Webhooks = exports.BaseWebhooks = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
var BaseWebhooks = /* @__PURE__ */ (() => {
class BaseWebhooks extends resource_1.APIResource {
/**
* Create a webhook for notifications about on-demand video uploads.
*
* @example
* ```ts
* const webhook = await client.stream.webhooks.update({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
update(params, options) {
const { account_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/stream/webhook`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Deletes the on-demand video webhook.
*
* @example
* ```ts
* const webhook = await client.stream.webhooks.delete({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
delete(params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/stream/webhook`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve current on-demand webhook information.
*
* @example
* ```ts
* const webhook = await client.stream.webhooks.get({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/stream/webhook`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseWebhooks._key = Object.freeze([
'stream',
'webhooks',
]);
return BaseWebhooks;
})();
exports.BaseWebhooks = BaseWebhooks;
class Webhooks extends BaseWebhooks {
}
exports.Webhooks = Webhooks;
//# sourceMappingURL=webhooks.js.map