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:
28
vendor/github.com/google/go-github/github/repos_hooks.go
generated
vendored
28
vendor/github.com/google/go-github/github/repos_hooks.go
generated
vendored
@ -76,7 +76,7 @@ type Hook struct {
|
||||
Events []string `json:"events,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Config map[string]interface{} `json:"config,omitempty"`
|
||||
ID *int `json:"id,omitempty"`
|
||||
ID *int64 `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (h Hook) String() string {
|
||||
@ -130,21 +130,25 @@ func (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string,
|
||||
// GetHook returns a single specified Hook.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/hooks/#get-single-hook
|
||||
func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int) (*Hook, *Response, error) {
|
||||
func (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
hook := new(Hook)
|
||||
resp, err := s.client.Do(ctx, req, hook)
|
||||
return hook, resp, err
|
||||
h := new(Hook)
|
||||
resp, err := s.client.Do(ctx, req, h)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return h, resp, nil
|
||||
}
|
||||
|
||||
// EditHook updates a specified Hook.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/hooks/#edit-a-hook
|
||||
func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int, hook *Hook) (*Hook, *Response, error) {
|
||||
func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id)
|
||||
req, err := s.client.NewRequest("PATCH", u, hook)
|
||||
if err != nil {
|
||||
@ -152,13 +156,17 @@ func (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string,
|
||||
}
|
||||
h := new(Hook)
|
||||
resp, err := s.client.Do(ctx, req, h)
|
||||
return h, resp, err
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return h, resp, nil
|
||||
}
|
||||
|
||||
// DeleteHook deletes a specified Hook.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/hooks/#delete-a-hook
|
||||
func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int) (*Response, error) {
|
||||
func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/hooks/%d", owner, repo, id)
|
||||
req, err := s.client.NewRequest("DELETE", u, nil)
|
||||
if err != nil {
|
||||
@ -170,7 +178,7 @@ func (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string
|
||||
// PingHook triggers a 'ping' event to be sent to the Hook.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/hooks/#ping-a-hook
|
||||
func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int) (*Response, error) {
|
||||
func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/hooks/%d/pings", owner, repo, id)
|
||||
req, err := s.client.NewRequest("POST", u, nil)
|
||||
if err != nil {
|
||||
@ -182,7 +190,7 @@ func (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string,
|
||||
// TestHook triggers a test Hook by github.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/repos/hooks/#test-a-push-hook
|
||||
func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int) (*Response, error) {
|
||||
func (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/hooks/%d/tests", owner, repo, id)
|
||||
req, err := s.client.NewRequest("POST", u, nil)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user