Skip to content

Commit 586de9a

Browse files
Merge pull request #181 from regulaforensics/feature/SP-23476
SP-23476 - update eLDS_ParsingNotificationCodes, generator version
2 parents dc7b7ae + 70264ca commit 586de9a

File tree

200 files changed

+387
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+387
-276
lines changed

client/.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.12.0
1+
7.13.0

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

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -899,15 +899,8 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
899899
return (T) downloadFileFromResponse(response);
900900
}
901901

902-
String respBody;
903-
try {
904-
if (response.body() != null) respBody = response.body().string();
905-
else respBody = null;
906-
} catch (IOException e) {
907-
throw new ApiException(e);
908-
}
909-
910-
if (respBody == null || "".equals(respBody)) {
902+
ResponseBody respBody = response.body();
903+
if (respBody == null) {
911904
return null;
912905
}
913906

@@ -916,17 +909,25 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
916909
// ensuring a default content type
917910
contentType = "application/json";
918911
}
919-
if (isJsonMime(contentType)) {
920-
return JSON.deserialize(respBody, returnType);
921-
} else if (returnType.equals(String.class)) {
922-
// Expecting string, return the raw response body.
923-
return (T) respBody;
924-
} else {
925-
throw new ApiException(
926-
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
927-
response.code(),
928-
response.headers().toMultimap(),
929-
respBody);
912+
try {
913+
if (isJsonMime(contentType)) {
914+
return JSON.deserialize(respBody.byteStream(), returnType);
915+
} else if (returnType.equals(String.class)) {
916+
String respBodyString = respBody.string();
917+
if (respBodyString.isEmpty()) {
918+
return null;
919+
}
920+
// Expecting string, return the raw response body.
921+
return (T) respBodyString;
922+
} else {
923+
throw new ApiException(
924+
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
925+
response.code(),
926+
response.headers().toMultimap(),
927+
response.body().string());
928+
}
929+
} catch (IOException e) {
930+
throw new ApiException(e);
930931
}
931932
}
932933

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@SuppressWarnings("serial")
2020
@javax.annotation.Generated(
2121
value = "org.openapitools.codegen.languages.JavaClientCodegen",
22-
comments = "Generator version: 7.12.0")
22+
comments = "Generator version: 7.13.0")
2323
public class ApiException extends RuntimeException {
2424
private static final long serialVersionUID = 1L;
2525

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212

1313
package com.regula.documentreader.webclient;
1414

15+
import java.util.Objects;
16+
import java.util.concurrent.atomic.AtomicReference;
17+
import java.util.function.Supplier;
18+
1519
@javax.annotation.Generated(
1620
value = "org.openapitools.codegen.languages.JavaClientCodegen",
17-
comments = "Generator version: 7.12.0")
21+
comments = "Generator version: 7.13.0")
1822
public class Configuration {
1923
public static final String VERSION = "8.1.0";
2024

21-
private static volatile ApiClient defaultApiClient = new ApiClient();
25+
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
26+
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
2227

2328
/**
2429
* Get the default API client, which would be used when creating API instances without providing
@@ -27,7 +32,18 @@ public class Configuration {
2732
* @return Default API client
2833
*/
2934
public static ApiClient getDefaultApiClient() {
30-
return defaultApiClient;
35+
ApiClient client = defaultApiClient.get();
36+
if (client == null) {
37+
client =
38+
defaultApiClient.updateAndGet(
39+
val -> {
40+
if (val != null) { // changed by another thread
41+
return val;
42+
}
43+
return apiClientFactory.get();
44+
});
45+
}
46+
return client;
3147
}
3248

3349
/**
@@ -37,6 +53,13 @@ public static ApiClient getDefaultApiClient() {
3753
* @param apiClient API client
3854
*/
3955
public static void setDefaultApiClient(ApiClient apiClient) {
40-
defaultApiClient = apiClient;
56+
defaultApiClient.set(apiClient);
57+
}
58+
59+
/** set the callback used to create new ApiClient objects */
60+
public static void setApiClientFactory(Supplier<ApiClient> factory) {
61+
apiClientFactory = Objects.requireNonNull(factory);
4162
}
63+
64+
private Configuration() {}
4265
}

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@
2323
import io.gsonfire.GsonFireBuilder;
2424
import io.gsonfire.TypeSelector;
2525
import java.io.IOException;
26+
import java.io.InputStream;
27+
import java.io.InputStreamReader;
2628
import java.io.StringReader;
2729
import java.lang.reflect.Type;
30+
import java.nio.charset.StandardCharsets;
2831
import java.text.DateFormat;
2932
import java.text.ParseException;
3033
import java.text.ParsePosition;
@@ -1448,6 +1451,29 @@ public static <T> T deserialize(String body, Type returnType) {
14481451
}
14491452
}
14501453

