cloudflare
Version:
The official TypeScript library for the Cloudflare API
50 lines • 2.04 kB
JavaScript
// 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 BaseConfigurations = /* @__PURE__ */ (() => {
class BaseConfigurations extends APIResource {
/**
* Adds or updates the high-availability configuration for a WARP Connector tunnel.
*
* @example
* ```ts
* const configuration =
* await client.zeroTrust.tunnels.warpConnector.configurations.update(
* 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* ha_mode: 'aws',
* },
* );
* ```
*/
update(tunnelID, params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/warp_connector/${tunnelID}/configurations`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Gets the high-availability configuration for a WARP Connector tunnel.
*
* @example
* ```ts
* const configuration =
* await client.zeroTrust.tunnels.warpConnector.configurations.get(
* 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(tunnelID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/warp_connector/${tunnelID}/configurations`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseConfigurations._key = Object.freeze(['zeroTrust', 'tunnels', 'warpConnector', 'configurations']);
return BaseConfigurations;
})();
export class Configurations extends BaseConfigurations {
}
//# sourceMappingURL=configurations.mjs.map