diff --git a/.github/workflows/run-smoke-test.yml b/.github/workflows/run-smoke-test.yml index ecf69a2..f074747 100755 --- a/.github/workflows/run-smoke-test.yml +++ b/.github/workflows/run-smoke-test.yml @@ -19,4 +19,3 @@ jobs: - run: ./gradlew clean :example:run env: API_BASE_PATH: "https://nightly-api.regulaforensics.com" - TEST_LICENSE: ${{secrets.TEST_LICENSE}} diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/ChosenDocumentType.java b/client/src/main/generated/com/regula/documentreader/webclient/model/ChosenDocumentType.java index 3568b2a..f5cffcf 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/ChosenDocumentType.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/ChosenDocumentType.java @@ -35,7 +35,7 @@ public class ChosenDocumentType { public static final String SERIALIZED_NAME_DOCUMENT_NAME = "DocumentName"; @SerializedName(SERIALIZED_NAME_DOCUMENT_NAME) - @javax.annotation.Nonnull + @javax.annotation.Nullable private String documentName; public static final String SERIALIZED_NAME_I_D = "ID"; @@ -65,7 +65,7 @@ public class ChosenDocumentType { public static final String SERIALIZED_NAME_FD_S_I_D_LIST = "FDSIDList"; @SerializedName(SERIALIZED_NAME_FD_S_I_D_LIST) - @javax.annotation.Nonnull + @javax.annotation.Nullable private FDSIDList fdSIDList; public static final String SERIALIZED_NAME_NECESSARY_LIGHTS = "NecessaryLights"; @@ -107,7 +107,7 @@ public class ChosenDocumentType { public ChosenDocumentType() {} - public ChosenDocumentType documentName(@javax.annotation.Nonnull String documentName) { + public ChosenDocumentType documentName(@javax.annotation.Nullable String documentName) { this.documentName = documentName; return this; } @@ -117,12 +117,12 @@ public ChosenDocumentType documentName(@javax.annotation.Nonnull String document * * @return documentName */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getDocumentName() { return documentName; } - public void setDocumentName(@javax.annotation.Nonnull String documentName) { + public void setDocumentName(@javax.annotation.Nullable String documentName) { this.documentName = documentName; } @@ -203,7 +203,7 @@ public void setRfIDPresence(@javax.annotation.Nonnull RfidLocation rfIDPresence) this.rfIDPresence = rfIDPresence; } - public ChosenDocumentType fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) { + public ChosenDocumentType fdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) { this.fdSIDList = fdSIDList; return this; } @@ -213,12 +213,12 @@ public ChosenDocumentType fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDLis * * @return fdSIDList */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public FDSIDList getFdSIDList() { return fdSIDList; } - public void setFdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) { + public void setFdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) { this.fdSIDList = fdSIDList; } @@ -437,12 +437,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("DocumentName"); openapiRequiredFields.add("ID"); openapiRequiredFields.add("P"); openapiRequiredFields.add("Rotated180"); openapiRequiredFields.add("RFID_Presence"); - openapiRequiredFields.add("FDSIDList"); openapiRequiredFields.add("NecessaryLights"); openapiRequiredFields.add("CheckAuthenticity"); openapiRequiredFields.add("UVExp"); @@ -477,7 +475,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("DocumentName").isJsonPrimitive()) { + if ((jsonObj.get("DocumentName") != null && !jsonObj.get("DocumentName").isJsonNull()) + && !jsonObj.get("DocumentName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `DocumentName` to be a primitive type in the JSON string but got `%s`", @@ -485,8 +484,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `RFID_Presence` RfidLocation.validateJsonElement(jsonObj.get("RFID_Presence")); - // validate the required field `FDSIDList` - FDSIDList.validateJsonElement(jsonObj.get("FDSIDList")); + // validate the optional field `FDSIDList` + if (jsonObj.get("FDSIDList") != null && !jsonObj.get("FDSIDList").isJsonNull()) { + FDSIDList.validateJsonElement(jsonObj.get("FDSIDList")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java b/client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java index 347f9d1..d255795 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java @@ -35,7 +35,7 @@ public class OneCandidate { public static final String SERIALIZED_NAME_DOCUMENT_NAME = "DocumentName"; @SerializedName(SERIALIZED_NAME_DOCUMENT_NAME) - @javax.annotation.Nonnull + @javax.annotation.Nullable private String documentName; public static final String SERIALIZED_NAME_I_D = "ID"; @@ -65,7 +65,7 @@ public class OneCandidate { public static final String SERIALIZED_NAME_FD_S_I_D_LIST = "FDSIDList"; @SerializedName(SERIALIZED_NAME_FD_S_I_D_LIST) - @javax.annotation.Nonnull + @javax.annotation.Nullable private FDSIDList fdSIDList; public static final String SERIALIZED_NAME_NECESSARY_LIGHTS = "NecessaryLights"; @@ -107,7 +107,7 @@ public class OneCandidate { public OneCandidate() {} - public OneCandidate documentName(@javax.annotation.Nonnull String documentName) { + public OneCandidate documentName(@javax.annotation.Nullable String documentName) { this.documentName = documentName; return this; } @@ -117,12 +117,12 @@ public OneCandidate documentName(@javax.annotation.Nonnull String documentName) * * @return documentName */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getDocumentName() { return documentName; } - public void setDocumentName(@javax.annotation.Nonnull String documentName) { + public void setDocumentName(@javax.annotation.Nullable String documentName) { this.documentName = documentName; } @@ -203,7 +203,7 @@ public void setRfIDPresence(@javax.annotation.Nonnull RfidLocation rfIDPresence) this.rfIDPresence = rfIDPresence; } - public OneCandidate fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) { + public OneCandidate fdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) { this.fdSIDList = fdSIDList; return this; } @@ -213,12 +213,12 @@ public OneCandidate fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) { * * @return fdSIDList */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public FDSIDList getFdSIDList() { return fdSIDList; } - public void setFdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) { + public void setFdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) { this.fdSIDList = fdSIDList; } @@ -437,12 +437,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("DocumentName"); openapiRequiredFields.add("ID"); openapiRequiredFields.add("P"); openapiRequiredFields.add("Rotated180"); openapiRequiredFields.add("RFID_Presence"); - openapiRequiredFields.add("FDSIDList"); openapiRequiredFields.add("NecessaryLights"); openapiRequiredFields.add("CheckAuthenticity"); openapiRequiredFields.add("UVExp"); @@ -477,7 +475,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("DocumentName").isJsonPrimitive()) { + if ((jsonObj.get("DocumentName") != null && !jsonObj.get("DocumentName").isJsonNull()) + && !jsonObj.get("DocumentName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `DocumentName` to be a primitive type in the JSON string but got `%s`", @@ -485,8 +484,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `RFID_Presence` RfidLocation.validateJsonElement(jsonObj.get("RFID_Presence")); - // validate the required field `FDSIDList` - FDSIDList.validateJsonElement(jsonObj.get("FDSIDList")); + // validate the optional field `FDSIDList` + if (jsonObj.get("FDSIDList") != null && !jsonObj.get("FDSIDList").isJsonNull()) { + FDSIDList.validateJsonElement(jsonObj.get("FDSIDList")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { 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 3694775..5177fb8 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 @@ -416,6 +416,12 @@ public class ProcessParams { @javax.annotation.Nullable private Boolean generateAlpha2Codes; + public static final String SERIALIZED_NAME_PDF_PAGES_LIMIT = "pdfPagesLimit"; + + @SerializedName(SERIALIZED_NAME_PDF_PAGES_LIMIT) + @javax.annotation.Nullable + private Integer pdfPagesLimit; + public ProcessParams() {} public ProcessParams generateDTCVC(@javax.annotation.Nullable Boolean generateDTCVC) { @@ -1764,6 +1770,25 @@ public void setGenerateAlpha2Codes(@javax.annotation.Nullable Boolean generateAl this.generateAlpha2Codes = generateAlpha2Codes; } + public ProcessParams pdfPagesLimit(@javax.annotation.Nullable Integer pdfPagesLimit) { + this.pdfPagesLimit = pdfPagesLimit; + return this; + } + + /** + * Limits the number of pages to be processed from a PDF file. + * + * @return pdfPagesLimit + */ + @javax.annotation.Nullable + public Integer getPdfPagesLimit() { + return pdfPagesLimit; + } + + public void setPdfPagesLimit(@javax.annotation.Nullable Integer pdfPagesLimit) { + this.pdfPagesLimit = pdfPagesLimit; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1837,7 +1862,8 @@ public boolean equals(Object o) { && Objects.equals(this.selectLongestNames, processParams.selectLongestNames) && Objects.equals(this.doBarcodes, processParams.doBarcodes) && Objects.equals(this.strictDLCategoryExpiry, processParams.strictDLCategoryExpiry) - && Objects.equals(this.generateAlpha2Codes, processParams.generateAlpha2Codes); + && Objects.equals(this.generateAlpha2Codes, processParams.generateAlpha2Codes) + && Objects.equals(this.pdfPagesLimit, processParams.pdfPagesLimit); } @Override @@ -1904,7 +1930,8 @@ public int hashCode() { selectLongestNames, doBarcodes, strictDLCategoryExpiry, - generateAlpha2Codes); + generateAlpha2Codes, + pdfPagesLimit); } @Override @@ -2007,6 +2034,7 @@ public String toString() { sb.append(" generateAlpha2Codes: ") .append(toIndentedString(generateAlpha2Codes)) .append("\n"); + sb.append(" pdfPagesLimit: ").append(toIndentedString(pdfPagesLimit)).append("\n"); sb.append("}"); return sb.toString(); } @@ -2089,6 +2117,7 @@ private String toIndentedString(Object o) { openapiFields.add("doBarcodes"); openapiFields.add("strictDLCategoryExpiry"); openapiFields.add("generateAlpha2Codes"); + openapiFields.add("pdfPagesLimit"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/client/src/main/generated/com/regula/documentreader/webclient/model/TextFieldType.java b/client/src/main/generated/com/regula/documentreader/webclient/model/TextFieldType.java index 09da3f6..5d4d082 100644 --- a/client/src/main/generated/com/regula/documentreader/webclient/model/TextFieldType.java +++ b/client/src/main/generated/com/regula/documentreader/webclient/model/TextFieldType.java @@ -1953,7 +1953,16 @@ public enum TextFieldType { SHORT_FLIGHT_NUMBER(693), /** Airline code */ - AIRLINE_CODE(694); + AIRLINE_CODE(694), + + /** MVC Agency */ + FT_MVC_AGENCY(695), + + /** Issuing state code alpha */ + FT_ISSUING_STATE_CODE_ALPHA2(696), + + /** Nationality code alpha */ + FT_NATIONALITY_CODE_ALPHA2(697); private Integer value; diff --git a/example/src/main/java/com/regula/documentreader/webclient/example/Main.java b/example/src/main/java/com/regula/documentreader/webclient/example/Main.java index ad5945b..35b307d 100755 --- a/example/src/main/java/com/regula/documentreader/webclient/example/Main.java +++ b/example/src/main/java/com/regula/documentreader/webclient/example/Main.java @@ -29,7 +29,6 @@ public class Main { public static final String API_BASE_PATH = "API_BASE_PATH"; - public static final String TEST_LICENSE = "TEST_LICENSE"; public static void main(String[] args) throws IOException, ApiException { @@ -37,9 +36,6 @@ public static void main(String[] args) throws IOException, ApiException { if (apiBaseUrl == null) { apiBaseUrl = "https://api.regulaforensics.com"; } - var licenseFromEnv = System.getenv(TEST_LICENSE); // optional, used here only for smoke test purposes - var licenseFromFile = readFile("regula.license"); - byte[] whitePage0 = readFile("WHITE.jpg"); @@ -72,10 +68,6 @@ public static void main(String[] args) throws IOException, ApiException { var api = new DocumentReaderApi(apiClient); - // Uncomment one of the lines below if you want to transfer the license with each request -// if (licenseFromEnv != null) api.setLicense(licenseFromEnv); -// if (licenseFromFile != null) api.setLicense(licenseFromFile); - var info = api.health(); System.out.println(); System.out.format(