diff --git a/portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/types/PortabilityJob.java b/portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/types/PortabilityJob.java index 8c0d82d2e..ef4814460 100644 --- a/portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/types/PortabilityJob.java +++ b/portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/types/PortabilityJob.java @@ -43,6 +43,7 @@ public abstract class PortabilityJob { private static final String NUMBER_OF_FAILED_FILES_KEY = "NUM_FAILED_FILES"; private static final String USER_TIMEZONE = "USER_TIMEZONE"; private static final String USER_LOCALE = "USER_LOCALE"; + private static final String USER_ALIAS = "USER_ALIAS"; public static PortabilityJob.Builder builder() { Instant now = Instant.now(); @@ -96,6 +97,9 @@ public static PortabilityJob fromMap(Map properties) { String userLocale = properties.containsKey(USER_LOCALE) ? (String) properties.get(USER_LOCALE) : null; + String userAlias = + properties.containsKey(USER_ALIAS) ? (String) properties.get(USER_ALIAS) : null; + TransferMode transferMode = properties.containsKey(TRANSFER_MODE) ? TransferMode.valueOf((String) properties.get(TRANSFER_MODE)) @@ -129,6 +133,7 @@ public static PortabilityJob fromMap(Map properties) { .build()) .setUserTimeZone(userTimeZone) .setUserLocale(userLocale) + .setUserAlias(userAlias) .setTransferMode(transferMode) .build(); } @@ -184,6 +189,10 @@ private static void isSet(String... strings) { @JsonProperty("userLocale") public abstract String userLocale(); + @Nullable + @JsonProperty("userAlias") + public abstract String userAlias(); + @Nullable @JsonProperty("transferMode") public abstract TransferMode transferMode(); @@ -246,6 +255,10 @@ public Map toMap() { builder.put(USER_LOCALE, userLocale()); } + if (null != userAlias()) { + builder.put(USER_ALIAS, userAlias()); + } + if (null != transferMode()) { builder.put(TRANSFER_MODE, transferMode().toString()); } @@ -340,6 +353,10 @@ public Builder setAndValidateJobAuthorization(JobAuthorization jobAuthorization) @JsonProperty("userLocale") public abstract Builder setUserLocale(String locale); + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonProperty("userAlias") + public abstract Builder setUserAlias(String alias); + @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty("transferMode") public abstract Builder setTransferMode(TransferMode transferMode);