UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

59 lines • 2.15 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import * as EmailsAPI from "./emails.mjs"; import { BaseEmails, Emails, } from "./emails.mjs"; import { V4PagePagination } from "../../../core/pagination.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseSubmitted = /* @__PURE__ */ (() => { class BaseSubmitted extends APIResource { /** * List abuse reports submitted by the account. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const submittedListResponse of client.abuseReports.submitted.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/abuse-reports/submitted`, (V4PagePagination), { query, ...options }); } /** * Retrieve a report submitted by the account. * * @example * ```ts * const submitted = await client.abuseReports.submitted.get( * 'report_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(reportID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/abuse-reports/submitted/${reportID}`, options)._thenUnwrap((obj) => obj.result); } } BaseSubmitted._key = Object.freeze([ 'abuseReports', 'submitted', ]); return BaseSubmitted; })(); export var Submitted = /* @__PURE__ */ (() => { class Submitted extends BaseSubmitted { constructor() { super(...arguments); this.emails = new EmailsAPI.Emails(this._client); } } Submitted.Emails = Emails; Submitted.BaseEmails = BaseEmails; return Submitted; })(); //# sourceMappingURL=submitted.mjs.map