File: Events.hs

package info (click to toggle)
haskell-github 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 452 kB
  • sloc: haskell: 2,286; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,043 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 repoName issueNumber =
  githubGet ["repos", user, repoName, "issues", show issueNumber, "events"]

-- | All the events for all issues in a repo.
--
-- > eventsForRepo "thoughtbot" "paperclip"
eventsForRepo :: String -> String -> IO (Either Error [Event])
eventsForRepo user repoName =
  githubGet ["repos", user, repoName, "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 repoName eventId =
  githubGet ["repos", user, repoName, "issues", "events", show eventId]