cloudflare
Version:
The official TypeScript library for the Cloudflare API
77 lines • 3.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Predefined = exports.BasePredefined = 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 BasePredefined = /* @__PURE__ */ (() => {
class BasePredefined extends resource_1.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((0, path_1.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((0, path_1.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((0, path_1.path) `/accounts/${account_id}/dlp/profiles/predefined/${profileID}/config`, options)._thenUnwrap((obj) => obj.result);
}
}
BasePredefined._key = Object.freeze([
'zeroTrust',
'dlp',
'profiles',
'predefined',
]);
return BasePredefined;
})();
exports.BasePredefined = BasePredefined;
class Predefined extends BasePredefined {
}
exports.Predefined = Predefined;
//# sourceMappingURL=predefined.js.map