Skip to content

Commit e609c5f

Browse files
committed
NA: Inline JSON property name in IDV classes
1 parent 22f5b01 commit e609c5f

File tree

8 files changed

+59
-174
lines changed

8 files changed

+59
-174
lines changed

yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/IbvOptions.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
public class IbvOptions {
88

9-
@JsonProperty(Property.SUPPORT)
9+
@JsonProperty("support")
1010
private final String support;
1111

12-
@JsonProperty(Property.GUIDANCE_URL)
12+
@JsonProperty("guidance_url")
1313
private final String guidanceUrl;
1414

15-
@JsonProperty(Property.USER_PRICE)
15+
@JsonProperty("user_price")
1616
private final UserPrice userPrice;
1717

1818
private IbvOptions(String support, String guidanceUrl, UserPrice userPrice) {
@@ -102,14 +102,4 @@ public IbvOptions build() {
102102

103103
}
104104

105-
private static final class Property {
106-
107-
private static final String SUPPORT = "support";
108-
private static final String GUIDANCE_URL = "guidance_url";
109-
private static final String USER_PRICE = "user_price";
110-
111-
private Property() { }
112-
113-
}
114-
115105
}

yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SdkConfig.java

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@
99
*/
1010
public class SdkConfig {
1111

12-
@JsonProperty(Property.ALLOWED_CAPTURE_METHODS)
12+
@JsonProperty("allowed_capture_methods")
1313
private final String allowedCaptureMethods;
1414

15-
@JsonProperty(Property.PRIMARY_COLOUR)
15+
@JsonProperty("primary_colour")
1616
private final String primaryColour;
1717

18-
@JsonProperty(Property.PRIMARY_COLOUR_DARK_MODE)
18+
@JsonProperty("primary_colour_dark_mode")
1919
private final String primaryColourDarkMode;
2020

21-
@JsonProperty(Property.SECONDARY_COLOUR)
21+
@JsonProperty("secondary_colour")
2222
private final String secondaryColour;
2323

24-
@JsonProperty(Property.FONT_COLOUR)
24+
@JsonProperty("font_colour")
2525
private final String fontColour;
2626

27-
@JsonProperty(Property.DARK_MODE)
27+
@JsonProperty("dark_mode")
2828
private final String darkMode;
2929

30-
@JsonProperty(Property.LOCALE)
30+
@JsonProperty("locale")
3131
private final String locale;
3232

33-
@JsonProperty(Property.PRESET_ISSUING_COUNTRY)
33+
@JsonProperty("preset_issuing_country")
3434
private final String presetIssuingCountry;
3535

36-
@JsonProperty(Property.SUCCESS_URL)
36+
@JsonProperty("success_url")
3737
private final String successUrl;
3838

39-
@JsonProperty(Property.ERROR_URL)
39+
@JsonProperty("error_url")
4040
private final String errorUrl;
4141

42-
@JsonProperty(Property.PRIVACY_POLICY_URL)
42+
@JsonProperty("privacy_policy_url")
4343
private final String privacyPolicyUrl;
4444

45-
@JsonProperty(Property.ALLOW_HANDOFF)
45+
@JsonProperty("allow_handoff")
4646
private final Boolean allowHandoff;
4747

48-
@JsonProperty(Property.ATTEMPTS_CONFIGURATION)
48+
@JsonProperty("attempts_configuration")
4949
private final AttemptsConfiguration attemptsConfiguration;
5050

51-
@JsonProperty(Property.BRAND_ID)
51+
@JsonProperty("brand_id")
5252
private final String brandId;
5353

54-
@JsonProperty(Property.BIOMETRIC_CONSENT_FLOW)
54+
@JsonProperty("biometric_consent_flow")
5555
private final String biometricConsentFlow;
5656

5757
SdkConfig(String allowedCaptureMethods,
@@ -502,26 +502,4 @@ public SdkConfig build() {
502502
}
503503
}
504504

505-
private static final class Property {
506-
507-
private static final String ALLOWED_CAPTURE_METHODS = "allowed_capture_methods";
508-
private static final String PRIMARY_COLOUR = "primary_colour";
509-
private static final String PRIMARY_COLOUR_DARK_MODE = "primary_colour_dark_mode";
510-
private static final String SECONDARY_COLOUR = "secondary_colour";
511-
private static final String FONT_COLOUR = "font_colour";
512-
private static final String DARK_MODE = "dark_mode";
513-
private static final String LOCALE = "locale";
514-
private static final String PRESET_ISSUING_COUNTRY = "preset_issuing_country";
515-
private static final String SUCCESS_URL = "success_url";
516-
private static final String ERROR_URL = "error_url";
517-
private static final String PRIVACY_POLICY_URL = "privacy_policy_url";
518-
private static final String ALLOW_HANDOFF = "allow_handoff";
519-
private static final String ATTEMPTS_CONFIGURATION = "attempts_configuration";
520-
private static final String BRAND_ID = "brand_id";
521-
private static final String BIOMETRIC_CONSENT_FLOW = "biometric_consent_flow";
522-
523-
private Property() {}
524-
525-
}
526-
527505
}

yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SessionSpec.java

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,55 +18,55 @@
1818
*/
1919
public class SessionSpec {
2020

21-
@JsonProperty(Property.CLIENT_SESSION_TOKEN_TTL)
21+
@JsonProperty("client_session_token_ttl")
2222
private final Integer clientSessionTokenTtl;
2323

24-
@JsonProperty(Property.SESSION_DEADLINE)
24+
@JsonProperty("session_deadline")
2525
private final ZonedDateTime sessionDeadline;
2626

27-
@JsonProperty(Property.RESOURCES_TTL)
27+
@JsonProperty("resources_ttl")
2828
private final Integer resourcesTtl;
2929

30-
@JsonProperty(Property.IMPORT_TOKEN)
30+
@JsonProperty("import_token")
3131
private final ImportTokenPayload importToken;
3232

33-
@JsonProperty(Property.USER_TRACKING_ID)
33+
@JsonProperty("user_tracking_id")
3434
private final String userTrackingId;
3535

36-
@JsonProperty(Property.NOTIFICATIONS)
36+
@JsonProperty("notifications")
3737
private final NotificationConfig notifications;
3838

39-
@JsonProperty(Property.REQUESTED_CHECKS)
39+
@JsonProperty("requested_checks")
4040
private final List<RequestedCheck<?>> requestedChecks;
4141

42-
@JsonProperty(Property.REQUESTED_TASKS)
42+
@JsonProperty("requested_tasks")
4343
private final List<RequestedTask<?>> requestedTasks;
4444

45-
@JsonProperty(Property.SDK_CONFIG)
45+
@JsonProperty("sdk_config")
4646
private final SdkConfig sdkConfig;
4747

48-
@JsonProperty(Property.REQUIRED_DOCUMENTS)
48+
@JsonProperty("required_documents")
4949
private final List<RequiredDocument> requiredDocuments;
5050

51-
@JsonProperty(Property.BLOCK_BIOMETRIC_CONSENT)
51+
@JsonProperty("block_biometric_consent")
5252
private final Boolean blockBiometricConsent;
5353

54-
@JsonProperty(Property.IBV_OPTIONS)
54+
@JsonProperty("ibv_options")
5555
private final IbvOptions ibvOptions;
5656

57-
@JsonProperty(Property.IDENTITY_PROFILE_REQUIREMENTS)
57+
@JsonProperty("identity_profile_requirements")
5858
private final IdentityProfileRequirementsPayload identityProfile;
5959

60-
@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE_REQUIREMENTS)
60+
@JsonProperty("advanced_identity_profile_requirements")
6161
private final AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements;
6262

63-
@JsonProperty(Property.SUBJECT)
63+
@JsonProperty("subject")
6464
private final SubjectPayload subject;
6565

66-
@JsonProperty(Property.RESOURCES)
66+
@JsonProperty("resources")
6767
private final ResourceCreationContainer resources;
6868

69-
@JsonProperty(Property.CREATE_IDENTITY_PROFILE_PREVIEW)
69+
@JsonProperty("create_identity_profile_preview")
7070
private final Boolean createIdentityProfilePreview;
7171

7272
SessionSpec(Integer clientSessionTokenTtl,
@@ -504,28 +504,4 @@ public SessionSpec build() {
504504
}
505505
}
506506

507-
private static final class Property {
508-
509-
private static final String CLIENT_SESSION_TOKEN_TTL = "client_session_token_ttl";
510-
private static final String SESSION_DEADLINE = "session_deadline";
511-
private static final String RESOURCES_TTL = "resources_ttl";
512-
private static final String USER_TRACKING_ID = "user_tracking_id";
513-
private static final String NOTIFICATIONS = "notifications";
514-
private static final String REQUESTED_CHECKS = "requested_checks";
515-
private static final String REQUESTED_TASKS = "requested_tasks";
516-
private static final String SDK_CONFIG = "sdk_config";
517-
private static final String REQUIRED_DOCUMENTS = "required_documents";
518-
private static final String BLOCK_BIOMETRIC_CONSENT = "block_biometric_consent";
519-
private static final String IBV_OPTIONS = "ibv_options";
520-
private static final String IDENTITY_PROFILE_REQUIREMENTS = "identity_profile_requirements";
521-
private static final String ADVANCED_IDENTITY_PROFILE_REQUIREMENTS = "advanced_identity_profile_requirements";
522-
private static final String SUBJECT = "subject";
523-
private static final String RESOURCES = "resources";
524-
private static final String CREATE_IDENTITY_PROFILE_PREVIEW = "create_identity_profile_preview";
525-
private static final String IMPORT_TOKEN = "import_token";
526-
527-
private Property() { }
528-
529-
}
530-
531507
}

yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/UserPrice.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
public class UserPrice {
88

9-
@JsonProperty(Property.AMOUNT)
9+
@JsonProperty("amount")
1010
private final String amount;
1111

12-
@JsonProperty(Property.CURRENCY)
12+
@JsonProperty("currency")
1313
private final String currency;
1414

1515
private UserPrice(String amount, String currency) {
@@ -78,13 +78,4 @@ public UserPrice build() {
7878

7979
}
8080

81-
private static final class Property {
82-
83-
private static final String AMOUNT = "amount";
84-
private static final String CURRENCY = "currency";
85-
86-
private Property() { }
87-
88-
}
89-
9081
}

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

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,43 @@
99

1010
public class GetSessionResult {
1111

12-
@JsonProperty(Property.CLIENT_SESSION_TOKEN_TTL)
12+
@JsonProperty("client_session_token_ttl")
1313
private long clientSessionTokenTtl;
1414

15-
@JsonProperty(Property.SESSION_ID)
15+
@JsonProperty("session_id")
1616
private String sessionId;
1717

18-
@JsonProperty(Property.USER_TRACKING_ID)
18+
@JsonProperty("user_tracking_id")
1919
private String userTrackingId;
2020

21-
@JsonProperty(Property.STATE)
21+
@JsonProperty("state")
2222
private String state;
2323

24-
@JsonProperty(Property.CLIENT_SESSION_TOKEN)
24+
@JsonProperty("client_session_token")
2525
private String clientSessionToken;
2626

27-
@JsonProperty(Property.BIOMETRIC_CONSENT)
27+
@JsonProperty("biometric_consent")
2828
private String biometricConsent;
2929

30-
@JsonProperty(Property.CHECKS)
30+
@JsonProperty("checks")
3131
private List<? extends CheckResponse> checks;
3232

33-
@JsonProperty(Property.RESOURCES)
33+
@JsonProperty("resources")
3434
private ResourceContainer resources;
3535

36-
@JsonProperty(Property.IDENTITY_PROFILE)
36+
@JsonProperty("identity_profile")
3737
private IdentityProfileResponse identityProfile;
3838

39-
@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE)
39+
@JsonProperty("advanced_identity_profile")
4040
private AdvancedIdentityProfileResponse advancedIdentityProfile;
4141

42-
@JsonProperty(Property.IDENTITY_PROFILE_PREVIEW)
42+
@JsonProperty("identity_profile_preview")
4343
private IdentityProfilePreviewResponse identityProfilePreview;
4444

45-
@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE_PREVIEW)
45+
@JsonProperty("advanced_identity_profile_preview")
4646
private IdentityProfilePreviewResponse advancedIdentityProfilePreview;
4747

