cloudflare
Version:
The official TypeScript library for the Cloudflare API
108 lines • 4.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Categories = exports.BaseCategories = void 0;
const tslib_1 = require("../../../../internal/tslib.js");
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const CatalogAPI = tslib_1.__importStar(require("./catalog.js"));
const catalog_1 = require("./catalog.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseCategories = /* @__PURE__ */ (() => {
class BaseCategories extends resource_1.APIResource {
/**
* Creates a new threat event category in Cloudforce One for organizing and
* classifying threat events.
*
* @example
* ```ts
* const category =
* await client.cloudforceOne.threatEvents.categories.create(
* {
* account_id: 'account_id',
* killChain: 0,
* name: 'name',
* },
* );
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/cloudforce-one/events/categories/create`, {
body,
...options,
});
}
/**
* Lists all threat event categories configured for classifying and organizing
* threat events.
*
* @example
* ```ts
* const categories =
* await client.cloudforceOne.threatEvents.categories.list({
* account_id: 'account_id',
* });
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/cloudforce-one/events/categories`, {
query,
...options,
});
}
/**
* Deprecated; use DELETE /events/event-categories/by-id/{category_id}. Available
* through 2026-11-28.
*
* @deprecated Use DELETE /events/event-categories/by-id/{category_id} before 2026-11-28.
*/
delete(categoryID, params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/cloudforce-one/events/categories/${categoryID}`, options);
}
/**
* Deprecated; use PATCH /events/event-categories/by-id/{category_id}. Available
* through 2026-11-28.
*
* @deprecated Use PATCH /events/event-categories/by-id/{category_id} before 2026-11-28.
*/
edit(categoryID, params, options) {
const { account_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/cloudforce-one/events/categories/${categoryID}`, {
body,
...options,
});
}
/**
* Deprecated; use GET /events/event-categories/by-id/{category_id}. Available
* through 2026-11-28.
*
* @deprecated Use GET /events/event-categories/by-id/{category_id} before 2026-11-28.
*/
get(categoryID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/cloudforce-one/events/categories/${categoryID}`, options);
}
}
BaseCategories._key = Object.freeze([
'cloudforceOne',
'threatEvents',
'categories',
]);
return BaseCategories;
})();
exports.BaseCategories = BaseCategories;
var Categories = /* @__PURE__ */ (() => {
class Categories extends BaseCategories {
constructor() {
super(...arguments);
this.catalog = new CatalogAPI.Catalog(this._client);
}
}
Categories.Catalog = catalog_1.Catalog;
Categories.BaseCatalog = catalog_1.BaseCatalog;
return Categories;
})();
exports.Categories = Categories;
//# sourceMappingURL=categories.js.map