11package io .constructor .client ;
22
33import java .io .File ;
4+ import java .util .ArrayList ;
5+ import java .util .List ;
46import java .util .Map ;
57
68/** Constructor.io Catalog Request */
@@ -13,7 +15,7 @@ public enum OnMissing {
1315
1416 private Map <String , File > files ;
1517 private String section ;
16- private String notificationEmail ;
18+ private List < String > notificationEmails ;
1719 private OnMissing onMissing ;
1820 private Boolean force ;
1921
@@ -34,6 +36,7 @@ public CatalogRequest(Map<String, File> files, String section) {
3436 this .files = files ;
3537 this .section = section ;
3638 this .onMissing = OnMissing .FAIL ;
39+ this .notificationEmails = new ArrayList <String >();
3740 }
3841
3942 /**
@@ -82,18 +85,48 @@ public String getSection() {
8285 }
8386
8487 /**
85- * @param email the email address where you'd like to receive a notifcation in case the task
86- * fails
88+ * @param email the email address to receive a notification in case the task fails
89+ * @deprecated Use {@link #setNotificationEmails(List)} instead to support multiple emails.
8790 */
91+ @ Deprecated
8892 public void setNotificationEmail (String email ) {
89- this .notificationEmail = email ;
93+ this .notificationEmails .clear ();
94+ if (email != null ) {
95+ this .notificationEmails .add (email );
96+ }
9097 }
9198
9299 /**
93- * @return the notification email
100+ * @param emails list of email addresses where you'd like to receive notifications in case the
101+ * task fails
102+ */
103+ public void setNotificationEmails (List <String > emails ) {
104+ this .notificationEmails .clear ();
105+ if (emails != null ) {
106+ this .notificationEmails .addAll (emails );
107+ }
108+ }
109+
110+ /**
111+ * @return the first notification email, or null if none set
112+ * @deprecated Use {@link #getNotificationEmails()} instead to support multiple emails.
94113 */
114+ @ Deprecated
95115 public String getNotificationEmail () {
96- return notificationEmail ;
116+ if (notificationEmails != null && !notificationEmails .isEmpty ()) {
117+ return notificationEmails .get (0 );
118+ }
119+ return null ;
120+ }
121+
122+ /**
123+ * @return the list of notification emails, or null if none set
124+ */
125+ public List <String > getNotificationEmails () {
126+ if (notificationEmails .isEmpty ()) {
127+ return null ;
128+ }
129+ return notificationEmails ;
97130 }
98131
99132 /**
0 commit comments