From e3f6283104fbad73a65d6eb3b0eed3c174337f56 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 14 Jan 2026 15:00:09 +0000 Subject: [PATCH] Commit: 5c4378a4 --- client/.openapi-generator/FILES | 2 + .../regula/documentreader/webclient/JSON.java | 22 ++ .../webclient/model/BSIV2Item.java | 192 ++++++++++++++++++ .../webclient/model/BSIV2Result.java | 189 +++++++++++++++++ .../model/ContainerListListInner.java | 90 ++++++-- .../webclient/model/ProcessParams.java | 37 +++- .../webclient/model/Result.java | 3 + .../webclient/model/ResultItem.java | 3 + 8 files changed, 514 insertions(+), 24 deletions(-) create mode 100644 client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Item.java create mode 100644 client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Result.java diff --git a/client/.openapi-generator/FILES b/client/.openapi-generator/FILES index 32767ef..c18a910 100755 --- a/client/.openapi-generator/FILES +++ b/client/.openapi-generator/FILES @@ -30,6 +30,8 @@ src/main/generated/com/regula/documentreader/webclient/model/AuthenticityCheckRe src/main/generated/com/regula/documentreader/webclient/model/AuthenticityCheckResultListInner.java src/main/generated/com/regula/documentreader/webclient/model/AuthenticityResult.java src/main/generated/com/regula/documentreader/webclient/model/AuthenticityResultType.java +src/main/generated/com/regula/documentreader/webclient/model/BSIV2Item.java +src/main/generated/com/regula/documentreader/webclient/model/BSIV2Result.java src/main/generated/com/regula/documentreader/webclient/model/BarCodeModuleType.java src/main/generated/com/regula/documentreader/webclient/model/BarcodePositionItem.java src/main/generated/com/regula/documentreader/webclient/model/BarcodePositionResult.java diff --git a/client/src/main/generated/com/regula/documentreader/webclient/JSON.java b/client/src/main/generated/com/regula/documentreader/webclient/JSON.java index 5979156..5f77558 100755 --- a/client/src/main/generated/com/regula/documentreader/webclient/JSON.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/JSON.java @@ -254,6 +254,20 @@ public static GsonBuilder createGson() { getDiscriminatorValue(readElement, "result_type")); } }) + .registerTypeSelector( + com.regula.documentreader.webclient.model.BSIV2Result.class, + new TypeSelector() { + @Override + public Class + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put( + "BSIV2Result", com.regula.documentreader.webclient.model.BSIV2Result.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "result_type")); + } + }) .registerTypeSelector( com.regula.documentreader.webclient.model.BarcodePositionResult.class, new TypeSelector< @@ -387,6 +401,8 @@ public static GsonBuilder createGson() { com.regula.documentreader.webclient.model.BarcodePositionResult.class); classByDiscriminatorValue.put( "7", com.regula.documentreader.webclient.model.MRZTestQualityResult.class); + classByDiscriminatorValue.put( + "73", com.regula.documentreader.webclient.model.BSIV2Result.class); classByDiscriminatorValue.put( "8", com.regula.documentreader.webclient.model.DocumentTypesCandidatesResult @@ -838,6 +854,8 @@ public static GsonBuilder createGson() { com.regula.documentreader.webclient.model.BarcodePositionResult.class); classByDiscriminatorValue.put( "7", com.regula.documentreader.webclient.model.MRZTestQualityResult.class); + classByDiscriminatorValue.put( + "73", com.regula.documentreader.webclient.model.BSIV2Result.class); classByDiscriminatorValue.put( "8", com.regula.documentreader.webclient.model.DocumentTypesCandidatesResult @@ -1009,6 +1027,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.regula.documentreader.webclient.model.AuthenticityResult .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.regula.documentreader.webclient.model.BSIV2Item.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.regula.documentreader.webclient.model.BSIV2Result.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.regula.documentreader.webclient.model.BarcodePositionItem .CustomTypeAdapterFactory()); diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Item.java b/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Item.java new file mode 100644 index 0000000..a9d79ce --- /dev/null +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Item.java @@ -0,0 +1,192 @@ +/* + * 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; + +/** BSIV2Item */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.15.0") +public class BSIV2Item { + public static final String SERIALIZED_NAME_XM_L_BUFFER = "XML_buffer"; + + @SerializedName(SERIALIZED_NAME_XM_L_BUFFER) + @javax.annotation.Nonnull + private String xmLBuffer; + + public BSIV2Item() {} + + public BSIV2Item xmLBuffer(@javax.annotation.Nonnull String xmLBuffer) { + this.xmLBuffer = xmLBuffer; + return this; + } + + /** + * Get xmLBuffer + * + * @return xmLBuffer + */ + @javax.annotation.Nonnull + public String getXmLBuffer() { + return xmLBuffer; + } + + public void setXmLBuffer(@javax.annotation.Nonnull String xmLBuffer) { + this.xmLBuffer = xmLBuffer; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BSIV2Item bsIV2Item = (BSIV2Item) o; + return Objects.equals(this.xmLBuffer, bsIV2Item.xmLBuffer); + } + + @Override + public int hashCode() { + return Objects.hash(xmLBuffer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BSIV2Item {\n"); + sb.append(" xmLBuffer: ").append(toIndentedString(xmLBuffer)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("XML_buffer")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("XML_buffer")); + } + + /** + * 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 BSIV2Item + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BSIV2Item.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + System.err.println( + String.format( + "The required field(s) %s in BSIV2Item is not found in the empty JSON string", + BSIV2Item.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BSIV2Item.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(); + if (!jsonObj.get("XML_buffer").isJsonPrimitive()) { + System.err.println( + String.format( + "Expected the field `XML_buffer` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("XML_buffer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BSIV2Item.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BSIV2Item' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BSIV2Item.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BSIV2Item value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BSIV2Item read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BSIV2Item given an JSON string + * + * @param jsonString JSON string + * @return An instance of BSIV2Item + * @throws IOException if the JSON string is invalid with respect to BSIV2Item + */ + public static BSIV2Item fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BSIV2Item.class); + } + + /** + * Convert an instance of BSIV2Item to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Result.java b/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Result.java new file mode 100644 index 0000000..0d279a2 --- /dev/null +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/BSIV2Result.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** BSIV2Result */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.15.0") +public class BSIV2Result extends ResultItem { + public static final String SERIALIZED_NAME_XM_L_BUFFER = "XML_buffer"; + + @SerializedName(SERIALIZED_NAME_XM_L_BUFFER) + @javax.annotation.Nonnull + private String xmLBuffer; + + public BSIV2Result() {} + + public BSIV2Result xmLBuffer(@javax.annotation.Nonnull String xmLBuffer) { + this.xmLBuffer = xmLBuffer; + return this; + } + + /** + * Get xmLBuffer + * + * @return xmLBuffer + */ + @javax.annotation.Nonnull + public String getXmLBuffer() { + return xmLBuffer; + } + + public void setXmLBuffer(@javax.annotation.Nonnull String xmLBuffer) { + this.xmLBuffer = xmLBuffer; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BSIV2Result bsIV2Result = (BSIV2Result) o; + return Objects.equals(this.xmLBuffer, bsIV2Result.xmLBuffer) && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(xmLBuffer, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BSIV2Result {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" xmLBuffer: ").append(toIndentedString(xmLBuffer)).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 openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet( + Arrays.asList( + "buf_length", "light", "list_idx", "page_idx", "result_type", "XML_buffer")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("XML_buffer", "result_type")); + } + + /** + * 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 BSIV2Result + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BSIV2Result.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + System.err.println( + String.format( + "The required field(s) %s in BSIV2Result is not found in the empty JSON string", + BSIV2Result.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BSIV2Result.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())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BSIV2Result.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BSIV2Result' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BSIV2Result.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BSIV2Result value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BSIV2Result read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BSIV2Result given an JSON string + * + * @param jsonString JSON string + * @return An instance of BSIV2Result + * @throws IOException if the JSON string is invalid with respect to BSIV2Result + */ + public static BSIV2Result fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BSIV2Result.class); + } + + /** + * Convert an instance of BSIV2Result to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/ContainerListListInner.java b/client/src/main/generated/com/regula/documentreader/webclient/model/ContainerListListInner.java index 59a3ed6..ec1edd4 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/ContainerListListInner.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/ContainerListListInner.java @@ -95,6 +95,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter(this, TypeToken.get(VDSDataResult.class)); final TypeAdapter adapterMDLResult = gson.getDelegateAdapter(this, TypeToken.get(MDLResult.class)); + final TypeAdapter adapterBSIV2Result = + gson.getDelegateAdapter(this, TypeToken.get(BSIV2Result.class)); return (TypeAdapter) new TypeAdapter() { @@ -310,8 +312,15 @@ public void write(JsonWriter out, ContainerListListInner value) throws IOExcepti elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `BSIV2Result` + if (value.getActualInstance() instanceof BSIV2Result) { + JsonElement element = + adapterBSIV2Result.toJsonTree((BSIV2Result) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: AuthenticityResult, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult"); + "Failed to serialize as the type doesn't match oneOf schemas: AuthenticityResult, BSIV2Result, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult"); } @Override @@ -722,6 +731,20 @@ public ContainerListListInner read(JsonReader in) throws IOException { "Deserialization for MDLResult failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'MDLResult'", e); } + // deserialize BSIV2Result + try { + // validate the JSON object to see if any exception is thrown + BSIV2Result.validateJsonElement(jsonElement); + actualAdapter = adapterBSIV2Result; + match++; + log.log(Level.FINER, "Input data matches schema 'BSIV2Result'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for BSIV2Result failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BSIV2Result'", e); + } if (match == 1) { ContainerListListInner ret = new ContainerListListInner(); @@ -778,6 +801,7 @@ public ContainerListListInner(Object o) { schemas.put("VDSNCDataResult", VDSNCDataResult.class); schemas.put("VDSDataResult", VDSDataResult.class); schemas.put("MDLResult", MDLResult.class); + schemas.put("BSIV2Result", BSIV2Result.class); } @Override @@ -787,12 +811,13 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AuthenticityResult, BarcodePositionResult, ByteArrayResult, - * ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, - * DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, - * GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, - * MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, - * RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult + * against the oneOf child schemas: AuthenticityResult, BSIV2Result, BarcodePositionResult, + * ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, + * DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, + * FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, + * LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, + * RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, + * VDSDataResult, VDSNCDataResult * *

