Skip to content

Commit f8a72bf

Browse files
committed
Commit: 14ccbb47
1 parent a9a2751 commit f8a72bf

File tree

4 files changed

+200
-16
lines changed

4 files changed

+200
-16
lines changed

client/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ src/main/generated/com/regula/documentreader/webclient/model/BarcodeType.java
3939
src/main/generated/com/regula/documentreader/webclient/model/BcPDF417INFO.java
4040
src/main/generated/com/regula/documentreader/webclient/model/BcROIDETECT.java
4141
src/main/generated/com/regula/documentreader/webclient/model/BinaryData.java
42+
src/main/generated/com/regula/documentreader/webclient/model/BsiTr03135.java
4243
src/main/generated/com/regula/documentreader/webclient/model/ByteArrayItem.java
4344
src/main/generated/com/regula/documentreader/webclient/model/ByteArrayResult.java
4445
src/main/generated/com/regula/documentreader/webclient/model/CandidatesListItem.java

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,8 @@ private static Class getClassByDiscriminator(
10431043
new com.regula.documentreader.webclient.model.BcROIDETECT.CustomTypeAdapterFactory());
10441044
gsonBuilder.registerTypeAdapterFactory(
10451045
new com.regula.documentreader.webclient.model.BinaryData.CustomTypeAdapterFactory());
1046+
gsonBuilder.registerTypeAdapterFactory(
1047+
new com.regula.documentreader.webclient.model.BsiTr03135.CustomTypeAdapterFactory());
10461048
gsonBuilder.registerTypeAdapterFactory(
10471049
new com.regula.documentreader.webclient.model.ByteArrayItem.CustomTypeAdapterFactory());
10481050
gsonBuilder.registerTypeAdapterFactory(
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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.model;
14+
15+
import com.google.gson.Gson;
16+
import com.google.gson.JsonElement;
17+
import com.google.gson.JsonObject;
18+
import com.google.gson.TypeAdapter;
19+
import com.google.gson.TypeAdapterFactory;
20+
import com.google.gson.annotations.SerializedName;
21+
import com.google.gson.reflect.TypeToken;
22+
import com.google.gson.stream.JsonReader;
23+
import com.google.gson.stream.JsonWriter;
24+
import com.regula.documentreader.webclient.JSON;
25+
import java.io.IOException;
26+
import java.util.Arrays;
27+
import java.util.HashSet;
28+
import java.util.Objects;
29+
30+
/** BsiTr03135 */
31+
@javax.annotation.Generated(
32+
value = "org.openapitools.codegen.languages.JavaClientCodegen",
33+
comments = "Generator version: 7.15.0")
34+
public class BsiTr03135 {
35+
public static final String SERIALIZED_NAME_GENERATE_RESULT = "generateResult";
36+
37+
@SerializedName(SERIALIZED_NAME_GENERATE_RESULT)
38+
@javax.annotation.Nullable
39+
private Boolean generateResult;
40+
41+
public BsiTr03135() {}
42+
43+
public BsiTr03135 generateResult(@javax.annotation.Nullable Boolean generateResult) {
44+
this.generateResult = generateResult;
45+
return this;
46+
}
47+
48+
/**
49+
* When enabled, returns processing results in accordance with the BSI TR-03135 standard in
50+
* addition to the existing processing results.
51+
*
52+
* @return generateResult
53+
*/
54+
@javax.annotation.Nullable
55+
public Boolean getGenerateResult() {
56+
return generateResult;
57+
}
58+
59+
public void setGenerateResult(@javax.annotation.Nullable Boolean generateResult) {
60+
this.generateResult = generateResult;
61+
}
62+
63+
@Override
64+
public boolean equals(Object o) {
65+
if (this == o) {
66+
return true;
67+
}
68+
if (o == null || getClass() != o.getClass()) {
69+
return false;
70+
}
71+
BsiTr03135 bsiTr03135 = (BsiTr03135) o;
72+
return Objects.equals(this.generateResult, bsiTr03135.generateResult);
73+
}
74+
75+
@Override
76+
public int hashCode() {
77+
return Objects.hash(generateResult);
78+
}
79+
80+
@Override
81+
public String toString() {
82+
StringBuilder sb = new StringBuilder();
83+
sb.append("class BsiTr03135 {\n");
84+
sb.append(" generateResult: ").append(toIndentedString(generateResult)).append("\n");
85+
sb.append("}");
86+
return sb.toString();
87+
}
88+
89+
/**
90+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
91+
*/
92+
private String toIndentedString(Object o) {
93+
if (o == null) {
94+
return "null";
95+
}
96+
return o.toString().replace("\n", "\n ");
97+
}
98+
99+
public static HashSet<String> openapiFields;
100+
public static HashSet<String> openapiRequiredFields;
101+
102+
static {
103+
// a set of all properties/fields (JSON key names)
104+
openapiFields = new HashSet<String>(Arrays.asList("generateResult"));
105+
106+
// a set of required properties/fields (JSON key names)
107+
openapiRequiredFields = new HashSet<String>(0);
108+
}
109+
110+
/**
111+
* Validates the JSON Element and throws an exception if issues found
112+
*
113+
* @param jsonElement JSON Element
114+
* @throws IOException if the JSON Element is invalid with respect to BsiTr03135
115+
*/
116+
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
117+
if (jsonElement == null) {
118+
if (!BsiTr03135.openapiRequiredFields
119+
.isEmpty()) { // has required fields but JSON element is null
120+
System.err.println(
121+
String.format(
122+
"The required field(s) %s in BsiTr03135 is not found in the empty JSON string",
123+
BsiTr03135.openapiRequiredFields.toString()));
124+
}
125+
}
126+
127+
JsonObject jsonObj = jsonElement.getAsJsonObject();
128+
}
129+
130+
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
131+
@SuppressWarnings("unchecked")
132+
@Override
133+
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
134+
if (!BsiTr03135.class.isAssignableFrom(type.getRawType())) {
135+
return null; // this class only serializes 'BsiTr03135' and its subtypes
136+
}
137+
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
138+
final TypeAdapter<BsiTr03135> thisAdapter =
139+
gson.getDelegateAdapter(this, TypeToken.get(BsiTr03135.class));
140+
141+
return (TypeAdapter<T>)
142+
new TypeAdapter<BsiTr03135>() {
143+
@Override
144+
public void write(JsonWriter out, BsiTr03135 value) throws IOException {
145+
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
146+
elementAdapter.write(out, obj);
147+
}
148+
149+
@Override
150+
public BsiTr03135 read(JsonReader in) throws IOException {
151+
JsonElement jsonElement = elementAdapter.read(in);
152+
validateJsonElement(jsonElement);
153+
return thisAdapter.fromJsonTree(jsonElement);
154+
}
155+
}.nullSafe();
156+
}
157+
}
158+
159+
/**
160+
* Create an instance of BsiTr03135 given an JSON string
161+
*
162+
* @param jsonString JSON string
163+
* @return An instance of BsiTr03135
164+
* @throws IOException if the JSON string is invalid with respect to BsiTr03135
165+
*/
166+
public static BsiTr03135 fromJson(String jsonString) throws IOException {
167+
return JSON.getGson().fromJson(jsonString, BsiTr03135.class);
168+
}
169+
170+
/**
171+
* Convert an instance of BsiTr03135 to an JSON string
172+
*
173+
* @return JSON string
174+
*/
175+
public String toJson() {
176+
return JSON.getGson().toJson(this);
177+
}
178+
}

