module GitHub.Endpoints.Gists.Comments (
commentsOn,
commentsOnR,
comment,
gistCommentR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
commentsOn :: Name Gist -> IO (Either Error (Vector GistComment))
gid :: Name Gist
gid =
GenRequest 'MtJSON 'RO (Vector GistComment)
-> IO (Either Error (Vector GistComment))
forall (mt :: MediaType *) a.
ParseResponse mt a =>
GenRequest mt 'RO a -> IO (Either Error a)
executeRequest' (GenRequest 'MtJSON 'RO (Vector GistComment)
-> IO (Either Error (Vector GistComment)))
-> GenRequest 'MtJSON 'RO (Vector GistComment)
-> IO (Either Error (Vector GistComment))
forall a b. (a -> b) -> a -> b
$ Name Gist
-> FetchCount -> GenRequest 'MtJSON 'RO (Vector GistComment)
forall (k :: RW).
Name Gist -> FetchCount -> Request k (Vector GistComment)
commentsOnR Name Gist
gid FetchCount
FetchAll
commentsOnR :: Name Gist -> FetchCount -> Request k (Vector GistComment)
gid :: Name Gist
gid =
Paths
-> QueryString -> FetchCount -> Request k (Vector GistComment)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["gists", Name Gist -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Gist
gid, "comments"] []
comment :: Id GistComment -> IO (Either Error GistComment)
cid :: Id GistComment
cid =
GenRequest 'MtJSON 'RO GistComment -> IO (Either Error GistComment)
forall (mt :: MediaType *) a.
ParseResponse mt a =>
GenRequest mt 'RO a -> IO (Either Error a)
executeRequest' (GenRequest 'MtJSON 'RO GistComment
-> IO (Either Error GistComment))
-> GenRequest 'MtJSON 'RO GistComment
-> IO (Either Error GistComment)
forall a b. (a -> b) -> a -> b
$ Id GistComment -> GenRequest 'MtJSON 'RO GistComment
forall (k :: RW). Id GistComment -> Request k GistComment
gistCommentR Id GistComment
cid
gistCommentR :: Id GistComment -> Request k GistComment
cid :: Id GistComment
cid =
Paths -> QueryString -> Request k GistComment
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["gists", "comments", Id GistComment -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id GistComment
cid] []