cloudflare
Version:
The official TypeScript library for the Cloudflare API
115 lines • 4.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PriorityResource = exports.BasePriorityResource = 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 BasePriorityResource = /* @__PURE__ */ (() => {
class BasePriorityResource extends resource_1.APIResource {
/**
* Creates a new priority intelligence request in Cloudforce One.
*
* @example
* ```ts
* const priority =
* await client.cloudforceOne.requests.priority.create({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* labels: ['DoS', 'CVE'],
* priority: 1,
* requirement: 'DoS attacks carried out by CVEs',
* tlp: 'clear',
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/cloudforce-one/requests/priority/new`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Updates a priority intelligence request in Cloudforce One.
*
* @example
* ```ts
* const item =
* await client.cloudforceOne.requests.priority.update(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* labels: ['DoS', 'CVE'],
* priority: 1,
* requirement: 'DoS attacks carried out by CVEs',
* tlp: 'clear',
* },
* );
* ```
*/
update(priorityID, params, options) {
const { account_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/cloudforce-one/requests/priority/${priorityID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Deletes a priority intelligence request from Cloudforce One.
*
* @example
* ```ts
* const priority =
* await client.cloudforceOne.requests.priority.delete(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(priorityID, params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/cloudforce-one/requests/priority/${priorityID}`, options);
}
/**
* Retrieves a specific priority intelligence request from Cloudforce One.
*
* @example
* ```ts
* const item =
* await client.cloudforceOne.requests.priority.get(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(priorityID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/cloudforce-one/requests/priority/${priorityID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves quota usage for Cloudforce One priority requests.
*
* @example
* ```ts
* const quota =
* await client.cloudforceOne.requests.priority.quota({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
quota(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/cloudforce-one/requests/priority/quota`, options)._thenUnwrap((obj) => obj.result);
}
}
BasePriorityResource._key = Object.freeze([
'cloudforceOne',
'requests',
'priority',
]);
return BasePriorityResource;
})();
exports.BasePriorityResource = BasePriorityResource;
class PriorityResource extends BasePriorityResource {
}
exports.PriorityResource = PriorityResource;
//# sourceMappingURL=priority.js.map