diff --git a/github/github-accessors.go b/github/github-accessors.go index 1c17384eac0..cbe40746ce5 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14924,6 +14924,14 @@ func (t *Timeline) GetSource() *Source { return t.Source } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (t *Timeline) GetState() string { + if t == nil || t.State == nil { + return "" + } + return *t.State +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (t *Timeline) GetURL() string { if t == nil || t.URL == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 750c6a40f8f..737a7ade00e 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -17471,6 +17471,16 @@ func TestTimeline_GetSource(tt *testing.T) { t.GetSource() } +func TestTimeline_GetState(tt *testing.T) { + var zeroValue string + t := &Timeline{State: &zeroValue} + t.GetState() + t = &Timeline{} + t.GetState() + t = nil + t.GetState() +} + func TestTimeline_GetURL(tt *testing.T) { var zeroValue string t := &Timeline{URL: &zeroValue} diff --git a/github/issues_timeline.go b/github/issues_timeline.go index 2033a7237bb..1fd13b128c7 100644 --- a/github/issues_timeline.go +++ b/github/issues_timeline.go @@ -81,6 +81,9 @@ type Timeline struct { // reopened // The issue was reopened by the actor. // + // reviewed + // The pull request was reviewed. + // // subscribed // The actor subscribed to receive notifications for an issue. // @@ -118,6 +121,10 @@ type Timeline struct { // Only provided for 'renamed' events. Rename *Rename `json:"rename,omitempty"` ProjectCard *ProjectCard `json:"project_card,omitempty"` + // The state of a submitted review. Can be one of: 'commented', + // 'changes_requested' or 'approved'. + // Only provided for 'reviewed' events. + State *string `json:"state,omitempty"` } // Source represents a reference's source.