Package com.qtsurfer.api.client.api
Class DatasetApi
java.lang.Object
com.qtsurfer.api.client.api.DatasetApi
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.14.0")
public class DatasetApi
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDataset(CreateDatasetRequest createDatasetRequest) Create a dataset and get a URL to upload it to Creates a dataset AND its first upload session in one call — a presigned URL your client PUTs the file to directly, no API credentials involved in that PUT.createDatasetWithHttpInfo(CreateDatasetRequest createDatasetRequest) Create a dataset and get a URL to upload it to Creates a dataset AND its first upload session in one call — a presigned URL your client PUTs the file to directly, no API credentials involved in that PUT.deleteDataset(String datasetId) Delete a dataset Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and can no longer be prepared from, but its object data is reclaimed later rather than purged inline, so a backtest already running against one of its versions is not disrupted.deleteDatasetWithHttpInfo(String datasetId) Delete a dataset Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and can no longer be prepared from, but its object data is reclaimed later rather than purged inline, so a backtest already running against one of its versions is not disrupted.finalizeDatasetUpload(String datasetId, String uploadId) Finalize an uploaded file and start ingest Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from `POST /datasets/{datasetId}/uploads`).finalizeDatasetUploadWithHttpInfo(String datasetId, String uploadId) Finalize an uploaded file and start ingest Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from `POST /datasets/{datasetId}/uploads`).protected ApiExceptiongetApiException(String operationId, HttpResponse<InputStream> response) getDataset(String datasetId) Get a dataset by id Detail for one dataset, plus a self link.getDatasetImport(String datasetId, String importId) Get the state of an import/ingest Poll after `POST /datasets/imports` until `status` is `ready` or `failed`.getDatasetImportWithHttpInfo(String datasetId, String importId) Get the state of an import/ingest Poll after `POST /datasets/imports` until `status` is `ready` or `failed`.getDatasetUpload(String datasetId, String uploadId) Get the state of an upload/ingest Poll after `POST .../finalize` until `status` is `ready` or `failed`.getDatasetUploadWithHttpInfo(String datasetId, String uploadId) Get the state of an upload/ingest Poll after `POST .../finalize` until `status` is `ready` or `failed`.getDatasetWithHttpInfo(String datasetId) Get a dataset by id Detail for one dataset, plus a self link.importDataset(DatasetImportRequest datasetImportRequest) Create a dataset by importing history instead of uploading it A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a file yourself, ask the API to go fetch history on your behalf.importDatasetWithHttpInfo(DatasetImportRequest datasetImportRequest) Create a dataset by importing history instead of uploading it A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a file yourself, ask the API to go fetch history on your behalf.List your datasets Every dataset you have created and not deleted, most recently created first.List your datasets Every dataset you have created and not deleted, most recently created first.openDatasetUpload(String datasetId) Open a new upload session for an existing dataset Get a fresh presigned URL to upload a new version into a dataset you already have — a corrected file, or the next chunk of history.openDatasetUploadWithHttpInfo(String datasetId) Open a new upload session for an existing dataset Get a fresh presigned URL to upload a new version into a dataset you already have — a corrected file, or the next chunk of history.
-
Constructor Details
-
DatasetApi
public DatasetApi() -
DatasetApi
-
-
Method Details
-
getApiException
protected ApiException getApiException(String operationId, HttpResponse<InputStream> response) throws IOException - Throws:
IOException
-
createDataset
public DatasetCreated createDataset(@Nonnull CreateDatasetRequest createDatasetRequest) throws ApiException Create a dataset and get a URL to upload it to Creates a dataset AND its first upload session in one call — a presigned URL your client PUTs the file to directly, no API credentials involved in that PUT. Call `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the upload completes to kick off ingest. Losing this response loses nothing: calling this dataset's `POST /datasets/{datasetId}/uploads` returns the very same upload session again rather than opening a new one, as long as nothing has been finalized against it yet. v1 is ticker data only — `type` is not a request field, it is always `\"ticker\"` in the response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative forms (e.g. `BTC/USDT:USDT`) are rejected. **Upload format.** A CSV with a header row, a parquet file with the same columns by name, or a lastra file — our own native columnar format, the same one a dataset's `dataUrl` hands back by default, so a downloaded dataset can be handed to another user to upload with no conversion in between. For CSV/parquet, required: `timestamp` (ISO-8601, or numeric epoch seconds/millis/micros — detected from the first row, then enforced for every later row), `close`. Optional: `open`, `high`, `low`, `volume`, `quoteVolume`, `bid`, `bidSize`, `ask`, `askSize`. A lastra upload carries its own fixed column set instead and only needs a timestamp series and a close series present. Cadence and timestamp unit are discovered from the data, not declared, for all three. A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet or lastra upload is stored as-is today. Either way, always check `dataFormat` on `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which one `dataUrl` actually is, rather than assuming from how you uploaded it (a converted CSV and an uploaded lastra file both report `dataFormat: \"lastra\"`). The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels). Format is detected from the decompressed content itself: there is no filename or `Content-Type` anywhere in this flow for a client to declare it with, so nothing needs to be sent besides the bytes.- Parameters:
createDatasetRequest- The dataset to create (required)- Returns:
- DatasetCreated
- Throws:
ApiException- if fails to make API call
-
createDatasetWithHttpInfo
public ApiResponse<DatasetCreated> createDatasetWithHttpInfo(@Nonnull CreateDatasetRequest createDatasetRequest) throws ApiException Create a dataset and get a URL to upload it to Creates a dataset AND its first upload session in one call — a presigned URL your client PUTs the file to directly, no API credentials involved in that PUT. Call `POST /datasets/{datasetId}/uploads/{uploadId}/finalize` once the upload completes to kick off ingest. Losing this response loses nothing: calling this dataset's `POST /datasets/{datasetId}/uploads` returns the very same upload session again rather than opening a new one, as long as nothing has been finalized against it yet. v1 is ticker data only — `type` is not a request field, it is always `\"ticker\"` in the response. `instrument` must be a plain spot pair (`BASE/QUOTE`, exactly one `/`); derivative forms (e.g. `BTC/USDT:USDT`) are rejected. **Upload format.** A CSV with a header row, a parquet file with the same columns by name, or a lastra file — our own native columnar format, the same one a dataset's `dataUrl` hands back by default, so a downloaded dataset can be handed to another user to upload with no conversion in between. For CSV/parquet, required: `timestamp` (ISO-8601, or numeric epoch seconds/millis/micros — detected from the first row, then enforced for every later row), `close`. Optional: `open`, `high`, `low`, `volume`, `quoteVolume`, `bid`, `bidSize`, `ask`, `askSize`. A lastra upload carries its own fixed column set instead and only needs a timestamp series and a close series present. Cadence and timestamp unit are discovered from the data, not declared, for all three. A CSV upload is converted to our native columnar format (`lastra`) for storage. A parquet or lastra upload is stored as-is today. Either way, always check `dataFormat` on `GET /datasets/{datasetId}` and `GET /datasets/{datasetId}/uploads/{uploadId}` for which one `dataUrl` actually is, rather than assuming from how you uploaded it (a converted CSV and an uploaded lastra file both report `dataFormat: \"lastra\"`). The bytes PUT to `upload.url` may be that file directly, gzipped (`.gz`), or zipped (`.zip`, exactly one file inside — a dataset is one file regardless of how it travels). Format is detected from the decompressed content itself: there is no filename or `Content-Type` anywhere in this flow for a client to declare it with, so nothing needs to be sent besides the bytes.- Parameters:
createDatasetRequest- The dataset to create (required)- Returns:
- ApiResponse<DatasetCreated>
- Throws:
ApiException- if fails to make API call
-
deleteDataset
Delete a dataset Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and can no longer be prepared from, but its object data is reclaimed later rather than purged inline, so a backtest already running against one of its versions is not disrupted.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- DeleteDataset200Response
- Throws:
ApiException- if fails to make API call
-
deleteDatasetWithHttpInfo
public ApiResponse<DeleteDataset200Response> deleteDatasetWithHttpInfo(@Nonnull String datasetId) throws ApiException Delete a dataset Soft-delete — the dataset stops appearing in `GET /datasets`/`GET /datasets/{datasetId}` and can no longer be prepared from, but its object data is reclaimed later rather than purged inline, so a backtest already running against one of its versions is not disrupted.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- ApiResponse<DeleteDataset200Response>
- Throws:
ApiException- if fails to make API call
-
finalizeDatasetUpload
public FinalizeDatasetUpload202Response finalizeDatasetUpload(@Nonnull String datasetId, @Nonnull String uploadId) throws ApiException Finalize an uploaded file and start ingest Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from `POST /datasets/{datasetId}/uploads`). Enqueues ingest and returns immediately; poll `GET /datasets/{datasetId}/uploads/{uploadId}` for the result. Idempotent while the upload is still open — a repeat finalize before it has produced a version returns the same `jobId` rather than enqueueing a second ingest. Once it HAS produced a version, `uploadId` is spent: finalizing it again is a `409`, even with different bytes freshly PUT to the same URL — open a new upload session instead (`POST /datasets/{datasetId}/uploads`) rather than reusing a spent one.- Parameters:
datasetId- The id returned by `POST /datasets` (required)uploadId- The `uploadId` returned by `POST /datasets` (required)- Returns:
- FinalizeDatasetUpload202Response
- Throws:
ApiException- if fails to make API call
-
finalizeDatasetUploadWithHttpInfo
public ApiResponse<FinalizeDatasetUpload202Response> finalizeDatasetUploadWithHttpInfo(@Nonnull String datasetId, @Nonnull String uploadId) throws ApiException Finalize an uploaded file and start ingest Call once the file has been PUT to the `upload.url` from `POST /datasets` (or from `POST /datasets/{datasetId}/uploads`). Enqueues ingest and returns immediately; poll `GET /datasets/{datasetId}/uploads/{uploadId}` for the result. Idempotent while the upload is still open — a repeat finalize before it has produced a version returns the same `jobId` rather than enqueueing a second ingest. Once it HAS produced a version, `uploadId` is spent: finalizing it again is a `409`, even with different bytes freshly PUT to the same URL — open a new upload session instead (`POST /datasets/{datasetId}/uploads`) rather than reusing a spent one.- Parameters:
datasetId- The id returned by `POST /datasets` (required)uploadId- The `uploadId` returned by `POST /datasets` (required)- Returns:
- ApiResponse<FinalizeDatasetUpload202Response>
- Throws:
ApiException- if fails to make API call
-
getDataset
Get a dataset by id Detail for one dataset, plus a self link.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- DatasetWithLinks
- Throws:
ApiException- if fails to make API call
-
getDatasetWithHttpInfo
public ApiResponse<DatasetWithLinks> getDatasetWithHttpInfo(@Nonnull String datasetId) throws ApiException Get a dataset by id Detail for one dataset, plus a self link.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- ApiResponse<DatasetWithLinks>
- Throws:
ApiException- if fails to make API call
-
getDatasetImport
public DatasetImportState getDatasetImport(@Nonnull String datasetId, @Nonnull String importId) throws ApiException Get the state of an import/ingest Poll after `POST /datasets/imports` until `status` is `ready` or `failed`. An import spends real time fetching from its source before anything is even staged — `fetching` is the one status only an import ever reports; `ingesting`/`ready`/`failed` mean exactly what they do on `GET /datasets/{datasetId}/uploads/{uploadId}`, since an import re-enters that same ingest chain once it has fetched and staged its data.- Parameters:
datasetId- The id returned by `POST /datasets/imports` (required)importId- The `importId` returned by `POST /datasets/imports` (required)- Returns:
- DatasetImportState
- Throws:
ApiException- if fails to make API call
-
getDatasetImportWithHttpInfo
public ApiResponse<DatasetImportState> getDatasetImportWithHttpInfo(@Nonnull String datasetId, @Nonnull String importId) throws ApiException Get the state of an import/ingest Poll after `POST /datasets/imports` until `status` is `ready` or `failed`. An import spends real time fetching from its source before anything is even staged — `fetching` is the one status only an import ever reports; `ingesting`/`ready`/`failed` mean exactly what they do on `GET /datasets/{datasetId}/uploads/{uploadId}`, since an import re-enters that same ingest chain once it has fetched and staged its data.- Parameters:
datasetId- The id returned by `POST /datasets/imports` (required)importId- The `importId` returned by `POST /datasets/imports` (required)- Returns:
- ApiResponse<DatasetImportState>
- Throws:
ApiException- if fails to make API call
-
getDatasetUpload
public DatasetUploadState getDatasetUpload(@Nonnull String datasetId, @Nonnull String uploadId) throws ApiException Get the state of an upload/ingest Poll after `POST .../finalize` until `status` is `ready` or `failed`. Also reports `uploading` (finalize not called yet, but the file was PUT) before you finalize at all.- Parameters:
datasetId- The id returned by `POST /datasets` (required)uploadId- The `uploadId` returned by `POST /datasets` (required)- Returns:
- DatasetUploadState
- Throws:
ApiException- if fails to make API call
-
getDatasetUploadWithHttpInfo
public ApiResponse<DatasetUploadState> getDatasetUploadWithHttpInfo(@Nonnull String datasetId, @Nonnull String uploadId) throws ApiException Get the state of an upload/ingest Poll after `POST .../finalize` until `status` is `ready` or `failed`. Also reports `uploading` (finalize not called yet, but the file was PUT) before you finalize at all.- Parameters:
datasetId- The id returned by `POST /datasets` (required)uploadId- The `uploadId` returned by `POST /datasets` (required)- Returns:
- ApiResponse<DatasetUploadState>
- Throws:
ApiException- if fails to make API call
-
importDataset
public DatasetImportCreated importDataset(@Nonnull DatasetImportRequest datasetImportRequest) throws ApiException Create a dataset by importing history instead of uploading it A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a file yourself, ask the API to go fetch history on your behalf. Creates the dataset and starts the fetch in the same call — there is no separate upload step, and the result lands as a dataset version indistinguishable from an uploaded one once it's ready. Poll `GET /datasets/{datasetId}/imports/{importId}` for progress. `type` selects the source. `dex` — history over a pool/pair's own on-chain market — is the only value today; other source types join this same endpoint later. A `dex` import has two data shapes, chosen by the top-level `cadence`: * Omitted/blank (default) — on-chain swap history, replayed directly from the pool/pair's own chain. Cadence is native, not resampled: each swap keeps the timestamp it happened at rather than being bucketed into candles, so the resulting version's `cadence` is `rt` unless the swaps happen to sit on a fixed grid (see `DatasetVersion.cadence`). * One of `1s` / `1m` / `5m` — pre-aggregated candles at that width instead of raw trades. The resulting dataset's `type` is `klines`, not `ticker`. Not every network supports every cadence yet — an unsupported combination fails asynchronously, same as an unresolvable pool (see the `failed` status on the poll endpoint below).- Parameters:
datasetImportRequest- What to fetch, and where from (required)- Returns:
- DatasetImportCreated
- Throws:
ApiException- if fails to make API call
-
importDatasetWithHttpInfo
public ApiResponse<DatasetImportCreated> importDatasetWithHttpInfo(@Nonnull DatasetImportRequest datasetImportRequest) throws ApiException Create a dataset by importing history instead of uploading it A second way to get data into a dataset, alongside `POST /datasets`: instead of `PUT`ting a file yourself, ask the API to go fetch history on your behalf. Creates the dataset and starts the fetch in the same call — there is no separate upload step, and the result lands as a dataset version indistinguishable from an uploaded one once it's ready. Poll `GET /datasets/{datasetId}/imports/{importId}` for progress. `type` selects the source. `dex` — history over a pool/pair's own on-chain market — is the only value today; other source types join this same endpoint later. A `dex` import has two data shapes, chosen by the top-level `cadence`: * Omitted/blank (default) — on-chain swap history, replayed directly from the pool/pair's own chain. Cadence is native, not resampled: each swap keeps the timestamp it happened at rather than being bucketed into candles, so the resulting version's `cadence` is `rt` unless the swaps happen to sit on a fixed grid (see `DatasetVersion.cadence`). * One of `1s` / `1m` / `5m` — pre-aggregated candles at that width instead of raw trades. The resulting dataset's `type` is `klines`, not `ticker`. Not every network supports every cadence yet — an unsupported combination fails asynchronously, same as an unresolvable pool (see the `failed` status on the poll endpoint below).- Parameters:
datasetImportRequest- What to fetch, and where from (required)- Returns:
- ApiResponse<DatasetImportCreated>
- Throws:
ApiException- if fails to make API call
-
listDatasets
List your datasets Every dataset you have created and not deleted, most recently created first. Never a `404` — an empty array if you have none, same convention as `GET /strategies`.- Returns:
- ListDatasets200Response
- Throws:
ApiException- if fails to make API call
-
listDatasetsWithHttpInfo
List your datasets Every dataset you have created and not deleted, most recently created first. Never a `404` — an empty array if you have none, same convention as `GET /strategies`.- Returns:
- ApiResponse<ListDatasets200Response>
- Throws:
ApiException- if fails to make API call
-
openDatasetUpload
Open a new upload session for an existing dataset Get a fresh presigned URL to upload a new version into a dataset you already have — a corrected file, or the next chunk of history. Behaves the same way `POST /datasets` does for a brand-new dataset's own upload: at most one upload session is open per dataset at a time, so calling this again before finalizing just hands back that same session rather than opening a second one — safe to call repeatedly if a response gets lost. Once a session has been finalized (successfully or not), the next call here opens a genuinely new one for that dataset's next version.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- DatasetUploadSession
- Throws:
ApiException- if fails to make API call
-
openDatasetUploadWithHttpInfo
public ApiResponse<DatasetUploadSession> openDatasetUploadWithHttpInfo(@Nonnull String datasetId) throws ApiException Open a new upload session for an existing dataset Get a fresh presigned URL to upload a new version into a dataset you already have — a corrected file, or the next chunk of history. Behaves the same way `POST /datasets` does for a brand-new dataset's own upload: at most one upload session is open per dataset at a time, so calling this again before finalizing just hands back that same session rather than opening a second one — safe to call repeatedly if a response gets lost. Once a session has been finalized (successfully or not), the next call here opens a genuinely new one for that dataset's next version.- Parameters:
datasetId- The id returned by `POST /datasets` (required)- Returns:
- ApiResponse<DatasetUploadSession>
- Throws:
ApiException- if fails to make API call
-