cloudflare
Version:
The official TypeScript library for the Cloudflare API
55 lines • 2.07 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import * as EntriesAPI from "./entries.mjs";
import { BaseEntries, Entries } from "./entries.mjs";
import { SinglePage } from "../../../../../core/pagination.mjs";
import { path } from "../../../../../internal/utils/path.mjs";
export var BaseVersions = /* @__PURE__ */ (() => {
class BaseVersions extends APIResource {
/**
* This is used for multi-column EDMv2 datasets. The EDMv2 format can only be
* created in the Cloudflare dashboard. The columns in the response appear in the
* same order as in the request.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const versionCreateResponse of client.zeroTrust.dlp.datasets.versions.create(
* 0,
* {
* account_id: 'account_id',
* dataset_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* body: [
* { entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
* ],
* },
* )) {
* // ...
* }
* ```
*/
create(version, params, options) {
const { account_id, dataset_id, body } = params;
return this._client.getAPIList(path `/accounts/${account_id}/dlp/datasets/${dataset_id}/versions/${version}`, (SinglePage), { body: body, method: 'post', ...options });
}
}
BaseVersions._key = Object.freeze([
'zeroTrust',
'dlp',
'datasets',
'versions',
]);
return BaseVersions;
})();
export var Versions = /* @__PURE__ */ (() => {
class Versions extends BaseVersions {
constructor() {
super(...arguments);
this.entries = new EntriesAPI.Entries(this._client);
}
}
Versions.Entries = Entries;
Versions.BaseEntries = BaseEntries;
return Versions;
})();
//# sourceMappingURL=versions.mjs.map