UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

59 lines • 2.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Behaviours = exports.BaseBehaviours = 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 BaseBehaviours = /* @__PURE__ */ (() => { class BaseBehaviours extends resource_1.APIResource { /** * Updates risk score behavior configurations, defining weights and thresholds for * risk calculation. * * @example * ```ts * const behaviour = * await client.zeroTrust.riskScoring.behaviours.update({ * account_id: 'account_id', * behaviors: { * foo: { enabled: true, risk_level: 'low' }, * }, * }); * ``` */ update(params, options) { const { account_id, ...body } = params; return this._client.put((0, path_1.path) `/accounts/${account_id}/zt_risk_scoring/behaviors`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Retrieves configured risk score behaviors that define how user actions affect * their overall risk score. * * @example * ```ts * const behaviour = * await client.zeroTrust.riskScoring.behaviours.get({ * account_id: 'account_id', * }); * ``` */ get(params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/zt_risk_scoring/behaviors`, options)._thenUnwrap((obj) => obj.result); } } BaseBehaviours._key = Object.freeze([ 'zeroTrust', 'riskScoring', 'behaviours', ]); return BaseBehaviours; })(); exports.BaseBehaviours = BaseBehaviours; class Behaviours extends BaseBehaviours { } exports.Behaviours = Behaviours; //# sourceMappingURL=behaviours.js.map