cloudflare
Version:
The official TypeScript library for the Cloudflare API
44 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Jobs = exports.BaseJobs = 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 BaseJobs = /* @__PURE__ */ (() => {
class BaseJobs extends resource_1.APIResource {
/**
* Creates webhook jobs to send a finding instance to one or more configured
* webhooks.
*
* @example
* ```ts
* const job =
* await client.zeroTrust.casb.posture.webhooks.jobs.create({
* account_id: '46148281d8a93d002ef242d8b0d5f9f6',
* finding_instance_ids: [
* '770e8400-e29b-41d4-a716-446655440002',
* '660e8400-e29b-41d4-a716-446655440001',
* ],
* webhook_ids: [
* '550e8400-e29b-41d4-a716-446655440000',
* '660e8400-e29b-41d4-a716-446655440001',
* ],
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/data-security/posture/webhooks/jobs`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseJobs._key = Object.freeze(['zeroTrust', 'casb', 'posture', 'webhooks', 'jobs']);
return BaseJobs;
})();
exports.BaseJobs = BaseJobs;
class Jobs extends BaseJobs {
}
exports.Jobs = Jobs;
//# sourceMappingURL=jobs.js.map