cloudflare
Version:
The official TypeScript library for the Cloudflare API
41 lines • 1.69 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BulkOperations = exports.BaseBulkOperations = 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 BaseBulkOperations = /* @__PURE__ */ (() => {
class BaseBulkOperations extends resource_1.APIResource {
/**
* Gets the current status of an asynchronous operation on a list.
*
* The `status` property can have one of the following values: `pending`,
* `running`, `completed`, or `failed`. If the status is `failed`, the `error`
* property will contain a message describing the error.
*
* @example
* ```ts
* const bulkOperation =
* await client.rules.lists.bulkOperations.get(
* '4da8780eeb215e6cb7f48dd981c4ea02',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(operationID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/rules/lists/bulk_operations/${operationID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseBulkOperations._key = Object.freeze([
'rules',
'lists',
'bulkOperations',
]);
return BaseBulkOperations;
})();
exports.BaseBulkOperations = BaseBulkOperations;
class BulkOperations extends BaseBulkOperations {
}
exports.BulkOperations = BulkOperations;
//# sourceMappingURL=bulk-operations.js.map