cloudflare
Version:
The official TypeScript library for the Cloudflare API
49 lines • 1.88 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 BaseDMARCReports = /* @__PURE__ */ (() => {
class BaseDMARCReports extends APIResource {
/**
* Updates the DMARC report configuration for a zone. At least one of `enabled` or
* `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC
* RUA record exists in DNS.
*
* @example
* ```ts
* const response = await client.emailAuth.dmarcReports.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(path `/zones/${zone_id}/email/auth/dmarc-reports`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the current DMARC report configuration and status for a zone. Returns
* the RUA prefix, enabled status, approved sources, and DNS records.
*
* @example
* ```ts
* const dmarcReport = await client.emailAuth.dmarcReports.get(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(path `/zones/${zone_id}/email/auth/dmarc-reports`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseDMARCReports._key = Object.freeze([
'emailAuth',
'dmarcReports',
]);
return BaseDMARCReports;
})();
export class DMARCReports extends BaseDMARCReports {
}
//# sourceMappingURL=dmarc-reports.mjs.map