| /** |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| /* |
| * Fineract Credit Scorecard |
| * An API module for credit risk assessment |
| * |
| * 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 org.apache.fineract.credit.scorecard.services; |
| |
| import org.apache.fineract.credit.scorecard.ApiCallback; |
| import org.apache.fineract.credit.scorecard.ApiClient; |
| import org.apache.fineract.credit.scorecard.ApiException; |
| import org.apache.fineract.credit.scorecard.ApiResponse; |
| import org.apache.fineract.credit.scorecard.Configuration; |
| import org.apache.fineract.credit.scorecard.Pair; |
| import org.apache.fineract.credit.scorecard.ProgressRequestBody; |
| import org.apache.fineract.credit.scorecard.ProgressResponseBody; |
| |
| import com.google.gson.reflect.TypeToken; |
| |
| import java.io.IOException; |
| |
| |
| import org.apache.fineract.credit.scorecard.models.Algorithm; |
| import org.apache.fineract.credit.scorecard.models.PredictionResponse; |
| |
| import java.lang.reflect.Type; |
| import java.util.ArrayList; |
| import java.util.HashMap; |
| import java.util.List; |
| import java.util.Map; |
| |
| public class AlgorithmsApi { |
| private ApiClient localVarApiClient; |
| |
| public AlgorithmsApi() { |
| this(Configuration.getDefaultApiClient()); |
| } |
| |
| public AlgorithmsApi(ApiClient apiClient) { |
| this.localVarApiClient = apiClient; |
| } |
| |
| public ApiClient getApiClient() { |
| return localVarApiClient; |
| } |
| |
| public void setApiClient(ApiClient apiClient) { |
| this.localVarApiClient = apiClient; |
| } |
| |
| /** |
| * Build call for algorithmsCreate |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 201 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsCreateCall(Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = algorithm; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms"; |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| final String[] localVarAccepts = { |
| "application/json" |
| }; |
| final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| if (localVarAccept != null) { |
| localVarHeaderParams.put("Accept", localVarAccept); |
| } |
| |
| final String[] localVarContentTypes = { |
| "application/json", "application/x-www-form-urlencoded", "multipart/form-data" |
| }; |
| final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsCreateValidateBeforeCall(Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'algorithm' is set |
| if (algorithm == null) { |
| throw new ApiException("Missing the required parameter 'algorithm' when calling algorithmsCreate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsCreateCall(algorithm, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param algorithm (required) |
| * @return Algorithm |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 201 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public Algorithm algorithmsCreate(Algorithm algorithm) throws ApiException { |
| ApiResponse<Algorithm> localVarResp = algorithmsCreateWithHttpInfo(algorithm); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param algorithm (required) |
| * @return ApiResponse<Algorithm> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 201 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<Algorithm> algorithmsCreateWithHttpInfo(Algorithm algorithm) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsCreateValidateBeforeCall(algorithm, null); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 201 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsCreateAsync(Algorithm algorithm, final ApiCallback<Algorithm> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsCreateValidateBeforeCall(algorithm, _callback); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsDestroy |
| * @param id A unique integer value identifying this algorithm. (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 204 </td><td> No response body </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsDestroyCall(Integer id, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms/{id}" |
| .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| final String[] localVarAccepts = { |
| |
| }; |
| final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| if (localVarAccept != null) { |
| localVarHeaderParams.put("Accept", localVarAccept); |
| } |
| |
| final String[] localVarContentTypes = { |
| |
| }; |
| final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsDestroyValidateBeforeCall(Integer id, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'id' is set |
| if (id == null) { |
| throw new ApiException("Missing the required parameter 'id' when calling algorithmsDestroy(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsDestroyCall(id, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 204 </td><td> No response body </td><td> - </td></tr> |
| </table> |
| */ |
| public void algorithmsDestroy(Integer id) throws ApiException { |
| algorithmsDestroyWithHttpInfo(id); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @return ApiResponse<Void> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 204 </td><td> No response body </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<Void> algorithmsDestroyWithHttpInfo(Integer id) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsDestroyValidateBeforeCall(id, null); |
| return localVarApiClient.execute(localVarCall); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this algorithm. (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 204 </td><td> No response body </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsDestroyAsync(Integer id, final ApiCallback<Void> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsDestroyValidateBeforeCall(id, _callback); |
| localVarApiClient.executeAsync(localVarCall, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsList |
| * @param _callback Callback for upload/download progress |
| * @return Call to execute |
| * @throws ApiException If fail to serialize the request body object |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsListCall(final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms"; |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| 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); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsListValidateBeforeCall(final ApiCallback _callback) throws ApiException { |
| |
| |
| okhttp3.Call localVarCall = algorithmsListCall(_callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @return List<Algorithm> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public List<Algorithm> algorithmsList() throws ApiException { |
| ApiResponse<List<Algorithm>> localVarResp = algorithmsListWithHttpInfo(); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @return ApiResponse<List<Algorithm>> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<List<Algorithm>> algorithmsListWithHttpInfo() throws ApiException { |
| okhttp3.Call localVarCall = algorithmsListValidateBeforeCall(null); |
| Type localVarReturnType = new TypeToken<List<Algorithm>>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsListAsync(final ApiCallback<List<Algorithm>> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsListValidateBeforeCall(_callback); |
| Type localVarReturnType = new TypeToken<List<Algorithm>>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsPartialUpdate |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsPartialUpdateCall(Integer id, Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = algorithm; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms/{id}" |
| .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| final String[] localVarAccepts = { |
| "application/json" |
| }; |
| final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| if (localVarAccept != null) { |
| localVarHeaderParams.put("Accept", localVarAccept); |
| } |
| |
| final String[] localVarContentTypes = { |
| "application/json", "application/x-www-form-urlencoded", "multipart/form-data" |
| }; |
| final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsPartialUpdateValidateBeforeCall(Integer id, Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'id' is set |
| if (id == null) { |
| throw new ApiException("Missing the required parameter 'id' when calling algorithmsPartialUpdate(Async)"); |
| } |
| |
| // verify the required parameter 'algorithm' is set |
| if (algorithm == null) { |
| throw new ApiException("Missing the required parameter 'algorithm' when calling algorithmsPartialUpdate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsPartialUpdateCall(id, algorithm, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (required) |
| * @return Algorithm |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public Algorithm algorithmsPartialUpdate(Integer id, Algorithm algorithm) throws ApiException { |
| ApiResponse<Algorithm> localVarResp = algorithmsPartialUpdateWithHttpInfo(id, algorithm); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (required) |
| * @return ApiResponse<Algorithm> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<Algorithm> algorithmsPartialUpdateWithHttpInfo(Integer id, Algorithm algorithm) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsPartialUpdateValidateBeforeCall(id, algorithm, null); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsPartialUpdateAsync(Integer id, Algorithm algorithm, final ApiCallback<Algorithm> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsPartialUpdateValidateBeforeCall(id, algorithm, _callback); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsPredict |
| * @param classifier The algorithm/classifier to use (required) |
| * @param version Algorithm version (required) |
| * @param dataset The name of the dataset (optional) |
| * @param status The status of the algorithm (optional) |
| * @param requestBody (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsPredictCall(String classifier, String version, String dataset, String status, Map<String, Object> requestBody, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = requestBody; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms/predict"; |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| if (classifier != null) { |
| localVarQueryParams.addAll(localVarApiClient.parameterToPair("classifier", classifier)); |
| } |
| |
| if (dataset != null) { |
| localVarQueryParams.addAll(localVarApiClient.parameterToPair("dataset", dataset)); |
| } |
| |
| if (status != null) { |
| localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); |
| } |
| |
| if (version != null) { |
| localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); |
| } |
| |
| final String[] localVarAccepts = { |
| "application/json" |
| }; |
| final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| if (localVarAccept != null) { |
| localVarHeaderParams.put("Accept", localVarAccept); |
| } |
| |
| final String[] localVarContentTypes = { |
| "application/json", "application/x-www-form-urlencoded", "multipart/form-data" |
| }; |
| final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsPredictValidateBeforeCall(String classifier, String version, String dataset, String status, Map<String, Object> requestBody, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'classifier' is set |
| if (classifier == null) { |
| throw new ApiException("Missing the required parameter 'classifier' when calling algorithmsPredict(Async)"); |
| } |
| |
| // verify the required parameter 'version' is set |
| if (version == null) { |
| throw new ApiException("Missing the required parameter 'version' when calling algorithmsPredict(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsPredictCall(classifier, version, dataset, status, requestBody, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * Predict credit risk for a loan |
| * @param classifier The algorithm/classifier to use (required) |
| * @param version Algorithm version (required) |
| * @param dataset The name of the dataset (optional) |
| * @param status The status of the algorithm (optional) |
| * @param requestBody (optional) |
| * @return PredictionResponse |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public PredictionResponse algorithmsPredict(String classifier, String version, String dataset, String status, Map<String, Object> requestBody) throws ApiException { |
| ApiResponse<PredictionResponse> localVarResp = algorithmsPredictWithHttpInfo(classifier, version, dataset, status, requestBody); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * Predict credit risk for a loan |
| * @param classifier The algorithm/classifier to use (required) |
| * @param version Algorithm version (required) |
| * @param dataset The name of the dataset (optional) |
| * @param status The status of the algorithm (optional) |
| * @param requestBody (optional) |
| * @return ApiResponse<PredictionResponse> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<PredictionResponse> algorithmsPredictWithHttpInfo(String classifier, String version, String dataset, String status, Map<String, Object> requestBody) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsPredictValidateBeforeCall(classifier, version, dataset, status, requestBody, null); |
| Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * Predict credit risk for a loan |
| * @param classifier The algorithm/classifier to use (required) |
| * @param version Algorithm version (required) |
| * @param dataset The name of the dataset (optional) |
| * @param status The status of the algorithm (optional) |
| * @param requestBody (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsPredictAsync(String classifier, String version, String dataset, String status, Map<String, Object> requestBody, final ApiCallback<PredictionResponse> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsPredictValidateBeforeCall(classifier, version, dataset, status, requestBody, _callback); |
| Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsRetrieve |
| * @param id A unique integer value identifying this algorithm. (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsRetrieveCall(Integer id, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms/{id}" |
| .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| 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); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsRetrieveValidateBeforeCall(Integer id, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'id' is set |
| if (id == null) { |
| throw new ApiException("Missing the required parameter 'id' when calling algorithmsRetrieve(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsRetrieveCall(id, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @return Algorithm |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public Algorithm algorithmsRetrieve(Integer id) throws ApiException { |
| ApiResponse<Algorithm> localVarResp = algorithmsRetrieveWithHttpInfo(id); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @return ApiResponse<Algorithm> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<Algorithm> algorithmsRetrieveWithHttpInfo(Integer id) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsRetrieveValidateBeforeCall(id, null); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this algorithm. (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsRetrieveAsync(Integer id, final ApiCallback<Algorithm> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsRetrieveValidateBeforeCall(id, _callback); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for algorithmsUpdate |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsUpdateCall(Integer id, Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = algorithm; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/algorithms/{id}" |
| .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); |
| |
| List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| |
| final String[] localVarAccepts = { |
| "application/json" |
| }; |
| final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| if (localVarAccept != null) { |
| localVarHeaderParams.put("Accept", localVarAccept); |
| } |
| |
| final String[] localVarContentTypes = { |
| "application/json", "application/x-www-form-urlencoded", "multipart/form-data" |
| }; |
| final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| localVarHeaderParams.put("Content-Type", localVarContentType); |
| |
| String[] localVarAuthNames = new String[] { }; |
| return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| } |
| |
| @SuppressWarnings("rawtypes") |
| private okhttp3.Call algorithmsUpdateValidateBeforeCall(Integer id, Algorithm algorithm, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'id' is set |
| if (id == null) { |
| throw new ApiException("Missing the required parameter 'id' when calling algorithmsUpdate(Async)"); |
| } |
| |
| // verify the required parameter 'algorithm' is set |
| if (algorithm == null) { |
| throw new ApiException("Missing the required parameter 'algorithm' when calling algorithmsUpdate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = algorithmsUpdateCall(id, algorithm, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (required) |
| * @return Algorithm |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public Algorithm algorithmsUpdate(Integer id, Algorithm algorithm) throws ApiException { |
| ApiResponse<Algorithm> localVarResp = algorithmsUpdateWithHttpInfo(id, algorithm); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (required) |
| * @return ApiResponse<Algorithm> |
| * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| * @http.response.details |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public ApiResponse<Algorithm> algorithmsUpdateWithHttpInfo(Integer id, Algorithm algorithm) throws ApiException { |
| okhttp3.Call localVarCall = algorithmsUpdateValidateBeforeCall(id, algorithm, null); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this algorithm. (required) |
| * @param algorithm (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 |
| <table summary="Response Details" border="1"> |
| <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| <tr><td> 200 </td><td> </td><td> - </td></tr> |
| </table> |
| */ |
| public okhttp3.Call algorithmsUpdateAsync(Integer id, Algorithm algorithm, final ApiCallback<Algorithm> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = algorithmsUpdateValidateBeforeCall(id, algorithm, _callback); |
| Type localVarReturnType = new TypeToken<Algorithm>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| } |