cloudflare
Version:
The official TypeScript library for the Cloudflare API
50 lines • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Slots = exports.BaseSlots = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
var BaseSlots = /* @__PURE__ */ (() => {
class BaseSlots extends resource_1.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((0, path_1.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((0, path_1.path) `/accounts/${account_id}/cni/slots/${slot}`, options);
}
}
BaseSlots._key = Object.freeze([
'networkInterconnects',
'slots',
]);
return BaseSlots;
})();
exports.BaseSlots = BaseSlots;
class Slots extends BaseSlots {
}
exports.Slots = Slots;
//# sourceMappingURL=slots.js.map