{-# LANGUAGE CPP #-}
module GitHub.Endpoints.Repos.Comments (
commentsFor,
commentsFor',
commentsForR,
commitCommentsFor,
commitCommentsFor',
commitCommentsForR,
commitCommentFor,
commitCommentFor',
commitCommentForR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
commentsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Comment))
= Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector Comment))
commentsFor' Maybe Auth
forall a. Maybe a
Nothing
commentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Comment))
auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment)))
-> GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Comment)
forall (k :: RW).
Name Owner -> Name Repo -> FetchCount -> Request k (Vector Comment)
commentsForR Name Owner
user Name Repo
repo FetchCount
FetchAll
commentsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Comment)
user :: Name Owner
user repo :: Name Repo
repo =
Paths -> QueryString -> FetchCount -> Request k (Vector Comment)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "comments"] []
commitCommentsFor :: Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))
= Maybe Auth
-> Name Owner
-> Name Repo
-> Name Commit
-> IO (Either Error (Vector Comment))
commitCommentsFor' Maybe Auth
forall a. Maybe a
Nothing
commitCommentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))
auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo sha :: Name Commit
sha =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment)))
-> GenRequest 'MtJSON 'RO (Vector Comment)
-> IO (Either Error (Vector Comment))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> Name Commit
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Comment)
forall (k :: RW).
Name Owner
-> Name Repo
-> Name Commit
-> FetchCount
-> Request k (Vector Comment)
commitCommentsForR Name Owner
user Name Repo
repo Name Commit
sha FetchCount
FetchAll
commitCommentsForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request k (Vector Comment)
user :: Name Owner
user repo :: Name Repo
repo sha :: Name Commit
sha =
Paths -> QueryString -> FetchCount -> Request k (Vector Comment)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "commits", Name Commit -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Commit
sha, "comments"] []
commitCommentFor :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)
= Maybe Auth
-> Name Owner
-> Name Repo
-> Id Comment
-> IO (Either Error Comment)
commitCommentFor' Maybe Auth
forall a. Maybe a
Nothing
commitCommentFor' :: Maybe Auth -> Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)
auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo cid :: Id Comment
cid =
Maybe Auth
-> GenRequest 'MtJSON 'RO Comment -> IO (Either Error Comment)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO Comment -> IO (Either Error Comment))
-> GenRequest 'MtJSON 'RO Comment -> IO (Either Error Comment)
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo -> Id Comment -> GenRequest 'MtJSON 'RO Comment
forall (k :: RW).
Name Owner -> Name Repo -> Id Comment -> Request k Comment
commitCommentForR Name Owner
user Name Repo
repo Id Comment
cid
commitCommentForR :: Name Owner -> Name Repo -> Id Comment -> Request k Comment
user :: Name Owner
user repo :: Name Repo
repo cid :: Id Comment
cid =
Paths -> QueryString -> Request k Comment
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "comments", Id Comment -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id Comment
cid] []