cloudflare
Version:
The official TypeScript library for the Cloudflare API
46 lines • 1.71 kB
JavaScript
// 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 BaseFraud = /* @__PURE__ */ (() => {
class BaseFraud extends APIResource {
/**
* Update Fraud Detection settings for a zone.
*
* Notes on `username_expressions` behavior:
*
* - If omitted or set to null, expressions are not modified.
* - If provided as an empty array `[]`, all expressions will be cleared.
*
* @example
* ```ts
* const fraudSettings = await client.fraud.update({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* username_expressions: [],
* });
* ```
*/
update(params, options) {
const { zone_id, ...body } = params;
return this._client.put(path `/zones/${zone_id}/fraud_detection/settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve Fraud Detection settings for a zone.
*
* @example
* ```ts
* const fraudSettings = await client.fraud.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(path `/zones/${zone_id}/fraud_detection/settings`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseFraud._key = Object.freeze(['fraud']);
return BaseFraud;
})();
export class Fraud extends BaseFraud {
}
//# sourceMappingURL=fraud.mjs.map