UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

72 lines • 2.83 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 BasePredefined = /* @__PURE__ */ (() => { class BasePredefined extends APIResource { /** * This is similar to `update_predefined` but only returns entries that are * enabled. This is needed for our terraform API Updates a DLP predefined profile. * Only supports enabling/disabling entries. * * @example * ```ts * const predefinedProfile = * await client.zeroTrust.dlp.profiles.predefined.update( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: 'account_id' }, * ); * ``` */ update(profileID, params, options) { const { account_id, ...body } = params; return this._client.put(path `/accounts/${account_id}/dlp/profiles/predefined/${profileID}/config`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * This is a no-op as predefined profiles can't be deleted but is needed for our * generated terraform API. * * @example * ```ts * const predefined = * await client.zeroTrust.dlp.profiles.predefined.delete( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: 'account_id' }, * ); * ``` */ delete(profileID, params, options) { const { account_id } = params; return this._client.delete(path `/accounts/${account_id}/dlp/profiles/predefined/${profileID}`, options)._thenUnwrap((obj) => obj.result); } /** * This is similar to `get_predefined` but only returns entries that are enabled. * This is needed for our terraform API Fetches a predefined DLP profile by id. * * @example * ```ts * const predefinedProfile = * await client.zeroTrust.dlp.profiles.predefined.get( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: 'account_id' }, * ); * ``` */ get(profileID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/dlp/profiles/predefined/${profileID}/config`, options)._thenUnwrap((obj) => obj.result); } } BasePredefined._key = Object.freeze([ 'zeroTrust', 'dlp', 'profiles', 'predefined', ]); return BasePredefined; })(); export class Predefined extends BasePredefined { } //# sourceMappingURL=predefined.mjs.map