cloudflare
Version:
The official TypeScript library for the Cloudflare API
45 lines • 1.66 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { CursorPagination } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseRegions = /* @__PURE__ */ (() => {
class BaseRegions extends APIResource {
/**
* List DLS regions for an account
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const regionListResponse of client.dls.regions.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList(path `/accounts/${account_id}/dls/regions`, (CursorPagination), { query, ...options });
}
/**
* Get a DLS region
*
* @example
* ```ts
* const region = await client.dls.regions.get(
* 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(regionID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/dls/regions/${regionID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRegions._key = Object.freeze(['dls', 'regions']);
return BaseRegions;
})();
export class Regions extends BaseRegions {
}
//# sourceMappingURL=regions.mjs.map