File: Gists.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 (35 lines) | stat: -rw-r--r-- 984 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
33
34
35
-- | The gists API as described at <http://developer.github.com/v3/gists/>.
module Github.Gists (
 gists
,gists'
,gist
,gist'
,module Github.Data
) where

import Github.Data
import Github.Private

-- | The list of all gists created by the user 
-- 
-- > gists' (Just ("github-username", "github-password")) "mike-burns"
gists' :: Maybe GithubAuth -> String -> IO (Either Error [Gist])
gists' auth userName = githubGet' auth ["users", userName, "gists"]

-- | The list of all public gists created by the user.
--
-- > gists "mike-burns"
gists :: String -> IO (Either Error [Gist])
gists = gists' Nothing

-- | A specific gist, given its id, with authentication credentials
--
-- > gist' (Just ("github-username", "github-password")) "225074"
gist' :: Maybe GithubAuth -> String -> IO (Either Error Gist)
gist' auth reqGistId = githubGet' auth ["gists", reqGistId]

-- | A specific gist, given its id.
--
-- > gist "225074"
gist :: String -> IO (Either Error Gist)
gist = gist' Nothing