client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,11 @@ public class ProcessParams {
449449
@javax.annotation.Nullable
450450
private Boolean returnTransliteratedFields;
451451

452-
public static final String SERIALIZED_NAME_BSI_TR03135_RESULTS = "bsiTr03135Results";
452+
public static final String SERIALIZED_NAME_BSI_TR03135 = "bsiTr03135";
453453

454-
@SerializedName(SERIALIZED_NAME_BSI_TR03135_RESULTS)
454+
@SerializedName(SERIALIZED_NAME_BSI_TR03135)
455455
@javax.annotation.Nullable
456-
private Boolean bsiTr03135Results;
456+
private BsiTr03135 bsiTr03135;
457457

458458
public ProcessParams() {}
459459

@@ -1926,24 +1926,23 @@ public void setReturnTransliteratedFields(
19261926
this.returnTransliteratedFields = returnTransliteratedFields;
19271927
}
19281928

1929-
public ProcessParams bsiTr03135Results(@javax.annotation.Nullable Boolean bsiTr03135Results) {
1930-
this.bsiTr03135Results = bsiTr03135Results;
1929+
public ProcessParams bsiTr03135(@javax.annotation.Nullable BsiTr03135 bsiTr03135) {
1930+
this.bsiTr03135 = bsiTr03135;
19311931
return this;
19321932
}
19331933

19341934
/**
1935-
* When enabled, returns processing results in accordance with the BSI TR-03135 standard in
1936-
* addition to the existing processing results.
1935+
* Get bsiTr03135
19371936
*
1938-
* @return bsiTr03135Results
1937+
* @return bsiTr03135
19391938
*/
19401939
@javax.annotation.Nullable
1941-
public Boolean getBsiTr03135Results() {
1942-
return bsiTr03135Results;
1940+
public BsiTr03135 getBsiTr03135() {
1941+
return bsiTr03135;
19431942
}
19441943

1945-
public void setBsiTr03135Results(@javax.annotation.Nullable Boolean bsiTr03135Results) {
1946-
this.bsiTr03135Results = bsiTr03135Results;
1944+
public void setBsiTr03135(@javax.annotation.Nullable BsiTr03135 bsiTr03135) {
1945+
this.bsiTr03135 = bsiTr03135;
19471946
}
19481947

19491948
@Override
@@ -2026,7 +2025,7 @@ public boolean equals(Object o) {
20262025
this.disableAuthResolutionFilter, processParams.disableAuthResolutionFilter)
20272026
&& Objects.equals(this.strictSecurityChecks, processParams.strictSecurityChecks)
20282027
&& Objects.equals(this.returnTransliteratedFields, processParams.returnTransliteratedFields)
2029-
&& Objects.equals(this.bsiTr03135Results, processParams.bsiTr03135Results);
2028+
&& Objects.equals(this.bsiTr03135, processParams.bsiTr03135);
20302029
}
20312030

20322031
@Override
@@ -2099,7 +2098,7 @@ public int hashCode() {
20992098
disableAuthResolutionFilter,
21002099
strictSecurityChecks,
21012100
returnTransliteratedFields,
2102-
bsiTr03135Results);
2101+
bsiTr03135);
21032102
}
21042103

21052104
@Override
@@ -2215,7 +2214,7 @@ public String toString() {
22152214
sb.append(" returnTransliteratedFields: ")
22162215
.append(toIndentedString(returnTransliteratedFields))
22172216
.append("\n");
2218-
sb.append(" bsiTr03135Results: ").append(toIndentedString(bsiTr03135Results)).append("\n");
2217+
sb.append(" bsiTr03135: ").append(toIndentedString(bsiTr03135)).append("\n");
22192218
sb.append("}");
22202219
return sb.toString();
22212220
}
@@ -2305,7 +2304,7 @@ private String toIndentedString(Object o) {
23052304
"disableAuthResolutionFilter",
23062305
"strictSecurityChecks",
23072306
"returnTransliteratedFields",
2308-
"bsiTr03135Results"));
2307+
"bsiTr03135"));
23092308

23102309
// a set of required properties/fields (JSON key names)
23112310
openapiRequiredFields = new HashSet<String>(Arrays.asList("scenario"));
@@ -2489,6 +2488,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
24892488
"Expected the field `doBarcodes` to be an array in the JSON string but got `%s`",
24902489
jsonObj.get("doBarcodes").toString()));
24912490
}
2491+
// validate the optional field `bsiTr03135`
2492+
if (jsonObj.get("bsiTr03135") != null && !jsonObj.get("bsiTr03135").isJsonNull()) {
2493+
BsiTr03135.validateJsonElement(jsonObj.get("bsiTr03135"));
2494+
}
24922495
}
24932496

24942497
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)