cloudflare
Version:
The official TypeScript library for the Cloudflare API
36 lines • 1.44 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { SinglePage } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseEntitlements = /* @__PURE__ */ (() => {
class BaseEntitlements extends APIResource {
/**
* Returns the list of entitlements (features and their allocations) for a given
* account. Each entitlement describes a product feature the account is permitted
* to use and the allocation value (boolean, count, range, enum, or string) that
* governs its behaviour.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const entitlementListResponse of client.accounts.entitlements.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id } = params;
return this._client.getAPIList(path `/accounts/${account_id}/entitlements`, (SinglePage), options);
}
}
BaseEntitlements._key = Object.freeze([
'accounts',
'entitlements',
]);
return BaseEntitlements;
})();
export class Entitlements extends BaseEntitlements {
}
//# sourceMappingURL=entitlements.mjs.map