mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Add get_organizations() (#748)
* Add get_organizations() * Add unit tests for get_organizations
This commit is contained in:
committed by
Wan Liuyang
parent
6563ce12f5
commit
1e0150b527
@@ -245,6 +245,23 @@ class Github(object):
|
||||
)
|
||||
return github.Organization.Organization(self.__requester, headers, data, completed=True)
|
||||
|
||||
def get_organizations(self, since=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /organizations <http://developer.github.com/v3/orgs#list-all-organizations>`_
|
||||
:param since: integer
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
|
||||
"""
|
||||
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,
|
||||
"/organizations",
|
||||
url_parameters
|
||||
)
|
||||
|
||||
def get_repo(self, full_name_or_id, lazy=True):
|
||||
"""
|
||||
:calls: `GET /repos/:owner/:repo <http://developer.github.com/v3/repos>`_ or `GET /repositories/:id <http://developer.github.com/v3/repos>`_
|
||||
|
||||
Reference in New Issue
Block a user