cloudflare
Version:
The official TypeScript library for the Cloudflare API
45 lines • 1.55 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 BaseSlots = /* @__PURE__ */ (() => {
class BaseSlots extends APIResource {
/**
* Lists all available infrastructure slots for the account, showing allocation
* status and capacity.
*
* @example
* ```ts
* const slots = await client.networkInterconnects.slots.list({
* account_id: 'account_id',
* });
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.get(path `/accounts/${account_id}/cni/slots`, { query, ...options });
}
/**
* Gets information about a specific infrastructure slot allocation.
*
* @example
* ```ts
* const slot = await client.networkInterconnects.slots.get(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
get(slot, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/cni/slots/${slot}`, options);
}
}
BaseSlots._key = Object.freeze([
'networkInterconnects',
'slots',
]);
return BaseSlots;
})();
export class Slots extends BaseSlots {
}
//# sourceMappingURL=slots.mjs.map