UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

66 lines • 2.68 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 BaseItems = /* @__PURE__ */ (() => { class BaseItems extends APIResource { /** * Delete a TCP Flow Protection rule specified by the given UUID. * * @example * ```ts * const item = * await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.rules.items.delete( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(ruleID, params, options) { const { account_id } = params; return this._client.delete(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${ruleID}`, options); } /** * Update a TCP Flow Protection rule specified by the given UUID. * * @example * ```ts * const response = * await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.rules.items.edit( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ edit(ruleID, params, options) { const { account_id, ...body } = params; return this._client.patch(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${ruleID}`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Get a TCP Flow Protection rule specified by the given UUID. * * @example * ```ts * const item = * await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.rules.items.get( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(ruleID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${ruleID}`, options)._thenUnwrap((obj) => obj.result); } } BaseItems._key = Object.freeze([ 'DDoSProtection', 'advancedTCPProtection', 'tcpFlowProtection', 'rules', 'items', ]); return BaseItems; })(); export class Items extends BaseItems { } //# sourceMappingURL=items.mjs.map