File: Events.hs

package info (click to toggle)
haskell-github 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 444 kB
  • sloc: haskell: 2,572; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- | The Github issue events API, which is described on
-- <http://developer.github.com/v3/issues/events/>
module Github.Issues.Events (
 eventsForIssue
,eventsForRepo
,event
,module Github.Data
) where

import Github.Data
import Github.Private

-- | All events that have happened on an issue.
--
-- > eventsForIssue "thoughtbot" "paperclip" 49
eventsForIssue :: String -> String -> Int -> IO (Either Error [Event])
eventsForIssue user reqRepoName reqIssueNumber =
  githubGet ["repos", user, reqRepoName, "issues", show reqIssueNumber, "events"]

-- | All the events for all issues in a repo.
--
-- > eventsForRepo "thoughtbot" "paperclip"
eventsForRepo :: String -> String -> IO (Either Error [Event])
eventsForRepo user reqRepoName =
  githubGet ["repos", user, reqRepoName, "issues", "events"]

-- | Details on a specific event, by the event's ID.
--
-- > event "thoughtbot" "paperclip" 5335772
event :: String -> String -> Int -> IO (Either Error Event)
event user reqRepoName reqEventId =
  githubGet ["repos", user, reqRepoName, "issues", "events", show reqEventId]