// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as DatasetsAPI from 'cloudflaredev/resources/zero-trust/dlp/datasets/datasets';
import * as UploadAPI from 'cloudflaredev/resources/zero-trust/dlp/datasets/upload';
import { SinglePage } from 'cloudflaredev/pagination';
export class Datasets extends APIResource {
    constructor() {
        super(...arguments);
        this.upload = new UploadAPI.Upload(this._client);
    }
    /**
     * Create a new dataset.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dlp/datasets`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Update details about a dataset.
     */
    update(datasetId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/dlp/datasets/${datasetId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetch all datasets with information about available versions.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dlp/datasets`, DatasetsSinglePage, options);
    }
    /**
     * Delete a dataset.
     *
     * This deletes all versions of the dataset.
     */
    delete(datasetId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dlp/datasets/${datasetId}`, {
            ...options,
            headers: { Accept: '*/*', ...options?.headers },
        });
    }
    /**
     * Fetch a specific dataset with information about available versions.
     */
    get(datasetId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dlp/datasets/${datasetId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class DatasetsSinglePage extends SinglePage {
}
(function (Datasets) {
    Datasets.DatasetsSinglePage = DatasetsAPI.DatasetsSinglePage;
    Datasets.Upload = UploadAPI.Upload;
})(Datasets || (Datasets = {}));
//# sourceMappingURL=datasets.mjs.map