1454+
/**
1455+
* Deserialize the given JSON InputStream to a Java object.
1456+
*
1457+
* @param <T> Type
1458+
* @param inputStream The JSON InputStream
1459+
* @param returnType The type to deserialize into
1460+
* @return The deserialized Java object
1461+
*/
1462+
@SuppressWarnings("unchecked")
1463+
public static <T> T deserialize(InputStream inputStream, Type returnType) throws IOException {
1464+
try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
1465+
if (isLenientOnJson) {
1466+
// see
1467+
// https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
1468+
JsonReader jsonReader = new JsonReader(reader);
1469+
jsonReader.setLenient(true);
1470+
return gson.fromJson(jsonReader, returnType);
1471+
} else {
1472+
return gson.fromJson(reader, returnType);
1473+
}
1474+
}
1475+
}
1476+
14511477
/** Gson TypeAdapter for Byte Array type */
14521478
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
14531479

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
@javax.annotation.Generated(
1616
value = "org.openapitools.codegen.languages.JavaClientCodegen",
17-
comments = "Generator version: 7.12.0")
17+
comments = "Generator version: 7.13.0")
1818
public class Pair {
1919
private String name = "";
2020
private String value = "";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/** Representing a Server configuration. */
1818
@javax.annotation.Generated(
1919
value = "org.openapitools.codegen.languages.JavaClientCodegen",
20-
comments = "Generator version: 7.12.0")
20+
comments = "Generator version: 7.13.0")
2121
public class ServerConfiguration {
2222
public String URL;
2323
public String description;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/** Representing a Server Variable for server URL template substitution. */
1818
@javax.annotation.Generated(
1919
value = "org.openapitools.codegen.languages.JavaClientCodegen",
20-
comments = "Generator version: 7.12.0")
20+
comments = "Generator version: 7.13.0")
2121
public class ServerVariable {
2222
public String description;
2323
public String defaultValue;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
@javax.annotation.Generated(
1919
value = "org.openapitools.codegen.languages.JavaClientCodegen",
20-
comments = "Generator version: 7.12.0")
20+
comments = "Generator version: 7.13.0")
2121
public class StringUtil {
2222
/**
2323
* Check if the given array contains the given value (with case-insensitive comparison).

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

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public void setCustomBaseUrl(String customBaseUrl) {
7878
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
7979
* </table>
8080
*/
81-
public okhttp3.Call healthzCall(String xRequestID, final ApiCallback _callback)
81+
public okhttp3.Call healthzCall(
82+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
8283
throws ApiException {
8384
String basePath = null;
8485
// Operation Servers
@@ -137,7 +138,8 @@ public okhttp3.Call healthzCall(String xRequestID, final ApiCallback _callback)
137138
}
138139

139140
@SuppressWarnings("rawtypes")
140-
private okhttp3.Call healthzValidateBeforeCall(String xRequestID, final ApiCallback _callback)
141+
private okhttp3.Call healthzValidateBeforeCall(
142+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
141143
throws ApiException {
142144
return healthzCall(xRequestID, _callback);
143145
}
@@ -156,7 +158,7 @@ private okhttp3.Call healthzValidateBeforeCall(String xRequestID, final ApiCallb
156158
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
157159
* </table>
158160
*/
159-
public Healthcheck healthz(String xRequestID) throws ApiException {
161+
public Healthcheck healthz(@javax.annotation.Nullable String xRequestID) throws ApiException {
160162
ApiResponse<Healthcheck> localVarResp = healthzWithHttpInfo(xRequestID);
161163
return localVarResp.getData();
162164
}
@@ -175,7 +177,8 @@ public Healthcheck healthz(String xRequestID) throws ApiException {
175177
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
176178
* </table>
177179
*/
178-
public ApiResponse<Healthcheck> healthzWithHttpInfo(String xRequestID) throws ApiException {
180+
public ApiResponse<Healthcheck> healthzWithHttpInfo(@javax.annotation.Nullable String xRequestID)
181+
throws ApiException {
179182
okhttp3.Call localVarCall = healthzValidateBeforeCall(xRequestID, null);
180183
Type localVarReturnType = new TypeToken<Healthcheck>() {}.getType();
181184
return localVarApiClient.execute(localVarCall, localVarReturnType);
@@ -195,7 +198,8 @@ public ApiResponse<Healthcheck> healthzWithHttpInfo(String xRequestID) throws Ap
195198
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
196199
* </table>
197200
*/
198-
public okhttp3.Call healthzAsync(String xRequestID, final ApiCallback<Healthcheck> _callback)
201+
public okhttp3.Call healthzAsync(
202+
@javax.annotation.Nullable String xRequestID, final ApiCallback<Healthcheck> _callback)
199203
throws ApiException {
200204

201205
okhttp3.Call localVarCall = healthzValidateBeforeCall(xRequestID, _callback);
@@ -220,7 +224,9 @@ public okhttp3.Call healthzAsync(String xRequestID, final ApiCallback<Healthchec
220224
* @deprecated
221225
*/
222226
@Deprecated
223-
public okhttp3.Call pingCall(String xRequestID, final ApiCallback _callback) throws ApiException {
227+
public okhttp3.Call pingCall(
228+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
229+
throws ApiException {
224230
String basePath = null;
225231
// Operation Servers
226232
String[] localBasePaths = new String[] {};
@@ -279,7 +285,8 @@ public okhttp3.Call pingCall(String xRequestID, final ApiCallback _callback) thr
279285

280286
@Deprecated
281287
@SuppressWarnings("rawtypes")
282-
private okhttp3.Call pingValidateBeforeCall(String xRequestID, final ApiCallback _callback)
288+
private okhttp3.Call pingValidateBeforeCall(
289+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
283290
throws ApiException {
284291
return pingCall(xRequestID, _callback);
285292
}
@@ -301,7 +308,7 @@ private okhttp3.Call pingValidateBeforeCall(String xRequestID, final ApiCallback
301308
* @deprecated
302309
*/
303310
@Deprecated
304-
public DeviceInfo ping(String xRequestID) throws ApiException {
311+
public DeviceInfo ping(@javax.annotation.Nullable String xRequestID) throws ApiException {
305312
ApiResponse<DeviceInfo> localVarResp = pingWithHttpInfo(xRequestID);
306313
return localVarResp.getData();
307314
}
@@ -323,7 +330,8 @@ public DeviceInfo ping(String xRequestID) throws ApiException {
323330
* @deprecated
324331
*/
325332
@Deprecated
326-
public ApiResponse<DeviceInfo> pingWithHttpInfo(String xRequestID) throws ApiException {
333+
public ApiResponse<DeviceInfo> pingWithHttpInfo(@javax.annotation.Nullable String xRequestID)
334+
throws ApiException {
327335
okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, null);
328336
Type localVarReturnType = new TypeToken<DeviceInfo>() {}.getType();
329337
return localVarApiClient.execute(localVarCall, localVarReturnType);
@@ -346,7 +354,8 @@ public ApiResponse<DeviceInfo> pingWithHttpInfo(String xRequestID) throws ApiExc
346354
* @deprecated
347355
*/
348356
@Deprecated
349-
public okhttp3.Call pingAsync(String xRequestID, final ApiCallback<DeviceInfo> _callback)
357+
public okhttp3.Call pingAsync(
358+
@javax.annotation.Nullable String xRequestID, final ApiCallback<DeviceInfo> _callback)
350359
throws ApiException {
351360

352361
okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, _callback);
@@ -369,7 +378,8 @@ public okhttp3.Call pingAsync(String xRequestID, final ApiCallback<DeviceInfo> _
369378
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
370379
* </table>
371380
*/
372-
public okhttp3.Call readyzCall(String xRequestID, final ApiCallback _callback)
381+
public okhttp3.Call readyzCall(
382+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
373383
throws ApiException {
374384
String basePath = null;
375385
// Operation Servers
@@ -428,7 +438,8 @@ public okhttp3.Call readyzCall(String xRequestID, final ApiCallback _callback)
428438
}
429439

430440
@SuppressWarnings("rawtypes")
431-
private okhttp3.Call readyzValidateBeforeCall(String xRequestID, final ApiCallback _callback)
441+
private okhttp3.Call readyzValidateBeforeCall(
442+
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
432443
throws ApiException {
433444
return readyzCall(xRequestID, _callback);
434445
}
@@ -447,7 +458,7 @@ private okhttp3.Call readyzValidateBeforeCall(String xRequestID, final ApiCallba
447458
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
448459
* </table>
449460
*/
450-
public void readyz(String xRequestID) throws ApiException {
461+
public void readyz(@javax.annotation.Nullable String xRequestID) throws ApiException {
451462
readyzWithHttpInfo(xRequestID);
452463
}
453464

@@ -466,7 +477,8 @@ public void readyz(String xRequestID) throws ApiException {
466477
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
467478
* </table>
468479
*/
469-
public ApiResponse<Void> readyzWithHttpInfo(String xRequestID) throws ApiException {
480+
public ApiResponse<Void> readyzWithHttpInfo(@javax.annotation.Nullable String xRequestID)
481+
throws ApiException {
470482
okhttp3.Call localVarCall = readyzValidateBeforeCall(xRequestID, null);
471483
return localVarApiClient.execute(localVarCall);
472484
}
@@ -486,7 +498,8 @@ public ApiResponse<Void> readyzWithHttpInfo(String xRequestID) throws ApiExcepti
486498
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
487499
* </table>
488500
*/
489-
public okhttp3.Call readyzAsync(String xRequestID, final ApiCallback<Void> _callback)
501+
public okhttp3.Call readyzAsync(
502+
@javax.annotation.Nullable String xRequestID, final ApiCallback<Void> _callback)
490503
throws ApiException {
491504

492505
okhttp3.Call localVarCall = readyzValidateBeforeCall(xRequestID, _callback);

0 commit comments

Comments
 (0)