-----------------------------------------------------------------------------
-- |
-- License     :  BSD-3-Clause
  Maintainer   :     <  >
--
-- The reviews API as described on </>.
module GitHub.Endpoints.PullRequests.Reviews
    ( pullRequestReviewsR
    , pullRequestReviewR
    , pullRequestReviewCommentsR
    , module GitHub.Data
    ) where

import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()

-- | List reviews for a pull request.
-- See </#list-reviews-on-a-pull-request>
pullRequestReviewsR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> FetchCount
    -> Request k (Vector Review)
pullRequestReviewsR owner repo prid =
    pagedQuery
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        ]
        []

-- | Query a single pull request review.
-- see </#get-a-single-review>
pullRequestReviewR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> Id Review
    -> Request k Review
pullRequestReviewR owner repo prid rid =
    query
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        , toPathPart rid
        ]
        []

-- | Query the comments for a single pull request review.
-- see </#get-comments-for-a-single-review>
pullRequestReviewCommentsR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> Id Review
    -> Request k [ReviewComment]
pullRequestReviewCommentsR owner repo prid rid =
    query
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        , toPathPart rid
        , "comments"
        ]
        []

---------------------------------------------------------------------------
 |
 License     :  BSD-3-Clause

 The reviews API as described on </>.
 | List reviews for a pull request.
 See </#list-reviews-on-a-pull-request>
 | Query a single pull request review.
 see </#get-a-single-review>
 | Query the comments for a single pull request review.
 see </#get-comments-for-a-single-review>
  Maintainer   :     <  >
module GitHub.Endpoints.PullRequests.Reviews
    ( pullRequestReviewsR
    , pullRequestReviewR
    , pullRequestReviewCommentsR
    , module GitHub.Data
    ) where

import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()

pullRequestReviewsR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> FetchCount
    -> Request k (Vector Review)
pullRequestReviewsR owner repo prid =
    pagedQuery
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        ]
        []

pullRequestReviewR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> Id Review
    -> Request k Review
pullRequestReviewR owner repo prid rid =
    query
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        , toPathPart rid
        ]
        []

pullRequestReviewCommentsR
    :: Name Owner
    -> Name Repo
    -> IssueNumber
    -> Id Review
    -> Request k [ReviewComment]
pullRequestReviewCommentsR owner repo prid rid =
    query
        [ "repos"
        , toPathPart owner
        , toPathPart repo
        , "pulls"
        , toPathPart prid
        , "reviews"
        , toPathPart rid
        , "comments"
        ]
        []
