mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-04 12:37:59 +00:00
Update deps
This commit is contained in:
51
vendor/github.com/google/go-github/github/issues.go
generated
vendored
51
vendor/github.com/google/go-github/github/issues.go
generated
vendored
@@ -6,6 +6,7 @@
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
@@ -13,7 +14,7 @@ import (
|
||||
// IssuesService handles communication with the issue related
|
||||
// methods of the GitHub API.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/
|
||||
type IssuesService service
|
||||
|
||||
// Issue represents a GitHub issue on a repository.
|
||||
@@ -107,27 +108,27 @@ type PullRequestLinks struct {
|
||||
// organization repositories; if false, list only owned and member
|
||||
// repositories.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/#list-issues
|
||||
func (s *IssuesService) List(all bool, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#list-issues
|
||||
func (s *IssuesService) List(ctx context.Context, all bool, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
var u string
|
||||
if all {
|
||||
u = "issues"
|
||||
} else {
|
||||
u = "user/issues"
|
||||
}
|
||||
return s.listIssues(u, opt)
|
||||
return s.listIssues(ctx, u, opt)
|
||||
}
|
||||
|
||||
// ListByOrg fetches the issues in the specified organization for the
|
||||
// authenticated user.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/#list-issues
|
||||
func (s *IssuesService) ListByOrg(org string, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#list-issues
|
||||
func (s *IssuesService) ListByOrg(ctx context.Context, org string, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
u := fmt.Sprintf("orgs/%v/issues", org)
|
||||
return s.listIssues(u, opt)
|
||||
return s.listIssues(ctx, u, opt)
|
||||
}
|
||||
|
||||
func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
func (s *IssuesService) listIssues(ctx context.Context, u string, opt *IssueListOptions) ([]*Issue, *Response, error) {
|
||||
u, err := addOptions(u, opt)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -142,7 +143,7 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, *
|
||||
req.Header.Set("Accept", mediaTypeReactionsPreview)
|
||||
|
||||
var issues []*Issue
|
||||
resp, err := s.client.Do(req, &issues)
|
||||
resp, err := s.client.Do(ctx, req, &issues)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
@@ -192,8 +193,8 @@ 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) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#list-issues-for-a-repository
|
||||
func (s *IssuesService) ListByRepo(ctx context.Context, 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 {
|
||||
@@ -209,7 +210,7 @@ func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRe
|
||||
req.Header.Set("Accept", mediaTypeReactionsPreview)
|
||||
|
||||
var issues []*Issue
|
||||
resp, err := s.client.Do(req, &issues)
|
||||
resp, err := s.client.Do(ctx, req, &issues)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
@@ -219,8 +220,8 @@ func (s *IssuesService) ListByRepo(owner string, repo string, opt *IssueListByRe
|
||||
|
||||
// Get a single issue.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/#get-a-single-issue
|
||||
func (s *IssuesService) Get(owner string, repo string, number int) (*Issue, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#get-a-single-issue
|
||||
func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
@@ -231,7 +232,7 @@ func (s *IssuesService) Get(owner string, repo string, number int) (*Issue, *Res
|
||||
req.Header.Set("Accept", mediaTypeReactionsPreview)
|
||||
|
||||
issue := new(Issue)
|
||||
resp, err := s.client.Do(req, issue)
|
||||
resp, err := s.client.Do(ctx, req, issue)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
@@ -241,8 +242,8 @@ func (s *IssuesService) Get(owner string, repo string, number int) (*Issue, *Res
|
||||
|
||||
// Create a new issue on the specified repository.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/#create-an-issue
|
||||
func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#create-an-issue
|
||||
func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/issues", owner, repo)
|
||||
req, err := s.client.NewRequest("POST", u, issue)
|
||||
if err != nil {
|
||||
@@ -250,7 +251,7 @@ func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) (
|
||||
}
|
||||
|
||||
i := new(Issue)
|
||||
resp, err := s.client.Do(req, i)
|
||||
resp, err := s.client.Do(ctx, req, i)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
@@ -260,8 +261,8 @@ func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) (
|
||||
|
||||
// Edit an issue.
|
||||
//
|
||||
// GitHub API docs: http://developer.github.com/v3/issues/#edit-an-issue
|
||||
func (s *IssuesService) Edit(owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) {
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#edit-an-issue
|
||||
func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number)
|
||||
req, err := s.client.NewRequest("PATCH", u, issue)
|
||||
if err != nil {
|
||||
@@ -269,7 +270,7 @@ func (s *IssuesService) Edit(owner string, repo string, number int, issue *Issue
|
||||
}
|
||||
|
||||
i := new(Issue)
|
||||
resp, err := s.client.Do(req, i)
|
||||
resp, err := s.client.Do(ctx, req, i)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
@@ -280,25 +281,25 @@ func (s *IssuesService) Edit(owner string, repo string, number int, issue *Issue
|
||||
// Lock an issue's conversation.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#lock-an-issue
|
||||
func (s *IssuesService) Lock(owner string, repo string, number int) (*Response, error) {
|
||||
func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number)
|
||||
req, err := s.client.NewRequest("PUT", u, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
// Unlock an issue's conversation.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/issues/#unlock-an-issue
|
||||
func (s *IssuesService) Unlock(owner string, repo string, number int) (*Response, error) {
|
||||
func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number)
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.client.Do(req, nil)
|
||||
return s.client.Do(ctx, req, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user