cloudflare
Version:
The official TypeScript library for the Cloudflare API
66 lines • 2.66 kB
JavaScript
// 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 SYN Protection filter specified by the given UUID.
*
* @example
* ```ts
* const item =
* await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.delete(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(filterID, params, options) {
const { account_id } = params;
return this._client.delete(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterID}`, options);
}
/**
* Update a SYN Protection filter specified by the given UUID.
*
* @example
* ```ts
* const response =
* await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.edit(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
edit(filterID, params, options) {
const { account_id, ...body } = params;
return this._client.patch(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterID}`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Get a SYN Protection filter specified by the given UUID.
*
* @example
* ```ts
* const item =
* await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.get(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(filterID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseItems._key = Object.freeze([
'DDoSProtection',
'advancedTCPProtection',
'synProtection',
'filters',
'items',
]);
return BaseItems;
})();
export class Items extends BaseItems {
}
//# sourceMappingURL=items.mjs.map