Skip to content

Commit

Permalink
SDK-2521: Support detected document_type in IDV Sandbox SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
bucky-boy committed Sep 24, 2024
1 parent bddc4a5 commit 0a8b7d9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.yoti.api.client.sandbox.docs.request.task;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class SandboxDocumentIdPhoto {

@JsonProperty("content_type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static class Builder {
private SandboxDocumentFilter documentFilter;
private SandboxDocumentIdPhoto documentIdPhoto;
private String detectedCountry;
private String detectedDocumentType;
private SandboxTextExtractionTaskRecommendation recommendation;

private Builder() {
Expand Down Expand Up @@ -82,14 +83,22 @@ public Builder withDetectedCountry(String detectedCountry) {
return this;
}

public Builder withDetectedDocumentType(String detectedDocumentType) {
this.detectedDocumentType = detectedDocumentType;
return this;
}

public Builder withRecommendation(SandboxTextExtractionTaskRecommendation recommendation) {
this.recommendation = recommendation;
return this;
}

public SandboxDocumentTextDataExtractionTask build() {
SandboxDocumentTextDataExtractionTaskResult result = new SandboxDocumentTextDataExtractionTaskResult(documentFields, this.documentIdPhoto,
detectedCountry, recommendation);
SandboxDocumentTextDataExtractionTaskResult result = new SandboxDocumentTextDataExtractionTaskResult(documentFields,
documentIdPhoto,
detectedCountry,
detectedDocumentType,
recommendation);
return new SandboxDocumentTextDataExtractionTask(result, documentFilter);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class SandboxDocumentTextDataExtractionTaskResult {

@JsonProperty("document_fields")
Expand All @@ -15,16 +17,21 @@ public class SandboxDocumentTextDataExtractionTaskResult {
@JsonProperty("detected_country")
private final String detectedCountry;

@JsonProperty("detected_document_type")
private final String detectedDocumentType;

@JsonProperty("recommendation")
private final SandboxTextExtractionTaskRecommendation recommendation;

SandboxDocumentTextDataExtractionTaskResult(Map<String, Object> documentFields,
SandboxDocumentIdPhoto documentIdPhoto,
String detectedCountry,
String detectedDocumentType,
SandboxTextExtractionTaskRecommendation recommendation) {
this.documentFields = documentFields;
this.documentIdPhoto = documentIdPhoto;
this.detectedCountry = detectedCountry;
this.detectedDocumentType = detectedDocumentType;
this.recommendation = recommendation;
}

Expand All @@ -40,6 +47,10 @@ public String getDetectedCountry() {
return detectedCountry;
}

public String getDetectedDocumentType() {
return detectedDocumentType;
}

public SandboxTextExtractionTaskRecommendation getRecommendation() {
return recommendation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class SandboxSupplementaryDocTextDataExtractionTaskResult {

@JsonProperty("document_fields")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.yoti.api.client.sandbox.docs.SandboxDocScanConstants;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class SandboxTextExtractionTaskReason {

@JsonProperty("value")
Expand Down

0 comments on commit 0a8b7d9

Please sign in to comment.