From 31f4b1bd624700453e5de4e3de58ee9fc48fe37a Mon Sep 17 00:00:00 2001 From: Sebastien Besson Date: Tue, 18 Aug 2015 11:57:25 +0100 Subject: [PATCH] Add support for filter/role options in Organization.get_members() --- github/Organization.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/github/Organization.py b/github/Organization.py index b6861fb7..ea52e228 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -469,16 +469,27 @@ class Organization(github.GithubObject.CompletableGithubObject): url_parameters ) - def get_members(self): + def get_members(self, filter=github.GithubObject.NotSet, + role=github.GithubObject.NotSet): """ :calls: `GET /orgs/:org/members `_ + :param filter: string + :param role: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ + assert filter is github.GithubObject.NotSet or isinstance(filter, (str, unicode)), filter + assert role is github.GithubObject.NotSet or isinstance(role, (str, unicode)), role + + url_parameters = dict() + if filter is not github.GithubObject.NotSet: + url_parameters["filter"] = filter + if role is not github.GithubObject.NotSet: + url_parameters["role"] = role return github.PaginatedList.PaginatedList( github.NamedUser.NamedUser, self._requester, self.url + "/members", - None + url_parameters ) def get_public_members(self):