github3.py icon indicating copy to clipboard operation
github3.py copied to clipboard

add GET /orgs/:org/outside_collaborators

Open hrez opened this issue 6 years ago • 4 comments

Hi,

Could you please add GET /orgs/:org/outside_collaborators ? https://developer.github.com/v3/orgs/outside_collaborators/

It's something like this in orgs.py:


    def outside_collaborators(self, filter=None, number=-1, etag=None):
        """Iterate over collaborators of this organization.

        :param str filter: (optional), filter members returned by this method.
            Can be one of: ``"2fa_disabled"``, ``"all",``. Default: ``"all"``.
            Filtering by ``"2fa_disabled"`` is only available for organization
            owners with private repositories.
        :param int number: (optional), number of members to return. Default:
            -1 will return all available.
        :param str etag: (optional), ETag from a previous request to the same
            endpoint
        :returns: generator of :class:`User <github3.users.User>`
        """
        headers = {}
        params = {}
        if filter in self.members_filters:
            params['filter'] = filter
        url = self._build_url('outside_collaborators', base_url=self._api)
        return self._iter(int(number), url, users.ShortUser, params=params,
                          etag=etag, headers=headers)

hrez avatar Feb 14 '19 00:02 hrez

I'm going to take a stab at this issue.

jmeridth avatar Mar 16 '24 12:03 jmeridth

Hi,

Could you please add GET /orgs/:org/outside_collaborators ? https://developer.github.com/v3/orgs/outside_collaborators/

It's something like this in orgs.py:


    def outside_collaborators(self, filter=None, number=-1, etag=None):
        """Iterate over collaborators of this organization.

        :param str filter: (optional), filter members returned by this method.
            Can be one of: ``"2fa_disabled"``, ``"all",``. Default: ``"all"``.
            Filtering by ``"2fa_disabled"`` is only available for organization
            owners with private repositories.
        :param int number: (optional), number of members to return. Default:
            -1 will return all available.
        :param str etag: (optional), ETag from a previous request to the same
            endpoint
        :returns: generator of :class:`User <github3.users.User>`
        """
        headers = {}
        params = {}
        if filter in self.members_filters:
            params['filter'] = filter
        url = self._build_url('outside_collaborators', base_url=self._api)
        return self._iter(int(number), url, users.ShortUser, params=params,
                          etag=etag, headers=headers)

Cristycanal386 avatar Apr 01 '24 22:04 Cristycanal386

I'm almost done with this. Just working through some of the betamax tests. Will push up draft with what I have soon and then can iterate. Sorry for the delays.

jmeridth avatar Apr 02 '24 06:04 jmeridth

@jmeridth take your time. Let me know if you need any help

sigmavirus24 avatar Apr 02 '24 10:04 sigmavirus24