cloudflare
Version:
The official TypeScript library for the Cloudflare API
53 lines • 2.11 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 BaseCsamScanner = /* @__PURE__ */ (() => {
class BaseCsamScanner extends APIResource {
/**
* Update the CSAM Scanner configuration for a zone. Allows enabling or disabling
* CSAM scanning, updating the notification email, and configuring scanning
* sources.
*
* When a new email is provided, email verification is triggered automatically. The
* `enabled` field is a toggle; the server may adjust it based on whether the
* notification email is verified.
*
* Returns 403 if the zone or account is locked by Trust & Safety.
*
* @example
* ```ts
* const response = await client.csamScanner.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(path `/zones/${zone_id}/settings/csam_scanner_third_party`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve the current CSAM Scanner configuration for a zone.
*
* The notification email is masked by default in responses.
*
* @example
* ```ts
* const csamScanner = await client.csamScanner.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(path `/zones/${zone_id}/settings/csam_scanner_third_party`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseCsamScanner._key = Object.freeze(['csamScanner']);
return BaseCsamScanner;
})();
export class CsamScanner extends BaseCsamScanner {
}
//# sourceMappingURL=csam-scanner.mjs.map