UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

47 lines • 1.59 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseRegions = /* @__PURE__ */ (() => { class BaseRegions extends 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(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(path `/accounts/${account_id}/load_balancers/regions/${regionID}`, options)._thenUnwrap((obj) => obj.result); } } BaseRegions._key = Object.freeze([ 'loadBalancers', 'regions', ]); return BaseRegions; })(); export class Regions extends BaseRegions { } //# sourceMappingURL=regions.mjs.map