io.tiledb.cloud.rest_api.v2.api.NotebooksApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tiledb-cloud-java Show documentation
Show all versions of tiledb-cloud-java Show documentation
The Java client for the TileDB Cloud Service
The newest version!
/*
* Tiledb Storage Platform API
* TileDB Storage Platform REST API
*
* The version of the OpenAPI document: 1.4.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.tiledb.cloud.rest_api.v2.api;
import io.tiledb.cloud.rest_api.v2.model.NotebookUploaded;
import io.tiledb.cloud.rest_api.v2.ApiCallback;
import io.tiledb.cloud.rest_api.v2.ApiClient;
import io.tiledb.cloud.rest_api.v2.ApiException;
import io.tiledb.cloud.rest_api.v2.ApiResponse;
import io.tiledb.cloud.rest_api.v2.Configuration;
import io.tiledb.cloud.rest_api.v2.Pair;
import com.google.gson.reflect.TypeToken;
import java.io.File;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class NotebooksApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public NotebooksApi() {
this(Configuration.getDefaultApiClient());
}
public NotebooksApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for handleUploadNotebook
* @param namespace The namespace of the notebook (required)
* @param array name/uri of array that is url-encoded (required)
* @param filesize size of the notebook to upload in bytes (required)
* @param notebook notebook to upload (required)
* @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional)
* @param name name of the TileDB array to create, if missing {array} is used (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
*/
public okhttp3.Call handleUploadNotebookCall(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = notebook;
// create path and map variables
String localVarPath = "/notebooks/{namespace}/{array}/upload"
.replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()))
.replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (filesize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("filesize", filesize));
}
if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) {
localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/octet-stream"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call handleUploadNotebookValidateBeforeCall(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'namespace' is set
if (namespace == null) {
throw new ApiException("Missing the required parameter 'namespace' when calling handleUploadNotebook(Async)");
}
// verify the required parameter 'array' is set
if (array == null) {
throw new ApiException("Missing the required parameter 'array' when calling handleUploadNotebook(Async)");
}
// verify the required parameter 'filesize' is set
if (filesize == null) {
throw new ApiException("Missing the required parameter 'filesize' when calling handleUploadNotebook(Async)");
}
// verify the required parameter 'notebook' is set
if (notebook == null) {
throw new ApiException("Missing the required parameter 'notebook' when calling handleUploadNotebook(Async)");
}
okhttp3.Call localVarCall = handleUploadNotebookCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, _callback);
return localVarCall;
}
/**
*
* Upload a notebook at the specified location and wrap it in TileDB Array
* @param namespace The namespace of the notebook (required)
* @param array name/uri of array that is url-encoded (required)
* @param filesize size of the notebook to upload in bytes (required)
* @param notebook notebook to upload (required)
* @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional)
* @param name name of the TileDB array to create, if missing {array} is used (optional)
* @return NotebookUploaded
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
*/
public NotebookUploaded handleUploadNotebook(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name) throws ApiException {
ApiResponse localVarResp = handleUploadNotebookWithHttpInfo(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name);
return localVarResp.getData();
}
/**
*
* Upload a notebook at the specified location and wrap it in TileDB Array
* @param namespace The namespace of the notebook (required)
* @param array name/uri of array that is url-encoded (required)
* @param filesize size of the notebook to upload in bytes (required)
* @param notebook notebook to upload (required)
* @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional)
* @param name name of the TileDB array to create, if missing {array} is used (optional)
* @return ApiResponse<NotebookUploaded>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
*/
public ApiResponse handleUploadNotebookWithHttpInfo(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name) throws ApiException {
okhttp3.Call localVarCall = handleUploadNotebookValidateBeforeCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* Upload a notebook at the specified location and wrap it in TileDB Array
* @param namespace The namespace of the notebook (required)
* @param array name/uri of array that is url-encoded (required)
* @param filesize size of the notebook to upload in bytes (required)
* @param notebook notebook to upload (required)
* @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional)
* @param name name of the TileDB array to create, if missing {array} is used (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
*/
public okhttp3.Call handleUploadNotebookAsync(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = handleUploadNotebookValidateBeforeCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy