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

io.lakefs.clients.sdk.ImportApi Maven / Gradle / Ivy

There is a newer version: 1.45.0
Show newest version
/*
 * lakeFS API
 * lakeFS HTTP API
 *
 * The version of the OpenAPI document: 1.0.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.lakefs.clients.sdk;

import io.lakefs.clients.sdk.ApiCallback;
import io.lakefs.clients.sdk.ApiClient;
import io.lakefs.clients.sdk.ApiException;
import io.lakefs.clients.sdk.ApiResponse;
import io.lakefs.clients.sdk.Configuration;
import io.lakefs.clients.sdk.Pair;
import io.lakefs.clients.sdk.ProgressRequestBody;
import io.lakefs.clients.sdk.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.lakefs.clients.sdk.model.Error;
import io.lakefs.clients.sdk.model.ImportCreation;
import io.lakefs.clients.sdk.model.ImportCreationResponse;
import io.lakefs.clients.sdk.model.ImportStatus;

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

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

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

    public ImportApi(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;
    }

    private okhttp3.Call importCancelCall(String repository, String branch, String id, 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 = "/repositories/{repository}/branches/{branch}/import"
            .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString()))
            .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        if (id != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" };
        return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call importCancelValidateBeforeCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'repository' is set
        if (repository == null) {
            throw new ApiException("Missing the required parameter 'repository' when calling importCancel(Async)");
        }

        // verify the required parameter 'branch' is set
        if (branch == null) {
            throw new ApiException("Missing the required parameter 'branch' when calling importCancel(Async)");
        }

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling importCancel(Async)");
        }

        return importCancelCall(repository, branch, id, _callback);

    }


    private ApiResponse importCancelWithHttpInfo(String repository, String branch, String id) throws ApiException {
        okhttp3.Call localVarCall = importCancelValidateBeforeCall(repository, branch, id, null);
        return localVarApiClient.execute(localVarCall);
    }

    private okhttp3.Call importCancelAsync(String repository, String branch, String id, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = importCancelValidateBeforeCall(repository, branch, id, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }

    public class APIimportCancelRequest {
        private final String repository;
        private final String branch;
        private final String id;

        private APIimportCancelRequest(String repository, String branch, String id) {
            this.repository = repository;
            this.branch = branch;
            this.id = id;
        }

        /**
         * Build call for importCancel
         * @param _callback ApiCallback API callback
         * @return Call to execute
         * @throws ApiException If fail to serialize the request body object
         * @http.response.details
         
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return importCancelCall(repository, branch, id, _callback); } /** * Execute importCancel request * @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
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public void execute() throws ApiException { importCancelWithHttpInfo(repository, branch, id); } /** * Execute importCancel request with HTTP info returned * @return ApiResponse<Void> * @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
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return importCancelWithHttpInfo(repository, branch, id); } /** * Execute importCancel request (asynchronously) * @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
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return importCancelAsync(repository, branch, id, _callback); } } /** * cancel ongoing import * * @param repository (required) * @param branch (required) * @param id Unique identifier of the import process (required) * @return APIimportCancelRequest * @http.response.details
Status Code Description Response Headers
204 import canceled successfully -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
409 Resource Conflicts With Target -
420 too many requests -
0 Internal Server Error -
*/ public APIimportCancelRequest importCancel(String repository, String branch, String id) { return new APIimportCancelRequest(repository, branch, id); } private okhttp3.Call importStartCall(String repository, String branch, ImportCreation importCreation, 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 = importCreation; // create path and map variables String localVarPath = "/repositories/{repository}/branches/{branch}/import" .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.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[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call importStartValidateBeforeCall(String repository, String branch, ImportCreation importCreation, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { throw new ApiException("Missing the required parameter 'repository' when calling importStart(Async)"); } // verify the required parameter 'branch' is set if (branch == null) { throw new ApiException("Missing the required parameter 'branch' when calling importStart(Async)"); } // verify the required parameter 'importCreation' is set if (importCreation == null) { throw new ApiException("Missing the required parameter 'importCreation' when calling importStart(Async)"); } return importStartCall(repository, branch, importCreation, _callback); } private ApiResponse importStartWithHttpInfo(String repository, String branch, ImportCreation importCreation) throws ApiException { okhttp3.Call localVarCall = importStartValidateBeforeCall(repository, branch, importCreation, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call importStartAsync(String repository, String branch, ImportCreation importCreation, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importStartValidateBeforeCall(repository, branch, importCreation, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIimportStartRequest { private final String repository; private final String branch; private final ImportCreation importCreation; private APIimportStartRequest(String repository, String branch, ImportCreation importCreation) { this.repository = repository; this.branch = branch; this.importCreation = importCreation; } /** * Build call for importStart * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return importStartCall(repository, branch, importCreation, _callback); } /** * Execute importStart request * @return ImportCreationResponse * @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
202 Import started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public ImportCreationResponse execute() throws ApiException { ApiResponse localVarResp = importStartWithHttpInfo(repository, branch, importCreation); return localVarResp.getData(); } /** * Execute importStart request with HTTP info returned * @return ApiResponse<ImportCreationResponse> * @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
202 Import started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return importStartWithHttpInfo(repository, branch, importCreation); } /** * Execute importStart request (asynchronously) * @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
202 Import started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return importStartAsync(repository, branch, importCreation, _callback); } } /** * import data from object store * * @param repository (required) * @param branch (required) * @param importCreation (required) * @return APIimportStartRequest * @http.response.details
Status Code Description Response Headers
202 Import started -
400 Validation Error -
401 Unauthorized -
403 Forbidden -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public APIimportStartRequest importStart(String repository, String branch, ImportCreation importCreation) { return new APIimportStartRequest(repository, branch, importCreation); } private okhttp3.Call importStatusCall(String repository, String branch, String id, 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 = "/repositories/{repository}/branches/{branch}/import" .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (id != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call importStatusValidateBeforeCall(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'repository' is set if (repository == null) { throw new ApiException("Missing the required parameter 'repository' when calling importStatus(Async)"); } // verify the required parameter 'branch' is set if (branch == null) { throw new ApiException("Missing the required parameter 'branch' when calling importStatus(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling importStatus(Async)"); } return importStatusCall(repository, branch, id, _callback); } private ApiResponse importStatusWithHttpInfo(String repository, String branch, String id) throws ApiException { okhttp3.Call localVarCall = importStatusValidateBeforeCall(repository, branch, id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call importStatusAsync(String repository, String branch, String id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = importStatusValidateBeforeCall(repository, branch, id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIimportStatusRequest { private final String repository; private final String branch; private final String id; private APIimportStatusRequest(String repository, String branch, String id) { this.repository = repository; this.branch = branch; this.id = id; } /** * Build call for importStatus * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return importStatusCall(repository, branch, id, _callback); } /** * Execute importStatus request * @return ImportStatus * @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 import status -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public ImportStatus execute() throws ApiException { ApiResponse localVarResp = importStatusWithHttpInfo(repository, branch, id); return localVarResp.getData(); } /** * Execute importStatus request with HTTP info returned * @return ApiResponse<ImportStatus> * @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 import status -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return importStatusWithHttpInfo(repository, branch, id); } /** * Execute importStatus request (asynchronously) * @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 import status -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return importStatusAsync(repository, branch, id, _callback); } } /** * get import status * * @param repository (required) * @param branch (required) * @param id Unique identifier of the import process (required) * @return APIimportStatusRequest * @http.response.details
Status Code Description Response Headers
200 import status -
401 Unauthorized -
404 Resource Not Found -
420 too many requests -
0 Internal Server Error -
*/ public APIimportStatusRequest importStatus(String repository, String branch, String id) { return new APIimportStatusRequest(repository, branch, id); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy