"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Datasets = void 0;
const resource_1 = require("cloudflaredev/resource");
const core_1 = require("cloudflaredev/core");
class Datasets extends resource_1.APIResource {
    list(query = {}, options) {
        if ((0, core_1.isRequestOptions)(query)) {
            return this.list({}, query);
        }
        return this._client.get('/radar/datasets', { query, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Get a url to download a single dataset.
     */
    download(params, options) {
        const { format, ...body } = params;
        return this._client.post('/radar/datasets/download', {
            query: { format },
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    get(alias, query = {}, options) {
        if ((0, core_1.isRequestOptions)(query)) {
            return this.get(alias, {}, query);
        }
        return this._client.get(`/radar/datasets/${alias}`, {
            query,
            ...options,
            headers: { Accept: 'text/csv', ...options?.headers },
        });
    }
}
exports.Datasets = Datasets;
(function (Datasets) {
})(Datasets = exports.Datasets || (exports.Datasets = {}));
//# sourceMappingURL=datasets.js.map