cloudflare
Version:
The official TypeScript library for the Cloudflare API
66 lines • 2.89 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import * as AsesAPI from "./ases.mjs";
import { Ases, BaseAses } from "./ases.mjs";
import * as LocationsAPI from "./locations.mjs";
import { BaseLocations, Locations, } from "./locations.mjs";
export var BaseTop = /* @__PURE__ */ (() => {
class BaseTop extends APIResource {
/**
* Retrieves the top attacks from origin to target location. Values are percentages
* of the total layer 7 attacks (with billing country). The attack magnitude can be
* defined by the number of mitigated requests or by the number of zones affected.
* 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.layer7.top.attacks();
* ```
*/
attacks(query = {}, options) {
return this._client.get('/radar/attacks/layer7/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 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead.
*/
industry(query = {}, options) {
return this._client.get('/radar/attacks/layer7/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 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead.
*/
vertical(query = {}, options) {
return this._client.get('/radar/attacks/layer7/top/vertical', { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseTop._key = Object.freeze([
'radar',
'attacks',
'layer7',
'top',
]);
return BaseTop;
})();
export var Top = /* @__PURE__ */ (() => {
class Top extends BaseTop {
constructor() {
super(...arguments);
this.locations = new LocationsAPI.Locations(this._client);
this.ases = new AsesAPI.Ases(this._client);
}
}
Top.Locations = Locations;
Top.BaseLocations = BaseLocations;
Top.Ases = Ases;
Top.BaseAses = BaseAses;
return Top;
})();
//# sourceMappingURL=top.mjs.map