Skip to content

Commit c14734f

Browse files
Merge pull request #229 from regulaforensics/66d1067c
Commit: 66d1067c
2 parents f7ad375 + 75ad197 commit c14734f

File tree

4 files changed

+244
-3
lines changed

4 files changed

+244
-3
lines changed

client/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ src/main/generated/com/regula/documentreader/webclient/model/FiberResult.java
8989
src/main/generated/com/regula/documentreader/webclient/model/FieldItem.java
9090
src/main/generated/com/regula/documentreader/webclient/model/FileImage.java
9191
src/main/generated/com/regula/documentreader/webclient/model/GetTransactionsByTagResponse.java
92+
src/main/generated/com/regula/documentreader/webclient/model/GlaresCheckParams.java
9293
src/main/generated/com/regula/documentreader/webclient/model/GraphData.java
9394
src/main/generated/com/regula/documentreader/webclient/model/GraphicField.java
9495
src/main/generated/com/regula/documentreader/webclient/model/GraphicFieldType.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
@@ -1082,6 +1082,8 @@ private static Class getClassByDiscriminator(
10821082
gsonBuilder.registerTypeAdapterFactory(
10831083
new com.regula.documentreader.webclient.model.GetTransactionsByTagResponse
10841084
.CustomTypeAdapterFactory());
1085+
gsonBuilder.registerTypeAdapterFactory(
1086+
new com.regula.documentreader.webclient.model.GlaresCheckParams.CustomTypeAdapterFactory());
10851087
gsonBuilder.registerTypeAdapterFactory(
10861088
new com.regula.documentreader.webclient.model.GraphData.CustomTypeAdapterFactory());
10871089
gsonBuilder.registerTypeAdapterFactory(
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
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+
/** GlaresCheckParams */
31+
@javax.annotation.Generated(
32+
value = "org.openapitools.codegen.languages.JavaClientCodegen",
33+
comments = "Generator version: 7.15.0")
34+
public class GlaresCheckParams {
35+
public static final String SERIALIZED_NAME_IMG_MARGIN_PART = "imgMarginPart";
36+
37+
@SerializedName(SERIALIZED_NAME_IMG_MARGIN_PART)
38+
@javax.annotation.Nullable
39+
private Float imgMarginPart;
40+
41+
public static final String SERIALIZED_NAME_MAX_GLARING_PART = "maxGlaringPart";
42+
43+
@SerializedName(SERIALIZED_NAME_MAX_GLARING_PART)
44+
@javax.annotation.Nullable
45+
private Float maxGlaringPart;
46+
47+
public GlaresCheckParams() {}
48+
49+
public GlaresCheckParams imgMarginPart(@javax.annotation.Nullable Float imgMarginPart) {
50+
this.imgMarginPart = imgMarginPart;
51+
return this;
52+
}
53+
54+
/**
55+
* Margin from the edges of the image. 0.35 = 35%
56+
*
57+
* @return imgMarginPart
58+
*/
59+
@javax.annotation.Nullable
60+
public Float getImgMarginPart() {
61+
return imgMarginPart;
62+
}
63+
64+
public void setImgMarginPart(@javax.annotation.Nullable Float imgMarginPart) {
65+
this.imgMarginPart = imgMarginPart;
66+
}
67+
68+
public GlaresCheckParams maxGlaringPart(@javax.annotation.Nullable Float maxGlaringPart) {
69+
this.maxGlaringPart = maxGlaringPart;
70+
return this;
71+
}
72+
73+
/**
74+
* The maximum allowable part of the area occupied by the glare. The same: 0.06 = 6%
75+
*
76+
* @return maxGlaringPart
77+
*/
78+
@javax.annotation.Nullable
79+
public Float getMaxGlaringPart() {
80+
return maxGlaringPart;
81+
}
82+
83+
public void setMaxGlaringPart(@javax.annotation.Nullable Float maxGlaringPart) {
84+
this.maxGlaringPart = maxGlaringPart;
85+
}
86+
87+
@Override
88+
public boolean equals(Object o) {
89+
if (this == o) {
90+
return true;
91+
}
92+
if (o == null || getClass() != o.getClass()) {
93+
return false;
94+
}
95+
GlaresCheckParams glaresCheckParams = (GlaresCheckParams) o;
96+
return Objects.equals(this.imgMarginPart, glaresCheckParams.imgMarginPart)
97+
&& Objects.equals(this.maxGlaringPart, glaresCheckParams.maxGlaringPart);
98+
}
99+
100+
@Override
101+
public int hashCode() {
102+
return Objects.hash(imgMarginPart, maxGlaringPart);
103+
}
104+
105+
@Override
106+
public String toString() {
107+
StringBuilder sb = new StringBuilder();
108+
sb.append("class GlaresCheckParams {\n");
109+
sb.append(" imgMarginPart: ").append(toIndentedString(imgMarginPart)).append("\n");
110+
sb.append(" maxGlaringPart: ").append(toIndentedString(maxGlaringPart)).append("\n");
111+
sb.append("}");
112+
return sb.toString();
113+
}
114+
115+
/**
116+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
117+
*/
118+
private String toIndentedString(Object o) {
119+
if (o == null) {
120+
return "null";
121+
}
122+
return o.toString().replace("\n", "\n ");
123+
}
124+
125+
public static HashSet<String> openapiFields;
126+
public static HashSet<String> openapiRequiredFields;
127+
128+
static {
129+
// a set of all properties/fields (JSON key names)
130+
openapiFields = new HashSet<String>(Arrays.asList("imgMarginPart", "maxGlaringPart"));
131+
132+
// a set of required properties/fields (JSON key names)
133+
openapiRequiredFields = new HashSet<String>(0);
134+
}
135+
136+
/**
137+
* Validates the JSON Element and throws an exception if issues found
138+
*
139+
* @param jsonElement JSON Element
140+
* @throws IOException if the JSON Element is invalid with respect to GlaresCheckParams
141+
*/
142+
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
143+
if (jsonElement == null) {
144+
if (!GlaresCheckParams.openapiRequiredFields
145+
.isEmpty()) { // has required fields but JSON element is null
146+
System.err.println(
147+
String.format(
148+
"The required field(s) %s in GlaresCheckParams is not found in the empty JSON string",
149+
GlaresCheckParams.openapiRequiredFields.toString()));
150+
}
151+
}
152+
153+
JsonObject jsonObj = jsonElement.getAsJsonObject();
154+
}
155+
156+
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
157+
@SuppressWarnings("unchecked")
158+
@Override
159+
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
160+
if (!GlaresCheckParams.class.isAssignableFrom(type.getRawType())) {
161+
return null; // this class only serializes 'GlaresCheckParams' and its subtypes
162+
}
163+
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
164+
final TypeAdapter<GlaresCheckParams> thisAdapter =
165+
gson.getDelegateAdapter(this, TypeToken.get(GlaresCheckParams.class));
166+
167+
return (TypeAdapter<T>)
168+
new TypeAdapter<GlaresCheckParams>() {
169+
@Override
170+
public void write(JsonWriter out, GlaresCheckParams value) throws IOException {
171+
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
172+
elementAdapter.write(out, obj);
173+
}
174+
175+
@Override
176+
public GlaresCheckParams read(JsonReader in) throws IOException {
177+
JsonElement jsonElement = elementAdapter.read(in);
178+
validateJsonElement(jsonElement);
179+
return thisAdapter.fromJsonTree(jsonElement);
180+
}
181+
}.nullSafe();
182+
}
183+
}
184+
185+
/**
186+
* Create an instance of GlaresCheckParams given an JSON string
187+
*
188+
* @param jsonString JSON string
189+
* @return An instance of GlaresCheckParams
190+
* @throws IOException if the JSON string is invalid with respect to GlaresCheckParams
191+
*/
192+
public static GlaresCheckParams fromJson(String jsonString) throws IOException {
193+
return JSON.getGson().fromJson(jsonString, GlaresCheckParams.class);
194+
}
195+
196+
/**
197+
* Convert an instance of GlaresCheckParams to an JSON string
198+
*
199+
* @return JSON string
200+
*/
201+
public String toJson() {
202+
return JSON.getGson().toJson(this);
203+
}
204+
}

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

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public class ImageQA {
8888
@javax.annotation.Nullable
8989
private List<InputImageQualityChecks> expectedPass;
9090

91+
public static final String SERIALIZED_NAME_GLARES_CHECK_PARAMS = "glaresCheckParams";
92+
93+
@SerializedName(SERIALIZED_NAME_GLARES_CHECK_PARAMS)
94+
@javax.annotation.Nullable
95+
private GlaresCheckParams glaresCheckParams;
96+
9197
public ImageQA() {}
9298

9399
public ImageQA brightnessThreshold(@javax.annotation.Nullable Double brightnessThreshold) {
@@ -275,6 +281,25 @@ public void setExpectedPass(
275281
this.expectedPass = expectedPass;
276282
}
277283

284+
public ImageQA glaresCheckParams(@javax.annotation.Nullable GlaresCheckParams glaresCheckParams) {
285+
this.glaresCheckParams = glaresCheckParams;
286+
return this;
287+
}
288+
289+
/**
290+
* Get glaresCheckParams
291+
*
292+
* @return glaresCheckParams
293+
*/
294+
@javax.annotation.Nullable
295+
public GlaresCheckParams getGlaresCheckParams() {
296+
return glaresCheckParams;
297+
}
298+
299+
public void setGlaresCheckParams(@javax.annotation.Nullable GlaresCheckParams glaresCheckParams) {
300+
this.glaresCheckParams = glaresCheckParams;
301+
}
302+
278303
@Override
279304
public boolean equals(Object o) {
280305
if (this == o) {
@@ -292,7 +317,8 @@ public boolean equals(Object o) {
292317
&& Objects.equals(this.colornessCheck, imageQA.colornessCheck)
293318
&& Objects.equals(this.moireCheck, imageQA.moireCheck)
294319
&& Objects.equals(this.documentPositionIndent, imageQA.documentPositionIndent)
295-
&& Objects.equals(this.expectedPass, imageQA.expectedPass);
320+
&& Objects.equals(this.expectedPass, imageQA.expectedPass)
321+
&& Objects.equals(this.glaresCheckParams, imageQA.glaresCheckParams);
296322
}
297323

298324
@Override
@@ -306,7 +332,8 @@ public int hashCode() {
306332
colornessCheck,
307333
moireCheck,
308334
documentPositionIndent,
309-
expectedPass);
335+
expectedPass,
336+
glaresCheckParams);
310337
}
311338

312339
@Override
@@ -326,6 +353,7 @@ public String toString() {
326353
.append(toIndentedString(documentPositionIndent))
327354
.append("\n");
328355
sb.append(" expectedPass: ").append(toIndentedString(expectedPass)).append("\n");
356+
sb.append(" glaresCheckParams: ").append(toIndentedString(glaresCheckParams)).append("\n");
329357
sb.append("}");
330358
return sb.toString();
331359
}
@@ -356,7 +384,8 @@ private String toIndentedString(Object o) {
356384
"colornessCheck",
357385
"moireCheck",
358386
"documentPositionIndent",
359-
"expectedPass"));
387+
"expectedPass",
388+
"glaresCheckParams"));
360389

361390
// a set of required properties/fields (JSON key names)
362391
openapiRequiredFields = new HashSet<String>(0);
@@ -389,6 +418,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
389418
"Expected the field `expectedPass` to be an array in the JSON string but got `%s`",
390419
jsonObj.get("expectedPass").toString()));
391420
}
421+
// validate the optional field `glaresCheckParams`
422+
if (jsonObj.get("glaresCheckParams") != null
423+
&& !jsonObj.get("glaresCheckParams").isJsonNull()) {
424+
GlaresCheckParams.validateJsonElement(jsonObj.get("glaresCheckParams"));
425+
}
392426
}
393427

394428
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)