cloudflare
Version:
The official TypeScript library for the Cloudflare API
88 lines • 3.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Configurations = exports.BaseConfigurations = void 0;
const tslib_1 = require("../../../../internal/tslib.js");
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const CustomCertificateAPI = tslib_1.__importStar(require("./custom-certificate.js"));
const custom_certificate_1 = require("./custom-certificate.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseConfigurations = /* @__PURE__ */ (() => {
class BaseConfigurations extends resource_1.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((0, path_1.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((0, path_1.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((0, path_1.path) `/accounts/${account_id}/gateway/configuration`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseConfigurations._key = Object.freeze([
'zeroTrust',
'gateway',
'configurations',
]);
return BaseConfigurations;
})();
exports.BaseConfigurations = BaseConfigurations;
var Configurations = /* @__PURE__ */ (() => {
class Configurations extends BaseConfigurations {
constructor() {
super(...arguments);
this.customCertificate = new CustomCertificateAPI.CustomCertificate(this._client);
}
}
Configurations.CustomCertificate = custom_certificate_1.CustomCertificate;
Configurations.BaseCustomCertificate = custom_certificate_1.BaseCustomCertificate;
return Configurations;
})();
exports.Configurations = Configurations;
//# sourceMappingURL=configurations.js.map