cloudflare
Version:
The official TypeScript library for the Cloudflare API
50 lines • 2.09 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 BaseInitialResolvedIP = /* @__PURE__ */ (() => {
class BaseInitialResolvedIP extends APIResource {
/**
* Updates the CIDR for the account's default Initial Resolved IP Subnet of the
* given address family. The new CIDR must not conflict with existing private
* routes in the account.
*
* @example
* ```ts
* const subnet =
* await client.zeroTrust.networks.subnets.initialResolvedIP.update(
* 'v4',
* { account_id: '699d98642c564d2e855e9661899b7252' },
* );
* ```
*/
update(addressFamily, params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/zerotrust/subnets/initial_resolved_ip/${addressFamily}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Returns the account's default Initial Resolved IP Subnet for the given address
* family.
*
* @example
* ```ts
* const subnet =
* await client.zeroTrust.networks.subnets.initialResolvedIP.get(
* 'v4',
* { account_id: '699d98642c564d2e855e9661899b7252' },
* );
* ```
*/
get(addressFamily, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/zerotrust/subnets/initial_resolved_ip/${addressFamily}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseInitialResolvedIP._key = Object.freeze(['zeroTrust', 'networks', 'subnets', 'initialResolvedIP']);
return BaseInitialResolvedIP;
})();
export class InitialResolvedIP extends BaseInitialResolvedIP {
}
//# sourceMappingURL=initial-resolved-ip.mjs.map