Repository: google/go-github
Pull request #1586 (2020-07-25 00:24:19)

Add rocket and eyes as available emojis on the Reactions struct
The [documentation](https://developer.github.com/v3/reactions/) lists two emojis which are not currently mapped over from the GitHub API response. This PR adds those emojis to the Reactions struct and aligns comments to reflect the new additions.

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%2F1586) for more info**.

<!-- need_sender_cla -->
codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/1586?src=pr&el=h1) Report
> Merging [#1586](https://codecov.io/gh/google/go-github/pull/1586?src=pr&el=desc) into [master](https://codecov.io/gh/google/go-github/commit/e881974953e6ab6d1a6a1610e98ed6401a3aa1ba&el=desc) will **increase** coverage by `5.17%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/go-github/pull/1586/graphs/tree.svg?width=650&height=150&src=pr&token=EgYjGjZlI0)](https://codecov.io/gh/google/go-github/pull/1586?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #1586      +/-   ##
==========================================
+ Coverage   67.95%   73.13%   +5.17%     
==========================================
  Files          96       96              
  Lines        8762     7053    -1709     
==========================================
- Hits         5954     5158     -796     
+ Misses       1898      985     -913     
  Partials      910      910              
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/1586?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [github/reactions.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL3JlYWN0aW9ucy5nbw==) | `69.00% <ø> (+4.49%)` | :arrow_up: |
| [github/github.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL2dpdGh1Yi5nbw==) | `89.65% <0.00%> (-0.03%)` | :arrow_down: |
| [github/admin.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL2FkbWluLmdv) | `100.00% <0.00%> (ø)` | |
| [github/strings.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL3N0cmluZ3MuZ28=) | `100.00% <0.00%> (ø)` | |
| [github/activity.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL2FjdGl2aXR5Lmdv) | `100.00% <0.00%> (ø)` | |
| [github/timestamp.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL3RpbWVzdGFtcC5nbw==) | `100.00% <0.00%> (ø)` | |
| [github/admin\_stats.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL2FkbWluX3N0YXRzLmdv) | `100.00% <0.00%> (ø)` | |
| [github/repos\_traffic.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL3JlcG9zX3RyYWZmaWMuZ28=) | `100.00% <0.00%> (ø)` | |
| [github/pulls\_reviewers.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL3B1bGxzX3Jldmlld2Vycy5nbw==) | `100.00% <0.00%> (ø)` | |
| [github/git\_commits.go](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree#diff-Z2l0aHViL2dpdF9jb21taXRzLmdv) | `91.30% <0.00%> (+1.30%)` | :arrow_up: |
| ... and [83 more](https://codecov.io/gh/google/go-github/pull/1586/diff?src=pr&el=tree-more) | |

------

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

breathingdust: @googlebot I signed it!
gmlewis: Thank you, @nightlark!
Merging.

Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 8c591ce8..1dee732d 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -10364,6 +10364,14 @@ func (r *Reactions) GetConfused() int {
 	return *r.Confused
 }
 
+// GetEyes returns the Eyes field if it's non-nil, zero value otherwise.
+func (r *Reactions) GetEyes() int {
+	if r == nil || r.Eyes == nil {
+		return 0
+	}
+	return *r.Eyes
+}
+
 // GetHeart returns the Heart field if it's non-nil, zero value otherwise.
 func (r *Reactions) GetHeart() int {
 	if r == nil || r.Heart == nil {
@@ -10404,6 +10412,14 @@ func (r *Reactions) GetPlusOne() int {
 	return *r.PlusOne
 }
 
+// GetRocket returns the Rocket field if it's non-nil, zero value otherwise.
+func (r *Reactions) GetRocket() int {
+	if r == nil || r.Rocket == nil {
+		return 0
+	}
+	return *r.Rocket
+}
+
 // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.
 func (r *Reactions) GetTotalCount() int {
 	if r == nil || r.TotalCount == nil {
diff --git a/github/reactions.go b/github/reactions.go
index ce0a7518..47eb41f0 100644
--- a/github/reactions.go
+++ b/github/reactions.go
@@ -25,7 +25,7 @@ type Reaction struct {
 	NodeID *string `json:"node_id,omitempty"`
 	// Content is the type of reaction.
 	// Possible values are:
-	//     "+1", "-1", "laugh", "confused", "heart", "hooray".
+	//     "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 	Content *string `json:"content,omitempty"`
 }
 
@@ -38,6 +38,8 @@ type Reactions struct {
 	Confused   *int    `json:"confused,omitempty"`
 	Heart      *int    `json:"heart,omitempty"`
 	Hooray     *int    `json:"hooray,omitempty"`
+	Rocket     *int    `json:"rocket,omitempty"`
+	Eyes       *int    `json:"eyes,omitempty"`
 	URL        *string `json:"url,omitempty"`
 }
 
@@ -86,7 +88,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo
 // CreateCommentReaction creates a reaction for a commit comment.
 // Note that if you have already created a reaction of type content, the
 // previously created reaction will be returned with Status: 200 OK.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment
 func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {
@@ -158,7 +160,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s
 // CreateIssueReaction creates a reaction for an issue.
 // Note that if you have already created a reaction of type content, the
 // previously created reaction will be returned with Status: 200 OK.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue
 func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) {
@@ -230,7 +232,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner,
 // CreateIssueCommentReaction creates a reaction for an issue comment.
 // Note that if you have already created a reaction of type content, the
 // previously created reaction will be returned with Status: 200 OK.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment
 func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {
@@ -302,7 +304,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context,
 // CreatePullRequestCommentReaction creates a reaction for a pull request review comment.
 // Note that if you have already created a reaction of type content, the
 // previously created reaction will be returned with Status: 200 OK.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment
 func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {
@@ -371,7 +373,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team
 }
 
 // CreateTeamDiscussionReaction creates a reaction for a team discussion.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy
 func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) {
@@ -438,7 +440,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex
 }
 
 // CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment.
-// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray".
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
 //
 // GitHub API docs: https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy
 func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) {


Test patch:
diff --git a/github/pulls_comments_test.go b/github/pulls_comments_test.go
index ace57003..7d3a7c76 100644
--- a/github/pulls_comments_test.go
+++ b/github/pulls_comments_test.go
@@ -29,6 +29,8 @@ func TestPullComments_marshall(t *testing.T) {
 		Confused:   Int(0),
 		Heart:      Int(0),
 		Hooray:     Int(0),
+		Rocket:     Int(0),
+		Eyes:       Int(0),
 		URL:        String("u"),
 	}
 
@@ -116,6 +118,8 @@ func TestPullComments_marshall(t *testing.T) {
 			"confused": 0,
 			"heart": 0,
 			"hooray": 0,
+			"rocket": 0,
+			"eyes": 0,
 			"url": "u"
 		},
 		"created_at": "2002-02-10T15:30:00Z",
diff --git a/github/reactions_test.go b/github/reactions_test.go
index ede3105e..9beaff73 100644
--- a/github/reactions_test.go
+++ b/github/reactions_test.go
@@ -43,6 +43,8 @@ func TestReactions_Marshal(t *testing.T) {
 		Confused:   Int(1),
 		Heart:      Int(1),
 		Hooray:     Int(1),
+		Rocket:     Int(1),
+		Eyes:       Int(1),
 		URL:        String("u"),
 	}
 
@@ -54,6 +56,8 @@ func TestReactions_Marshal(t *testing.T) {
 		"confused": 1,
 		"heart": 1,
 		"hooray": 1,
+		"rocket": 1,
+		"eyes": 1,		
 		"url": "u"
 	}`