Permalink
Browse files

Add PullRequest.AuthorAssociation field. (#802)

The field contains the author association with the repository,
e.g., "COLLABORATOR", "CONTRIBUTOR", "NONE", etc.

It's not currently documented at https://developer.github.com/v3/pulls/ but
is present in GitHub API v3 responses. It's documented in GitHub API v4 at
https://developer.github.com/v4/reference/object/pullrequest/#fields and
https://developer.github.com/v4/reference/enum/commentauthorassociation/.
  • Loading branch information...
allencloud authored and dmitshur committed Dec 2, 2017
1 parent a89ea1c commit d4f26c38359465e853e7022f41eaae42f8ac1085
Showing with 9 additions and 0 deletions.
  1. +8 −0 github/github-accessors.go
  2. +1 −0 github/pulls.go
@@ -5812,6 +5812,14 @@ func (p *PullRequest) GetAssignee() *User {
return p.Assignee
}
// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.
func (p *PullRequest) GetAuthorAssociation() string {
if p == nil || p.AuthorAssociation == nil {
return ""
}
return *p.AuthorAssociation
}
// GetBase returns the Base field.
func (p *PullRequest) GetBase() *PullRequestBranch {
if p == nil {
View
@@ -51,6 +51,7 @@ type PullRequest struct {
Assignees []*User `json:"assignees,omitempty"`
Milestone *Milestone `json:"milestone,omitempty"`
MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"`
AuthorAssociation *string `json:"author_association,omitempty"`
Head *PullRequestBranch `json:"head,omitempty"`
Base *PullRequestBranch `json:"base,omitempty"`

0 comments on commit d4f26c3

Please sign in to comment.