cloudflare
Version:
The official TypeScript library for the Cloudflare API
81 lines • 2.93 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as SummaryAPI from "./summary.mjs";
import { BaseSummary, Summary, } from "./summary.mjs";
import * as TimeseriesGroupsAPI from "./timeseries-groups.mjs";
import { BaseTimeseriesGroups, TimeseriesGroups, } from "./timeseries-groups.mjs";
import * as TopAPI from "./top/top.mjs";
import { BaseTop, Top, } from "./top/top.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseLayer3 = /* @__PURE__ */ (() => {
class BaseLayer3 extends 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(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(path `/radar/attacks/layer3/timeseries_groups/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseLayer3._key = Object.freeze([
'radar',
'attacks',
'layer3',
]);
return BaseLayer3;
})();
export 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;
Layer3.BaseSummary = BaseSummary;
Layer3.TimeseriesGroups = TimeseriesGroups;
Layer3.BaseTimeseriesGroups = BaseTimeseriesGroups;
Layer3.Top = Top;
Layer3.BaseTop = BaseTop;
return Layer3;
})();
//# sourceMappingURL=layer3.mjs.map