cloudflare
Version:
The official TypeScript library for the Cloudflare API
67 lines • 2.44 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BasePermissions = /* @__PURE__ */ (() => {
class BasePermissions extends 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(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(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(path `/accounts/${account_id}/intel/indicator-feeds/permissions/remove`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BasePermissions._key = Object.freeze([
'intel',
'indicatorFeeds',
'permissions',
]);
return BasePermissions;
})();
export class Permissions extends BasePermissions {
}
//# sourceMappingURL=permissions.mjs.map