|
| 1 | +/* |
| 2 | + * Regula Document Reader Web API |
| 3 | + * Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 8.1.0 |
| 6 | + * |
| 7 | + * |
| 8 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 9 | + * https://openapi-generator.tech |
| 10 | + * Do not edit the class manually. |
| 11 | + */ |
| 12 | + |
| 13 | +package com.regula.documentreader.webclient.api; |
| 14 | + |
| 15 | +import com.google.gson.reflect.TypeToken; |
| 16 | +import com.regula.documentreader.webclient.ApiCallback; |
| 17 | +import com.regula.documentreader.webclient.ApiClient; |
| 18 | +import com.regula.documentreader.webclient.ApiException; |
| 19 | +import com.regula.documentreader.webclient.ApiResponse; |
| 20 | +import com.regula.documentreader.webclient.Configuration; |
| 21 | +import com.regula.documentreader.webclient.Pair; |
| 22 | +import com.regula.documentreader.webclient.model.DatabaseDocumentList; |
| 23 | +import java.lang.reflect.Type; |
| 24 | +import java.util.ArrayList; |
| 25 | +import java.util.HashMap; |
| 26 | +import java.util.List; |
| 27 | +import java.util.Map; |
| 28 | + |
| 29 | +public class ResourcesApi { |
| 30 | + private ApiClient localVarApiClient; |
| 31 | + private int localHostIndex; |
| 32 | + private String localCustomBaseUrl; |
| 33 | + |
| 34 | + public ResourcesApi() { |
| 35 | + this(Configuration.getDefaultApiClient()); |
| 36 | + } |
| 37 | + |
| 38 | + public ResourcesApi(ApiClient apiClient) { |
| 39 | + this.localVarApiClient = apiClient; |
| 40 | + } |
| 41 | + |
| 42 | + public ApiClient getApiClient() { |
| 43 | + return localVarApiClient; |
| 44 | + } |
| 45 | + |
| 46 | + public void setApiClient(ApiClient apiClient) { |
| 47 | + this.localVarApiClient = apiClient; |
| 48 | + } |
| 49 | + |
| 50 | + public int getHostIndex() { |
| 51 | + return localHostIndex; |
| 52 | + } |
| 53 | + |
| 54 | + public void setHostIndex(int hostIndex) { |
| 55 | + this.localHostIndex = hostIndex; |
| 56 | + } |
| 57 | + |
| 58 | + public String getCustomBaseUrl() { |
| 59 | + return localCustomBaseUrl; |
| 60 | + } |
| 61 | + |
| 62 | + public void setCustomBaseUrl(String customBaseUrl) { |
| 63 | + this.localCustomBaseUrl = customBaseUrl; |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * Build call for doclist |
| 68 | + * |
| 69 | + * @param _callback Callback for upload/download progress |
| 70 | + * @return Call to execute |
| 71 | + * @throws ApiException If fail to serialize the request body object |
| 72 | + * @http.response.details |
| 73 | + * <table border="1"> |
| 74 | + * <caption>Response Details</caption> |
| 75 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 76 | + * <tr><td> 200 </td><td> The list of documents stored in the database. </td><td> - </td></tr> |
| 77 | + * </table> |
| 78 | + */ |
| 79 | + public okhttp3.Call doclistCall(final ApiCallback _callback) throws ApiException { |
| 80 | + String basePath = null; |
| 81 | + // Operation Servers |
| 82 | + String[] localBasePaths = new String[] {}; |
| 83 | + |
| 84 | + // Determine Base Path to Use |
| 85 | + if (localCustomBaseUrl != null) { |
| 86 | + basePath = localCustomBaseUrl; |
| 87 | + } else if (localBasePaths.length > 0) { |
| 88 | + basePath = localBasePaths[localHostIndex]; |
| 89 | + } else { |
| 90 | + basePath = null; |
| 91 | + } |
| 92 | + |
| 93 | + Object localVarPostBody = null; |
| 94 | + |
| 95 | + // create path and map variables |
| 96 | + String localVarPath = "/api/doclist"; |
| 97 | + |
| 98 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 99 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 100 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 101 | + Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| 102 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 103 | + |
| 104 | + final String[] localVarAccepts = {"application/json"}; |
| 105 | + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| 106 | + if (localVarAccept != null) { |
| 107 | + localVarHeaderParams.put("Accept", localVarAccept); |
| 108 | + } |
| 109 | + |
| 110 | + final String[] localVarContentTypes = {}; |
| 111 | + final String localVarContentType = |
| 112 | + localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| 113 | + if (localVarContentType != null) { |
| 114 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 115 | + } |
| 116 | + |
| 117 | + String[] localVarAuthNames = new String[] {}; |
| 118 | + return localVarApiClient.buildCall( |
| 119 | + basePath, |
| 120 | + localVarPath, |
| 121 | + "GET", |
| 122 | + localVarQueryParams, |
| 123 | + localVarCollectionQueryParams, |
| 124 | + localVarPostBody, |
| 125 | + localVarHeaderParams, |
| 126 | + localVarCookieParams, |
| 127 | + localVarFormParams, |
| 128 | + localVarAuthNames, |
| 129 | + _callback); |
| 130 | + } |
| 131 | + |
| 132 | + @SuppressWarnings("rawtypes") |
| 133 | + private okhttp3.Call doclistValidateBeforeCall(final ApiCallback _callback) throws ApiException { |
| 134 | + return doclistCall(_callback); |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * Returns the list of documents stored in the database that the Web Service API is running with. |
| 139 | + * |
| 140 | + * @return DatabaseDocumentList |
| 141 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the |
| 142 | + * response body |
| 143 | + * @http.response.details |
| 144 | + * <table border="1"> |
| 145 | + * <caption>Response Details</caption> |
| 146 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 147 | + * <tr><td> 200 </td><td> The list of documents stored in the database. </td><td> - </td></tr> |
| 148 | + * </table> |
| 149 | + */ |
| 150 | + public DatabaseDocumentList doclist() throws ApiException { |
| 151 | + ApiResponse<DatabaseDocumentList> localVarResp = doclistWithHttpInfo(); |
| 152 | + return localVarResp.getData(); |
| 153 | + } |
| 154 | + |
| 155 | + /** |
| 156 | + * Returns the list of documents stored in the database that the Web Service API is running with. |
| 157 | + * |
| 158 | + * @return ApiResponse<DatabaseDocumentList> |
| 159 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the |
| 160 | + * response body |
| 161 | + * @http.response.details |
| 162 | + * <table border="1"> |
| 163 | + * <caption>Response Details</caption> |
| 164 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 165 | + * <tr><td> 200 </td><td> The list of documents stored in the database. </td><td> - </td></tr> |
| 166 | + * </table> |
| 167 | + */ |
| 168 | + public ApiResponse<DatabaseDocumentList> doclistWithHttpInfo() throws ApiException { |
| 169 | + okhttp3.Call localVarCall = doclistValidateBeforeCall(null); |
| 170 | + Type localVarReturnType = new TypeToken<DatabaseDocumentList>() {}.getType(); |
| 171 | + return localVarApiClient.execute(localVarCall, localVarReturnType); |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * Returns the list of documents stored in the database that the Web Service API is running with. |
| 176 | + * (asynchronously) |
| 177 | + * |
| 178 | + * @param _callback The callback to be executed when the API call finishes |
| 179 | + * @return The request call |
| 180 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 181 | + * @http.response.details |
| 182 | + * <table border="1"> |
| 183 | + * <caption>Response Details</caption> |
| 184 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 185 | + * <tr><td> 200 </td><td> The list of documents stored in the database. </td><td> - </td></tr> |
| 186 | + * </table> |
| 187 | + */ |
| 188 | + public okhttp3.Call doclistAsync(final ApiCallback<DatabaseDocumentList> _callback) |
| 189 | + throws ApiException { |
| 190 | + |
| 191 | + okhttp3.Call localVarCall = doclistValidateBeforeCall(_callback); |
| 192 | + Type localVarReturnType = new TypeToken<DatabaseDocumentList>() {}.getType(); |
| 193 | + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); |
| 194 | + return localVarCall; |
| 195 | + } |
| 196 | +} |
0 commit comments