All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tiledb.cloud.rest_api.api.FilesApi Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
/*
 * TileDB Storage Platform API
 * TileDB Storage Platform REST API
 *
 * The version of the OpenAPI document: 2.2.19
 * 
 *
 * 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.api;

import io.tiledb.cloud.rest_api.ApiCallback;
import io.tiledb.cloud.rest_api.model.FileCreated;
import io.tiledb.cloud.rest_api.ApiClient;
import io.tiledb.cloud.rest_api.ApiException;
import io.tiledb.cloud.rest_api.ApiResponse;
import io.tiledb.cloud.rest_api.Configuration;
import io.tiledb.cloud.rest_api.Pair;

import com.google.gson.reflect.TypeToken;


import java.io.File;
import io.tiledb.cloud.rest_api.model.FileCreate;
import io.tiledb.cloud.rest_api.model.FileExport;
import io.tiledb.cloud.rest_api.model.FileExported;
import io.tiledb.cloud.rest_api.model.FileUploaded;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class FilesApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public FilesApi() {
        this(Configuration.getDefaultApiClient());
    }

    public FilesApi(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 handleCreateFile
     * @param namespace The namespace of the file (required)
     * @param fileCreate Input/Output information to create a new TileDB file (required)
     * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (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 File created -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleCreateFileCall(String namespace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_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 = fileCreate; // create path and map variables String localVarPath = "/files/{namespace}" .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); 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/json" }; 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 handleCreateFileValidateBeforeCall(String namespace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_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 handleCreateFile(Async)"); } // verify the required parameter 'fileCreate' is set if (fileCreate == null) { throw new ApiException("Missing the required parameter 'fileCreate' when calling handleCreateFile(Async)"); } okhttp3.Call localVarCall = handleCreateFileCall(namespace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); return localVarCall; } /** * * Create a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param fileCreate Input/Output information to create a new TileDB file (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @return FileCreated * @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 File created -
502 Bad Gateway -
0 error response -
*/ public FileCreated handleCreateFile(String namespace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) throws ApiException { ApiResponse localVarResp = handleCreateFileWithHttpInfo(namespace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); return localVarResp.getData(); } /** * * Create a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param fileCreate Input/Output information to create a new TileDB file (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @return ApiResponse<FileCreated> * @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 File created -
502 Bad Gateway -
0 error response -
*/ public ApiResponse handleCreateFileWithHttpInfo(String namespace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) throws ApiException { okhttp3.Call localVarCall = handleCreateFileValidateBeforeCall(namespace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) * Create a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param fileCreate Input/Output information to create a new TileDB file (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (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 File created -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleCreateFileAsync(String namespace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = handleCreateFileValidateBeforeCall(namespace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for handleExportFile * @param namespace The namespace of the file (required) * @param _file The file identifier (required) * @param fileExport Export configuration information (required) * @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 File exported -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleExportFileCall(String namespace, String _file, FileExport fileExport, 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 = fileExport; // create path and map variables String localVarPath = "/files/{namespace}/{file}/export" .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) .replaceAll("\\{" + "file" + "\\}", localVarApiClient.escapeString(_file.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; 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 handleExportFileValidateBeforeCall(String namespace, String _file, FileExport fileExport, 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 handleExportFile(Async)"); } // verify the required parameter '_file' is set if (_file == null) { throw new ApiException("Missing the required parameter '_file' when calling handleExportFile(Async)"); } // verify the required parameter 'fileExport' is set if (fileExport == null) { throw new ApiException("Missing the required parameter 'fileExport' when calling handleExportFile(Async)"); } okhttp3.Call localVarCall = handleExportFileCall(namespace, _file, fileExport, _callback); return localVarCall; } /** * * Export a TileDB File back to its original file format * @param namespace The namespace of the file (required) * @param _file The file identifier (required) * @param fileExport Export configuration information (required) * @return FileExported * @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 File exported -
502 Bad Gateway -
0 error response -
*/ public FileExported handleExportFile(String namespace, String _file, FileExport fileExport) throws ApiException { ApiResponse localVarResp = handleExportFileWithHttpInfo(namespace, _file, fileExport); return localVarResp.getData(); } /** * * Export a TileDB File back to its original file format * @param namespace The namespace of the file (required) * @param _file The file identifier (required) * @param fileExport Export configuration information (required) * @return ApiResponse<FileExported> * @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 File exported -
502 Bad Gateway -
0 error response -
*/ public ApiResponse handleExportFileWithHttpInfo(String namespace, String _file, FileExport fileExport) throws ApiException { okhttp3.Call localVarCall = handleExportFileValidateBeforeCall(namespace, _file, fileExport, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) * Export a TileDB File back to its original file format * @param namespace The namespace of the file (required) * @param _file The file identifier (required) * @param fileExport Export configuration information (required) * @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 File exported -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleExportFileAsync(String namespace, String _file, FileExport fileExport, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = handleExportFileValidateBeforeCall(namespace, _file, fileExport, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for handleUploadFile * @param namespace The namespace of the file (required) * @param inputFile the file to upload (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @param outputUri output location of the TileDB File (optional) * @param name name to set for registered file (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 File uploaded -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleUploadFileCall(String namespace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, 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 = null; // create path and map variables String localVarPath = "/files/{namespace}/upload" .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (inputFile != null) { localVarFormParams.put("input_file", inputFile); } if (outputUri != null) { localVarFormParams.put("output_uri", outputUri); } if (name != null) { localVarFormParams.put("name", name); } 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 = { "multipart/form-data" }; 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 handleUploadFileValidateBeforeCall(String namespace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, 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 handleUploadFile(Async)"); } // verify the required parameter 'inputFile' is set if (inputFile == null) { throw new ApiException("Missing the required parameter 'inputFile' when calling handleUploadFile(Async)"); } okhttp3.Call localVarCall = handleUploadFileCall(namespace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); return localVarCall; } /** * * Upload a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param inputFile the file to upload (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @param outputUri output location of the TileDB File (optional) * @param name name to set for registered file (optional) * @return FileUploaded * @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 File uploaded -
502 Bad Gateway -
0 error response -
*/ public FileUploaded handleUploadFile(String namespace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, String name) throws ApiException { ApiResponse localVarResp = handleUploadFileWithHttpInfo(namespace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); return localVarResp.getData(); } /** * * Upload a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param inputFile the file to upload (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @param outputUri output location of the TileDB File (optional) * @param name name to set for registered file (optional) * @return ApiResponse<FileUploaded> * @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 File uploaded -
502 Bad Gateway -
0 error response -
*/ public ApiResponse handleUploadFileWithHttpInfo(String namespace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, String name) throws ApiException { okhttp3.Call localVarCall = handleUploadFileValidateBeforeCall(namespace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) * Upload a tiledb file at the specified location * @param namespace The namespace of the file (required) * @param inputFile the file to upload (required) * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) * @param outputUri output location of the TileDB File (optional) * @param name name to set for registered file (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 File uploaded -
502 Bad Gateway -
0 error response -
*/ public okhttp3.Call handleUploadFileAsync(String namespace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, String name, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = handleUploadFileValidateBeforeCall(namespace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy