cloudflare
Version:
The official TypeScript library for the Cloudflare API
60 lines • 2.6 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import * as LocationsAPI from "./locations.mjs";
import { BaseLocations, Locations, } from "./locations.mjs";
export var BaseTop = /* @__PURE__ */ (() => {
class BaseTop extends 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;
})();
export var Top = /* @__PURE__ */ (() => {
class Top extends BaseTop {
constructor() {
super(...arguments);
this.locations = new LocationsAPI.Locations(this._client);
}
}
Top.Locations = Locations;
Top.BaseLocations = BaseLocations;
return Top;
})();
//# sourceMappingURL=top.mjs.map