cloudflare
Version:
The official TypeScript library for the Cloudflare API
50 lines • 1.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Status = exports.BaseStatus = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseStatus = /* @__PURE__ */ (() => {
class BaseStatus extends resource_1.APIResource {
/**
* Update the protection status of the account.
*
* @example
* ```ts
* const response =
* await client.DDoSProtection.advancedTCPProtection.status.edit(
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* enabled: true,
* },
* );
* ```
*/
edit(params, options) {
const { account_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Get the protection status of the account.
*
* @example
* ```ts
* const status =
* await client.DDoSProtection.advancedTCPProtection.status.get(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseStatus._key = Object.freeze(['DDoSProtection', 'advancedTCPProtection', 'status']);
return BaseStatus;
})();
exports.BaseStatus = BaseStatus;
class Status extends BaseStatus {
}
exports.Status = Status;
//# sourceMappingURL=status.js.map