Skip to content
Closed
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
4 changes: 4 additions & 0 deletions client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ src/main/generated/com/regula/documentreader/webclient/model/CrossSourceValueCom
src/main/generated/com/regula/documentreader/webclient/model/DataModule.java
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocument.java
src/main/generated/com/regula/documentreader/webclient/model/DatabaseDocumentList.java
src/main/generated/com/regula/documentreader/webclient/model/DetailsAge.java
src/main/generated/com/regula/documentreader/webclient/model/DetailsOptical.java
src/main/generated/com/regula/documentreader/webclient/model/DetailsRFID.java
src/main/generated/com/regula/documentreader/webclient/model/DeviceInfo.java
Expand Down Expand Up @@ -131,6 +132,9 @@ src/main/generated/com/regula/documentreader/webclient/model/ListVerifiedFields.
src/main/generated/com/regula/documentreader/webclient/model/ListVerifiedFieldsItem.java
src/main/generated/com/regula/documentreader/webclient/model/LivenessParams.java
src/main/generated/com/regula/documentreader/webclient/model/LogLevel.java
src/main/generated/com/regula/documentreader/webclient/model/MDLDeviceEngagement.java
src/main/generated/com/regula/documentreader/webclient/model/MDLDeviceRetrieval.java
src/main/generated/com/regula/documentreader/webclient/model/MDLServerRetrieval.java
src/main/generated/com/regula/documentreader/webclient/model/MRZDetectorResult.java
src/main/generated/com/regula/documentreader/webclient/model/MRZFormat.java
src/main/generated/com/regula/documentreader/webclient/model/MRZPositionResult.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.DatabaseDocumentList
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.DetailsAge.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.regula.documentreader.webclient.model.DetailsOptical.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
/*
* 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;

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

@SerializedName(SERIALIZED_NAME_THRESHOLD)
@javax.annotation.Nonnull
private Integer threshold;

public static final String SERIALIZED_NAME_OVER_THRESHOLD = "overThreshold";

@SerializedName(SERIALIZED_NAME_OVER_THRESHOLD)
@javax.annotation.Nonnull
private CheckResult overThreshold;

public static final String SERIALIZED_NAME_OVER18 = "over18";

@SerializedName(SERIALIZED_NAME_OVER18)
@javax.annotation.Nonnull
private CheckResult over18;

public static final String SERIALIZED_NAME_OVER21 = "over21";

@SerializedName(SERIALIZED_NAME_OVER21)
@javax.annotation.Nonnull
private CheckResult over21;

public static final String SERIALIZED_NAME_OVER25 = "over25";

@SerializedName(SERIALIZED_NAME_OVER25)
@javax.annotation.Nonnull
private CheckResult over25;

public static final String SERIALIZED_NAME_OVER65 = "over65";

@SerializedName(SERIALIZED_NAME_OVER65)
@javax.annotation.Nonnull
private CheckResult over65;

public DetailsAge() {}

public DetailsAge threshold(@javax.annotation.Nonnull Integer threshold) {
this.threshold = threshold;
return this;
}

/**
* Get threshold
*
* @return threshold
*/
@javax.annotation.Nonnull
public Integer getThreshold() {
return threshold;
}

public void setThreshold(@javax.annotation.Nonnull Integer threshold) {
this.threshold = threshold;
}

public DetailsAge overThreshold(@javax.annotation.Nonnull CheckResult overThreshold) {
this.overThreshold = overThreshold;
return this;
}

/**
* Get overThreshold
*
* @return overThreshold
*/
@javax.annotation.Nonnull
public CheckResult getOverThreshold() {
return overThreshold;
}

public void setOverThreshold(@javax.annotation.Nonnull CheckResult overThreshold) {
this.overThreshold = overThreshold;
}

public DetailsAge over18(@javax.annotation.Nonnull CheckResult over18) {
this.over18 = over18;
return this;
}

/**
* Get over18
*
* @return over18
*/
@javax.annotation.Nonnull
public CheckResult getOver18() {
return over18;
}

public void setOver18(@javax.annotation.Nonnull CheckResult over18) {
this.over18 = over18;
}

public DetailsAge over21(@javax.annotation.Nonnull CheckResult over21) {
this.over21 = over21;
return this;
}

/**
* Get over21
*
* @return over21
*/
@javax.annotation.Nonnull
public CheckResult getOver21() {
return over21;
}

public void setOver21(@javax.annotation.Nonnull CheckResult over21) {
this.over21 = over21;
}

public DetailsAge over25(@javax.annotation.Nonnull CheckResult over25) {
this.over25 = over25;
return this;
}

/**
* Get over25
*
* @return over25
*/
@javax.annotation.Nonnull
public CheckResult getOver25() {
return over25;
}

public void setOver25(@javax.annotation.Nonnull CheckResult over25) {
this.over25 = over25;
}

public DetailsAge over65(@javax.annotation.Nonnull CheckResult over65) {
this.over65 = over65;
return this;
}

/**
* Get over65
*
* @return over65
*/
@javax.annotation.Nonnull
public CheckResult getOver65() {
return over65;
}

public void setOver65(@javax.annotation.Nonnull CheckResult over65) {
this.over65 = over65;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DetailsAge detailsAge = (DetailsAge) o;
return Objects.equals(this.threshold, detailsAge.threshold)
&& Objects.equals(this.overThreshold, detailsAge.overThreshold)
&& Objects.equals(this.over18, detailsAge.over18)
&& Objects.equals(this.over21, detailsAge.over21)
&& Objects.equals(this.over25, detailsAge.over25)
&& Objects.equals(this.over65, detailsAge.over65);
}

@Override
public int hashCode() {
return Objects.hash(threshold, overThreshold, over18, over21, over25, over65);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DetailsAge {\n");
sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n");
sb.append(" overThreshold: ").append(toIndentedString(overThreshold)).append("\n");
sb.append(" over18: ").append(toIndentedString(over18)).append("\n");
sb.append(" over21: ").append(toIndentedString(over21)).append("\n");
sb.append(" over25: ").append(toIndentedString(over25)).append("\n");
sb.append(" over65: ").append(toIndentedString(over65)).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("threshold", "overThreshold", "over18", "over21", "over25", "over65"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields =
new HashSet<String>(
Arrays.asList("threshold", "overThreshold", "over18", "over21", "over25", "over65"));
}

/**
* 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 DetailsAge
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!DetailsAge.openapiRequiredFields
.isEmpty()) { // has required fields but JSON element is null
System.err.println(
String.format(
"The required field(s) %s in DetailsAge is not found in the empty JSON string",
DetailsAge.openapiRequiredFields.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : DetailsAge.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
System.err.println(
String.format(
"The required field `%s` is not found in the JSON string: %s",
requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `overThreshold`
CheckResult.validateJsonElement(jsonObj.get("overThreshold"));
// validate the required field `over18`
CheckResult.validateJsonElement(jsonObj.get("over18"));
// validate the required field `over21`
CheckResult.validateJsonElement(jsonObj.get("over21"));
// validate the required field `over25`
CheckResult.validateJsonElement(jsonObj.get("over25"));
// validate the required field `over65`
CheckResult.validateJsonElement(jsonObj.get("over65"));
}

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

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

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

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

/**
* Convert an instance of DetailsAge to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
Loading