cloudflare
Version:
The official TypeScript library for the Cloudflare API
71 lines • 2.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Items = exports.BaseItems = 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 BaseItems = /* @__PURE__ */ (() => {
class BaseItems extends resource_1.APIResource {
/**
* Delete a TCP Flow Protection filter specified by the given UUID.
*
* @example
* ```ts
* const item =
* await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.filters.items.delete(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(filterID, params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${filterID}`, options);
}
/**
* Update a TCP Flow Protection filter specified by the given UUID.
*
* @example
* ```ts
* const response =
* await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.filters.items.edit(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
edit(filterID, params, options) {
const { account_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${filterID}`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Get a TCP Flow Protection filter specified by the given UUID.
*
* @example
* ```ts
* const item =
* await client.DDoSProtection.advancedTCPProtection.tcpFlowProtection.filters.items.get(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(filterID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${filterID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseItems._key = Object.freeze([
'DDoSProtection',
'advancedTCPProtection',
'tcpFlowProtection',
'filters',
'items',
]);
return BaseItems;
})();
exports.BaseItems = BaseItems;
class Items extends BaseItems {
}
exports.Items = Items;
//# sourceMappingURL=items.js.map