UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

46 lines • 1.9 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { V4PagePaginationArray } from "../../core/pagination.mjs"; import { path } from "../../internal/utils/path.mjs"; /** * @deprecated Please use the [Account Permission Groups](https://developers.cloudflare.com/api/resources/iam/subresources/permission_groups/) API instead */ export var BaseRoles = /* @__PURE__ */ (() => { /** * @deprecated Please use the [Account Permission Groups](https://developers.cloudflare.com/api/resources/iam/subresources/permission_groups/) API instead */ class BaseRoles extends APIResource { /** * Get all available roles for an account. * * @deprecated Use /accounts/{account_id}/iam/permission_groups instead. */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/roles`, (V4PagePaginationArray), { query, ...options, }); } /** * Get information about a specific role for an account. * * @deprecated Use /accounts/{account_id}/iam/permission_groups/{permission_group_id} instead. */ get(roleID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/roles/${roleID}`, options)._thenUnwrap((obj) => obj.result); } } BaseRoles._key = Object.freeze([ 'accounts', 'roles', ]); return BaseRoles; })(); /** * @deprecated Please use the [Account Permission Groups](https://developers.cloudflare.com/api/resources/iam/subresources/permission_groups/) API instead */ export class Roles extends BaseRoles { } //# sourceMappingURL=roles.mjs.map