mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Switch from govendor to go modules. (#587)
Thanks to @BenoitKnecht for leading the way on this.
This commit is contained in:
37
vendor/github.com/google/go-github/github/pulls.go
generated
vendored
37
vendor/github.com/google/go-github/github/pulls.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -20,7 +21,7 @@ type PullRequestsService service
|
||||
|
||||
// PullRequest represents a GitHub pull request on a repository.
|
||||
type PullRequest struct {
|
||||
ID *int `json:"id,omitempty"`
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
Number *int `json:"number,omitempty"`
|
||||
State *string `json:"state,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
@ -29,9 +30,11 @@ type PullRequest struct {
|
||||
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
||||
ClosedAt *time.Time `json:"closed_at,omitempty"`
|
||||
MergedAt *time.Time `json:"merged_at,omitempty"`
|
||||
Labels []*Label `json:"labels,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
Merged *bool `json:"merged,omitempty"`
|
||||
Mergeable *bool `json:"mergeable,omitempty"`
|
||||
MergeableState *string `json:"mergeable_state,omitempty"`
|
||||
MergedBy *User `json:"merged_by,omitempty"`
|
||||
MergeCommitSHA *string `json:"merge_commit_sha,omitempty"`
|
||||
Comments *int `json:"comments,omitempty"`
|
||||
@ -45,15 +48,24 @@ type PullRequest struct {
|
||||
StatusesURL *string `json:"statuses_url,omitempty"`
|
||||
DiffURL *string `json:"diff_url,omitempty"`
|
||||
PatchURL *string `json:"patch_url,omitempty"`
|
||||
CommitsURL *string `json:"commits_url,omitempty"`
|
||||
CommentsURL *string `json:"comments_url,omitempty"`
|
||||
ReviewCommentsURL *string `json:"review_comments_url,omitempty"`
|
||||
ReviewCommentURL *string `json:"review_comment_url,omitempty"`
|
||||
Assignee *User `json:"assignee,omitempty"`
|
||||
Assignees []*User `json:"assignees,omitempty"`
|
||||
Milestone *Milestone `json:"milestone,omitempty"`
|
||||
MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"`
|
||||
AuthorAssociation *string `json:"author_association,omitempty"`
|
||||
NodeID *string `json:"node_id,omitempty"`
|
||||
RequestedReviewers []*User `json:"requested_reviewers,omitempty"`
|
||||
|
||||
Head *PullRequestBranch `json:"head,omitempty"`
|
||||
Base *PullRequestBranch `json:"base,omitempty"`
|
||||
|
||||
// ActiveLockReason is populated only when LockReason is provided while locking the pull request.
|
||||
// Possible values are: "off-topic", "too heated", "resolved", and "spam".
|
||||
ActiveLockReason *string `json:"active_lock_reason,omitempty"`
|
||||
}
|
||||
|
||||
func (p PullRequest) String() string {
|
||||
@ -110,6 +122,10 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview}
|
||||
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
|
||||
|
||||
var pulls []*PullRequest
|
||||
resp, err := s.client.Do(ctx, req, &pulls)
|
||||
if err != nil {
|
||||
@ -129,6 +145,10 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview}
|
||||
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
|
||||
|
||||
pull := new(PullRequest)
|
||||
resp, err := s.client.Do(ctx, req, pull)
|
||||
if err != nil {
|
||||
@ -138,7 +158,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string
|
||||
return pull, resp, nil
|
||||
}
|
||||
|
||||
// GetRaw gets raw (diff or patch) format of a pull request.
|
||||
// GetRaw gets a single pull request in raw (diff or patch) format.
|
||||
func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opt RawOptions) (string, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
@ -155,13 +175,13 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str
|
||||
return "", nil, fmt.Errorf("unsupported raw type %d", opt.Type)
|
||||
}
|
||||
|
||||
ret := new(bytes.Buffer)
|
||||
resp, err := s.client.Do(ctx, req, ret)
|
||||
var buf bytes.Buffer
|
||||
resp, err := s.client.Do(ctx, req, &buf)
|
||||
if err != nil {
|
||||
return "", resp, err
|
||||
}
|
||||
|
||||
return ret.String(), resp, nil
|
||||
return buf.String(), resp, nil
|
||||
}
|
||||
|
||||
// NewPullRequest represents a new pull request to be created.
|
||||
@ -184,6 +204,9 @@ func (s *PullRequestsService) Create(ctx context.Context, owner string, repo str
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview)
|
||||
|
||||
p := new(PullRequest)
|
||||
resp, err := s.client.Do(ctx, req, p)
|
||||
if err != nil {
|
||||
@ -230,6 +253,10 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: remove custom Accept header when this API fully launches.
|
||||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview}
|
||||
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
|
||||
|
||||
p := new(PullRequest)
|
||||
resp, err := s.client.Do(ctx, req, p)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user