aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/issues_labels.go
diff options
context:
space:
mode:
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.go52
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 {