cloudflare
Version:
The official TypeScript library for the Cloudflare API
102 lines • 3.8 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as CatalogAPI from "./catalog.mjs";
import { BaseCatalog, Catalog } from "./catalog.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseCategories = /* @__PURE__ */ (() => {
class BaseCategories extends 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(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(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(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(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(path `/accounts/${account_id}/cloudforce-one/events/categories/${categoryID}`, options);
}
}
BaseCategories._key = Object.freeze([
'cloudforceOne',
'threatEvents',
'categories',
]);
return BaseCategories;
})();
export var Categories = /* @__PURE__ */ (() => {
class Categories extends BaseCategories {
constructor() {
super(...arguments);
this.catalog = new CatalogAPI.Catalog(this._client);
}
}
Categories.Catalog = Catalog;
Categories.BaseCatalog = BaseCatalog;
return Categories;
})();
//# sourceMappingURL=categories.mjs.map