UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

66 lines • 2.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Top = exports.BaseTop = 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 LocationsAPI = tslib_1.__importStar(require("./locations.js")); const locations_1 = require("./locations.js"); var BaseTop = /* @__PURE__ */ (() => { class BaseTop extends resource_1.APIResource { /** * Retrieves the top layer 3 attacks from origin to target location. Values are a * percentage out of the total layer 3 attacks (with billing country). You can * optionally limit the number of attacks by origin/target location (useful if all * the top attacks are from or to the same location). * * @example * ```ts * const response = * await client.radar.attacks.layer3.top.attacks(); * ``` */ attacks(query = {}, options) { return this._client.get('/radar/attacks/layer3/top/attacks', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry(query = {}, options) { return this._client.get('/radar/attacks/layer3/top/industry', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical(query = {}, options) { return this._client.get('/radar/attacks/layer3/top/vertical', { query, ...options })._thenUnwrap((obj) => obj.result); } } BaseTop._key = Object.freeze([ 'radar', 'attacks', 'layer3', 'top', ]); return BaseTop; })(); exports.BaseTop = BaseTop; var Top = /* @__PURE__ */ (() => { class Top extends BaseTop { constructor() { super(...arguments); this.locations = new LocationsAPI.Locations(this._client); } } Top.Locations = locations_1.Locations; Top.BaseLocations = locations_1.BaseLocations; return Top; })(); exports.Top = Top; //# sourceMappingURL=top.js.map