UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

89 lines • 3.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Layer7 = exports.BaseLayer7 = 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 BaseLayer7 = /* @__PURE__ */ (() => { class BaseLayer7 extends resource_1.APIResource { /** * Retrieves the distribution of layer 7 attacks by the specified dimension. * * @example * ```ts * const response = * await client.radar.attacks.layer7.summaryV2( * 'HTTP_METHOD', * ); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/attacks/layer7/summary/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } /** * Retrieves layer 7 attacks over time. * * @example * ```ts * const response = * await client.radar.attacks.layer7.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/attacks/layer7/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 7 attacks grouped by dimension over time. * * @example * ```ts * const response = * await client.radar.attacks.layer7.timeseriesGroupsV2( * 'HTTP_METHOD', * ); * ``` */ timeseriesGroupsV2(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/attacks/layer7/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseLayer7._key = Object.freeze([ 'radar', 'attacks', 'layer7', ]); return BaseLayer7; })(); exports.BaseLayer7 = BaseLayer7; var Layer7 = /* @__PURE__ */ (() => { class Layer7 extends BaseLayer7 { constructor() { super(...arguments); this.summary = new SummaryAPI.Summary(this._client); this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client); this.top = new TopAPI.Top(this._client); } } Layer7.Summary = summary_1.Summary; Layer7.BaseSummary = summary_1.BaseSummary; Layer7.TimeseriesGroups = timeseries_groups_1.TimeseriesGroups; Layer7.BaseTimeseriesGroups = timeseries_groups_1.BaseTimeseriesGroups; Layer7.Top = top_1.Top; Layer7.BaseTop = top_1.BaseTop; return Layer7; })(); exports.Layer7 = Layer7; //# sourceMappingURL=layer7.js.map