diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 17:16:14 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 18:24:20 +0100 |
commit | c9849d667ab55c23d343332a11afb3eb8ede3f2d (patch) | |
tree | 86684d5481d8b12be84ea1a3a8f32afaac007efa /vendor/github.com/google/go-github/github/issues.go | |
parent | 49f40a952943f26494d6407dc608b50b2ec0df7f (diff) |
Update vendor libs
Diffstat (limited to 'vendor/github.com/google/go-github/github/issues.go')
-rw-r--r-- | vendor/github.com/google/go-github/github/issues.go | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/vendor/github.com/google/go-github/github/issues.go b/vendor/github.com/google/go-github/github/issues.go index d380dd3..02c82cd 100644 --- a/vendor/github.com/google/go-github/github/issues.go +++ b/vendor/github.com/google/go-github/github/issues.go @@ -14,12 +14,11 @@ import ( // methods of the GitHub API. // // GitHub API docs: http://developer.github.com/v3/issues/ -type IssuesService struct { - client *Client -} +type IssuesService service // Issue represents a GitHub issue on a repository. type Issue struct { + ID *int `json:"id,omitempty"` Number *int `json:"number,omitempty"` State *string `json:"state,omitempty"` Title *string `json:"title,omitempty"` @@ -37,6 +36,7 @@ type Issue struct { PullRequestLinks *PullRequestLinks `json:"pull_request,omitempty"` Repository *Repository `json:"repository,omitempty"` Reactions *Reactions `json:"reactions,omitempty"` + Assignees []*User `json:"assignees,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://developer.github.com/v3/search/#text-match-metadata @@ -57,6 +57,7 @@ type IssueRequest struct { Assignee *string `json:"assignee,omitempty"` State *string `json:"state,omitempty"` Milestone *int `json:"milestone,omitempty"` + Assignees *[]string `json:"assignees,omitempty"` } // IssueListOptions specifies the optional parameters to the IssuesService.List @@ -102,7 +103,7 @@ type PullRequestLinks struct { // repositories. // // GitHub API docs: http://developer.github.com/v3/issues/#list-issues -func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]Issue, *Response, error) { +func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]*Issue, *Response, error) { var u string if all { u = "issues" @@ -116,12 +117,12 @@ func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]Issue, *Respons // authenticated user. // // GitHub API docs: http://developer.github.com/v3/issues/#list-issues -func (s *IssuesService) ListByOrg(org string, opt *IssueListOptions) ([]Issue, *Response, error) { +func (s *IssuesService) ListByOrg(org string, opt *IssueListOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("orgs/%v/issues", org) return s.listIssues(u, opt) } -func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]Issue, *Response, error) { +func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, *Response, error) { u, err := addOptions(u, opt) if err != nil { return nil, nil, err @@ -135,7 +136,7 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]Issue, *R // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeReactionsPreview) - issues := new([]Issue) + issues := new([]*Issue) resp, err := s.client.Do(req, issues) if err != nil { return nil, resp, err @@ -187,7 +188,7 @@ type IssueListByRepoOptions struct { // ListByRepo lists the issues for the specified repository. // // GitHub API docs: http://developer.github.com/v3/issues/#list-issues-for-a-repository -func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRepoOptions) ([]Issue, *Response, error) { +func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opt) if err != nil { @@ -202,7 +203,7 @@ func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRe // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeReactionsPreview) - issues := new([]Issue) + issues := new([]*Issue) resp, err := s.client.Do(req, issues) if err != nil { return nil, resp, err @@ -281,9 +282,6 @@ func (s *IssuesService) Lock(owner string, repo string, number int) (*Response, return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIssueLockingPreview) - return s.client.Do(req, nil) } @@ -297,8 +295,5 @@ func (s *IssuesService) Unlock(owner string, repo string, number int) (*Response return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIssueLockingPreview) - return s.client.Do(req, nil) } |