cloudflare
Version:
The official TypeScript library for the Cloudflare API
72 lines • 2.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Permissions = exports.BasePermissions = 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 BasePermissions = /* @__PURE__ */ (() => {
class BasePermissions extends resource_1.APIResource {
/**
* Grants access permissions for a custom threat indicator feed to other accounts.
*
* @example
* ```ts
* const permission =
* await client.intel.indicatorFeeds.permissions.create({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/intel/indicator-feeds/permissions/add`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Lists current access permissions for custom threat indicator feeds.
*
* @example
* ```ts
* const permissions =
* await client.intel.indicatorFeeds.permissions.list({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
list(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/intel/indicator-feeds/permissions/view`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Revokes access permissions for a custom threat indicator feed.
*
* @example
* ```ts
* const permission =
* await client.intel.indicatorFeeds.permissions.delete({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
delete(params, options) {
const { account_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/intel/indicator-feeds/permissions/remove`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BasePermissions._key = Object.freeze([
'intel',
'indicatorFeeds',
'permissions',
]);
return BasePermissions;
})();
exports.BasePermissions = BasePermissions;
class Permissions extends BasePermissions {
}
exports.Permissions = Permissions;
//# sourceMappingURL=permissions.js.map