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: 0 additions & 1 deletion .github/workflows/run-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
- run: ./gradlew clean :example:run
env:
API_BASE_PATH: "https://nightly-api.regulaforensics.com"
TEST_LICENSE: ${{secrets.TEST_LICENSE}}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -437,12 +437,10 @@ private String toIndentedString(Object o) {

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
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");
Expand Down Expand Up @@ -477,16 +475,19 @@ 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`",
jsonObj.get("DocumentName").toString()));
}
// 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -437,12 +437,10 @@ private String toIndentedString(Object o) {

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
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");
Expand Down Expand Up @@ -477,16 +475,19 @@ 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`",
jsonObj.get("DocumentName").toString()));
}
// 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1904,7 +1930,8 @@ public int hashCode() {
selectLongestNames,
doBarcodes,
strictDLCategoryExpiry,
generateAlpha2Codes);
generateAlpha2Codes,
pdfPagesLimit);
}

@Override
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@

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 {

var apiBaseUrl = System.getenv(API_BASE_PATH);
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");

Expand Down Expand Up @@ -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(
Expand Down