Skip to content

Commit 9f5190d

Browse files
committed
Commit: 9a69cd29
1 parent fab6b37 commit 9f5190d

File tree

9 files changed

+696
-6
lines changed

9 files changed

+696
-6
lines changed

client/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ src/main/generated/com/regula/documentreader/webclient/model/CrossSourceValueCom
5252
src/main/generated/com/regula/documentreader/webclient/model/DataModule.java
5353
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocument.java
5454
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocumentList.java
55+
src/main/generated/com/regula/documentreader/webclient/model/DetailsAge.java
5556
src/main/generated/com/regula/documentreader/webclient/model/DetailsOptical.java
5657
src/main/generated/com/regula/documentreader/webclient/model/DetailsRFID.java
5758
src/main/generated/com/regula/documentreader/webclient/model/DeviceInfo.java
@@ -131,6 +132,9 @@ src/main/generated/com/regula/documentreader/webclient/model/ListVerifiedFields.
131132
src/main/generated/com/regula/documentreader/webclient/model/ListVerifiedFieldsItem.java
132133
src/main/generated/com/regula/documentreader/webclient/model/LivenessParams.java
133134
src/main/generated/com/regula/documentreader/webclient/model/LogLevel.java
135+
src/main/generated/com/regula/documentreader/webclient/model/MDLDeviceEngagement.java
136+
src/main/generated/com/regula/documentreader/webclient/model/MDLDeviceRetrieval.java
137+
src/main/generated/com/regula/documentreader/webclient/model/MDLServerRetrieval.java
134138
src/main/generated/com/regula/documentreader/webclient/model/MRZDetectorResult.java
135139
src/main/generated/com/regula/documentreader/webclient/model/MRZFormat.java
136140
src/main/generated/com/regula/documentreader/webclient/model/MRZPositionResult.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
@@ -995,6 +995,8 @@ private static Class getClassByDiscriminator(
995995
gsonBuilder.registerTypeAdapterFactory(
996996
new com.regula.documentreader.webclient.model.DatabaseDocumentList
997997
.CustomTypeAdapterFactory());
998+
gsonBuilder.registerTypeAdapterFactory(
999+
new com.regula.documentreader.webclient.model.DetailsAge.CustomTypeAdapterFactory());
9981000
gsonBuilder.registerTypeAdapterFactory(
9991001
new com.regula.documentreader.webclient.model.DetailsOptical.CustomTypeAdapterFactory());
10001002
gsonBuilder.registerTypeAdapterFactory(
Lines changed: 335 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,335 @@
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+
/** DetailsAge */
31+
@javax.annotation.Generated(
32+
value = "org.openapitools.codegen.languages.JavaClientCodegen",
33+
comments = "Generator version: 7.15.0")
34+
public class DetailsAge {
35+
public static final String SERIALIZED_NAME_THRESHOLD = "threshold";
36+
37+
@SerializedName(SERIALIZED_NAME_THRESHOLD)
38+
@javax.annotation.Nonnull
39+
private Integer threshold;
40+
41+
public static final String SERIALIZED_NAME_OVER_THRESHOLD = "overThreshold";
42+
43+
@SerializedName(SERIALIZED_NAME_OVER_THRESHOLD)
44+
@javax.annotation.Nonnull
45+
private CheckResult overThreshold;
46+
47+
public static final String SERIALIZED_NAME_OVER18 = "over18";
48+
49+
@SerializedName(SERIALIZED_NAME_OVER18)
50+
@javax.annotation.Nonnull
51+
private CheckResult over18;
52+
53+
public static final String SERIALIZED_NAME_OVER21 = "over21";
54+
55+
@SerializedName(SERIALIZED_NAME_OVER21)
56+
@javax.annotation.Nonnull
57+
private CheckResult over21;
58+
59+
public static final String SERIALIZED_NAME_OVER25 = "over25";
60+
61+
@SerializedName(SERIALIZED_NAME_OVER25)
62+
@javax.annotation.Nonnull
63+
private CheckResult over25;
64+
65+
public static final String SERIALIZED_NAME_OVER65 = "over65";
66+
67+
@SerializedName(SERIALIZED_NAME_OVER65)
68+
@javax.annotation.Nonnull
69+
private CheckResult over65;
70+
71+
public DetailsAge() {}
72+
73+
public DetailsAge threshold(@javax.annotation.Nonnull Integer threshold) {
74+
this.threshold = threshold;
75+
return this;
76+
}
77+
78+
/**
79+
* Get threshold
80+
*
81+
* @return threshold
82+
*/
83+
@javax.annotation.Nonnull
84+
public Integer getThreshold() {
85+
return threshold;
86+
}
87+
88+
public void setThreshold(@javax.annotation.Nonnull Integer threshold) {
89+
this.threshold = threshold;
90+
}
91+
92+
public DetailsAge overThreshold(@javax.annotation.Nonnull CheckResult overThreshold) {
93+
this.overThreshold = overThreshold;
94+
return this;
95+
}
96+
97+
/**
98+
* Get overThreshold
99+
*
100+
* @return overThreshold
101+
*/
102+
@javax.annotation.Nonnull
103+
public CheckResult getOverThreshold() {
104+
return overThreshold;
105+
}
106+
107+
public void setOverThreshold(@javax.annotation.Nonnull CheckResult overThreshold) {
108+
this.overThreshold = overThreshold;
109+
}
110+
111+
public DetailsAge over18(@javax.annotation.Nonnull CheckResult over18) {
112+
this.over18 = over18;
113+
return this;
114+
}
115+
116+
/**
117+
* Get over18
118+
*
119+
* @return over18
120+
*/
121+
@javax.annotation.Nonnull
122+
public CheckResult getOver18() {
123+
return over18;
124+
}
125+
126+
public void setOver18(@javax.annotation.Nonnull CheckResult over18) {
127+
this.over18 = over18;
128+
}
129+
130+
public DetailsAge over21(@javax.annotation.Nonnull CheckResult over21) {
131+
this.over21 = over21;
132+
return this;
133+
}
134+
135+
/**
136+
* Get over21
137+
*
138+
* @return over21
139+
*/
140+
@javax.annotation.Nonnull
141+
public CheckResult getOver21() {
142+
return over21;
143+
}
144+
145+
public void setOver21(@javax.annotation.Nonnull CheckResult over21) {
146+
this.over21 = over21;
147+
}
148+
149+
public DetailsAge over25(@javax.annotation.Nonnull CheckResult over25) {
150+
this.over25 = over25;
151+
return this;
152+
}
153+
154+
/**
155+
* Get over25
156+
*
157+
* @return over25
158+
*/
159+
@javax.annotation.Nonnull
160+
public CheckResult getOver25() {
161+
return over25;
162+
}
163+
164+
public void setOver25(@javax.annotation.Nonnull CheckResult over25) {
165+
this.over25 = over25;
166+
}
167+
168+
public DetailsAge over65(@javax.annotation.Nonnull CheckResult over65) {
169+
this.over65 = over65;
170+
return this;
171+
}
172+
173+
/**
174+
* Get over65
175+
*
176+
* @return over65
177+
*/
178+
@javax.annotation.Nonnull
179+
public CheckResult getOver65() {
180+
return over65;
181+
}
182+
183+
public void setOver65(@javax.annotation.Nonnull CheckResult over65) {
184+
this.over65 = over65;
185+
}
186+
187+
@Override
188+
public boolean equals(Object o) {
189+
if (this == o) {
190+
return true;
191+
}
192+
if (o == null || getClass() != o.getClass()) {
193+
return false;
194+
}
195+
DetailsAge detailsAge = (DetailsAge) o;
196+
return Objects.equals(this.threshold, detailsAge.threshold)
197+
&& Objects.equals(this.overThreshold, detailsAge.overThreshold)
198+
&& Objects.equals(this.over18, detailsAge.over18)
199+
&& Objects.equals(this.over21, detailsAge.over21)
200+
&& Objects.equals(this.over25, detailsAge.over25)
201+
&& Objects.equals(this.over65, detailsAge.over65);
202+
}
203+
204+
@Override
205+
public int hashCode() {
206+
return Objects.hash(threshold, overThreshold, over18, over21, over25, over65);
207+
}
208+
209+
@Override
210+
public String toString() {
211+
StringBuilder sb = new StringBuilder();
212+
sb.append("class DetailsAge {\n");
213+
sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n");
214+
sb.append(" overThreshold: ").append(toIndentedString(overThreshold)).append("\n");
215+
sb.append(" over18: ").append(toIndentedString(over18)).append("\n");
216+
sb.append(" over21: ").append(toIndentedString(over21)).append("\n");
217+
sb.append(" over25: ").append(toIndentedString(over25)).append("\n");
218+
sb.append(" over65: ").append(toIndentedString(over65)).append("\n");
219+
sb.append("}");
220+
return sb.toString();
221+
}
222+
223+
/**
224+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
225+
*/
226+
private String toIndentedString(Object o) {
227+
if (o == null) {
228+
return "null";
229+
}
230+
return o.toString().replace("\n", "\n ");
231+
}
232+
233+
public static HashSet<String> openapiFields;
234+
public static HashSet<String> openapiRequiredFields;
235+
236+
static {
237+
// a set of all properties/fields (JSON key names)
238+
openapiFields =
239+
new HashSet<String>(
240+
Arrays.asList("threshold", "overThreshold", "over18", "over21", "over25", "over65"));
241+
242+
// a set of required properties/fields (JSON key names)
243+
openapiRequiredFields =
244+
new HashSet<String>(
245+
Arrays.asList("threshold", "overThreshold", "over18", "over21", "over25", "over65"));
246+
}
247+
248+
/**
249+
* Validates the JSON Element and throws an exception if issues found
250+
*
251+
* @param jsonElement JSON Element
252+
* @throws IOException if the JSON Element is invalid with respect to DetailsAge
253+
*/
254+
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
255+
if (jsonElement == null) {
256+
if (!DetailsAge.openapiRequiredFields
257+
.isEmpty()) { // has required fields but JSON element is null
258+
System.err.println(
259+
String.format(
260+
"The required field(s) %s in DetailsAge is not found in the empty JSON string",
261+
DetailsAge.openapiRequiredFields.toString()));
262+
}
263+
}
264+
265+
// check to make sure all required properties/fields are present in the JSON string
266+
for (String requiredField : DetailsAge.openapiRequiredFields) {
267+
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
268+
System.err.println(
269+
String.format(
270+
"The required field `%s` is not found in the JSON string: %s",
271+
requiredField, jsonElement.toString()));
272+
}
273+
}
274+
JsonObject jsonObj = jsonElement.getAsJsonObject();
275+
// validate the required field `overThreshold`
276+
CheckResult.validateJsonElement(jsonObj.get("overThreshold"));
277+
// validate the required field `over18`
278+
CheckResult.validateJsonElement(jsonObj.get("over18"));
279+
// validate the required field `over21`
280+
CheckResult.validateJsonElement(jsonObj.get("over21"));
281+
// validate the required field `over25`
282+
CheckResult.validateJsonElement(jsonObj.get("over25"));
283+
// validate the required field `over65`
284+
CheckResult.validateJsonElement(jsonObj.get("over65"));
285+
}
286+
287+
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
288+
@SuppressWarnings("unchecked")
289+
@Override
290+
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
291+
if (!DetailsAge.class.isAssignableFrom(type.getRawType())) {
292+
return null; // this class only serializes 'DetailsAge' and its subtypes
293+
}
294+
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
295+
final TypeAdapter<DetailsAge> thisAdapter =
296+
gson.getDelegateAdapter(this, TypeToken.get(DetailsAge.class));
297+
298+
return (TypeAdapter<T>)
299+
new TypeAdapter<DetailsAge>() {
300+
@Override
301+
public void write(JsonWriter out, DetailsAge value) throws IOException {
302+
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
303+
elementAdapter.write(out, obj);
304+
}
305+
306+
@Override
307+
public DetailsAge read(JsonReader in) throws IOException {
308+
JsonElement jsonElement = elementAdapter.read(in);
309+
validateJsonElement(jsonElement);
310+
return thisAdapter.fromJsonTree(jsonElement);
311+
}
312+
}.nullSafe();
313+
}
314+
}
315+
316+
/**
317+
* Create an instance of DetailsAge given an JSON string
318+
*
319+
* @param jsonString JSON string
320+
* @return An instance of DetailsAge
321+
* @throws IOException if the JSON string is invalid with respect to DetailsAge
322+
*/
323+
public static DetailsAge fromJson(String jsonString) throws IOException {
324+
return JSON.getGson().fromJson(jsonString, DetailsAge.class);
325+
}
326+
327+
/**
328+
* Convert an instance of DetailsAge to an JSON string
329+
*
330+
* @return JSON string
331+
*/
332+
public String toJson() {
333+
return JSON.getGson().toJson(this);
334+
}
335+
}

0 commit comments

Comments
 (0)