11-- | The pull requests API as documented at
22-- <http://developer.github.com/v3/pulls/>.
33module Github.PullRequests (
4- pullRequestsFor
4+ pullRequestsFor'
5+ ,pullRequest'
6+ ,pullRequestCommits'
7+ ,pullRequestFiles'
8+ ,pullRequestsFor
59,pullRequest
610,pullRequestCommits
711,pullRequestFiles
@@ -11,33 +15,63 @@ module Github.PullRequests (
1115import Github.Data
1216import Github.Private
1317
18+ -- | All pull requests for the repo, by owner and repo name.
19+ -- | With authentification
20+ --
21+ -- > pullRequestsFor' (Just ("github-username", "github-password")) "rails" "rails"
22+ pullRequestsFor' :: Maybe BasicAuth -> String -> String -> IO (Either Error [PullRequest ])
23+ pullRequestsFor' auth userName repoName =
24+ githubGet' auth [" repos" , userName, repoName, " pulls" ]
25+
1426-- | All pull requests for the repo, by owner and repo name.
1527--
1628-- > pullRequestsFor "rails" "rails"
1729pullRequestsFor :: String -> String -> IO (Either Error [PullRequest ])
18- pullRequestsFor userName repoName =
19- githubGet [" repos" , userName, repoName, " pulls" ]
30+ pullRequestsFor = pullRequestsFor' Nothing
31+
32+ -- | A detailed pull request, which has much more information. This takes the
33+ -- repo owner and name along with the number assigned to the pull request.
34+ -- | With authentification
35+ --
36+ -- > pullRequest' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" 562
37+ pullRequest' :: Maybe BasicAuth -> String -> String -> Int -> IO (Either Error DetailedPullRequest )
38+ pullRequest' auth userName repoName number =
39+ githubGet' auth [" repos" , userName, repoName, " pulls" , show number]
2040
2141-- | A detailed pull request, which has much more information. This takes the
2242-- repo owner and name along with the number assigned to the pull request.
2343--
2444-- > pullRequest "thoughtbot" "paperclip" 562
2545pullRequest :: String -> String -> Int -> IO (Either Error DetailedPullRequest )
26- pullRequest userName repoName number =
27- githubGet [" repos" , userName, repoName, " pulls" , show number]
46+ pullRequest = pullRequest' Nothing
47+
48+ -- | All the commits on a pull request, given the repo owner, repo name, and
49+ -- the number of the pull request.
50+ -- | With authentification
51+ --
52+ -- > pullRequestCommits' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" 688
53+ pullRequestCommits' :: Maybe BasicAuth -> String -> String -> Int -> IO (Either Error [Commit ])
54+ pullRequestCommits' auth userName repoName number =
55+ githubGet' auth [" repos" , userName, repoName, " pulls" , show number, " commits" ]
2856
2957-- | All the commits on a pull request, given the repo owner, repo name, and
3058-- the number of the pull request.
3159--
3260-- > pullRequestCommits "thoughtbot" "paperclip" 688
3361pullRequestCommits :: String -> String -> Int -> IO (Either Error [Commit ])
34- pullRequestCommits userName repoName number =
35- githubGet [" repos" , userName, repoName, " pulls" , show number, " commits" ]
62+ pullRequestCommits = pullRequestCommits' Nothing
3663
64+ -- | The individual files that a pull request patches. Takes the repo owner and
65+ -- name, plus the number assigned to the pull request.
66+ -- | With authentification
67+ --
68+ -- > pullRequestFiles' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" 688
69+ pullRequestFiles' :: Maybe BasicAuth -> String -> String -> Int -> IO (Either Error [File ])
70+ pullRequestFiles' auth userName repoName number =
71+ githubGet' auth [" repos" , userName, repoName, " pulls" , show number, " files" ]
3772-- | The individual files that a pull request patches. Takes the repo owner and
3873-- name, plus the number assigned to the pull request.
3974--
4075-- > pullRequestFiles "thoughtbot" "paperclip" 688
4176pullRequestFiles :: String -> String -> Int -> IO (Either Error [File ])
42- pullRequestFiles userName repoName number =
43- githubGet [" repos" , userName, repoName, " pulls" , show number, " files" ]
77+ pullRequestFiles = pullRequestFiles' Nothing
0 commit comments