cloudflare
Version:
The official TypeScript library for the Cloudflare API
36 lines • 1.41 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
* zone. Each entitlement describes a product feature the zone 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.zones.entitlements.list(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { zone_id } = params;
return this._client.getAPIList(path `/zones/${zone_id}/entitlements`, (SinglePage), options);
}
}
BaseEntitlements._key = Object.freeze([
'zones',
'entitlements',
]);
return BaseEntitlements;
})();
export class Entitlements extends BaseEntitlements {
}
//# sourceMappingURL=entitlements.mjs.map