It could be an instance of the 'oneOf' schemas. */ @@ -933,23 +958,28 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof BSIV2Result) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be AuthenticityResult, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult"); + "Invalid instance type. Must be AuthenticityResult, BSIV2Result, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult"); } /** - * Get the actual instance, which can be the following: AuthenticityResult, BarcodePositionResult, - * ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, - * DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, - * FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, - * LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, - * RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, - * VDSDataResult, VDSNCDataResult + * Get the actual instance, which can be the following: AuthenticityResult, BSIV2Result, + * BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, + * DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, + * DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, + * ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, + * MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, + * RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult * - * @return The actual instance (AuthenticityResult, BarcodePositionResult, ByteArrayResult, - * ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, - * DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, - * FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, + * @return The actual instance (AuthenticityResult, BSIV2Result, BarcodePositionResult, + * ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, + * DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, + * EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, * LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, * MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, * TextDataResult, TextResult, VDSDataResult, VDSNCDataResult) @@ -1258,6 +1288,17 @@ public MDLResult getMDLResult() throws ClassCastException { return (MDLResult) super.getActualInstance(); } + /** + * Get the actual instance of `BSIV2Result`. If the actual instance is not `BSIV2Result`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `BSIV2Result` + * @throws ClassCastException if the instance is not `BSIV2Result` + */ + public BSIV2Result getBSIV2Result() throws ClassCastException { + return (BSIV2Result) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -1526,10 +1567,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti String.format("Deserialization for MDLResult failed with `%s`.", e.getMessage())); // continue to the next one } + // validate the json string with BSIV2Result + try { + BSIV2Result.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format("Deserialization for BSIV2Result failed with `%s`.", e.getMessage())); + // continue to the next one + } if (validCount != 1) { throw new IOException( String.format( - "The JSON string is invalid for ContainerListListInner with oneOf schemas: AuthenticityResult, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + "The JSON string is invalid for ContainerListListInner with oneOf schemas: AuthenticityResult, BSIV2Result, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java b/client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java index 9f0105d..bc19248 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java @@ -449,6 +449,12 @@ public class ProcessParams { @javax.annotation.Nullable private Boolean returnTransliteratedFields; + public static final String SERIALIZED_NAME_BSI_TR03135_RESULTS = "bsiTr03135Results"; + + @SerializedName(SERIALIZED_NAME_BSI_TR03135_RESULTS) + @javax.annotation.Nullable + private Boolean bsiTr03135Results; + public ProcessParams() {} public ProcessParams generateDTCVC(@javax.annotation.Nullable Boolean generateDTCVC) { @@ -1920,6 +1926,26 @@ public void setReturnTransliteratedFields( this.returnTransliteratedFields = returnTransliteratedFields; } + public ProcessParams bsiTr03135Results(@javax.annotation.Nullable Boolean bsiTr03135Results) { + this.bsiTr03135Results = bsiTr03135Results; + return this; + } + + /** + * When enabled, returns processing results in accordance with the BSI TR-03135 standard in + * addition to the existing processing results. + * + * @return bsiTr03135Results + */ + @javax.annotation.Nullable + public Boolean getBsiTr03135Results() { + return bsiTr03135Results; + } + + public void setBsiTr03135Results(@javax.annotation.Nullable Boolean bsiTr03135Results) { + this.bsiTr03135Results = bsiTr03135Results; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1999,8 +2025,8 @@ public boolean equals(Object o) { && Objects.equals( this.disableAuthResolutionFilter, processParams.disableAuthResolutionFilter) && Objects.equals(this.strictSecurityChecks, processParams.strictSecurityChecks) - && Objects.equals( - this.returnTransliteratedFields, processParams.returnTransliteratedFields); + && Objects.equals(this.returnTransliteratedFields, processParams.returnTransliteratedFields) + && Objects.equals(this.bsiTr03135Results, processParams.bsiTr03135Results); } @Override @@ -2072,7 +2098,8 @@ public int hashCode() { pdfPagesLimit, disableAuthResolutionFilter, strictSecurityChecks, - returnTransliteratedFields); + returnTransliteratedFields, + bsiTr03135Results); } @Override @@ -2188,6 +2215,7 @@ public String toString() { sb.append(" returnTransliteratedFields: ") .append(toIndentedString(returnTransliteratedFields)) .append("\n"); + sb.append(" bsiTr03135Results: ").append(toIndentedString(bsiTr03135Results)).append("\n"); sb.append("}"); return sb.toString(); } @@ -2276,7 +2304,8 @@ private String toIndentedString(Object o) { "pdfPagesLimit", "disableAuthResolutionFilter", "strictSecurityChecks", - "returnTransliteratedFields")); + "returnTransliteratedFields", + "bsiTr03135Results")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("scenario")); diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/Result.java b/client/src/main/generated/com/regula/documentreader/webclient/model/Result.java index 652e3a0..e4202aa 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/Result.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/Result.java @@ -115,6 +115,9 @@ public enum Result { /** Contains result of barcode position */ BARCODE_POSITION(62), + /** Contains results in accordance with the BSI TR-03135 standard */ + BSI_XML_V2(73), + /** Contains information about document position on the input image, its center, angle, etc */ DOCUMENT_POSITION(85), diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/ResultItem.java b/client/src/main/generated/com/regula/documentreader/webclient/model/ResultItem.java index 6468f90..c93908c 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/ResultItem.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/ResultItem.java @@ -330,6 +330,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti case "7": MRZTestQualityResult.validateJsonElement(jsonElement); break; + case "73": + BSIV2Result.validateJsonElement(jsonElement); + break; case "8": DocumentTypesCandidatesResult.validateJsonElement(jsonElement); break;