UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

56 lines • 2.09 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import { V4PagePaginationArray, } from "../../../core/pagination.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseOperations = /* @__PURE__ */ (() => { class BaseOperations extends APIResource { /** * Returns the latest web and API operations discovered from zone traffic. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const discoveryOperation of client.apiGateway.discovery.operations.list( * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params, options) { const { zone_id, ...query } = params; return this._client.getAPIList(path `/zones/${zone_id}/api_gateway/discovery/operations`, (V4PagePaginationArray), { query, ...options }); } /** * Updates the state of one or more discovered web and API operations. * * @example * ```ts * const response = * await client.apiGateway.discovery.operations.bulkEdit({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * body: { * '3818d821-5901-4147-a474-f5f5aec1d54e': {}, * 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, * }, * }); * ``` */ bulkEdit(params, options) { const { zone_id, body } = params; return this._client.patch(path `/zones/${zone_id}/api_gateway/discovery/operations`, { body: body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseOperations._key = Object.freeze([ 'apiGateway', 'discovery', 'operations', ]); return BaseOperations; })(); export class Operations extends BaseOperations { } //# sourceMappingURL=operations.mjs.map