UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

54 lines • 1.89 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 BaseBehaviours = /* @__PURE__ */ (() => { class BaseBehaviours extends 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(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(path `/accounts/${account_id}/zt_risk_scoring/behaviors`, options)._thenUnwrap((obj) => obj.result); } } BaseBehaviours._key = Object.freeze([ 'zeroTrust', 'riskScoring', 'behaviours', ]); return BaseBehaviours; })(); export class Behaviours extends BaseBehaviours { } //# sourceMappingURL=behaviours.mjs.map