Skip to content

Commit 7d68e11

Browse files
committed
Github:19595 & Github:19428
- Rename .notification functions into .notifier
1 parent 8310cc7 commit 7d68e11

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

Documentation/Notifications.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a resource changes, user-defined callbacks are dispatched in the 4D worker
1616

1717
### API
1818

19-
#### `Office365.mail.notification(param{; folderId}) → notificationObj`
19+
#### `Office365.mail.notifier(param{; folderId}) → notificationObj`
2020

2121
Creates a notification object for **mail** change notifications.
2222

@@ -25,7 +25,7 @@ Creates a notification object for **mail** change notifications.
2525
| `param` | Object | Callback and mode definitions (see below) |
2626
| `folderId` | Text | *(optional)* Subscribe only to changes in that mail folder. If omitted, subscribe to all folders. |
2727

28-
#### `Office365.calendar.notification(param{; calendarId}) → notificationObj`
28+
#### `Office365.calendar.notifier(param{; calendarId}) → notificationObj`
2929

3030
Creates a notification object for **calendar event** change notifications.
3131

@@ -87,15 +87,15 @@ Creates a notification object for **calendar event** change notifications.
8787

8888
```4d
8989
// Push mode — Mail notifications via webhook
90-
$notif:=$office365.mail.notification({ \
90+
$notif:=$office365.mail.notifier({ \
9191
endPoint: "https://myserver.com"; \
9292
onCreate: Formula(ALERT("New mail: "+String($1.IDs))); \
9393
onDelete: Formula(ALERT("Mail deleted: "+String($1.IDs))) \
9494
})
9595
$status:=$notif.start()
9696
9797
// Pull mode — Calendar notifications via delta polling (every 60 seconds)
98-
$calNotif:=$office365.calendar.notification({ \
98+
$calNotif:=$office365.calendar.notifier({ \
9999
timer: 60; \
100100
onCreate: Formula(handleNewEvent($1)); \
101101
onModify: Formula(handleEventUpdate($1)) \
@@ -112,15 +112,15 @@ $status:=$notif.stop()
112112

113113
### API
114114

115-
#### `Google.mail.notification(param) → notificationObj`
115+
#### `Google.mail.notifier(param) → notificationObj`
116116

117117
Creates a notification object for **Gmail** change notifications.
118118

119119
| Parameter | Type | Description |
120120
|---|---|---|
121121
| `param` | Object | Callback and mode definitions (see below) |
122122

123-
#### `Google.calendar.notification(param{; calendarId}) → notificationObj`
123+
#### `Google.calendar.notifier(param{; calendarId}) → notificationObj`
124124

125125
Creates a notification object for **Google Calendar** event change notifications.
126126

@@ -207,23 +207,23 @@ For Calendar push notifications, pass the `endPoint` parameter. The webhook URL
207207

208208
```4d
209209
// Pull mode — Gmail notifications (polling every 30 seconds, default)
210-
$notif:=$google.mail.notification({ \
210+
$notif:=$google.mail.notifier({ \
211211
onCreate: Formula(handleNewMail($1)); \
212212
onDelete: Formula(handleDeletedMail($1)); \
213213
onModify: Formula(handleModifiedMail($1)) \
214214
})
215215
$status:=$notif.start()
216216
217217
// Push mode — Gmail notifications via Pub/Sub
218-
$notif:=$google.mail.notification({ \
218+
$notif:=$google.mail.notifier({ \
219219
topicName: "projects/my-project/topics/gmail-notifications"; \
220220
labelIds: ["INBOX"]; \
221221
onCreate: Formula(handleNewMail($1)) \
222222
})
223223
$status:=$notif.start()
224224
225225
// Pull mode — Calendar notifications (polling every 60 seconds)
226-
$calNotif:=$google.calendar.notification({ \
226+
$calNotif:=$google.calendar.notifier({ \
227227
timer: 60; \
228228
onCreate: Formula(handleNewEvent($1)); \
229229
onModify: Formula(handleEventUpdate($1)); \
@@ -232,7 +232,7 @@ $calNotif:=$google.calendar.notification({ \
232232
$status:=$calNotif.start()
233233
234234
// Push mode — Calendar notifications via webhook
235-
$calNotif:=$google.calendar.notification({ \
235+
$calNotif:=$google.calendar.notifier({ \
236236
endPoint: "https://myserver.com"; \
237237
onCreate: Formula(handleNewEvent($1)) \
238238
}; "primary")

Project/Sources/Classes/GoogleCalendar.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ Function updateEvent($inEvent : Object; $inParameters : Object) : Object
378378
// ----------------------------------------------------
379379

380380

381-
Function notification($inParameters : Object; $inCalendarId : Text) : cs.GoogleNotification
381+
Function notifier($inParameters : Object; $inCalendarId : Text) : cs.GoogleNotification
382382

383383
/*
384384
Creates a notification object for calendar event change notifications.

Project/Sources/Classes/GoogleMail.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ Function updateLabel($inLabelId : Text; $inLabelInfo : Object) : Object
566566
// ----------------------------------------------------
567567

568568

569-
Function notification($inParameters : Object) : cs.GoogleNotification
569+
Function notifier($inParameters : Object) : cs.GoogleNotification
570570

571571
/*
572572
Creates a notification object for mail change notifications.

Project/Sources/Classes/Office365Calendar.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Function updateEvent($inEvent : Object; $inParameters : Object) : Object
580580
// ----------------------------------------------------
581581

582582

583-
Function notification($inParameters : Object; $inCalendarId : Text) : cs.GraphNotification
583+
Function notifier($inParameters : Object; $inCalendarId : Text) : cs.GraphNotification
584584

585585
/*
586586
Creates a notification object for calendar event change notifications.

Project/Sources/Classes/Office365Mail.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ Function renameFolder($inFolderId : Text; $inNewFolderName : Text) : Object
622622
// ----------------------------------------------------
623623

624624

625-
Function notification($inParameters : Object; $inFolderId : Text) : cs.GraphNotification
625+
Function notifier($inParameters : Object; $inFolderId : Text) : cs.GraphNotification
626626

627627
/*
628628
Creates a notification object for mail change notifications.

0 commit comments

Comments
 (0)