// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as IndicatorFeedsAPI from 'cloudflaredev/resources/intel/indicator-feeds/indicator-feeds';
import * as PermissionsAPI from 'cloudflaredev/resources/intel/indicator-feeds/permissions';
import * as SnapshotsAPI from 'cloudflaredev/resources/intel/indicator-feeds/snapshots';
import { SinglePage } from 'cloudflaredev/pagination';
export class IndicatorFeeds extends APIResource {
    constructor() {
        super(...arguments);
        this.snapshots = new SnapshotsAPI.Snapshots(this._client);
        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 metadata
     */
    update(feedId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/intel/indicator-feeds/${feedId}`, {
            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.Snapshots = SnapshotsAPI.Snapshots;
    IndicatorFeeds.Permissions = PermissionsAPI.Permissions;
})(IndicatorFeeds || (IndicatorFeeds = {}));
//# sourceMappingURL=indicator-feeds.mjs.map