langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
40 lines (39 loc) • 1.48 kB
JavaScript
;
// @ts-nocheck
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Snapshots = void 0;
const resource_js_1 = require("../../core/resource.cjs");
const headers_js_1 = require("../../internal/headers.cjs");
const path_js_1 = require("../../internal/utils/path.cjs");
class Snapshots extends resource_js_1.APIResource {
/**
* Create a snapshot from a Docker image (async build).
*/
create(body, options) {
return this._client.post('/v2/sandboxes/snapshots', { body, ...options });
}
/**
* Get a sandbox snapshot by ID.
*/
retrieve(snapshotID, options) {
return this._client.get((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, options);
}
/**
* List sandbox snapshots for the authenticated tenant, with optional filtering,
* sorting, and pagination.
*/
list(query = {}, options) {
return this._client.get('/v2/sandboxes/snapshots', { query, ...options });
}
/**
* Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
*/
delete(snapshotID, options) {
return this._client.delete((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, {
...options,
headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
}
exports.Snapshots = Snapshots;