@@ -15,25 +15,31 @@ import Prelude ()
1515
1616getNotifications :: Auth -> IO (Either Error (Vector Notification ))
1717getNotifications auth =
18- executeRequest auth $ getNotificationsR FetchAll
18+ executeRequest auth $ getNotificationsR FetchAll
1919
20+ -- | List your notifications.
21+ -- See <https://developer.github.com/v3/activity/notifications/#list-your-notifications>
2022getNotificationsR :: FetchCount -> Request 'RA (Vector Notification )
21- getNotificationsR =
22- pagedQuery [" notifications" ] []
23+ getNotificationsR = pagedQuery [" notifications" ] []
2324
2425markNotificationAsRead :: Auth -> Id Notification -> IO (Either Error () )
25- markNotificationAsRead auth notificationId =
26- executeRequest auth $ markNotificationAsReadR notificationId
26+ markNotificationAsRead auth nid =
27+ executeRequest auth $ markNotificationAsReadR nid
2728
28- markNotificationAsReadR :: Id Notification -> Request 'RW ()
29- markNotificationAsReadR notificationId = SimpleQuery $
30- Command Patch [" notifications" , " threads" , toPathPart notificationId]
31- (encode () )
29+ -- | Mark a thread as read.
30+ -- See <https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read>
31+ markNotificationAsReadR :: Id Notification -> GenRequest 'MtUnit 'RW ()
32+ markNotificationAsReadR nid = Command
33+ Patch
34+ [" notifications" , " threads" , toPathPart nid]
35+ (encode () )
3236
3337markNotificationsAsRead :: Auth -> IO (Either Error () )
3438markNotificationsAsRead auth =
3539 executeRequest auth markAllNotificationsAsReadR
3640
37- markAllNotificationsAsReadR :: Request 'RW ()
38- markAllNotificationsAsReadR = SimpleQuery $
39- Command Put [" notifications" ] $ encode emptyObject
41+ -- | Mark as read.
42+ -- See <https://developer.github.com/v3/activity/notifications/#mark-as-read>
43+ markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
44+ markAllNotificationsAsReadR =
45+ Command Put [" notifications" ] $ encode emptyObject
0 commit comments