Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ src/main/generated/com/regula/documentreader/webclient/model/FiberResult.java
src/main/generated/com/regula/documentreader/webclient/model/FieldItem.java
src/main/generated/com/regula/documentreader/webclient/model/FileImage.java
src/main/generated/com/regula/documentreader/webclient/model/GetTransactionsByTagResponse.java
src/main/generated/com/regula/documentreader/webclient/model/GlaresCheckParams.java
src/main/generated/com/regula/documentreader/webclient/model/GraphData.java
src/main/generated/com/regula/documentreader/webclient/model/GraphicField.java
src/main/generated/com/regula/documentreader/webclient/model/GraphicFieldType.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,8 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.GetTransactionsByTagResponse
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.GlaresCheckParams.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.GraphData.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
/*
* Regula Document Reader Web API
* 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
*
* The version of the OpenAPI document: 8.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.regula.documentreader.webclient.model;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.regula.documentreader.webclient.JSON;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;

/** GlaresCheckParams */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
public class GlaresCheckParams {
public static final String SERIALIZED_NAME_IMG_MARGIN_PART = "imgMarginPart";

@SerializedName(SERIALIZED_NAME_IMG_MARGIN_PART)
@javax.annotation.Nullable
private Float imgMarginPart;

public static final String SERIALIZED_NAME_MAX_GLARING_PART = "maxGlaringPart";

@SerializedName(SERIALIZED_NAME_MAX_GLARING_PART)
@javax.annotation.Nullable
private Float maxGlaringPart;

public GlaresCheckParams() {}

public GlaresCheckParams imgMarginPart(@javax.annotation.Nullable Float imgMarginPart) {
this.imgMarginPart = imgMarginPart;
return this;
}

/**
* Margin from the edges of the image. 0.35 = 35%
*
* @return imgMarginPart
*/
@javax.annotation.Nullable
public Float getImgMarginPart() {
return imgMarginPart;
}

public void setImgMarginPart(@javax.annotation.Nullable Float imgMarginPart) {
this.imgMarginPart = imgMarginPart;
}

public GlaresCheckParams maxGlaringPart(@javax.annotation.Nullable Float maxGlaringPart) {
this.maxGlaringPart = maxGlaringPart;
return this;
}

/**
* The maximum allowable part of the area occupied by the glare. The same: 0.06 = 6%
*
* @return maxGlaringPart
*/
@javax.annotation.Nullable
public Float getMaxGlaringPart() {
return maxGlaringPart;
}

public void setMaxGlaringPart(@javax.annotation.Nullable Float maxGlaringPart) {
this.maxGlaringPart = maxGlaringPart;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GlaresCheckParams glaresCheckParams = (GlaresCheckParams) o;
return Objects.equals(this.imgMarginPart, glaresCheckParams.imgMarginPart)
&& Objects.equals(this.maxGlaringPart, glaresCheckParams.maxGlaringPart);
}

@Override
public int hashCode() {
return Objects.hash(imgMarginPart, maxGlaringPart);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GlaresCheckParams {\n");
sb.append(" imgMarginPart: ").append(toIndentedString(imgMarginPart)).append("\n");
sb.append(" maxGlaringPart: ").append(toIndentedString(maxGlaringPart)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;

static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>(Arrays.asList("imgMarginPart", "maxGlaringPart"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(0);
}

/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to GlaresCheckParams
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!GlaresCheckParams.openapiRequiredFields
.isEmpty()) { // has required fields but JSON element is null
System.err.println(
String.format(
"The required field(s) %s in GlaresCheckParams is not found in the empty JSON string",
GlaresCheckParams.openapiRequiredFields.toString()));
}
}

JsonObject jsonObj = jsonElement.getAsJsonObject();
}

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!GlaresCheckParams.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'GlaresCheckParams' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<GlaresCheckParams> thisAdapter =
gson.getDelegateAdapter(this, TypeToken.get(GlaresCheckParams.class));

return (TypeAdapter<T>)
new TypeAdapter<GlaresCheckParams>() {
@Override
public void write(JsonWriter out, GlaresCheckParams value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}

@Override
public GlaresCheckParams read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}

/**
* Create an instance of GlaresCheckParams given an JSON string
*
* @param jsonString JSON string
* @return An instance of GlaresCheckParams
* @throws IOException if the JSON string is invalid with respect to GlaresCheckParams
*/
public static GlaresCheckParams fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, GlaresCheckParams.class);
}

/**
* Convert an instance of GlaresCheckParams to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public class ImageQA {
@javax.annotation.Nullable
private List<InputImageQualityChecks> expectedPass;

public static final String SERIALIZED_NAME_GLARES_CHECK_PARAMS = "glaresCheckParams";

@SerializedName(SERIALIZED_NAME_GLARES_CHECK_PARAMS)
@javax.annotation.Nullable
private GlaresCheckParams glaresCheckParams;

public ImageQA() {}

public ImageQA brightnessThreshold(@javax.annotation.Nullable Double brightnessThreshold) {
Expand Down Expand Up @@ -275,6 +281,25 @@ public void setExpectedPass(
this.expectedPass = expectedPass;
}

public ImageQA glaresCheckParams(@javax.annotation.Nullable GlaresCheckParams glaresCheckParams) {
this.glaresCheckParams = glaresCheckParams;
return this;
}

/**
* Get glaresCheckParams
*
* @return glaresCheckParams
*/
@javax.annotation.Nullable
public GlaresCheckParams getGlaresCheckParams() {
return glaresCheckParams;
}

public void setGlaresCheckParams(@javax.annotation.Nullable GlaresCheckParams glaresCheckParams) {
this.glaresCheckParams = glaresCheckParams;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -292,7 +317,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.colornessCheck, imageQA.colornessCheck)
&& Objects.equals(this.moireCheck, imageQA.moireCheck)
&& Objects.equals(this.documentPositionIndent, imageQA.documentPositionIndent)
&& Objects.equals(this.expectedPass, imageQA.expectedPass);
&& Objects.equals(this.expectedPass, imageQA.expectedPass)
&& Objects.equals(this.glaresCheckParams, imageQA.glaresCheckParams);
}

@Override
Expand All @@ -306,7 +332,8 @@ public int hashCode() {
colornessCheck,
moireCheck,
documentPositionIndent,
expectedPass);
expectedPass,
glaresCheckParams);
}

@Override
Expand All @@ -326,6 +353,7 @@ public String toString() {
.append(toIndentedString(documentPositionIndent))
.append("\n");
sb.append(" expectedPass: ").append(toIndentedString(expectedPass)).append("\n");
sb.append(" glaresCheckParams: ").append(toIndentedString(glaresCheckParams)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -356,7 +384,8 @@ private String toIndentedString(Object o) {
"colornessCheck",
"moireCheck",
"documentPositionIndent",
"expectedPass"));
"expectedPass",
"glaresCheckParams"));

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

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
Expand Down