Skip to content

Commit 787b344

Browse files
palash25gmlewis
authored andcommitted
IssueEvents: Support Project Card fields (google#1066)
Fixes google#1000.
1 parent d8c8693 commit 787b344

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Noah Zoschke <[email protected]>
155155
ns-cweber <[email protected]>
156156
Oleg Kovalov <[email protected]>
157157
Ondřej Kupka <[email protected]>
158+
Palash Nigam <[email protected]>
158159
Panagiotis Moustafellos <[email protected]>
159160
Parham Alvani <[email protected]>
160161
Parker Moore <[email protected]>

github/github-accessors.go

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github.go

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ const (
128128

129129
// https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/
130130
mediaTypeSignaturePreview = "application/vnd.github.zzzax-preview+json"
131+
132+
// https://developer.github.com/changes/2018-09-05-project-card-events/
133+
mediaTypeProjectCardDetailsPreview = "application/vnd.github.starfox-preview+json"
131134
)
132135

133136
// A Client manages communication with the GitHub API.

github/issues_events.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package github
88
import (
99
"context"
1010
"fmt"
11+
"strings"
1112
"time"
1213
)
1314

@@ -68,13 +69,14 @@ type IssueEvent struct {
6869
Issue *Issue `json:"issue,omitempty"`
6970

7071
// Only present on certain events; see above.
71-
Assignee *User `json:"assignee,omitempty"`
72-
Assigner *User `json:"assigner,omitempty"`
73-
CommitID *string `json:"commit_id,omitempty"`
74-
Milestone *Milestone `json:"milestone,omitempty"`
75-
Label *Label `json:"label,omitempty"`
76-
Rename *Rename `json:"rename,omitempty"`
77-
LockReason *string `json:"lock_reason,omitempty"`
72+
Assignee *User `json:"assignee,omitempty"`
73+
Assigner *User `json:"assigner,omitempty"`
74+
CommitID *string `json:"commit_id,omitempty"`
75+
Milestone *Milestone `json:"milestone,omitempty"`
76+
Label *Label `json:"label,omitempty"`
77+
Rename *Rename `json:"rename,omitempty"`
78+
LockReason *string `json:"lock_reason,omitempty"`
79+
ProjectCard *ProjectCard `json:"project_card,omitempty"`
7880
}
7981

8082
// ListIssueEvents lists events for the specified issue.
@@ -92,7 +94,8 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string,
9294
return nil, nil, err
9395
}
9496

95-
req.Header.Set("Accept", mediaTypeLockReasonPreview)
97+
acceptHeaders := []string{mediaTypeLockReasonPreview, mediaTypeProjectCardDetailsPreview}
98+
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
9699

97100
var events []*IssueEvent
98101
resp, err := s.client.Do(ctx, req, &events)

0 commit comments

Comments
 (0)