Skip to content

Commit ff79bda

Browse files
Merge pull request #234 from regulaforensics/develop
Develop -> Stable
2 parents df9e69b + 88f75de commit ff79bda

File tree

14 files changed

+1425
-13
lines changed

14 files changed

+1425
-13
lines changed

client/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ src/main/generated/com/regula/documentreader/webclient/ServerVariable.java
1313
src/main/generated/com/regula/documentreader/webclient/StringUtil.java
1414
src/main/generated/com/regula/documentreader/webclient/api/HealthcheckApi.java
1515
src/main/generated/com/regula/documentreader/webclient/api/ProcessApi.java
16+
src/main/generated/com/regula/documentreader/webclient/api/ResourcesApi.java
1617
src/main/generated/com/regula/documentreader/webclient/api/TransactionApi.java
1718
src/main/generated/com/regula/documentreader/webclient/auth/ApiKeyAuth.java
1819
src/main/generated/com/regula/documentreader/webclient/auth/Authentication.java
@@ -49,6 +50,8 @@ src/main/generated/com/regula/documentreader/webclient/model/ContainerListListIn
4950
src/main/generated/com/regula/documentreader/webclient/model/Critical.java
5051
src/main/generated/com/regula/documentreader/webclient/model/CrossSourceValueComparison.java
5152
src/main/generated/com/regula/documentreader/webclient/model/DataModule.java
53+
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocument.java
54+
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocumentList.java
5255
src/main/generated/com/regula/documentreader/webclient/model/DetailsOptical.java
5356
src/main/generated/com/regula/documentreader/webclient/model/DetailsRFID.java
5457
src/main/generated/com/regula/documentreader/webclient/model/DeviceInfo.java
@@ -89,6 +92,7 @@ src/main/generated/com/regula/documentreader/webclient/model/FiberResult.java
8992
src/main/generated/com/regula/documentreader/webclient/model/FieldItem.java
9093
src/main/generated/com/regula/documentreader/webclient/model/FileImage.java
9194
src/main/generated/com/regula/documentreader/webclient/model/GetTransactionsByTagResponse.java
95+
src/main/generated/com/regula/documentreader/webclient/model/GlaresCheckParams.java
9296
src/main/generated/com/regula/documentreader/webclient/model/GraphData.java
9397
src/main/generated/com/regula/documentreader/webclient/model/GraphicField.java
9498
src/main/generated/com/regula/documentreader/webclient/model/GraphicFieldType.java

client/generator-templates/lenient/JSON.mustache

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import java.util.Date;
4242
import java.util.Locale;
4343
import java.util.Map;
4444
import java.util.HashMap;
45+
import com.regula.documentreader.webclient.model.ResultItem;
4546

4647
/*
4748
* A JSON utility class
@@ -83,6 +84,15 @@ public class JSON {
8384
System.err.println("Warning: failed to parse field of type "
8485
+ type + ", reason: " + e.getMessage());
8586
in.skipValue();
87+
88+
if (type.getRawType() == ResultItem.class) {
89+
try {
90+
return (T) ResultItem.class.getDeclaredConstructor().newInstance();
91+
} catch (Exception ex) {
92+
throw new IOException("Failed to create default ResultItem", ex);
93+
}
94+
}
95+
8696
return null;
8797
}
8898
}

client/src/main/generated/com/regula/documentreader/webclient/JSON.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.gson.reflect.TypeToken;
2323
import com.google.gson.stream.JsonReader;
2424
import com.google.gson.stream.JsonWriter;
25+
import com.regula.documentreader.webclient.model.ResultItem;
2526
import io.gsonfire.GsonFireBuilder;
2627
import io.gsonfire.TypeSelector;
2728
import java.io.IOException;
@@ -76,6 +77,15 @@ public T read(JsonReader in) throws IOException {
7677
System.err.println(
7778
"Warning: failed to parse field of type " + type + ", reason: " + e.getMessage());
7879
in.skipValue();
80+
81+
if (type.getRawType() == ResultItem.class) {
82+
try {
83+
return (T) ResultItem.class.getDeclaredConstructor().newInstance();
84+
} catch (Exception ex) {
85+
throw new IOException("Failed to create default ResultItem", ex);
86+
}
87+
}
88+
7989
return null;
8090
}
8191
}
@@ -980,6 +990,11 @@ private static Class getClassByDiscriminator(
980990
.CustomTypeAdapterFactory());
981991
gsonBuilder.registerTypeAdapterFactory(
982992
new com.regula.documentreader.webclient.model.DataModule.CustomTypeAdapterFactory());
993+
gsonBuilder.registerTypeAdapterFactory(
994+
new com.regula.documentreader.webclient.model.DatabaseDocument.CustomTypeAdapterFactory());
995+
gsonBuilder.registerTypeAdapterFactory(
996+
new com.regula.documentreader.webclient.model.DatabaseDocumentList
997+
.CustomTypeAdapterFactory());
983998
gsonBuilder.registerTypeAdapterFactory(
984999
new com.regula.documentreader.webclient.model.DetailsOptical.CustomTypeAdapterFactory());
9851000
gsonBuilder.registerTypeAdapterFactory(
@@ -1072,6 +1087,8 @@ private static Class getClassByDiscriminator(
10721087
gsonBuilder.registerTypeAdapterFactory(
10731088
new com.regula.documentreader.webclient.model.GetTransactionsByTagResponse
10741089
.CustomTypeAdapterFactory());
1090+
gsonBuilder.registerTypeAdapterFactory(
1091+
new com.regula.documentreader.webclient.model.GlaresCheckParams.CustomTypeAdapterFactory());
10751092
gsonBuilder.registerTypeAdapterFactory(
10761093
new com.regula.documentreader.webclient.model.GraphData.CustomTypeAdapterFactory());
10771094
gsonBuilder.registerTypeAdapterFactory(
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
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&lt;DatabaseDocumentList&gt;
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

Comments
 (0)