Skip to content

Commit bcacb62

Browse files
committed
SDK-2533: Change IdentityProfileResponse to use a stronly typed object for the report
1 parent 2e16c25 commit bcacb62

File tree

5 files changed

+129
-4
lines changed

5 files changed

+129
-4
lines changed

examples/doc-scan/src/main/resources/templates/success.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,14 @@ <h2>Identity Profile</h2>
965965
</div>
966966
</div>
967967

968+
<th:block th:if="${sessionResult.getIdentityProfile().getIdentityProfileReport()() != null}">
969+
<div th:if="${sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia() != null}">
970+
Generated Profile Media: <a th:href="${'/media?mediaId=' + sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia().getId()}"
971+
th:text="${sessionResult.getIdentityProfile().getIdentityProfileReport().getMedia().getId()}">
972+
</a>
973+
</div>
974+
</th:block>
975+
968976
<!-- Identity Profile Failure Reason -->
969977
<th:block th:if="${sessionResult.getIdentityProfile().getFailureReason() != null}">
970978
<div class="row pt-4">
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.yoti.api.client.docs.session.retrieve;
2+
3+
import java.util.List;
4+
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
7+
public class IdentityProfileReportResponse {
8+
9+
@JsonProperty("trust_framework")
10+
private String trustFramework;
11+
12+
@JsonProperty("media")
13+
private MediaResponse media;
14+
15+
@JsonProperty("schemes_compliance")
16+
private List<IdentityProfileSchemeComplianceReportResponse> schemesCompliance;
17+
18+
/**
19+
* The trust framework the report was generated for
20+
*
21+
* @return the trust framework
22+
*/
23+
public String getTrustFramework() {
24+
return trustFramework;
25+
}
26+
27+
/**
28+
* The media object containing the report
29+
*
30+
* @return the report media
31+
*/
32+
public MediaResponse getMedia() {
33+
return media;
34+
}
35+
36+
/**
37+
* The list of schemes used in the trust framework
38+
*
39+
* @return the list of schemes
40+
*/
41+
public List<IdentityProfileSchemeComplianceReportResponse> getSchemesCompliance() {
42+
return schemesCompliance;
43+
}
44+
45+
}

yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/retrieve/IdentityProfileResponse.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.yoti.api.client.docs.session.retrieve;
22

3-
import java.util.Map;
4-
53
import com.fasterxml.jackson.annotation.JsonProperty;
64

75
public class IdentityProfileResponse {
@@ -16,7 +14,7 @@ public class IdentityProfileResponse {
1614
private IdentityProfileFailureResponse failureReason;
1715

1816
@JsonProperty(Property.IDENTITY_PROFILE_REPORT)
19-
private Map<String, Object> identityProfileReport;
17+
private IdentityProfileReportResponse identityProfileReport;
2018

2119
public String getSubjectId() {
2220
return subjectId;
@@ -30,7 +28,7 @@ public IdentityProfileFailureResponse getFailureReason() {
3028
return failureReason;
3129
}
3230

33-
public Map<String, Object> getIdentityProfileReport() {
31+
public IdentityProfileReportResponse getIdentityProfileReport() {
3432
return identityProfileReport;
3533
}
3634

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.yoti.api.client.docs.session.retrieve;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
public class IdentityProfileSchemeComplianceReportResponse {
6+
7+
@JsonProperty("scheme")
8+
private IdentityProfileSchemeResponse scheme;
9+
10+
@JsonProperty("requirements_met")
11+
private Boolean requirementsMet;
12+
13+
@JsonProperty("requirements_not_met_info")
14+
private String requirementsNotMetInfo;
15+
16+
/**
17+
* The Identity Profile scheme
18+
*
19+
* @return the scheme
20+
*/
21+
public IdentityProfileSchemeResponse getScheme() {
22+
return scheme;
23+
}
24+
25+
/**
26+
* Whether or not the requirements for the scheme were met
27+
*
28+
* @return boolean
29+
*/
30+
public Boolean getRequirementsMet() {
31+
return requirementsMet;
32+
}
33+
34+
/**
35+
* Information about why the requirements for the scheme were not met
36+
*
37+
* @return string
38+
*/
39+
public String getRequirementsNotMetInfo() {
40+
return requirementsNotMetInfo;
41+
}
42+
43+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.yoti.api.client.docs.session.retrieve;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
public class IdentityProfileSchemeResponse {
6+
7+
@JsonProperty("type")
8+
private String type;
9+
10+
@JsonProperty("objective")
11+
private String objective;
12+
13+
/**
14+
* The type of the scheme
15+
*
16+
* @return the type
17+
*/
18+
public String getType() {
19+
return type;
20+
}
21+
22+
/**
23+
* The objective of the scheme
24+
*
25+
* @return the objective
26+
*/
27+
public String getObjective() {
28+
return objective;
29+
}
30+
31+
}

0 commit comments

Comments
 (0)