11-- | The issues API as described on <http://developer.github.com/v3/issues/>.
22module Github.Issues (
33 issue
4+ ,issue'
45,issuesForRepo
6+ ,issuesForRepo'
57,IssueLimitation (.. )
68,module Github.Data
79) where
@@ -30,21 +32,30 @@ data IssueLimitation =
3032 | Descending -- ^ Sort descending. [default]
3133 | Since UTCTime -- ^ Only issues created since the specified date and time.
3234
35+
36+ -- | Details on a specific issue, given the repo owner and name, and the issue
37+ -- number.'
38+ --
39+ -- > issue "thoughtbot" "paperclip" "462"
40+ issue' :: Maybe BasicAuth -> String -> String -> Int -> IO (Either Error Issue )
41+ issue' auth user repoName issueNumber =
42+ githubGet' auth [" repos" , user, repoName, " issues" , show issueNumber]
43+
3344-- | Details on a specific issue, given the repo owner and name, and the issue
3445-- number.
3546--
3647-- > issue "thoughtbot" "paperclip" "462"
3748issue :: String -> String -> Int -> IO (Either Error Issue )
38- issue user repoName issueNumber =
39- githubGet [" repos" , user, repoName, " issues" , show issueNumber]
49+ issue = issue' Nothing
4050
4151-- | All issues for a repo (given the repo owner and name), with optional
4252-- restrictions as described in the @IssueLimitation@ data type.
4353--
4454-- > issuesForRepo "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]
45- issuesForRepo :: String -> String -> [IssueLimitation ] -> IO (Either Error [Issue ])
46- issuesForRepo user repoName issueLimitations =
47- githubGetWithQueryString
55+ issuesForRepo' :: Maybe BasicAuth -> String -> String -> [IssueLimitation ] -> IO (Either Error [Issue ])
56+ issuesForRepo' auth user repoName issueLimitations =
57+ githubGetWithQueryString'
58+ auth
4859 [" repos" , user, repoName, " issues" ]
4960 (queryStringFromLimitations issueLimitations)
5061 where
@@ -64,3 +75,10 @@ issuesForRepo user repoName issueLimitations =
6475 convert Descending = " direction=desc"
6576 convert (Since t) =
6677 " since=" ++ formatTime defaultTimeLocale " %FT%TZ" t
78+
79+ -- | All issues for a repo (given the repo owner and name), with optional
80+ -- restrictions as described in the @IssueLimitation@ data type.
81+ --
82+ -- > issuesForRepo "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]
83+ issuesForRepo :: String -> String -> [IssueLimitation ] -> IO (Either Error [Issue ])
84+ issuesForRepo = issuesForRepo' Nothing
0 commit comments