Repository: google/go-github
Pull request #2197 (2021-11-04 20:28:52)

Add missing fields to Timeline

google-cla[bot]: 
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: **Please visit <https://cla.developers.google.com/> to sign.**

Once you've signed (or fixed any issues), please reply here with `@googlebot I signed it!` and we'll verify it.

----

#### What to do if you already signed the CLA

##### Individual signers

*   It's possible we don't have your GitHub username or you're using a different email address on your commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).

##### Corporate signers

*   Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to [go/cla#troubleshoot](http://go/cla#troubleshoot) ([Public version](https://opensource.google/docs/cla/#troubleshoot)).
*   The email used to register you as an authorized contributor must be the email used for the Git commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).
*   The email used to register you as an authorized contributor must also be [attached to your GitHub account](https://github.com/settings/emails).
		

ℹ️ **Googlers: [Go here](https://goto.google.com/prinfo/https%3A%2F%2Fgithub.com%2Fgoogle%2Fgo-github%2Fpull%2F2197) for more info**.

<!-- need_sender_cla -->
devfd: @googlebot I signed it!
devfd: my bad, thanks @gmlewis 


codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2197](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (6089613) into [master](https://codecov.io/gh/google/go-github/commit/05114210f35ebfcd3ba84776d2bb70a57e9433ce?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (0511421) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/go-github/pull/2197/graphs/tree.svg?width=650&height=150&src=pr&token=EgYjGjZlI0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

```diff
@@           Coverage Diff           @@
##           master    #2197   +/-   ##
=======================================
  Coverage   97.79%   97.79%           
=======================================
  Files         112      112           
  Lines       10003    10003           
=======================================
  Hits         9782     9782           
  Misses        154      154           
  Partials       67       67           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/issues\_timeline.go](https://codecov.io/gh/google/go-github/pull/2197/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2lzc3Vlc190aW1lbGluZS5nbw==) | `100.00% <ø> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [0511421...6089613](https://codecov.io/gh/google/go-github/pull/2197?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 1d2db4ec..e69d5e84 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -16372,6 +16372,30 @@ func (t *Timeline) GetAssignee() *User {
 	return t.Assignee
 }
 
+// GetAssigner returns the Assigner field.
+func (t *Timeline) GetAssigner() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Assigner
+}
+
+// GetAuthor returns the Author field.
+func (t *Timeline) GetAuthor() *CommitAuthor {
+	if t == nil {
+		return nil
+	}
+	return t.Author
+}
+
+// GetBody returns the Body field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetBody() string {
+	if t == nil || t.Body == nil {
+		return ""
+	}
+	return *t.Body
+}
+
 // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetCommitID() string {
 	if t == nil || t.CommitID == nil {
@@ -16380,6 +16404,14 @@ func (t *Timeline) GetCommitID() string {
 	return *t.CommitID
 }
 
+// GetCommitter returns the Committer field.
+func (t *Timeline) GetCommitter() *CommitAuthor {
+	if t == nil {
+		return nil
+	}
+	return t.Committer
+}
+
 // GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetCommitURL() string {
 	if t == nil || t.CommitURL == nil {
@@ -16420,6 +16452,14 @@ func (t *Timeline) GetLabel() *Label {
 	return t.Label
 }
 
+// GetMessage returns the Message field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetMessage() string {
+	if t == nil || t.Message == nil {
+		return ""
+	}
+	return *t.Message
+}
+
 // GetMilestone returns the Milestone field.
 func (t *Timeline) GetMilestone() *Milestone {
 	if t == nil {
@@ -16444,6 +16484,30 @@ func (t *Timeline) GetRename() *Rename {
 	return t.Rename
 }
 
+// GetRequester returns the Requester field.
+func (t *Timeline) GetRequester() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Requester
+}
+
+// GetReviewer returns the Reviewer field.
+func (t *Timeline) GetReviewer() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Reviewer
+}
+
+// GetSHA returns the SHA field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetSHA() string {
+	if t == nil || t.SHA == nil {
+		return ""
+	}
+	return *t.SHA
+}
+
 // GetSource returns the Source field.
 func (t *Timeline) GetSource() *Source {
 	if t == nil {
@@ -16460,6 +16524,14 @@ func (t *Timeline) GetState() string {
 	return *t.State
 }
 
+// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetSubmittedAt() time.Time {
+	if t == nil || t.SubmittedAt == nil {
+		return time.Time{}
+	}
+	return *t.SubmittedAt
+}
+
 // GetURL returns the URL field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetURL() string {
 	if t == nil || t.URL == nil {
@@ -16468,6 +16540,14 @@ func (t *Timeline) GetURL() string {
 	return *t.URL
 }
 
+// GetUser returns the User field.
+func (t *Timeline) GetUser() *User {
+	if t == nil {
+		return nil
+	}
+	return t.User
+}
+
 // GetGUID returns the GUID field if it's non-nil, zero value otherwise.
 func (t *Tool) GetGUID() string {
 	if t == nil || t.GUID == nil {
diff --git a/github/issues_timeline.go b/github/issues_timeline.go
index 1fd13b12..845e3f76 100644
--- a/github/issues_timeline.go
+++ b/github/issues_timeline.go
@@ -15,7 +15,7 @@ import (
 // Timeline represents an event that occurred around an Issue or Pull Request.
 //
 // It is similar to an IssueEvent but may contain more information.
-// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/timeline/
+// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types
 type Timeline struct {
 	ID        *int64  `json:"id,omitempty"`
 	URL       *string `json:"url,omitempty"`
@@ -24,6 +24,18 @@ type Timeline struct {
 	// The User object that generated the event.
 	Actor *User `json:"actor,omitempty"`
 
+	// The person who commented on the issue.
+	User *User `json:"user,omitempty"`
+
+	// The person who authored the commit.
+	Author *CommitAuthor `json:"author,omitempty"`
+	// The person who committed the commit on behalf of the author.
+	Committer *CommitAuthor `json:"committer,omitempty"`
+	// The SHA of the commit in the pull request.
+	SHA *string `json:"sha,omitempty"`
+	// The commit message.
+	Message *string `json:"message,omitempty"`
+
 	// Event identifies the actual type of Event that occurred. Possible values
 	// are:
 	//
@@ -111,6 +123,8 @@ type Timeline struct {
 	// The User object which was assigned to (or unassigned from) this Issue or
 	// Pull Request. Only provided for 'assigned' and 'unassigned' events.
 	Assignee *User `json:"assignee,omitempty"`
+	Assigner *User `json:"assigner,omitempty"`
+
 	// The Milestone object including a 'title' attribute.
 	// Only provided for 'milestoned' and 'demilestoned' events.
 	Milestone *Milestone `json:"milestone,omitempty"`
@@ -125,6 +139,15 @@ type Timeline struct {
 	// 'changes_requested' or 'approved'.
 	// Only provided for 'reviewed' events.
 	State *string `json:"state,omitempty"`
+
+	// The person requested to review the pull request.
+	Reviewer *User `json:"requested_reviewer,omitempty"`
+	// The person who requested a review.
+	Requester *User `json:"review_requester,omitempty"`
+
+	// The review summary text.
+	Body        *string    `json:"body,omitempty"`
+	SubmittedAt *time.Time `json:"submitted_at,omitempty"`
 }
 
 // Source represents a reference's source.


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index f6af9991..8fb7dc03 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -19119,6 +19119,30 @@ func TestTimeline_GetAssignee(tt *testing.T) {
 	t.GetAssignee()
 }
 
+func TestTimeline_GetAssigner(tt *testing.T) {
+	t := &Timeline{}
+	t.GetAssigner()
+	t = nil
+	t.GetAssigner()
+}
+
+func TestTimeline_GetAuthor(tt *testing.T) {
+	t := &Timeline{}
+	t.GetAuthor()
+	t = nil
+	t.GetAuthor()
+}
+
+func TestTimeline_GetBody(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{Body: &zeroValue}
+	t.GetBody()
+	t = &Timeline{}
+	t.GetBody()
+	t = nil
+	t.GetBody()
+}
+
 func TestTimeline_GetCommitID(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{CommitID: &zeroValue}
@@ -19129,6 +19153,13 @@ func TestTimeline_GetCommitID(tt *testing.T) {
 	t.GetCommitID()
 }
 
+func TestTimeline_GetCommitter(tt *testing.T) {
+	t := &Timeline{}
+	t.GetCommitter()
+	t = nil
+	t.GetCommitter()
+}
+
 func TestTimeline_GetCommitURL(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{CommitURL: &zeroValue}
@@ -19176,6 +19207,16 @@ func TestTimeline_GetLabel(tt *testing.T) {
 	t.GetLabel()
 }
 
+func TestTimeline_GetMessage(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{Message: &zeroValue}
+	t.GetMessage()
+	t = &Timeline{}
+	t.GetMessage()
+	t = nil
+	t.GetMessage()
+}
+
 func TestTimeline_GetMilestone(tt *testing.T) {
 	t := &Timeline{}
 	t.GetMilestone()
@@ -19197,6 +19238,30 @@ func TestTimeline_GetRename(tt *testing.T) {
 	t.GetRename()
 }
 
+func TestTimeline_GetRequester(tt *testing.T) {
+	t := &Timeline{}
+	t.GetRequester()
+	t = nil
+	t.GetRequester()
+}
+
+func TestTimeline_GetReviewer(tt *testing.T) {
+	t := &Timeline{}
+	t.GetReviewer()
+	t = nil
+	t.GetReviewer()
+}
+
+func TestTimeline_GetSHA(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{SHA: &zeroValue}
+	t.GetSHA()
+	t = &Timeline{}
+	t.GetSHA()
+	t = nil
+	t.GetSHA()
+}
+
 func TestTimeline_GetSource(tt *testing.T) {
 	t := &Timeline{}
 	t.GetSource()
@@ -19214,6 +19279,16 @@ func TestTimeline_GetState(tt *testing.T) {
 	t.GetState()
 }
 
+func TestTimeline_GetSubmittedAt(tt *testing.T) {
+	var zeroValue time.Time
+	t := &Timeline{SubmittedAt: &zeroValue}
+	t.GetSubmittedAt()
+	t = &Timeline{}
+	t.GetSubmittedAt()
+	t = nil
+	t.GetSubmittedAt()
+}
+
 func TestTimeline_GetURL(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{URL: &zeroValue}
@@ -19224,6 +19299,13 @@ func TestTimeline_GetURL(tt *testing.T) {
 	t.GetURL()
 }
 
+func TestTimeline_GetUser(tt *testing.T) {
+	t := &Timeline{}
+	t.GetUser()
+	t = nil
+	t.GetUser()
+}
+
 func TestTool_GetGUID(tt *testing.T) {
 	var zeroValue string
 	t := &Tool{GUID: &zeroValue}