aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/gists.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/gists.go')
-rw-r--r--vendor/github.com/google/go-github/github/gists.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-github/github/gists.go b/vendor/github.com/google/go-github/github/gists.go
index 15276ea..9108b64 100644
--- a/vendor/github.com/google/go-github/github/gists.go
+++ b/vendor/github.com/google/go-github/github/gists.go
@@ -30,6 +30,7 @@ type Gist struct {
GitPushURL *string `json:"git_push_url,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
}
func (g Gist) String() string {
@@ -60,6 +61,7 @@ type GistCommit struct {
User *User `json:"user,omitempty"`
ChangeStatus *CommitStats `json:"change_status,omitempty"`
CommittedAt *Timestamp `json:"committed_at,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
}
func (gc GistCommit) String() string {
@@ -73,6 +75,7 @@ type GistFork struct {
ID *string `json:"id,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
+ NodeID *string `json:"node_id,omitempty"`
}
func (gf GistFork) String() string {
@@ -111,6 +114,9 @@ func (s *GistsService) List(ctx context.Context, user string, opt *GistListOptio
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var gists []*Gist
resp, err := s.client.Do(ctx, req, &gists)
if err != nil {
@@ -134,6 +140,9 @@ func (s *GistsService) ListAll(ctx context.Context, opt *GistListOptions) ([]*Gi
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var gists []*Gist
resp, err := s.client.Do(ctx, req, &gists)
if err != nil {
@@ -157,6 +166,9 @@ func (s *GistsService) ListStarred(ctx context.Context, opt *GistListOptions) ([
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var gists []*Gist
resp, err := s.client.Do(ctx, req, &gists)
if err != nil {
@@ -175,6 +187,10 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er
if err != nil {
return nil, nil, err
}
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
gist := new(Gist)
resp, err := s.client.Do(ctx, req, gist)
if err != nil {
@@ -193,6 +209,10 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist,
if err != nil {
return nil, nil, err
}
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
gist := new(Gist)
resp, err := s.client.Do(ctx, req, gist)
if err != nil {
@@ -211,6 +231,10 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response
if err != nil {
return nil, nil, err
}
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
g := new(Gist)
resp, err := s.client.Do(ctx, req, g)
if err != nil {
@@ -229,6 +253,10 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist,
if err != nil {
return nil, nil, err
}
+
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
g := new(Gist)
resp, err := s.client.Do(ctx, req, g)
if err != nil {
@@ -253,6 +281,9 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opt *ListOpti
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var gistCommits []*GistCommit
resp, err := s.client.Do(ctx, req, &gistCommits)
if err != nil {
@@ -322,6 +353,9 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
g := new(Gist)
resp, err := s.client.Do(ctx, req, g)
if err != nil {
@@ -341,6 +375,9 @@ func (s *GistsService) ListForks(ctx context.Context, id string) ([]*GistFork, *
return nil, nil, err
}
+ // TODO: remove custom Accept header when this API fully launches.
+ req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
+
var gistForks []*GistFork
resp, err := s.client.Do(ctx, req, &gistForks)
if err != nil {