Skip to content

Commit dc7b7ae

Browse files
Merge pull request #180 from regulaforensics/feature/SP-23182
SP-23182 - remove example license
2 parents 08a7af4 + 404f5e4 commit dc7b7ae

File tree

6 files changed

+69
-38
lines changed

6 files changed

+69
-38
lines changed

.github/workflows/run-smoke-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
- run: ./gradlew clean :example:run
2020
env:
2121
API_BASE_PATH: "https://nightly-api.regulaforensics.com"
22-
TEST_LICENSE: ${{secrets.TEST_LICENSE}}

client/src/main/generated/com/regula/documentreader/webclient/model/ChosenDocumentType.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class ChosenDocumentType {
3535
public static final String SERIALIZED_NAME_DOCUMENT_NAME = "DocumentName";
3636

3737
@SerializedName(SERIALIZED_NAME_DOCUMENT_NAME)
38-
@javax.annotation.Nonnull
38+
@javax.annotation.Nullable
3939
private String documentName;
4040

4141
public static final String SERIALIZED_NAME_I_D = "ID";
@@ -65,7 +65,7 @@ public class ChosenDocumentType {
6565
public static final String SERIALIZED_NAME_FD_S_I_D_LIST = "FDSIDList";
6666

6767
@SerializedName(SERIALIZED_NAME_FD_S_I_D_LIST)
68-
@javax.annotation.Nonnull
68+
@javax.annotation.Nullable
6969
private FDSIDList fdSIDList;
7070

7171
public static final String SERIALIZED_NAME_NECESSARY_LIGHTS = "NecessaryLights";
@@ -107,7 +107,7 @@ public class ChosenDocumentType {
107107

108108
public ChosenDocumentType() {}
109109

110-
public ChosenDocumentType documentName(@javax.annotation.Nonnull String documentName) {
110+
public ChosenDocumentType documentName(@javax.annotation.Nullable String documentName) {
111111
this.documentName = documentName;
112112
return this;
113113
}
@@ -117,12 +117,12 @@ public ChosenDocumentType documentName(@javax.annotation.Nonnull String document
117117
*
118118
* @return documentName
119119
*/
120-
@javax.annotation.Nonnull
120+
@javax.annotation.Nullable
121121
public String getDocumentName() {
122122
return documentName;
123123
}
124124

125-
public void setDocumentName(@javax.annotation.Nonnull String documentName) {
125+
public void setDocumentName(@javax.annotation.Nullable String documentName) {
126126
this.documentName = documentName;
127127
}
128128

@@ -203,7 +203,7 @@ public void setRfIDPresence(@javax.annotation.Nonnull RfidLocation rfIDPresence)
203203
this.rfIDPresence = rfIDPresence;
204204
}
205205

206-
public ChosenDocumentType fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) {
206+
public ChosenDocumentType fdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) {
207207
this.fdSIDList = fdSIDList;
208208
return this;
209209
}
@@ -213,12 +213,12 @@ public ChosenDocumentType fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDLis
213213
*
214214
* @return fdSIDList
215215
*/
216-
@javax.annotation.Nonnull
216+
@javax.annotation.Nullable
217217
public FDSIDList getFdSIDList() {
218218
return fdSIDList;
219219
}
220220

221-
public void setFdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) {
221+
public void setFdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) {
222222
this.fdSIDList = fdSIDList;
223223
}
224224

@@ -437,12 +437,10 @@ private String toIndentedString(Object o) {
437437

438438
// a set of required properties/fields (JSON key names)
439439
openapiRequiredFields = new HashSet<String>();
440-
openapiRequiredFields.add("DocumentName");
441440
openapiRequiredFields.add("ID");
442441
openapiRequiredFields.add("P");
443442
openapiRequiredFields.add("Rotated180");
444443
openapiRequiredFields.add("RFID_Presence");
445-
openapiRequiredFields.add("FDSIDList");
446444
openapiRequiredFields.add("NecessaryLights");
447445
openapiRequiredFields.add("CheckAuthenticity");
448446
openapiRequiredFields.add("UVExp");
@@ -477,16 +475,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
477475
}
478476
}
479477
JsonObject jsonObj = jsonElement.getAsJsonObject();
480-
if (!jsonObj.get("DocumentName").isJsonPrimitive()) {
478+
if ((jsonObj.get("DocumentName") != null && !jsonObj.get("DocumentName").isJsonNull())
479+
&& !jsonObj.get("DocumentName").isJsonPrimitive()) {
481480
throw new IllegalArgumentException(
482481
String.format(
483482
"Expected the field `DocumentName` to be a primitive type in the JSON string but got `%s`",
484483
jsonObj.get("DocumentName").toString()));
485484
}
486485
// validate the required field `RFID_Presence`
487486
RfidLocation.validateJsonElement(jsonObj.get("RFID_Presence"));
488-
// validate the required field `FDSIDList`
489-
FDSIDList.validateJsonElement(jsonObj.get("FDSIDList"));
487+
// validate the optional field `FDSIDList`
488+
if (jsonObj.get("FDSIDList") != null && !jsonObj.get("FDSIDList").isJsonNull()) {
489+
FDSIDList.validateJsonElement(jsonObj.get("FDSIDList"));
490+
}
490491
}
491492

492493
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

client/src/main/generated/com/regula/documentreader/webclient/model/OneCandidate.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class OneCandidate {
3535
public static final String SERIALIZED_NAME_DOCUMENT_NAME = "DocumentName";
3636

3737
@SerializedName(SERIALIZED_NAME_DOCUMENT_NAME)
38-
@javax.annotation.Nonnull
38+
@javax.annotation.Nullable
3939
private String documentName;
4040

4141
public static final String SERIALIZED_NAME_I_D = "ID";
@@ -65,7 +65,7 @@ public class OneCandidate {
6565
public static final String SERIALIZED_NAME_FD_S_I_D_LIST = "FDSIDList";
6666

6767
@SerializedName(SERIALIZED_NAME_FD_S_I_D_LIST)
68-
@javax.annotation.Nonnull
68+
@javax.annotation.Nullable
6969
private FDSIDList fdSIDList;
7070

7171
public static final String SERIALIZED_NAME_NECESSARY_LIGHTS = "NecessaryLights";
@@ -107,7 +107,7 @@ public class OneCandidate {
107107

108108
public OneCandidate() {}
109109

110-
public OneCandidate documentName(@javax.annotation.Nonnull String documentName) {
110+
public OneCandidate documentName(@javax.annotation.Nullable String documentName) {
111111
this.documentName = documentName;
112112
return this;
113113
}
@@ -117,12 +117,12 @@ public OneCandidate documentName(@javax.annotation.Nonnull String documentName)
117117
*
118118
* @return documentName
119119
*/
120-
@javax.annotation.Nonnull
120+
@javax.annotation.Nullable
121121
public String getDocumentName() {
122122
return documentName;
123123
}
124124

125-
public void setDocumentName(@javax.annotation.Nonnull String documentName) {
125+
public void setDocumentName(@javax.annotation.Nullable String documentName) {
126126
this.documentName = documentName;
127127
}
128128

@@ -203,7 +203,7 @@ public void setRfIDPresence(@javax.annotation.Nonnull RfidLocation rfIDPresence)
203203
this.rfIDPresence = rfIDPresence;
204204
}
205205

206-
public OneCandidate fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) {
206+
public OneCandidate fdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) {
207207
this.fdSIDList = fdSIDList;
208208
return this;
209209
}
@@ -213,12 +213,12 @@ public OneCandidate fdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) {
213213
*
214214
* @return fdSIDList
215215
*/
216-
@javax.annotation.Nonnull
216+
@javax.annotation.Nullable
217217
public FDSIDList getFdSIDList() {
218218
return fdSIDList;
219219
}
220220

221-
public void setFdSIDList(@javax.annotation.Nonnull FDSIDList fdSIDList) {
221+
public void setFdSIDList(@javax.annotation.Nullable FDSIDList fdSIDList) {
222222
this.fdSIDList = fdSIDList;
223223
}
224224

@@ -437,12 +437,10 @@ private String toIndentedString(Object o) {
437437

438438
// a set of required properties/fields (JSON key names)
439439
openapiRequiredFields = new HashSet<String>();
440-
openapiRequiredFields.add("DocumentName");
441440
openapiRequiredFields.add("ID");
442441
openapiRequiredFields.add("P");
443442
openapiRequiredFields.add("Rotated180");
444443
openapiRequiredFields.add("RFID_Presence");
445-
openapiRequiredFields.add("FDSIDList");
446444
openapiRequiredFields.add("NecessaryLights");
447445
openapiRequiredFields.add("CheckAuthenticity");
448446
openapiRequiredFields.add("UVExp");
@@ -477,16 +475,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
477475
}
478476
}
479477
JsonObject jsonObj = jsonElement.getAsJsonObject();
480-
if (!jsonObj.get("DocumentName").isJsonPrimitive()) {
478+
if ((jsonObj.get("DocumentName") != null && !jsonObj.get("DocumentName").isJsonNull())
479+
&& !jsonObj.get("DocumentName").isJsonPrimitive()) {
481480
throw new IllegalArgumentException(
482481
String.format(
483482
"Expected the field `DocumentName` to be a primitive type in the JSON string but got `%s`",
484483
jsonObj.get("DocumentName").toString()));
485484
}
486485
// validate the required field `RFID_Presence`
487486
RfidLocation.validateJsonElement(jsonObj.get("RFID_Presence"));
488-
// validate the required field `FDSIDList`
489-
FDSIDList.validateJsonElement(jsonObj.get("FDSIDList"));
487+
// validate the optional field `FDSIDList`
488+
if (jsonObj.get("FDSIDList") != null && !jsonObj.get("FDSIDList").isJsonNull()) {
489+
FDSIDList.validateJsonElement(jsonObj.get("FDSIDList"));
490+
}
490491
}
491492

492493
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ public class ProcessParams {
416416
@javax.annotation.Nullable
417417
private Boolean generateAlpha2Codes;
418418

419+
public static final String SERIALIZED_NAME_PDF_PAGES_LIMIT = "pdfPagesLimit";
420+
421+
@SerializedName(SERIALIZED_NAME_PDF_PAGES_LIMIT)
422+
@javax.annotation.Nullable
423+
private Integer pdfPagesLimit;
424+
419425
public ProcessParams() {}
420426

421427
public ProcessParams generateDTCVC(@javax.annotation.Nullable Boolean generateDTCVC) {
@@ -1764,6 +1770,25 @@ public void setGenerateAlpha2Codes(@javax.annotation.Nullable Boolean generateAl
17641770
this.generateAlpha2Codes = generateAlpha2Codes;
17651771
}
17661772

1773+
public ProcessParams pdfPagesLimit(@javax.annotation.Nullable Integer pdfPagesLimit) {
1774+
this.pdfPagesLimit = pdfPagesLimit;
1775+
return this;
1776+
}
1777+
1778+
/**
1779+
* Limits the number of pages to be processed from a PDF file.
1780+
*
1781+
* @return pdfPagesLimit
1782+
*/
1783+
@javax.annotation.Nullable
1784+
public Integer getPdfPagesLimit() {
1785+
return pdfPagesLimit;
1786+
}
1787+
1788+
public void setPdfPagesLimit(@javax.annotation.Nullable Integer pdfPagesLimit) {
1789+
this.pdfPagesLimit = pdfPagesLimit;
1790+
}
1791+
17671792
@Override
17681793
public boolean equals(Object o) {
17691794
if (this == o) {
@@ -1837,7 +1862,8 @@ public boolean equals(Object o) {
18371862
&& Objects.equals(this.selectLongestNames, processParams.selectLongestNames)
18381863
&& Objects.equals(this.doBarcodes, processParams.doBarcodes)
18391864
&& Objects.equals(this.strictDLCategoryExpiry, processParams.strictDLCategoryExpiry)
1840-
&& Objects.equals(this.generateAlpha2Codes, processParams.generateAlpha2Codes);
1865+
&& Objects.equals(this.generateAlpha2Codes, processParams.generateAlpha2Codes)
1866+
&& Objects.equals(this.pdfPagesLimit, processParams.pdfPagesLimit);
18411867
}
18421868

18431869
@Override
@@ -1904,7 +1930,8 @@ public int hashCode() {
19041930
selectLongestNames,
19051931
doBarcodes,
19061932
strictDLCategoryExpiry,
1907-
generateAlpha2Codes);
1933+
generateAlpha2Codes,
1934+
pdfPagesLimit);
19081935
}
19091936

19101937
@Override
@@ -2007,6 +2034,7 @@ public String toString() {
20072034
sb.append(" generateAlpha2Codes: ")
20082035
.append(toIndentedString(generateAlpha2Codes))
20092036
.append("\n");
2037+
sb.append(" pdfPagesLimit: ").append(toIndentedString(pdfPagesLimit)).append("\n");
20102038
sb.append("}");
20112039
return sb.toString();
20122040
}
@@ -2089,6 +2117,7 @@ private String toIndentedString(Object o) {
20892117
openapiFields.add("doBarcodes");
20902118
openapiFields.add("strictDLCategoryExpiry");
20912119
openapiFields.add("generateAlpha2Codes");
2120+
openapiFields.add("pdfPagesLimit");
20922121

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

client/src/main/generated/com/regula/documentreader/webclient/model/TextFieldType.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,16 @@ public enum TextFieldType {
19531953
SHORT_FLIGHT_NUMBER(693),
19541954

19551955
/** Airline code */
1956-
AIRLINE_CODE(694);
1956+
AIRLINE_CODE(694),
1957+
1958+
/** MVC Agency */
1959+
FT_MVC_AGENCY(695),
1960+
1961+
/** Issuing state code alpha */
1962+
FT_ISSUING_STATE_CODE_ALPHA2(696),
1963+
1964+
/** Nationality code alpha */
1965+
FT_NATIONALITY_CODE_ALPHA2(697);
19571966

19581967
private Integer value;
19591968

example/src/main/java/com/regula/documentreader/webclient/example/Main.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@
2929

3030
public class Main {
3131
public static final String API_BASE_PATH = "API_BASE_PATH";
32-
public static final String TEST_LICENSE = "TEST_LICENSE";
3332

3433
public static void main(String[] args) throws IOException, ApiException {
3534

3635
var apiBaseUrl = System.getenv(API_BASE_PATH);
3736
if (apiBaseUrl == null) {
3837
apiBaseUrl = "https://api.regulaforensics.com";
3938
}
40-
var licenseFromEnv = System.getenv(TEST_LICENSE); // optional, used here only for smoke test purposes
41-
var licenseFromFile = readFile("regula.license");
42-
4339

4440
byte[] whitePage0 = readFile("WHITE.jpg");
4541

@@ -72,10 +68,6 @@ public static void main(String[] args) throws IOException, ApiException {
7268

7369
var api = new DocumentReaderApi(apiClient);
7470

75-
// Uncomment one of the lines below if you want to transfer the license with each request
76-
// if (licenseFromEnv != null) api.setLicense(licenseFromEnv);
77-
// if (licenseFromFile != null) api.setLicense(licenseFromFile);
78-
7971
var info = api.health();
8072
System.out.println();
8173
System.out.format(

0 commit comments

Comments
 (0)