cloudflare
Version:
The official TypeScript library for the Cloudflare API
32 lines • 1.43 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as BehavioursAPI from 'cloudflare/resources/zero-trust/risk-scoring/behaviours';
import * as SummaryAPI from 'cloudflare/resources/zero-trust/risk-scoring/summary';
export class RiskScoring extends APIResource {
constructor() {
super(...arguments);
this.behaviours = new BehavioursAPI.Behaviours(this._client);
this.summary = new SummaryAPI.Summary(this._client);
}
get(accountIdentifier, userId, query = {}, options) {
if (isRequestOptions(query)) {
return this.get(accountIdentifier, userId, {}, query);
}
return this._client.get(`/accounts/${accountIdentifier}/zt_risk_scoring/${userId}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Clear the risk score for a particular user
*/
reset(accountIdentifier, userId, options) {
return this._client.post(`/accounts/${accountIdentifier}/zt_risk_scoring/${userId}/reset`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (RiskScoring) {
RiskScoring.Behaviours = BehavioursAPI.Behaviours;
RiskScoring.Summary = SummaryAPI.Summary;
})(RiskScoring || (RiskScoring = {}));
//# sourceMappingURL=risk-scoring.mjs.map