Skip to content

Commit 1c770f5

Browse files
committed
Support authenticated requests for the members of an organization.
1 parent 342a4e5 commit 1c770f5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Github/Organizations/Members.hs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22
-- <http://developer.github.com/v3/orgs/members/>.
33
module Github.Organizations.Members (
44
membersOf
5+
,membersOf'
56
,module Github.Data
67
) where
78

89
import Github.Data
910
import Github.Private
1011

11-
-- | All the users who are members of the specified organization.
12+
-- | All the users who are members of the specified organization,
13+
-- | with or without authentication.
14+
--
15+
-- > membersOf' (Just $ GithubOAuth "token") "thoughtbot"
16+
membersOf' :: Maybe GithubAuth -> String -> IO (Either Error [GithubOwner])
17+
membersOf' auth organization = githubGet' auth ["orgs", organization, "members"]
18+
19+
-- | All the users who are members of the specified organization,
20+
-- | without authentication.
1221
--
1322
-- > membersOf "thoughtbot"
1423
membersOf :: String -> IO (Either Error [GithubOwner])
15-
membersOf organization = githubGet ["orgs", organization, "members"]
24+
membersOf = membersOf' Nothing

0 commit comments

Comments
 (0)