module GitHub.Endpoints.PullRequests.Comments (
pullRequestCommentsR,
pullRequestCommentR,
createPullCommentR,
createPullCommentReplyR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
pullRequestCommentsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector Comment)
Name Owner
user Name Repo
repo IssueNumber
prid =
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"pulls", forall a. IsPathPart a => a -> Text
toPathPart IssueNumber
prid, Text
"comments"] []
pullRequestCommentR :: Name Owner -> Name Repo -> Id Comment -> Request k Comment
Name Owner
user Name Repo
repo Id Comment
cid =
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"pulls", Text
"comments", forall a. IsPathPart a => a -> Text
toPathPart Id Comment
cid] []
createPullCommentR :: Name Owner -> Name Repo -> IssueNumber -> Text -> Text -> Int -> Text -> Request 'RW Comment
Name Owner
user Name Repo
repo IssueNumber
iss Text
commit Text
path Int
position Text
body =
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post Paths
parts (forall a. ToJSON a => a -> ByteString
encode forall a b. (a -> b) -> a -> b
$ Text -> Text -> Int -> Text -> NewPullComment
NewPullComment Text
commit Text
path Int
position Text
body)
where
parts :: Paths
parts = [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"pulls", forall a. IsPathPart a => a -> Text
toPathPart IssueNumber
iss, Text
"comments"]
createPullCommentReplyR :: Name Owner -> Name Repo -> IssueNumber -> Id Comment -> Text -> Request 'RW Comment
Name Owner
user Name Repo
repo IssueNumber
iss Id Comment
cid Text
body =
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post Paths
parts (forall a. ToJSON a => a -> ByteString
encode forall a b. (a -> b) -> a -> b
$ Text -> PullCommentReply
PullCommentReply Text
body)
where
parts :: Paths
parts = [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"pulls", forall a. IsPathPart a => a -> Text
toPathPart IssueNumber
iss
, Text
"comments", forall a. IsPathPart a => a -> Text
toPathPart Id Comment
cid, Text
"replies"]