Skip to content

Commit 2393a98

Browse files
author
Alex Malgaroli
authored
Merge pull request #39 from OneSignal/add-external-id-param
Adds `external_id` to the Notification class to be used for idempotency
2 parents 86dd586 + a86a2f2 commit 2393a98

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/com/currencyfair/onesignal/model/notification/Notification.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,14 @@ public class Notification {
724724
@JsonProperty("isChrome")
725725
private Boolean chrome;
726726

727+
/**
728+
* A request received with this parameter will first look for another notification with the same external_id.
729+
* If one exists, a notification will not be sent, and result of the previous operation will instead be returned.
730+
* Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here.
731+
*/
732+
@JsonProperty("external_id")
733+
private String externalId;
734+
727735
public String getId() {
728736
return id;
729737
}
@@ -1216,6 +1224,14 @@ public Boolean getChrome() {
12161224
return chrome;
12171225
}
12181226

1227+
public void setExternalId(String string) {
1228+
this.externalId = string;
1229+
}
1230+
1231+
public String getExternalId() {
1232+
return this.externalId;
1233+
}
1234+
12191235
public void setChrome(Boolean chrome) {
12201236
this.chrome = chrome;
12211237
}

0 commit comments

Comments
 (0)