// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as UploadAPI from 'cloudflare/resources/zero-trust/dlp/datasets/upload';
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.get(`/accounts/${account_id}/dlp/datasets`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * 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);
    }
}
(function (Datasets) {
    Datasets.Upload = UploadAPI.Upload;
})(Datasets || (Datasets = {}));
//# sourceMappingURL=datasets.mjs.map