-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add support for new repository invitations #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
781b29e
to
f26e2d3
Compare
func (s *RepositoriesService) AddCollaborator(owner, repo, user string, opt *RepositoryAddCollaboratorOptions) (*Response, error) { | ||
u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user) | ||
req, err := s.client.NewRequest("PUT", u, opt) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// TODO: remove custom Accept header when this API fully launches. | ||
req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting that this takes an existing, previously stable endpoint, and changes it slightly to use the (potentially less stable) preview API. (Usually preview APIs are for new endpoints.)
I think it's fine per our discussion in #376 because people who have really really specific needs will be vendoring this library anyway.
I've left 4 inline comments, otherwise LGTM. I did not test the functionality, just reviewed the code. |
f26e2d3
to
6c958ff
Compare
// ListInvitations lists all currently-open repository invitations for the | ||
// authenticated user. | ||
// | ||
// GitHub API docs: https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks, @shurcooL
6c958ff
to
a4eeb22
Compare
Fixes google#371. Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b
a4eeb22
to
5c1b3a0
Compare
Fixes #371.
Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b