Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/GitHub.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module GitHub (
getNotificationsR,
markNotificationAsReadR,
markAllNotificationsAsReadR,
deleteThreadSubscriptionR,

-- ** Starring
-- | See <https://developer.github.com/v3/activity/starring/>
Expand Down
12 changes: 12 additions & 0 deletions src/GitHub/Endpoints/Activity/Notifications.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ markNotificationAsReadR nid = Command
markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
markAllNotificationsAsReadR =
Command Put ["notifications"] $ encode emptyObject

deleteThreadSubscription :: Auth -> Id Notification -> IO (Either Error ())
deleteThreadSubscription auth nid =
executeRequest auth $ deleteThreadSubscriptionR nid

-- | Delete a thread subscription.
-- See <https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription>
deleteThreadSubscriptionR :: Id Notification -> GenRequest 'MtUnit 'RW ()
deleteThreadSubscriptionR nid = Command
Delete
["notifications", "threads", toPathPart nid, "subscription"]
mempty