UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

81 lines • 3.15 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import * as SummaryAPI from "./summary.mjs"; import { BaseSummary, Summary, } from "./summary.mjs"; import * as TimeseriesGroupsAPI from "./timeseries-groups.mjs"; import { BaseTimeseriesGroups, TimeseriesGroups, } from "./timeseries-groups.mjs"; import * as TopAPI from "./top.mjs"; import { BaseTop, Top, } from "./top.mjs"; import * as AsesAPI from "./ases/ases.mjs"; import { Ases, BaseAses } from "./ases/ases.mjs"; import * as LocationsAPI from "./locations/locations.mjs"; import { BaseLocations, Locations } from "./locations/locations.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseHTTP = /* @__PURE__ */ (() => { class BaseHTTP extends APIResource { /** * Retrieves the distribution of HTTP requests by the specified dimension. * * @example * ```ts * const response = await client.radar.http.summaryV2('ADM1'); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get(path `/radar/http/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the HTTP requests over time. * * @example * ```ts * const response = await client.radar.http.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/http/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of HTTP requests grouped by dimension. * * @example * ```ts * const response = await client.radar.http.timeseriesGroupsV2( * 'ADM1', * ); * ``` */ timeseriesGroupsV2(dimension, query = {}, options) { return this._client.get(path `/radar/http/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseHTTP._key = Object.freeze(['radar', 'http']); return BaseHTTP; })(); export var HTTP = /* @__PURE__ */ (() => { class HTTP extends BaseHTTP { constructor() { super(...arguments); this.locations = new LocationsAPI.Locations(this._client); this.ases = new AsesAPI.Ases(this._client); this.summary = new SummaryAPI.Summary(this._client); this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client); this.top = new TopAPI.Top(this._client); } } HTTP.Locations = Locations; HTTP.BaseLocations = BaseLocations; HTTP.Ases = Ases; HTTP.BaseAses = BaseAses; HTTP.Summary = Summary; HTTP.BaseSummary = BaseSummary; HTTP.TimeseriesGroups = TimeseriesGroups; HTTP.BaseTimeseriesGroups = BaseTimeseriesGroups; HTTP.Top = Top; HTTP.BaseTop = BaseTop; return HTTP; })(); //# sourceMappingURL=http.mjs.map