diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-06-20 22:39:07 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-06-20 22:39:07 +0100 |
commit | de6d2c524430287c699aaa898c1325da6afea539 (patch) | |
tree | f78eb841208d667668a7bc92a9290d693cc7103b /vendor/github.com/google/go-github/github/issues_labels.go | |
parent | eb99016e1629e690e55633de6fc63a14c53e7ea2 (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/google/go-github/github/issues_labels.go')
-rw-r--r-- | vendor/github.com/google/go-github/github/issues_labels.go | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/vendor/github.com/google/go-github/github/issues_labels.go b/vendor/github.com/google/go-github/github/issues_labels.go index b0e34c4..4328997 100644 --- a/vendor/github.com/google/go-github/github/issues_labels.go +++ b/vendor/github.com/google/go-github/github/issues_labels.go @@ -8,14 +8,18 @@ package github import ( "context" "fmt" + "strings" ) // Label represents a GitHub label on an Issue type Label struct { - ID *int `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - Name *string `json:"name,omitempty"` - Color *string `json:"color,omitempty"` + ID *int64 `json:"id,omitempty"` + URL *string `json:"url,omitempty"` + Name *string `json:"name,omitempty"` + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Default *bool `json:"default,omitempty"` + NodeID *string `json:"node_id,omitempty"` } func (l Label) String() string { @@ -37,6 +41,10 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var labels []*Label resp, err := s.client.Do(ctx, req, &labels) if err != nil { @@ -56,6 +64,10 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + label := new(Label) resp, err := s.client.Do(ctx, req, label) if err != nil { @@ -75,6 +87,10 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + l := new(Label) resp, err := s.client.Do(ctx, req, l) if err != nil { @@ -94,6 +110,10 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + l := new(Label) resp, err := s.client.Do(ctx, req, l) if err != nil { @@ -130,6 +150,10 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var labels []*Label resp, err := s.client.Do(ctx, req, &labels) if err != nil { @@ -149,6 +173,10 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var l []*Label resp, err := s.client.Do(ctx, req, &l) if err != nil { @@ -167,6 +195,10 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r if err != nil { return nil, err } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) + return s.client.Do(ctx, req, nil) } @@ -180,6 +212,10 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var l []*Label resp, err := s.client.Do(ctx, req, &l) if err != nil { @@ -198,6 +234,10 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, if err != nil { return nil, err } + + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview) + return s.client.Do(ctx, req, nil) } @@ -216,6 +256,10 @@ func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string return nil, nil, err } + // TODO: remove custom Accept header when this API fully launches. + acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + var labels []*Label resp, err := s.client.Do(ctx, req, &labels) if err != nil { |