cloudflare
Version:
The official TypeScript library for the Cloudflare API
72 lines • 2.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Snapshots = exports.BaseSnapshots = void 0;
const tslib_1 = require("../../../../internal/tslib.js");
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const LatestAPI = tslib_1.__importStar(require("./latest.js"));
const latest_1 = require("./latest.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseSnapshots = /* @__PURE__ */ (() => {
class BaseSnapshots extends resource_1.APIResource {
/**
* Lists Magic WAN Connector Telemetry Snapshots
*
* @example
* ```ts
* const snapshots =
* await client.magicTransit.connectors.snapshots.list(
* 'connector_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* from: 0,
* to: 0,
* },
* );
* ```
*/
list(connectorID, params, options) {
const { account_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/connectors/${connectorID}/telemetry/snapshots`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Gets Magic WAN Connector Telemetry Snapshot
*
* @example
* ```ts
* const snapshot =
* await client.magicTransit.connectors.snapshots.get(0, {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* connector_id: 'connector_id',
* });
* ```
*/
get(snapshotT, params, options) {
const { account_id, connector_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/connectors/${connector_id}/telemetry/snapshots/${snapshotT}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseSnapshots._key = Object.freeze([
'magicTransit',
'connectors',
'snapshots',
]);
return BaseSnapshots;
})();
exports.BaseSnapshots = BaseSnapshots;
var Snapshots = /* @__PURE__ */ (() => {
class Snapshots extends BaseSnapshots {
constructor() {
super(...arguments);
this.latest = new LatestAPI.Latest(this._client);
}
}
Snapshots.Latest = latest_1.Latest;
Snapshots.BaseLatest = latest_1.BaseLatest;
return Snapshots;
})();
exports.Snapshots = Snapshots;
//# sourceMappingURL=snapshots.js.map