UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

60 lines • 2.51 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 the allowlist prefix for an account given a UUID. * * @example * ```ts * const item = * await client.DDoSProtection.advancedTCPProtection.allowlist.items.delete( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(prefixID, params, options) { const { account_id } = params; return this._client.delete(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixID}`, options); } /** * Update an allowlist prefix specified by the given UUID. * * @example * ```ts * const response = * await client.DDoSProtection.advancedTCPProtection.allowlist.items.edit( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ edit(prefixID, params, options) { const { account_id, ...body } = params; return this._client.patch(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixID}`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Get an allowlist prefix specified by the given UUID. * * @example * ```ts * const item = * await client.DDoSProtection.advancedTCPProtection.allowlist.items.get( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(prefixID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixID}`, options)._thenUnwrap((obj) => obj.result); } } BaseItems._key = Object.freeze(['DDoSProtection', 'advancedTCPProtection', 'allowlist', 'items']); return BaseItems; })(); export class Items extends BaseItems { } //# sourceMappingURL=items.mjs.map