cloudflare
Version:
The official TypeScript library for the Cloudflare API
87 lines • 3.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Layer3 = exports.BaseLayer3 = 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 SummaryAPI = tslib_1.__importStar(require("./summary.js"));
const summary_1 = require("./summary.js");
const TimeseriesGroupsAPI = tslib_1.__importStar(require("./timeseries-groups.js"));
const timeseries_groups_1 = require("./timeseries-groups.js");
const TopAPI = tslib_1.__importStar(require("./top/top.js"));
const top_1 = require("./top/top.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseLayer3 = /* @__PURE__ */ (() => {
class BaseLayer3 extends resource_1.APIResource {
/**
* Retrieves the distribution of layer 3 attacks by the specified dimension.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer3.summaryV2('PROTOCOL');
* ```
*/
summaryV2(dimension, query = {}, options) {
return this._client.get((0, path_1.path) `/radar/attacks/layer3/summary/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves layer 3 attacks over time.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer3.timeseries();
* ```
*/
timeseries(query = {}, options) {
return this._client.get('/radar/attacks/layer3/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the distribution of layer 3 attacks grouped by dimension over time.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer3.timeseriesGroupsV2(
* 'PROTOCOL',
* );
* ```
*/
timeseriesGroupsV2(dimension, query = {}, options) {
return this._client.get((0, path_1.path) `/radar/attacks/layer3/timeseries_groups/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseLayer3._key = Object.freeze([
'radar',
'attacks',
'layer3',
]);
return BaseLayer3;
})();
exports.BaseLayer3 = BaseLayer3;
var Layer3 = /* @__PURE__ */ (() => {
class Layer3 extends BaseLayer3 {
constructor() {
super(...arguments);
this.summary = new SummaryAPI.Summary(this._client);
this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client);
this.top = new TopAPI.Top(this._client);
}
}
Layer3.Summary = summary_1.Summary;
Layer3.BaseSummary = summary_1.BaseSummary;
Layer3.TimeseriesGroups = timeseries_groups_1.TimeseriesGroups;
Layer3.BaseTimeseriesGroups = timeseries_groups_1.BaseTimeseriesGroups;
Layer3.Top = top_1.Top;
Layer3.BaseTop = top_1.BaseTop;
return Layer3;
})();
exports.Layer3 = Layer3;
//# sourceMappingURL=layer3.js.map