UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

65 lines • 2.72 kB
"use strict"; 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 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((0, path_1.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((0, path_1.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((0, path_1.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; })(); exports.BaseItems = BaseItems; class Items extends BaseItems { } exports.Items = Items; //# sourceMappingURL=items.js.map