| /** |
| * 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.PredictionRequest; |
| |
| import java.lang.reflect.Type; |
| import java.util.ArrayList; |
| import java.util.HashMap; |
| import java.util.List; |
| import java.util.Map; |
| |
| public class RequestsApi { |
| private ApiClient localVarApiClient; |
| |
| public RequestsApi() { |
| this(Configuration.getDefaultApiClient()); |
| } |
| |
| public RequestsApi(ApiClient apiClient) { |
| this.localVarApiClient = apiClient; |
| } |
| |
| public ApiClient getApiClient() { |
| return localVarApiClient; |
| } |
| |
| public void setApiClient(ApiClient apiClient) { |
| this.localVarApiClient = apiClient; |
| } |
| |
| /** |
| * Build call for requestsCreate |
| * @param predictionRequest (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 requestsCreateCall(PredictionRequest predictionRequest, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = predictionRequest; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests"; |
| |
| 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 requestsCreateValidateBeforeCall(PredictionRequest predictionRequest, final ApiCallback _callback) throws ApiException { |
| |
| // verify the required parameter 'predictionRequest' is set |
| if (predictionRequest == null) { |
| throw new ApiException("Missing the required parameter 'predictionRequest' when calling requestsCreate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = requestsCreateCall(predictionRequest, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param predictionRequest (required) |
| * @return PredictionRequest |
| * @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 PredictionRequest requestsCreate(PredictionRequest predictionRequest) throws ApiException { |
| ApiResponse<PredictionRequest> localVarResp = requestsCreateWithHttpInfo(predictionRequest); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param predictionRequest (required) |
| * @return ApiResponse<PredictionRequest> |
| * @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<PredictionRequest> requestsCreateWithHttpInfo(PredictionRequest predictionRequest) throws ApiException { |
| okhttp3.Call localVarCall = requestsCreateValidateBeforeCall(predictionRequest, null); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param predictionRequest (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 requestsCreateAsync(PredictionRequest predictionRequest, final ApiCallback<PredictionRequest> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsCreateValidateBeforeCall(predictionRequest, _callback); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for requestsDestroy |
| * @param id A unique integer value identifying this prediction request. (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 requestsDestroyCall(Integer id, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests/{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 requestsDestroyValidateBeforeCall(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 requestsDestroy(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = requestsDestroyCall(id, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (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 requestsDestroy(Integer id) throws ApiException { |
| requestsDestroyWithHttpInfo(id); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (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> requestsDestroyWithHttpInfo(Integer id) throws ApiException { |
| okhttp3.Call localVarCall = requestsDestroyValidateBeforeCall(id, null); |
| return localVarApiClient.execute(localVarCall); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this prediction request. (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 requestsDestroyAsync(Integer id, final ApiCallback<Void> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsDestroyValidateBeforeCall(id, _callback); |
| localVarApiClient.executeAsync(localVarCall, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for requestsList |
| * @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 requestsListCall(final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests"; |
| |
| 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 requestsListValidateBeforeCall(final ApiCallback _callback) throws ApiException { |
| |
| |
| okhttp3.Call localVarCall = requestsListCall(_callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @return List<PredictionRequest> |
| * @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<PredictionRequest> requestsList() throws ApiException { |
| ApiResponse<List<PredictionRequest>> localVarResp = requestsListWithHttpInfo(); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @return ApiResponse<List<PredictionRequest>> |
| * @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<PredictionRequest>> requestsListWithHttpInfo() throws ApiException { |
| okhttp3.Call localVarCall = requestsListValidateBeforeCall(null); |
| Type localVarReturnType = new TypeToken<List<PredictionRequest>>(){}.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 requestsListAsync(final ApiCallback<List<PredictionRequest>> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsListValidateBeforeCall(_callback); |
| Type localVarReturnType = new TypeToken<List<PredictionRequest>>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for requestsPartialUpdate |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (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 requestsPartialUpdateCall(Integer id, PredictionRequest predictionRequest, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = predictionRequest; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests/{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 requestsPartialUpdateValidateBeforeCall(Integer id, PredictionRequest predictionRequest, 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 requestsPartialUpdate(Async)"); |
| } |
| |
| // verify the required parameter 'predictionRequest' is set |
| if (predictionRequest == null) { |
| throw new ApiException("Missing the required parameter 'predictionRequest' when calling requestsPartialUpdate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = requestsPartialUpdateCall(id, predictionRequest, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (required) |
| * @return PredictionRequest |
| * @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 PredictionRequest requestsPartialUpdate(Integer id, PredictionRequest predictionRequest) throws ApiException { |
| ApiResponse<PredictionRequest> localVarResp = requestsPartialUpdateWithHttpInfo(id, predictionRequest); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (required) |
| * @return ApiResponse<PredictionRequest> |
| * @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<PredictionRequest> requestsPartialUpdateWithHttpInfo(Integer id, PredictionRequest predictionRequest) throws ApiException { |
| okhttp3.Call localVarCall = requestsPartialUpdateValidateBeforeCall(id, predictionRequest, null); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (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 requestsPartialUpdateAsync(Integer id, PredictionRequest predictionRequest, final ApiCallback<PredictionRequest> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsPartialUpdateValidateBeforeCall(id, predictionRequest, _callback); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for requestsRetrieve |
| * @param id A unique integer value identifying this prediction request. (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 requestsRetrieveCall(Integer id, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = null; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests/{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 requestsRetrieveValidateBeforeCall(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 requestsRetrieve(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = requestsRetrieveCall(id, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @return PredictionRequest |
| * @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 PredictionRequest requestsRetrieve(Integer id) throws ApiException { |
| ApiResponse<PredictionRequest> localVarResp = requestsRetrieveWithHttpInfo(id); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @return ApiResponse<PredictionRequest> |
| * @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<PredictionRequest> requestsRetrieveWithHttpInfo(Integer id) throws ApiException { |
| okhttp3.Call localVarCall = requestsRetrieveValidateBeforeCall(id, null); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this prediction request. (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 requestsRetrieveAsync(Integer id, final ApiCallback<PredictionRequest> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsRetrieveValidateBeforeCall(id, _callback); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| /** |
| * Build call for requestsUpdate |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (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 requestsUpdateCall(Integer id, PredictionRequest predictionRequest, final ApiCallback _callback) throws ApiException { |
| Object localVarPostBody = predictionRequest; |
| |
| // create path and map variables |
| String localVarPath = "/api/v1/requests/{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 requestsUpdateValidateBeforeCall(Integer id, PredictionRequest predictionRequest, 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 requestsUpdate(Async)"); |
| } |
| |
| // verify the required parameter 'predictionRequest' is set |
| if (predictionRequest == null) { |
| throw new ApiException("Missing the required parameter 'predictionRequest' when calling requestsUpdate(Async)"); |
| } |
| |
| |
| okhttp3.Call localVarCall = requestsUpdateCall(id, predictionRequest, _callback); |
| return localVarCall; |
| |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (required) |
| * @return PredictionRequest |
| * @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 PredictionRequest requestsUpdate(Integer id, PredictionRequest predictionRequest) throws ApiException { |
| ApiResponse<PredictionRequest> localVarResp = requestsUpdateWithHttpInfo(id, predictionRequest); |
| return localVarResp.getData(); |
| } |
| |
| /** |
| * |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (required) |
| * @return ApiResponse<PredictionRequest> |
| * @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<PredictionRequest> requestsUpdateWithHttpInfo(Integer id, PredictionRequest predictionRequest) throws ApiException { |
| okhttp3.Call localVarCall = requestsUpdateValidateBeforeCall(id, predictionRequest, null); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| return localVarApiClient.execute(localVarCall, localVarReturnType); |
| } |
| |
| /** |
| * (asynchronously) |
| * |
| * @param id A unique integer value identifying this prediction request. (required) |
| * @param predictionRequest (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 requestsUpdateAsync(Integer id, PredictionRequest predictionRequest, final ApiCallback<PredictionRequest> _callback) throws ApiException { |
| |
| okhttp3.Call localVarCall = requestsUpdateValidateBeforeCall(id, predictionRequest, _callback); |
| Type localVarReturnType = new TypeToken<PredictionRequest>(){}.getType(); |
| localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| return localVarCall; |
| } |
| } |