cloudflare
Version:
The official TypeScript library for the Cloudflare API
80 lines • 3.15 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 pagination_1 = require("../../../../../core/pagination.js");
const path_1 = require("../../../../../internal/utils/path.js");
var BaseJobs = /* @__PURE__ */ (() => {
class BaseJobs extends resource_1.APIResource {
/**
* Create one or more remediation jobs tied to a specific Cloudflare Account.
*
* @example
* ```ts
* const job =
* await client.zeroTrust.casb.posture.remediations.jobs.create(
* {
* account_id: '46148281d8a93d002ef242d8b0d5f9f6',
* finding_instance_ids: [
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* ],
* remediation_type_id:
* '5a7d9e2f-1b3c-4d5e-8f6a-7b8c9d0e1f2a',
* },
* );
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/data-security/posture/remediations/jobs`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List all remediation jobs tied to a specific Cloudflare Account. Note that
* `cursor` and `page` are mutually exclusive.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const jobListResponse of client.zeroTrust.casb.posture.remediations.jobs.list(
* { account_id: '46148281d8a93d002ef242d8b0d5f9f6' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/data-security/posture/remediations/jobs`, (pagination_1.V4PagePaginationArray), { query, ...options });
}
/**
* Creates a CSV export for remediation jobs and accepts optional filters in the
* payload.
*
* @example
* ```ts
* const response =
* await client.zeroTrust.casb.posture.remediations.jobs.export(
* { account_id: '46148281d8a93d002ef242d8b0d5f9f6' },
* );
* ```
*/
export(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/data-security/posture/remediations/jobs/export`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseJobs._key = Object.freeze(['zeroTrust', 'casb', 'posture', 'remediations', 'jobs']);
return BaseJobs;
})();
exports.BaseJobs = BaseJobs;
class Jobs extends BaseJobs {
}
exports.Jobs = Jobs;
//# sourceMappingURL=jobs.js.map