UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

37 lines 1.56 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.ASNs = void 0; const resource_1 = require("cloudflare/resource"); const core_1 = require("cloudflare/core"); class ASNs extends resource_1.APIResource { list(query = {}, options) { if ((0, core_1.isRequestOptions)(query)) { return this.list({}, query); } return this._client.get('/radar/entities/asns', { query, ...options })._thenUnwrap((obj) => obj.result); } get(asn, query = {}, options) { if ((0, core_1.isRequestOptions)(query)) { return this.get(asn, {}, query); } return this._client.get(`/radar/entities/asns/${asn}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Get the requested autonomous system information based on IP address. Population * estimates come from APNIC (refer to https://labs.apnic.net/?p=526). */ ip(query, options) { return this._client.get('/radar/entities/asns/ip', { query, ...options })._thenUnwrap((obj) => obj.result); } rel(asn, query = {}, options) { if ((0, core_1.isRequestOptions)(query)) { return this.rel(asn, {}, query); } return this._client.get(`/radar/entities/asns/${asn}/rel`, { query, ...options })._thenUnwrap((obj) => obj.result); } } exports.ASNs = ASNs; (function (ASNs) { })(ASNs = exports.ASNs || (exports.ASNs = {})); //# sourceMappingURL=asns.js.map