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

com.finbourne.horizon.api.RunsApi Maven / Gradle / Ivy

/*
 * FINBOURNE Horizon API
 *
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.finbourne.horizon.api;

import com.finbourne.horizon.ApiCallback;
import com.finbourne.horizon.ApiClient;
import com.finbourne.horizon.ApiException;
import com.finbourne.horizon.ApiResponse;
import com.finbourne.horizon.Configuration;
import com.finbourne.horizon.Pair;
import com.finbourne.horizon.ProgressRequestBody;
import com.finbourne.horizon.ProgressResponseBody;
import com.finbourne.horizon.extensions.ConfigurationOptions;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.finbourne.horizon.model.IntegrationRerunResponse;
import com.finbourne.horizon.model.LusidProblemDetails;
import com.finbourne.horizon.model.PagedResourceListOfIntegrationRunResponse;

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

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

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

    public RunsApi(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 getRunResultsCall(String filter, List sortBy, Integer limit, String pageToken, final ApiCallback _callback) throws ApiException {
        return getRunResultsCall(filter, sortBy, limit, pageToken,  _callback, new ConfigurationOptions());
    }

    private okhttp3.Call getRunResultsCall(String filter, List sortBy, Integer limit, String pageToken, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/runs";

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

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

        if (sortBy != null) {
            localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sortBy", sortBy));
        }

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

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

        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[] { "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getRunResultsValidateBeforeCall(String filter, List sortBy, Integer limit, String pageToken, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
        return getRunResultsCall(filter, sortBy, limit, pageToken, _callback, opts);

    }


    private ApiResponse getRunResultsWithHttpInfo(String filter, List sortBy, Integer limit, String pageToken) throws ApiException {
        okhttp3.Call localVarCall = getRunResultsValidateBeforeCall(filter, sortBy, limit, pageToken, null, new ConfigurationOptions());
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private ApiResponse getRunResultsWithHttpInfo(String filter, List sortBy, Integer limit, String pageToken, ConfigurationOptions opts) throws ApiException {
        okhttp3.Call localVarCall = getRunResultsValidateBeforeCall(filter, sortBy, limit, pageToken, null, opts);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call getRunResultsAsync(String filter, List sortBy, Integer limit, String pageToken, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = getRunResultsValidateBeforeCall(filter, sortBy, limit, pageToken, _callback, new ConfigurationOptions());
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    private okhttp3.Call getRunResultsAsync(String filter, List sortBy, Integer limit, String pageToken, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {

        okhttp3.Call localVarCall = getRunResultsValidateBeforeCall(filter, sortBy, limit, pageToken, _callback, opts);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class APIgetRunResultsRequest {
        private String filter;
        private List sortBy;
        private Integer limit;
        private String pageToken;

        private APIgetRunResultsRequest() {
        }

        /**
         * Set filter
         * @param filter Expression to filter the result set. (optional)
         * @return APIgetRunResultsRequest
         */
        public APIgetRunResultsRequest filter(String filter) {
            this.filter = filter;
            return this;
        }

        /**
         * Set sortBy
         * @param sortBy A list of field names or properties to sort by, each suffixed by \" ASC\" or \" DESC\". (optional)
         * @return APIgetRunResultsRequest
         */
        public APIgetRunResultsRequest sortBy(List sortBy) {
            this.sortBy = sortBy;
            return this;
        }

        /**
         * Set limit
         * @param limit When paginating, limit the results to this number. (optional, default to 100)
         * @return APIgetRunResultsRequest
         */
        public APIgetRunResultsRequest limit(Integer limit) {
            this.limit = limit;
            return this;
        }

        /**
         * Set pageToken
         * @param pageToken The pagination token to use to continue listing integration runs; this value is returned from   the previous call. If a pagination token is provided, the <i>sortBy</i> and <i>filter</i> fields must not have changed since the original request. (optional, default to )
         * @return APIgetRunResultsRequest
         */
        public APIgetRunResultsRequest pageToken(String pageToken) {
            this.pageToken = pageToken;
            return this;
        }

        /**
         * Build call for getRunResults
         * @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 Success -
404 Not Found -
0 Error response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getRunResultsCall(filter, sortBy, limit, pageToken, _callback); } /** * Execute getRunResults request * @return PagedResourceListOfIntegrationRunResponse * @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 Success -
404 Not Found -
0 Error response -
*/ public PagedResourceListOfIntegrationRunResponse execute() throws ApiException { ApiResponse localVarResp = getRunResultsWithHttpInfo(filter, sortBy, limit, pageToken); return localVarResp.getData(); } /** * Execute getRunResults request. Use any specified configuration options to override any other configuration for this request only. * @return PagedResourceListOfIntegrationRunResponse * @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 Success -
404 Not Found -
0 Error response -
*/ public PagedResourceListOfIntegrationRunResponse execute(ConfigurationOptions opts) throws ApiException { ApiResponse localVarResp = getRunResultsWithHttpInfo(filter, sortBy, limit, pageToken, opts); return localVarResp.getData(); } /** * Execute getRunResults request with HTTP info returned * @return ApiResponse<PagedResourceListOfIntegrationRunResponse> * @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 Success -
404 Not Found -
0 Error response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getRunResultsWithHttpInfo(filter, sortBy, limit, pageToken); } /** * Execute getRunResults request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only. * @return ApiResponse<PagedResourceListOfIntegrationRunResponse> * @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 Success -
404 Not Found -
0 Error response -
*/ public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException { return getRunResultsWithHttpInfo(filter, sortBy, limit, pageToken, opts); } /** * Execute getRunResults 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 Success -
404 Not Found -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getRunResultsAsync(filter, sortBy, limit, pageToken, _callback); } /** * Execute getRunResults request (asynchronously). Use any specified configuration options to override any other configuration for this request only. * @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 Success -
404 Not Found -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { return getRunResultsAsync(filter, sortBy, limit, pageToken, _callback, opts); } } /** * [EXPERIMENTAL] GetRunResults: Get run results * Get run results * @return APIgetRunResultsRequest * @http.response.details
Status Code Description Response Headers
200 Success -
404 Not Found -
0 Error response -
*/ public APIgetRunResultsRequest getRunResults() { return new APIgetRunResultsRequest(); } private okhttp3.Call rerunInstanceCall(String runId, final ApiCallback _callback) throws ApiException { return rerunInstanceCall(runId, _callback, new ConfigurationOptions()); } private okhttp3.Call rerunInstanceCall(String runId, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/runs/{runId}/rerun" .replace("{" + "runId" + "}", localVarApiClient.escapeString(runId.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 = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "oauth2" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts); } @SuppressWarnings("rawtypes") private okhttp3.Call rerunInstanceValidateBeforeCall(String runId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { // verify the required parameter 'runId' is set if (runId == null) { throw new ApiException("Missing the required parameter 'runId' when calling rerunInstance(Async)"); } return rerunInstanceCall(runId, _callback, opts); } private ApiResponse rerunInstanceWithHttpInfo(String runId) throws ApiException { okhttp3.Call localVarCall = rerunInstanceValidateBeforeCall(runId, null, new ConfigurationOptions()); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private ApiResponse rerunInstanceWithHttpInfo(String runId, ConfigurationOptions opts) throws ApiException { okhttp3.Call localVarCall = rerunInstanceValidateBeforeCall(runId, null, opts); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call rerunInstanceAsync(String runId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = rerunInstanceValidateBeforeCall(runId, _callback, new ConfigurationOptions()); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } private okhttp3.Call rerunInstanceAsync(String runId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { okhttp3.Call localVarCall = rerunInstanceValidateBeforeCall(runId, _callback, opts); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIrerunInstanceRequest { private final String runId; private APIrerunInstanceRequest(String runId) { this.runId = runId; } /** * Build call for rerunInstance * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return rerunInstanceCall(runId, _callback); } /** * Execute rerunInstance request * @return IntegrationRerunResponse * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public IntegrationRerunResponse execute() throws ApiException { ApiResponse localVarResp = rerunInstanceWithHttpInfo(runId); return localVarResp.getData(); } /** * Execute rerunInstance request. Use any specified configuration options to override any other configuration for this request only. * @return IntegrationRerunResponse * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public IntegrationRerunResponse execute(ConfigurationOptions opts) throws ApiException { ApiResponse localVarResp = rerunInstanceWithHttpInfo(runId, opts); return localVarResp.getData(); } /** * Execute rerunInstance request with HTTP info returned * @return ApiResponse<IntegrationRerunResponse> * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return rerunInstanceWithHttpInfo(runId); } /** * Execute rerunInstance request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only. * @return ApiResponse<IntegrationRerunResponse> * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException { return rerunInstanceWithHttpInfo(runId, opts); } /** * Execute rerunInstance 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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return rerunInstanceAsync(runId, _callback); } /** * Execute rerunInstance request (asynchronously). Use any specified configuration options to override any other configuration for this request only. * @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 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { return rerunInstanceAsync(runId, _callback, opts); } } /** * [EXPERIMENTAL] RerunInstance: Reruns a single instance execution. * <br>Reruns an execution instance of an integration. <br /> <br /> <br>The user must be authenticated, entitled to call this method, and the user's domain must be licensed for the integration. * @param runId Run identifier e.g. \"b64135e7-98a0-41af-a845-d86167d54cc7\". (required) * @return APIrerunInstanceRequest * @http.response.details
Status Code Description Response Headers
200 The instance was rerun. -
404 The execution does not exist. -
0 Error response -
*/ public APIrerunInstanceRequest rerunInstance(String runId) { return new APIrerunInstanceRequest(runId); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy