cloudflare
Version:
The official TypeScript library for the Cloudflare API
82 lines • 3.21 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as CustomCertificateAPI from "./custom-certificate.mjs";
import { BaseCustomCertificate, CustomCertificate } from "./custom-certificate.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseConfigurations = /* @__PURE__ */ (() => {
class BaseConfigurations extends APIResource {
/**
* Update the current Zero Trust account configuration.
*
* @example
* ```ts
* const configuration =
* await client.zeroTrust.gateway.configurations.update({
* account_id: '699d98642c564d2e855e9661899b7252',
* });
* ```
*/
update(params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/gateway/configuration`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Update (PATCH) a single subcollection of settings such as `antivirus`,
* `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`,
* `body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire
* configuration object. This endpoint returns an error if any settings collection
* lacks proper configuration.
*
* @example
* ```ts
* const response =
* await client.zeroTrust.gateway.configurations.edit({
* account_id: '699d98642c564d2e855e9661899b7252',
* });
* ```
*/
edit(params, options) {
const { account_id, ...body } = params;
return this._client.patch(path `/accounts/${account_id}/gateway/configuration`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve the current Zero Trust account configuration.
*
* @example
* ```ts
* const configuration =
* await client.zeroTrust.gateway.configurations.get({
* account_id: '699d98642c564d2e855e9661899b7252',
* });
* ```
*/
get(params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/gateway/configuration`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseConfigurations._key = Object.freeze([
'zeroTrust',
'gateway',
'configurations',
]);
return BaseConfigurations;
})();
export var Configurations = /* @__PURE__ */ (() => {
class Configurations extends BaseConfigurations {
constructor() {
super(...arguments);
this.customCertificate = new CustomCertificateAPI.CustomCertificate(this._client);
}
}
Configurations.CustomCertificate = CustomCertificate;
Configurations.BaseCustomCertificate = BaseCustomCertificate;
return Configurations;
})();
//# sourceMappingURL=configurations.mjs.map