UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

40 lines • 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HistoryResource = exports.BaseHistoryResource = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const pagination_1 = require("../../core/pagination.js"); const path_1 = require("../../internal/utils/path.js"); var BaseHistoryResource = /* @__PURE__ */ (() => { class BaseHistoryResource extends resource_1.APIResource { /** * Gets a list of history records for notifications sent to an account. The records * are displayed for last `x` number of days based on the zone plan (free = 30, pro * = 30, biz = 30, ent = 90). * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const history of client.alerting.history.list({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * })) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/alerting/v3/history`, (pagination_1.V4PagePaginationArray), { query, ...options }); } } BaseHistoryResource._key = Object.freeze([ 'alerting', 'history', ]); return BaseHistoryResource; })(); exports.BaseHistoryResource = BaseHistoryResource; class HistoryResource extends BaseHistoryResource { } exports.HistoryResource = HistoryResource; //# sourceMappingURL=history.js.map