Skip to content

Commit 66264fd

Browse files
committed
Update to latest openapi model
1 parent 4a4e7ff commit 66264fd

4 files changed

Lines changed: 41 additions & 27 deletions

File tree

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
/** Status */
1919
public class Status {
20-
public static final String SERIALIZED_NAME_COMPLETE = "complete";
20+
public static final String SERIALIZED_NAME_OVERALL_STATUS = "overallStatus";
2121

22-
@SerializedName(SERIALIZED_NAME_COMPLETE)
23-
private int complete;
22+
@SerializedName(SERIALIZED_NAME_OVERALL_STATUS)
23+
private int overallStatus;
2424

2525
public static final String SERIALIZED_NAME_OPTICAL = "optical";
2626

@@ -52,22 +52,22 @@ public class Status {
5252
@SerializedName(SERIALIZED_NAME_DETAILS_OPTICAL)
5353
private DetailsOptical detailsOptical;
5454

55-
public Status withComplete(int complete) {
56-
this.complete = complete;
55+
public Status withOverallStatus(int overallStatus) {
56+
this.overallStatus = overallStatus;
5757
return this;
5858
}
5959

6060
/**
61-
* Get complete
61+
* Get overallStatus
6262
*
63-
* @return complete
63+
* @return overallStatus
6464
*/
65-
public int getComplete() {
66-
return complete;
65+
public int getOverallStatus() {
66+
return overallStatus;
6767
}
6868

69-
public void setComplete(int complete) {
70-
this.complete = complete;
69+
public void setOverallStatus(int overallStatus) {
70+
this.overallStatus = overallStatus;
7171
}
7272

7373
public Status withOptical(int optical) {
@@ -191,7 +191,7 @@ public boolean equals(java.lang.Object o) {
191191
return false;
192192
}
193193
Status status = (Status) o;
194-
return Objects.equals(this.complete, status.complete)
194+
return Objects.equals(this.overallStatus, status.overallStatus)
195195
&& Objects.equals(this.optical, status.optical)
196196
&& Objects.equals(this.portrait, status.portrait)
197197
&& Objects.equals(this.rfid, status.rfid)
@@ -202,14 +202,15 @@ public boolean equals(java.lang.Object o) {
202202

203203
@Override
204204
public int hashCode() {
205-
return Objects.hash(complete, optical, portrait, rfid, stopList, detailsRFID, detailsOptical);
205+
return Objects.hash(
206+
overallStatus, optical, portrait, rfid, stopList, detailsRFID, detailsOptical);
206207
}
207208

208209
@Override
209210
public String toString() {
210211
StringBuilder sb = new StringBuilder();
211212
sb.append("class Status {\n");
212-
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
213+
sb.append(" overallStatus: ").append(toIndentedString(overallStatus)).append("\n");
213214
sb.append(" optical: ").append(toIndentedString(optical)).append("\n");
214215
sb.append(" portrait: ").append(toIndentedString(portrait)).append("\n");
215216
sb.append(" rfid: ").append(toIndentedString(rfid)).append("\n");

client/src/main/java/com/regula/documentreader/webclient/model/ext/Images.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package com.regula.documentreader.webclient.model.ext;
22

3+
import java.util.Collections;
4+
import java.util.List;
5+
import javax.annotation.Nonnull;
36
import javax.annotation.Nullable;
47

58
public class Images extends com.regula.documentreader.webclient.model.Images {
69

10+
private List<byte[]> normalizedInputImages = Collections.emptyList();
11+
712
@Nullable
813
public ImagesField getField(int fieldType) {
914
for (ImagesField field : getFieldList()) {
@@ -13,4 +18,21 @@ public ImagesField getField(int fieldType) {
1318
}
1419
return null;
1520
}
21+
22+
@Nullable
23+
public byte[] normalizedInputImage() {
24+
if (normalizedInputImages.size() >= 1) {
25+
return normalizedInputImages.get(0);
26+
}
27+
return null;
28+
}
29+
30+
public List<byte[]> getNormalizedInputImages() {
31+
return normalizedInputImages;
32+
}
33+
34+
public Images withNormalizedInputImages(@Nonnull List<byte[]> normalizedInputImages) {
35+
this.normalizedInputImages = normalizedInputImages;
36+
return this;
37+
}
1638
}

client/src/main/java/com/regula/documentreader/webclient/model/ext/RecognitionResponse.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,7 @@ public ProcessResponse getOriginalResponse() {
2424
return originalResponse;
2525
}
2626

27-
@Nullable
28-
public byte[] normalizedInputImage() {
29-
RawImageResult result = resultByType(Result.RAW_IMAGE);
30-
if (result != null) {
31-
return result.getRawImageContainer().getImage();
32-
}
33-
return null;
34-
}
35-
36-
public List<byte[]> normalizedInputImages() {
27+
private List<byte[]> normalizedInputImages() {
3728
List<RawImageResult> results = resultsByType(Result.RAW_IMAGE);
3829
if (results != null) {
3930
List<byte[]> images = new ArrayList<>();
@@ -67,7 +58,7 @@ public Text text() {
6758
public Images images() {
6859
ImagesResult result = resultByType(Result.IMAGES);
6960
if (result != null) {
70-
return result.getImages();
61+
return result.getImages().withNormalizedInputImages(normalizedInputImages());
7162
}
7263
return null;
7364
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void main(String[] args) throws IOException, ApiException, URISynt
4848
RecognitionResponse response = api.process(request);
4949

5050
var status = response.status();
51-
var docOverallStatus = status.getComplete() == CheckResult.OK ? "valid" : "not valid";
51+
var docOverallStatus = status.getOverallStatus() == CheckResult.OK ? "valid" : "not valid";
5252
var docOpticalTextStatus = status.getDetailsOptical().getText();
5353

5454
var docNumberField = response.text().getField(DOCUMENT_NUMBER);
@@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException, ApiException, URISynt
6868
System.out.format(" MRZ-Visual values comparison: %s%n", docNumberMrzVisualMatching);
6969
System.out.format("-----------------------------------------------------------------");
7070

71-
var normalizedInputImage = response.normalizedInputImage();
71+
var normalizedInputImage = response.images().normalizedInputImage();
7272
var portraitField = response.images().getField(PORTRAIT);
7373
var portraitFromVisual = portraitField.getValue(Source.VISUAL);
7474
saveFile("portraitFromVisual.jpg", portraitFromVisual);

0 commit comments

Comments
 (0)