48-
@JsonProperty(Property.IMPORT_TOKEN)
48+
@JsonProperty("import_token")
4949
private ImportTokenResponse importToken;
5050

5151
public long getClientSessionTokenTtl() {
@@ -175,24 +175,4 @@ private <T extends CheckResponse> List<T> filterChecksByType(Class<T> clazz) {
175175
.collect(Collectors.toList());
176176
}
177177

178-
private static final class Property {
179-
180-
private static final String CLIENT_SESSION_TOKEN_TTL = "client_session_token_ttl";
181-
private static final String SESSION_ID = "session_id";
182-
private static final String USER_TRACKING_ID = "user_tracking_id";
183-
private static final String STATE = "state";
184-
private static final String CLIENT_SESSION_TOKEN = "client_session_token";
185-
private static final String BIOMETRIC_CONSENT = "biometric_consent";
186-
private static final String CHECKS = "checks";
187-
private static final String RESOURCES = "resources";
188-
private static final String IDENTITY_PROFILE = "identity_profile";
189-
private static final String ADVANCED_IDENTITY_PROFILE = "advanced_identity_profile";
190-
private static final String IDENTITY_PROFILE_PREVIEW = "identity_profile_preview";
191-
private static final String ADVANCED_IDENTITY_PROFILE_PREVIEW = "advanced_identity_profile_preview";
192-
private static final String IMPORT_TOKEN = "import_token";
193-
194-
private Property() { }
195-
196-
}
197-
198178
}

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
public class IdentityProfileResponse {
66

7-
@JsonProperty(Property.SUBJECT_ID)
7+
@JsonProperty("subject_id")
88
private String subjectId;
99

10-
@JsonProperty(Property.RESULT)
10+
@JsonProperty("result")
1111
private String result;
1212

13-
@JsonProperty(Property.FAILURE_REASON)
13+
@JsonProperty("failure_reason")
1414
private IdentityProfileFailureResponse failureReason;
1515

16-
@JsonProperty(Property.IDENTITY_PROFILE_REPORT)
16+
@JsonProperty("identity_profile_report")
1717
private IdentityProfileReportResponse identityProfileReport;
1818

1919
public String getSubjectId() {
@@ -32,15 +32,4 @@ public IdentityProfileReportResponse getIdentityProfileReport() {
3232
return identityProfileReport;
3333
}
3434

35-
private static final class Property {
36-
37-
private static final String SUBJECT_ID = "subject_id";
38-
private static final String RESULT = "result";
39-
private static final String FAILURE_REASON = "failure_reason";
40-
private static final String IDENTITY_PROFILE_REPORT = "identity_profile_report";
41-
42-
private Property() { }
43-
44-
}
45-
4635
}

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
public class ImportTokenResponse {
66

7-
@JsonProperty(Property.MEDIA)
7+
@JsonProperty("media")
88
private MediaResponse media;
99

10-
@JsonProperty(Property.FAILURE_REASON)
10+
@JsonProperty("failure_reason")
1111
private String failureReason;
1212

1313
public MediaResponse getMedia() {
@@ -18,13 +18,4 @@ public String getFailureReason() {
1818
return failureReason;
1919
}
2020

21-
private static final class Property {
22-
23-
private static final String MEDIA = "media";
24-
private static final String FAILURE_REASON = "failure_reason";
25-
26-
private Property() { }
27-
28-
}
29-
3021
}

0 commit comments

Comments
 (0)