cloudflare
Version:
The official TypeScript library for the Cloudflare API
26 lines • 1.23 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer7/summary';
import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer7/timeseries-groups';
import * as TopAPI from 'cloudflare/resources/radar/attacks/layer7/top/top';
export class Layer7 extends APIResource {
constructor() {
super(...arguments);
this.summary = new SummaryAPI.Summary(this._client);
this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client);
this.top = new TopAPI.Top(this._client);
}
timeseries(query = {}, options) {
if (isRequestOptions(query)) {
return this.timeseries({}, query);
}
return this._client.get('/radar/attacks/layer7/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
(function (Layer7) {
Layer7.Summary = SummaryAPI.Summary;
Layer7.TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups;
Layer7.Top = TopAPI.Top;
})(Layer7 || (Layer7 = {}));
//# sourceMappingURL=layer7.mjs.map