diff --git a/github/github-accessors.go b/github/github-accessors.go index 72d200be32d..a17114ec914 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -8708,6 +8708,14 @@ func (p *PullRequestMergeResult) GetSHA() string { return *p.SHA } +// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. +func (p *PullRequestReview) GetAuthorAssociation() string { + if p == nil || p.AuthorAssociation == nil { + return "" + } + return *p.AuthorAssociation +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (p *PullRequestReview) GetBody() string { if p == nil || p.Body == nil { diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index b156cc1db92..a8050964e61 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -1012,16 +1012,17 @@ func TestPullRequestComment_String(t *testing.T) { func TestPullRequestReview_String(t *testing.T) { v := PullRequestReview{ - ID: Int64(0), - NodeID: String(""), - User: &User{}, - Body: String(""), - CommitID: String(""), - HTMLURL: String(""), - PullRequestURL: String(""), - State: String(""), + ID: Int64(0), + NodeID: String(""), + User: &User{}, + Body: String(""), + CommitID: String(""), + HTMLURL: String(""), + PullRequestURL: String(""), + State: String(""), + AuthorAssociation: String(""), } - want := `github.PullRequestReview{ID:0, NodeID:"", User:github.User{}, Body:"", CommitID:"", HTMLURL:"", PullRequestURL:"", State:""}` + want := `github.PullRequestReview{ID:0, NodeID:"", User:github.User{}, Body:"", CommitID:"", HTMLURL:"", PullRequestURL:"", State:"", AuthorAssociation:""}` if got := v.String(); got != want { t.Errorf("PullRequestReview.String = %v, want %v", got, want) } diff --git a/github/pulls_reviews.go b/github/pulls_reviews.go index 88b82982f6d..aee49147ae1 100644 --- a/github/pulls_reviews.go +++ b/github/pulls_reviews.go @@ -22,6 +22,9 @@ type PullRequestReview struct { HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` State *string `json:"state,omitempty"` + // AuthorAssociation is the comment author's relationship to the issue's repository. + // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + AuthorAssociation *string `json:"author_association,omitempty"` } func (p PullRequestReview) String() string {