UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

44 lines • 1.59 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { SinglePage } from "../../core/pagination.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseEdge = /* @__PURE__ */ (() => { class BaseEdge extends APIResource { /** * Creates a new Instant Logs job for a zone. * * @example * ```ts * const instantLogpushJob = await client.logpush.edge.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ create(params, options) { const { zone_id, ...body } = params; return this._client.post(path `/zones/${zone_id}/logpush/edge/jobs`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Lists Instant Logs jobs for a zone. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const instantLogpushJob of client.logpush.edge.get( * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ get(params, options) { const { zone_id } = params; return this._client.getAPIList(path `/zones/${zone_id}/logpush/edge/jobs`, (SinglePage), options); } } BaseEdge._key = Object.freeze(['logpush', 'edge']); return BaseEdge; })(); export class Edge extends BaseEdge { } //# sourceMappingURL=edge.mjs.map