
io.tiledb.cloud.rest_api.v2.api.QueryApi 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
/*
* 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.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 io.tiledb.cloud.rest_api.v2.model.Query;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class QueryApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public QueryApi() {
this(Configuration.getDefaultApiClient());
}
public QueryApi(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 submitQuery
* @param namespace namespace array is in (an organization name or user's username) (required)
* @param array name/uri of array that is url-encoded (required)
* @param type type of query (required)
* @param contentType Content Type of input and return mime (required)
* @param query query to run (required)
* @param xPayer Name of organization or user who should be charged for this request (optional)
* @param openAt open_at for array in unix epoch (optional)
* @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (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
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
*/
public okhttp3.Call submitQueryCall(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, 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 = query;
// create path and map variables
String localVarPath = "/arrays/{namespace}/{array}/query/submit"
.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 (type != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type));
}
if (openAt != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("open_at", openAt));
}
if (readAll != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("read_all", readAll));
}
if (contentType != null) {
localVarHeaderParams.put("Content-Type", localVarApiClient.parameterToString(contentType));
}
if (xPayer != null) {
localVarHeaderParams.put("X-Payer", localVarApiClient.parameterToString(xPayer));
}
final String[] localVarAccepts = {
"application/json", "application/capnp"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json", "application/capnp"
};
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 submitQueryValidateBeforeCall(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, 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 submitQuery(Async)");
}
// verify the required parameter 'array' is set
if (array == null) {
throw new ApiException("Missing the required parameter 'array' when calling submitQuery(Async)");
}
// verify the required parameter 'type' is set
if (type == null) {
throw new ApiException("Missing the required parameter 'type' when calling submitQuery(Async)");
}
// verify the required parameter 'contentType' is set
if (contentType == null) {
throw new ApiException("Missing the required parameter 'contentType' when calling submitQuery(Async)");
}
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException("Missing the required parameter 'query' when calling submitQuery(Async)");
}
okhttp3.Call localVarCall = submitQueryCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, _callback);
return localVarCall;
}
/**
*
* send a query to run against a specified array/URI registered to a group/project
* @param namespace namespace array is in (an organization name or user's username) (required)
* @param array name/uri of array that is url-encoded (required)
* @param type type of query (required)
* @param contentType Content Type of input and return mime (required)
* @param query query to run (required)
* @param xPayer Name of organization or user who should be charged for this request (optional)
* @param openAt open_at for array in unix epoch (optional)
* @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional)
* @return File
* @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
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
*/
public File submitQuery(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll) throws ApiException {
ApiResponse localVarResp = submitQueryWithHttpInfo(namespace, array, type, contentType, query, xPayer, openAt, readAll);
return localVarResp.getData();
}
/**
*
* send a query to run against a specified array/URI registered to a group/project
* @param namespace namespace array is in (an organization name or user's username) (required)
* @param array name/uri of array that is url-encoded (required)
* @param type type of query (required)
* @param contentType Content Type of input and return mime (required)
* @param query query to run (required)
* @param xPayer Name of organization or user who should be charged for this request (optional)
* @param openAt open_at for array in unix epoch (optional)
* @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional)
* @return ApiResponse<File>
* @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
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
*/
public ApiResponse submitQueryWithHttpInfo(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll) throws ApiException {
okhttp3.Call localVarCall = submitQueryValidateBeforeCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* (asynchronously)
* send a query to run against a specified array/URI registered to a group/project
* @param namespace namespace array is in (an organization name or user's username) (required)
* @param array name/uri of array that is url-encoded (required)
* @param type type of query (required)
* @param contentType Content Type of input and return mime (required)
* @param query query to run (required)
* @param xPayer Name of organization or user who should be charged for this request (optional)
* @param openAt open_at for array in unix epoch (optional)
* @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (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
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
*/
public okhttp3.Call submitQueryAsync(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = submitQueryValidateBeforeCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy