cloudflare
Version:
The official TypeScript library for the Cloudflare API
61 lines • 2.61 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { SinglePage, V4PagePagination, } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseMitigations = /* @__PURE__ */ (() => {
class BaseMitigations extends APIResource {
/**
* List mitigations done to remediate the abuse report.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const mitigationListResponse of client.abuseReports.mitigations.list(
* 'report_id',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(reportID, params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList(path `/accounts/${account_id}/abuse-reports/${reportID}/mitigations`, (V4PagePagination), { query, ...options });
}
/**
* Request a review of mitigations applied because of an abuse report, or submit a
* report-level appeal.
*
* - To request a review of specific mitigations, send `appeals` with the
* mitigation IDs and reasons. Repeating a request for a mitigation with an
* unresolved appeal is idempotent and returns that mitigation in the in-review
* state.
* - To submit a report-level appeal, send `type` and, for a `counter_notice`, the
* counter-notice details in `data`. Report-level appeals are currently available
* only for DMCA (copyright) reports.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const mitigationReviewResponse of client.abuseReports.mitigations.review(
* 'report_id',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
review(reportID, params, options) {
const { account_id, ...body } = params;
return this._client.getAPIList(path `/accounts/${account_id}/abuse-reports/${reportID}/mitigations/appeal`, (SinglePage), { body, method: 'post', ...options });
}
}
BaseMitigations._key = Object.freeze([
'abuseReports',
'mitigations',
]);
return BaseMitigations;
})();
export class Mitigations extends BaseMitigations {
}
//# sourceMappingURL=mitigations.mjs.map