octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.69k stars 1.08k forks source link

Organization Membership Preview API Changes - existing endpoints #1514

Closed ryangribble closed 2 years ago

ryangribble commented 7 years ago

As per this blog post several changes are in preview for the Organization Membership API

This issue is to cover changes to existing endpoints

NOTE: A new preview accepts header needs to be specified application/vnd.github.korra-preview+json in AcceptHeaders.cs

hnrkndrssn commented 7 years ago

And while I'm in the area, I'd like to put my face on this one too

hnrkndrssn commented 5 years ago

You can now use the affiliation parameter with the List collaborators endpoint to filter a repository's collaborators by their affiliation type.

There is already a CollaboratorRequest class that is used when creating/updating a collaborator to set their permissions and I don't think I can re-use this class for the affiliation parameter (looking at the code it'd add all the properties of the class to the query string)?

Should I add a new class ListCollaboratorRequest(?) with the Affiliation property and use that for the List collaborators endpoint?

The Create team endpoint now offers the maintainers parameter which will allow you to add team maintainers upon creation.

Looks like this has already been implemented https://github.com/octokit/octokit.net/blob/master/Octokit/Models/Request/NewTeam.cs#L43

ryangribble commented 5 years ago

Yeah it looks like the naming conventions have been a bit out of whack with this one. "normally" we would have XxxRequest on a GetAll endpoint, and NewXxx/UpdateXxx on any create/update endpoints... but in this case the CollaboratorRequest name has aleady been used 😬

So yeah I would say :+1: to this

Should I add a new class ListCollaboratorRequest(?) with the Affiliation property and use that for the List collaborators endpoint?

github-actions[bot] commented 2 years ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!