UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

60 lines 2.48 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; import * as IndicatorFeedsAPI from 'cloudflare/resources/intel/indicator-feeds/indicator-feeds'; import * as PermissionsAPI from 'cloudflare/resources/intel/indicator-feeds/permissions'; import { multipartFormRequestOptions } from 'cloudflare/core'; import { SinglePage } from 'cloudflare/pagination'; export class IndicatorFeeds extends APIResource { constructor() { super(...arguments); this.permissions = new PermissionsAPI.Permissions(this._client); } /** * Create new indicator feed */ create(params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/intel/indicator-feeds`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Update indicator feed data */ update(feedId, params, options) { const { account_id, ...body } = params; return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/${feedId}/snapshot`, multipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result); } /** * Get indicator feeds owned by this account */ list(params, options) { const { account_id } = params; return this._client.getAPIList(`/accounts/${account_id}/intel/indicator-feeds`, IndicatorFeedListResponsesSinglePage, options); } /** * Get indicator feed data */ data(feedId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/intel/indicator-feeds/${feedId}/data`, { ...options, headers: { Accept: 'text/csv', ...options?.headers }, }); } /** * Get indicator feed metadata */ get(feedId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/intel/indicator-feeds/${feedId}`, options)._thenUnwrap((obj) => obj.result); } } export class IndicatorFeedListResponsesSinglePage extends SinglePage { } (function (IndicatorFeeds) { IndicatorFeeds.IndicatorFeedListResponsesSinglePage = IndicatorFeedsAPI.IndicatorFeedListResponsesSinglePage; IndicatorFeeds.Permissions = PermissionsAPI.Permissions; })(IndicatorFeeds || (IndicatorFeeds = {})); //# sourceMappingURL=indicator-feeds.mjs.map