mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Implement GET /users (issue #173)
This commit is contained in:
+18
-1
@@ -99,7 +99,7 @@ class Github(object):
|
||||
|
||||
def get_user(self, login=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /users/:user <http://developer.github.com/v3/todo>`_
|
||||
:calls: `GET /users/:user <http://developer.github.com/v3/users/#get-a-single-user>`_ or `GET /user <http://developer.github.com/v3/users/#get-the-authenticated-user>`_
|
||||
:param login: string
|
||||
:rtype: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
@@ -115,6 +115,23 @@ class Github(object):
|
||||
)
|
||||
return github.NamedUser.NamedUser(self.__requester, data, completed=True)
|
||||
|
||||
def get_users(self, since=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /users <http://developer.github.com/v3/users/#get-all-users>`_
|
||||
:param since: integer
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
assert since is github.GithubObject.NotSet or isinstance(since, (int, long)), since
|
||||
url_parameters = dict()
|
||||
if since is not github.GithubObject.NotSet:
|
||||
url_parameters["since"] = since
|
||||
return github.PaginatedList.PaginatedList(
|
||||
github.NamedUser.NamedUser,
|
||||
self.__requester,
|
||||
"/users",
|
||||
url_parameters
|
||||
)
|
||||
|
||||
def get_organization(self, login):
|
||||
"""
|
||||
:calls: `GET /orgs/:org <http://developer.github.com/v3/todo>`_
|
||||
|
||||
Reference in New Issue
Block a user