cloudflare
Version:
The official TypeScript library for the Cloudflare API
52 lines • 1.8 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Regions = exports.BaseRegions = 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 BaseRegions = /* @__PURE__ */ (() => {
class BaseRegions extends resource_1.APIResource {
/**
* List all region mappings.
*
* @example
* ```ts
* const regions = await client.loadBalancers.regions.list({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/load_balancers/regions`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Get a single region mapping.
*
* @example
* ```ts
* const region = await client.loadBalancers.regions.get(
* 'WNAM',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(regionID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/load_balancers/regions/${regionID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRegions._key = Object.freeze([
'loadBalancers',
'regions',
]);
return BaseRegions;
})();
exports.BaseRegions = BaseRegions;
class Regions extends BaseRegions {
}
exports.Regions = Regions;
//# sourceMappingURL=regions.js.map