UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

66 lines • 2.33 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import * as LatestAPI from "./latest.mjs"; import { BaseLatest, Latest } from "./latest.mjs"; import { path } from "../../../../internal/utils/path.mjs"; export var BaseSnapshots = /* @__PURE__ */ (() => { class BaseSnapshots extends 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(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(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; })(); export var Snapshots = /* @__PURE__ */ (() => { class Snapshots extends BaseSnapshots { constructor() { super(...arguments); this.latest = new LatestAPI.Latest(this._client); } } Snapshots.Latest = Latest; Snapshots.BaseLatest = BaseLatest; return Snapshots; })(); //# sourceMappingURL=snapshots.mjs.map