Skip to content

Commit 5eba55f

Browse files
authored
Merge pull request #64 from regulaforensics/b3e9cacf
update clients
2 parents 6c60dd8 + 2cd384c commit 5eba55f

3 files changed

Lines changed: 56 additions & 21 deletions

File tree

client/src/main/generated/com/regula/documentreader/webclient/api/DefaultApi.java

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void setApiClient(ApiClient apiClient) {
4848
/**
4949
* Build call for ping
5050
*
51+
* @param xRequestID (optional)
5152
* @param _callback Callback for upload/download progress
5253
* @return Call to execute
5354
* @throws ApiException If fail to serialize the request body object
@@ -57,7 +58,7 @@ public void setApiClient(ApiClient apiClient) {
5758
* <tr><td> 200 </td><td> Device info </td><td> - </td></tr>
5859
* </table>
5960
*/
60-
public okhttp3.Call pingCall(final ApiCallback _callback) throws ApiException {
61+
public okhttp3.Call pingCall(String xRequestID, final ApiCallback _callback) throws ApiException {
6162
Object localVarPostBody = null;
6263

6364
// create path and map variables
@@ -66,6 +67,10 @@ public okhttp3.Call pingCall(final ApiCallback _callback) throws ApiException {
6667
List<Pair> localVarQueryParams = new ArrayList<Pair>();
6768
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
6869
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
70+
if (xRequestID != null) {
71+
localVarHeaderParams.put("X-RequestID", localVarApiClient.parameterToString(xRequestID));
72+
}
73+
6974
Map<String, String> localVarCookieParams = new HashMap<String, String>();
7075
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
7176
final String[] localVarAccepts = {"application/json"};
@@ -95,15 +100,17 @@ public okhttp3.Call pingCall(final ApiCallback _callback) throws ApiException {
95100
}
96101

97102
@SuppressWarnings("rawtypes")
98-
private okhttp3.Call pingValidateBeforeCall(final ApiCallback _callback) throws ApiException {
103+
private okhttp3.Call pingValidateBeforeCall(String xRequestID, final ApiCallback _callback)
104+
throws ApiException {
99105

100-
okhttp3.Call localVarCall = pingCall(_callback);
106+
okhttp3.Call localVarCall = pingCall(xRequestID, _callback);
101107
return localVarCall;
102108
}
103109

104110
/**
105111
* Server health check
106112
*
113+
* @param xRequestID (optional)
107114
* @return DeviceInfo
108115
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
109116
* response body
@@ -113,14 +120,15 @@ private okhttp3.Call pingValidateBeforeCall(final ApiCallback _callback) throws
113120
* <tr><td> 200 </td><td> Device info </td><td> - </td></tr>
114121
* </table>
115122
*/
116-
public DeviceInfo ping() throws ApiException {
117-
ApiResponse<DeviceInfo> localVarResp = pingWithHttpInfo();
123+
public DeviceInfo ping(String xRequestID) throws ApiException {
124+
ApiResponse<DeviceInfo> localVarResp = pingWithHttpInfo(xRequestID);
118125
return localVarResp.getData();
119126
}
120127

121128
/**
122129
* Server health check
123130
*
131+
* @param xRequestID (optional)
124132
* @return ApiResponse&lt;DeviceInfo&gt;
125133
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
126134
* response body
@@ -130,15 +138,16 @@ public DeviceInfo ping() throws ApiException {
130138
* <tr><td> 200 </td><td> Device info </td><td> - </td></tr>
131139
* </table>
132140
*/
133-
public ApiResponse<DeviceInfo> pingWithHttpInfo() throws ApiException {
134-
okhttp3.Call localVarCall = pingValidateBeforeCall(null);
141+
public ApiResponse<DeviceInfo> pingWithHttpInfo(String xRequestID) throws ApiException {
142+
okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, null);
135143
Type localVarReturnType = new TypeToken<DeviceInfo>() {}.getType();
136144
return localVarApiClient.execute(localVarCall, localVarReturnType);
137145
}
138146

139147
/**
140148
* Server health check (asynchronously)
141149
*
150+
* @param xRequestID (optional)
142151
* @param _callback The callback to be executed when the API call finishes
143152
* @return The request call
144153
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -148,9 +157,10 @@ public ApiResponse<DeviceInfo> pingWithHttpInfo() throws ApiException {
148157
* <tr><td> 200 </td><td> Device info </td><td> - </td></tr>
149158
* </table>
150159
*/
151-
public okhttp3.Call pingAsync(final ApiCallback<DeviceInfo> _callback) throws ApiException {
160+
public okhttp3.Call pingAsync(String xRequestID, final ApiCallback<DeviceInfo> _callback)
161+
throws ApiException {
152162

153-
okhttp3.Call localVarCall = pingValidateBeforeCall(_callback);
163+
okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, _callback);
154164
Type localVarReturnType = new TypeToken<DeviceInfo>() {}.getType();
155165
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
156166
return localVarCall;

client/src/main/generated/com/regula/documentreader/webclient/api/ProcessApi.java

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public void setApiClient(ApiClient apiClient) {
5050
* Build call for apiProcess
5151
*
5252
* @param processRequest (required)
53+
* @param xRequestID (optional)
5354
* @param _callback Callback for upload/download progress
5455
* @return Call to execute
5556
* @throws ApiException If fail to serialize the request body object
@@ -61,7 +62,8 @@ public void setApiClient(ApiClient apiClient) {
6162
* <tr><td> 403 </td><td> Bad license. Either server or request does not contain valid license. </td><td> - </td></tr>
6263
* </table>
6364
*/
64-
public okhttp3.Call apiProcessCall(ProcessRequest processRequest, final ApiCallback _callback)
65+
public okhttp3.Call apiProcessCall(
66+
ProcessRequest processRequest, String xRequestID, final ApiCallback _callback)
6567
throws ApiException {
6668
Object localVarPostBody = processRequest;
6769

@@ -71,6 +73,10 @@ public okhttp3.Call apiProcessCall(ProcessRequest processRequest, final ApiCallb
7173
List<Pair> localVarQueryParams = new ArrayList<Pair>();
7274
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
7375
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
76+
if (xRequestID != null) {
77+
localVarHeaderParams.put("X-RequestID", localVarApiClient.parameterToString(xRequestID));
78+
}
79+
7480
Map<String, String> localVarCookieParams = new HashMap<String, String>();
7581
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
7682
final String[] localVarAccepts = {"application/json"};
@@ -100,22 +106,24 @@ public okhttp3.Call apiProcessCall(ProcessRequest processRequest, final ApiCallb
100106

101107
@SuppressWarnings("rawtypes")
102108
private okhttp3.Call apiProcessValidateBeforeCall(
103-
ProcessRequest processRequest, final ApiCallback _callback) throws ApiException {
109+
ProcessRequest processRequest, String xRequestID, final ApiCallback _callback)
110+
throws ApiException {
104111

105112
// verify the required parameter 'processRequest' is set
106113
if (processRequest == null) {
107114
throw new ApiException(
108115
"Missing the required parameter 'processRequest' when calling apiProcess(Async)");
109116
}
110117

111-
okhttp3.Call localVarCall = apiProcessCall(processRequest, _callback);
118+
okhttp3.Call localVarCall = apiProcessCall(processRequest, xRequestID, _callback);
112119
return localVarCall;
113120
}
114121

115122
/**
116123
* Process list of documents images and return extracted data
117124
*
118125
* @param processRequest (required)
126+
* @param xRequestID (optional)
119127
* @return ProcessResponse
120128
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
121129
* response body
@@ -127,15 +135,17 @@ private okhttp3.Call apiProcessValidateBeforeCall(
127135
* <tr><td> 403 </td><td> Bad license. Either server or request does not contain valid license. </td><td> - </td></tr>
128136
* </table>
129137
*/
130-
public ProcessResponse apiProcess(ProcessRequest processRequest) throws ApiException {
131-
ApiResponse<ProcessResponse> localVarResp = apiProcessWithHttpInfo(processRequest);
138+
public ProcessResponse apiProcess(ProcessRequest processRequest, String xRequestID)
139+
throws ApiException {
140+
ApiResponse<ProcessResponse> localVarResp = apiProcessWithHttpInfo(processRequest, xRequestID);
132141
return localVarResp.getData();
133142
}
134143

135144
/**
136145
* Process list of documents images and return extracted data
137146
*
138147
* @param processRequest (required)
148+
* @param xRequestID (optional)
139149
* @return ApiResponse&lt;ProcessResponse&gt;
140150
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
141151
* response body
@@ -147,9 +157,9 @@ public ProcessResponse apiProcess(ProcessRequest processRequest) throws ApiExcep
147157
* <tr><td> 403 </td><td> Bad license. Either server or request does not contain valid license. </td><td> - </td></tr>
148158
* </table>
149159
*/
150-
public ApiResponse<ProcessResponse> apiProcessWithHttpInfo(ProcessRequest processRequest)
151-
throws ApiException {
152-
okhttp3.Call localVarCall = apiProcessValidateBeforeCall(processRequest, null);
160+
public ApiResponse<ProcessResponse> apiProcessWithHttpInfo(
161+
ProcessRequest processRequest, String xRequestID) throws ApiException {
162+
okhttp3.Call localVarCall = apiProcessValidateBeforeCall(processRequest, xRequestID, null);
153163
Type localVarReturnType = new TypeToken<ProcessResponse>() {}.getType();
154164
return localVarApiClient.execute(localVarCall, localVarReturnType);
155165
}
@@ -158,6 +168,7 @@ public ApiResponse<ProcessResponse> apiProcessWithHttpInfo(ProcessRequest proces
158168
* Process list of documents images and return extracted data (asynchronously)
159169
*
160170
* @param processRequest (required)
171+
* @param xRequestID (optional)
161172
* @param _callback The callback to be executed when the API call finishes
162173
* @return The request call
163174
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -170,10 +181,12 @@ public ApiResponse<ProcessResponse> apiProcessWithHttpInfo(ProcessRequest proces
170181
* </table>
171182
*/
172183
public okhttp3.Call apiProcessAsync(
173-
ProcessRequest processRequest, final ApiCallback<ProcessResponse> _callback)
184+
ProcessRequest processRequest,
185+
String xRequestID,
186+
final ApiCallback<ProcessResponse> _callback)
174187
throws ApiException {
175188

176-
okhttp3.Call localVarCall = apiProcessValidateBeforeCall(processRequest, _callback);
189+
okhttp3.Call localVarCall = apiProcessValidateBeforeCall(processRequest, xRequestID, _callback);
177190
Type localVarReturnType = new TypeToken<ProcessResponse>() {}.getType();
178191
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
179192
return localVarCall;

client/src/main/java/com/regula/documentreader/webclient/api/DocumentReaderApi.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ private static ApiClient getApiClient(String basePath, boolean debugging, boolea
6262
* response body
6363
*/
6464
public DeviceInfo ping() throws ApiException {
65-
return defaultApi.ping();
65+
return defaultApi.ping("");
6666
}
6767

68+
public DeviceInfo ping(String xRequestID) throws ApiException {
69+
return defaultApi.ping(xRequestID);
70+
}
71+
72+
73+
6874
/**
6975
* Reads list of documents and return extracted data
7076
*
@@ -75,7 +81,13 @@ public DeviceInfo ping() throws ApiException {
7581
*/
7682
public RecognitionResponse process(ProcessRequest processRequest) {
7783
processRequest.getSystemInfo().withLicense(this.license);
78-
ProcessResponse response = processApi.apiProcess(processRequest);
84+
ProcessResponse response = processApi.apiProcess(processRequest, "");
85+
return new RecognitionResponse(response);
86+
}
87+
88+
public RecognitionResponse process(ProcessRequest processRequest, String xRequestID) {
89+
processRequest.getSystemInfo().withLicense(this.license);
90+
ProcessResponse response = processApi.apiProcess(processRequest, xRequestID);
7991
return new RecognitionResponse(response);
8092
}
8193

0 commit comments

Comments
 (0)