UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

39 lines • 1.5 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../../core/resource.mjs"; import { path } from "../../../../../internal/utils/path.mjs"; export var BaseJobs = /* @__PURE__ */ (() => { class BaseJobs extends 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(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; })(); export class Jobs extends BaseJobs { } //# sourceMappingURL=jobs.mjs.map