Skip to content

Commit

Permalink
NA: Inline JSON property name in IDV classes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBurtyyy committed Sep 27, 2024
1 parent f751604 commit 84992e3
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

public class IbvOptions {

@JsonProperty(Property.SUPPORT)
@JsonProperty("support")
private final String support;

@JsonProperty(Property.GUIDANCE_URL)
@JsonProperty("guidance_url")
private final String guidanceUrl;

@JsonProperty(Property.USER_PRICE)
@JsonProperty("user_price")
private final UserPrice userPrice;

private IbvOptions(String support, String guidanceUrl, UserPrice userPrice) {
Expand Down Expand Up @@ -102,14 +102,4 @@ public IbvOptions build() {

}

private static final class Property {

private static final String SUPPORT = "support";
private static final String GUIDANCE_URL = "guidance_url";
private static final String USER_PRICE = "user_price";

private Property() { }

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,49 @@
*/
public class SdkConfig {

@JsonProperty(Property.ALLOWED_CAPTURE_METHODS)
@JsonProperty("allowed_capture_methods")
private final String allowedCaptureMethods;

@JsonProperty(Property.PRIMARY_COLOUR)
@JsonProperty("primary_colour")
private final String primaryColour;

@JsonProperty(Property.PRIMARY_COLOUR_DARK_MODE)
@JsonProperty("primary_colour_dark_mode")
private final String primaryColourDarkMode;

@JsonProperty(Property.SECONDARY_COLOUR)
@JsonProperty("secondary_colour")
private final String secondaryColour;

@JsonProperty(Property.FONT_COLOUR)
@JsonProperty("font_colour")
private final String fontColour;

@JsonProperty(Property.DARK_MODE)
@JsonProperty("dark_mode")
private final String darkMode;

@JsonProperty(Property.LOCALE)
@JsonProperty("locale")
private final String locale;

@JsonProperty(Property.PRESET_ISSUING_COUNTRY)
@JsonProperty("preset_issuing_country")
private final String presetIssuingCountry;

@JsonProperty(Property.SUCCESS_URL)
@JsonProperty("success_url")
private final String successUrl;

@JsonProperty(Property.ERROR_URL)
@JsonProperty("error_url")
private final String errorUrl;

@JsonProperty(Property.PRIVACY_POLICY_URL)
@JsonProperty("privacy_policy_url")
private final String privacyPolicyUrl;

@JsonProperty(Property.ALLOW_HANDOFF)
@JsonProperty("allow_handoff")
private final Boolean allowHandoff;

@JsonProperty(Property.ATTEMPTS_CONFIGURATION)
@JsonProperty("attempts_configuration")
private final AttemptsConfiguration attemptsConfiguration;

@JsonProperty(Property.BRAND_ID)
@JsonProperty("brand_id")
private final String brandId;

@JsonProperty(Property.BIOMETRIC_CONSENT_FLOW)
@JsonProperty("biometric_consent_flow")
private final String biometricConsentFlow;

SdkConfig(String allowedCaptureMethods,
Expand Down Expand Up @@ -502,26 +502,4 @@ public SdkConfig build() {
}
}

private static final class Property {

private static final String ALLOWED_CAPTURE_METHODS = "allowed_capture_methods";
private static final String PRIMARY_COLOUR = "primary_colour";
private static final String PRIMARY_COLOUR_DARK_MODE = "primary_colour_dark_mode";
private static final String SECONDARY_COLOUR = "secondary_colour";
private static final String FONT_COLOUR = "font_colour";
private static final String DARK_MODE = "dark_mode";
private static final String LOCALE = "locale";
private static final String PRESET_ISSUING_COUNTRY = "preset_issuing_country";
private static final String SUCCESS_URL = "success_url";
private static final String ERROR_URL = "error_url";
private static final String PRIVACY_POLICY_URL = "privacy_policy_url";
private static final String ALLOW_HANDOFF = "allow_handoff";
private static final String ATTEMPTS_CONFIGURATION = "attempts_configuration";
private static final String BRAND_ID = "brand_id";
private static final String BIOMETRIC_CONSENT_FLOW = "biometric_consent_flow";

private Property() {}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,55 @@
*/
public class SessionSpec {

@JsonProperty(Property.CLIENT_SESSION_TOKEN_TTL)
@JsonProperty("client_session_token_ttl")
private final Integer clientSessionTokenTtl;

@JsonProperty(Property.SESSION_DEADLINE)
@JsonProperty("session_deadline")
private final ZonedDateTime sessionDeadline;

@JsonProperty(Property.RESOURCES_TTL)
@JsonProperty("resources_ttl")
private final Integer resourcesTtl;

@JsonProperty(Property.IMPORT_TOKEN)
@JsonProperty("import_token")
private final ImportTokenPayload importToken;

@JsonProperty(Property.USER_TRACKING_ID)
@JsonProperty("user_tracking_id")
private final String userTrackingId;

@JsonProperty(Property.NOTIFICATIONS)
@JsonProperty("notifications")
private final NotificationConfig notifications;

@JsonProperty(Property.REQUESTED_CHECKS)
@JsonProperty("requested_checks")
private final List<RequestedCheck<?>> requestedChecks;

@JsonProperty(Property.REQUESTED_TASKS)
@JsonProperty("requested_tasks")
private final List<RequestedTask<?>> requestedTasks;

@JsonProperty(Property.SDK_CONFIG)
@JsonProperty("sdk_config")
private final SdkConfig sdkConfig;

@JsonProperty(Property.REQUIRED_DOCUMENTS)
@JsonProperty("required_documents")
private final List<RequiredDocument> requiredDocuments;

@JsonProperty(Property.BLOCK_BIOMETRIC_CONSENT)
@JsonProperty("block_biometric_consent")
private final Boolean blockBiometricConsent;

@JsonProperty(Property.IBV_OPTIONS)
@JsonProperty("ibv_options")
private final IbvOptions ibvOptions;

@JsonProperty(Property.IDENTITY_PROFILE_REQUIREMENTS)
@JsonProperty("identity_profile_requirements")
private final IdentityProfileRequirementsPayload identityProfile;

@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE_REQUIREMENTS)
@JsonProperty("advanced_identity_profile_requirements")
private final AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements;

@JsonProperty(Property.SUBJECT)
@JsonProperty("subject")
private final SubjectPayload subject;

@JsonProperty(Property.RESOURCES)
@JsonProperty("resources")
private final ResourceCreationContainer resources;

@JsonProperty(Property.CREATE_IDENTITY_PROFILE_PREVIEW)
@JsonProperty("create_identity_profile_preview")
private final Boolean createIdentityProfilePreview;

SessionSpec(Integer clientSessionTokenTtl,
Expand Down Expand Up @@ -504,28 +504,4 @@ public SessionSpec build() {
}
}

private static final class Property {

private static final String CLIENT_SESSION_TOKEN_TTL = "client_session_token_ttl";
private static final String SESSION_DEADLINE = "session_deadline";
private static final String RESOURCES_TTL = "resources_ttl";
private static final String USER_TRACKING_ID = "user_tracking_id";
private static final String NOTIFICATIONS = "notifications";
private static final String REQUESTED_CHECKS = "requested_checks";
private static final String REQUESTED_TASKS = "requested_tasks";
private static final String SDK_CONFIG = "sdk_config";
private static final String REQUIRED_DOCUMENTS = "required_documents";
private static final String BLOCK_BIOMETRIC_CONSENT = "block_biometric_consent";
private static final String IBV_OPTIONS = "ibv_options";
private static final String IDENTITY_PROFILE_REQUIREMENTS = "identity_profile_requirements";
private static final String ADVANCED_IDENTITY_PROFILE_REQUIREMENTS = "advanced_identity_profile_requirements";
private static final String SUBJECT = "subject";
private static final String RESOURCES = "resources";
private static final String CREATE_IDENTITY_PROFILE_PREVIEW = "create_identity_profile_preview";
private static final String IMPORT_TOKEN = "import_token";

private Property() { }

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

public class UserPrice {

@JsonProperty(Property.AMOUNT)
@JsonProperty("amount")
private final String amount;

@JsonProperty(Property.CURRENCY)
@JsonProperty("currency")
private final String currency;

private UserPrice(String amount, String currency) {
Expand Down Expand Up @@ -78,13 +78,4 @@ public UserPrice build() {

}

private static final class Property {

private static final String AMOUNT = "amount";
private static final String CURRENCY = "currency";

private Property() { }

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@

public class GetSessionResult {

@JsonProperty(Property.CLIENT_SESSION_TOKEN_TTL)
@JsonProperty("client_session_token_ttl")
private long clientSessionTokenTtl;

@JsonProperty(Property.SESSION_ID)
@JsonProperty("session_id")
private String sessionId;

@JsonProperty(Property.USER_TRACKING_ID)
@JsonProperty("user_tracking_id")
private String userTrackingId;

@JsonProperty(Property.STATE)
@JsonProperty("state")
private String state;

@JsonProperty(Property.CLIENT_SESSION_TOKEN)
@JsonProperty("client_session_token")
private String clientSessionToken;

@JsonProperty(Property.BIOMETRIC_CONSENT)
@JsonProperty("biometric_consent")
private String biometricConsent;

@JsonProperty(Property.CHECKS)
@JsonProperty("checks")
private List<? extends CheckResponse> checks;

@JsonProperty(Property.RESOURCES)
@JsonProperty("resources")
private ResourceContainer resources;

@JsonProperty(Property.IDENTITY_PROFILE)
@JsonProperty("identity_profile")
private IdentityProfileResponse identityProfile;

@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE)
@JsonProperty("advanced_identity_profile")
private AdvancedIdentityProfileResponse advancedIdentityProfile;

@JsonProperty(Property.IDENTITY_PROFILE_PREVIEW)
@JsonProperty("identity_profile_preview")
private IdentityProfilePreviewResponse identityProfilePreview;

@JsonProperty(Property.ADVANCED_IDENTITY_PROFILE_PREVIEW)
@JsonProperty("advanced_identity_profile_preview")
private IdentityProfilePreviewResponse advancedIdentityProfilePreview;

@JsonProperty(Property.IMPORT_TOKEN)
@JsonProperty("import_token")
private ImportTokenResponse importToken;

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

private static final class Property {

private static final String CLIENT_SESSION_TOKEN_TTL = "client_session_token_ttl";
private static final String SESSION_ID = "session_id";
private static final String USER_TRACKING_ID = "user_tracking_id";
private static final String STATE = "state";
private static final String CLIENT_SESSION_TOKEN = "client_session_token";
private static final String BIOMETRIC_CONSENT = "biometric_consent";
private static final String CHECKS = "checks";
private static final String RESOURCES = "resources";
private static final String IDENTITY_PROFILE = "identity_profile";
private static final String ADVANCED_IDENTITY_PROFILE = "advanced_identity_profile";
private static final String IDENTITY_PROFILE_PREVIEW = "identity_profile_preview";
private static final String ADVANCED_IDENTITY_PROFILE_PREVIEW = "advanced_identity_profile_preview";
private static final String IMPORT_TOKEN = "import_token";

private Property() { }

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

public class IdentityProfileResponse {

@JsonProperty(Property.SUBJECT_ID)
@JsonProperty("subject_id")
private String subjectId;

@JsonProperty(Property.RESULT)
@JsonProperty("result")
private String result;

@JsonProperty(Property.FAILURE_REASON)
@JsonProperty("failure_reason")
private IdentityProfileFailureResponse failureReason;

@JsonProperty(Property.IDENTITY_PROFILE_REPORT)
@JsonProperty("identity_profile_report")
private IdentityProfileReportResponse identityProfileReport;

public String getSubjectId() {
Expand All @@ -32,15 +32,4 @@ public IdentityProfileReportResponse getIdentityProfileReport() {
return identityProfileReport;
}

private static final class Property {

private static final String SUBJECT_ID = "subject_id";
private static final String RESULT = "result";
private static final String FAILURE_REASON = "failure_reason";
private static final String IDENTITY_PROFILE_REPORT = "identity_profile_report";

private Property() { }

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

public class ImportTokenResponse {

@JsonProperty(Property.MEDIA)
@JsonProperty("media")
private MediaResponse media;

@JsonProperty(Property.FAILURE_REASON)
@JsonProperty("failure_reason")
private String failureReason;

public MediaResponse getMedia() {
Expand All @@ -18,13 +18,4 @@ public String getFailureReason() {
return failureReason;
}

private static final class Property {

private static final String MEDIA = "media";
private static final String FAILURE_REASON = "failure_reason";

private Property() { }

}

}
Loading

0 comments on commit 84992e3

Please sign in to comment.