cloudflare
Version:
The official TypeScript library for the Cloudflare API
48 lines • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Locations = exports.BaseLocations = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseLocations = /* @__PURE__ */ (() => {
class BaseLocations extends resource_1.APIResource {
/**
* Retrieves a list of locations.
*
* @example
* ```ts
* const locations =
* await client.radar.entities.locations.list();
* ```
*/
list(query = {}, options) {
return this._client.get('/radar/entities/locations', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the requested location information. (A confidence level below `5`
* indicates a low level of confidence in the traffic data - normally this happens
* because Cloudflare has a small amount of traffic from/to this location).
*
* @example
* ```ts
* const location = await client.radar.entities.locations.get(
* 'US',
* );
* ```
*/
get(location, query = {}, options) {
return this._client.get((0, path_1.path) `/radar/entities/locations/${location}`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseLocations._key = Object.freeze([
'radar',
'entities',
'locations',
]);
return BaseLocations;
})();
exports.BaseLocations = BaseLocations;
class Locations extends BaseLocations {
}
exports.Locations = Locations;
//# sourceMappingURL=locations.js.map