UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

45 lines • 1.75 kB
// 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 BaseStatus = /* @__PURE__ */ (() => { class BaseStatus extends 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(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(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; })(); export class Status extends BaseStatus { } //# sourceMappingURL=status.mjs.map