module GitHub.Endpoints.Activity.Notifications (
getNotificationsR,
markNotificationAsReadR,
markAllNotificationsAsReadR,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
getNotificationsR :: FetchCount -> Request 'RA (Vector Notification)
getNotificationsR :: FetchCount -> Request 'RA (Vector Notification)
getNotificationsR = Paths
-> QueryString -> FetchCount -> Request 'RA (Vector Notification)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"notifications"] []
markNotificationAsReadR :: Id Notification -> GenRequest 'MtUnit 'RW ()
markNotificationAsReadR :: Id Notification -> GenRequest 'MtUnit 'RW ()
markNotificationAsReadR Id Notification
nid = CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command
CommandMethod
Patch
[Text
"notifications", Text
"threads", Id Notification -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id Notification
nid]
(() -> ByteString
forall a. ToJSON a => a -> ByteString
encode ())
markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
markAllNotificationsAsReadR =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Put [Text
"notifications"] (ByteString -> GenRequest 'MtUnit 'RW ())
-> ByteString -> GenRequest 'MtUnit 'RW ()
forall a b. (a -> b) -> a -> b
$ Value -> ByteString
forall a. ToJSON a => a -> ByteString
encode Value
emptyObject