aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xanzy/go-gitlab/system_hooks.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-19 22:23:05 +0200
committerGitHub <noreply@github.com>2020-04-19 21:23:05 +0100
commit82dbb34c9c2d0efa8eeb8df845ee3e283024b1d6 (patch)
tree45f81306d304a30be114187b72bdfd3e1be18e6e /vendor/github.com/xanzy/go-gitlab/system_hooks.go
parent5c092eb0ef9347e88db59618902781e099880196 (diff)
downloadgitea-82dbb34c9c2d0efa8eeb8df845ee3e283024b1d6.tar.gz
gitea-82dbb34c9c2d0efa8eeb8df845ee3e283024b1d6.zip
Vendor Update: go-gitlab v0.22.1 -> v0.31.0 (#11136)
* vendor update: go-gitlab to v0.31.0 * migrate client init to v0.31.0 * refactor
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/system_hooks.go')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/system_hooks.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/system_hooks.go b/vendor/github.com/xanzy/go-gitlab/system_hooks.go
index d5209d4f76..041264e952 100644
--- a/vendor/github.com/xanzy/go-gitlab/system_hooks.go
+++ b/vendor/github.com/xanzy/go-gitlab/system_hooks.go
@@ -46,7 +46,7 @@ func (h Hook) String() string {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/system_hooks.html#list-system-hooks
-func (s *SystemHooksService) ListHooks(options ...OptionFunc) ([]*Hook, *Response, error) {
+func (s *SystemHooksService) ListHooks(options ...RequestOptionFunc) ([]*Hook, *Response, error) {
req, err := s.client.NewRequest("GET", "hooks", nil, options)
if err != nil {
return nil, nil, err
@@ -66,14 +66,20 @@ func (s *SystemHooksService) ListHooks(options ...OptionFunc) ([]*Hook, *Respons
// GitLab API docs:
// https://docs.gitlab.com/ce/api/system_hooks.html#add-new-system-hook-hook
type AddHookOptions struct {
- URL *string `url:"url,omitempty" json:"url,omitempty"`
+ URL *string `url:"url,omitempty" json:"url,omitempty"`
+ Token *string `url:"token,omitempty" json:"token,omitempty"`
+ PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
+ TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
+ MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
+ RepositoryUpdateEvents *bool `url:"repository_update_events,omitempty" json:"repository_update_events,omitempty"`
+ EnableSSLVerification *bool `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
}
// AddHook adds a new system hook hook.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/system_hooks.html#add-new-system-hook-hook
-func (s *SystemHooksService) AddHook(opt *AddHookOptions, options ...OptionFunc) (*Hook, *Response, error) {
+func (s *SystemHooksService) AddHook(opt *AddHookOptions, options ...RequestOptionFunc) (*Hook, *Response, error) {
req, err := s.client.NewRequest("POST", "hooks", opt, options)
if err != nil {
return nil, nil, err
@@ -108,7 +114,7 @@ func (h HookEvent) String() string {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/system_hooks.html#test-system-hook
-func (s *SystemHooksService) TestHook(hook int, options ...OptionFunc) (*HookEvent, *Response, error) {
+func (s *SystemHooksService) TestHook(hook int, options ...RequestOptionFunc) (*HookEvent, *Response, error) {
u := fmt.Sprintf("hooks/%d", hook)
req, err := s.client.NewRequest("GET", u, nil, options)
@@ -131,7 +137,7 @@ func (s *SystemHooksService) TestHook(hook int, options ...OptionFunc) (*HookEve
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/system_hooks.html#delete-system-hook
-func (s *SystemHooksService) DeleteHook(hook int, options ...OptionFunc) (*Response, error) {
+func (s *SystemHooksService) DeleteHook(hook int, options ...RequestOptionFunc) (*Response, error) {
u := fmt.Sprintf("hooks/%d", hook)
req, err := s.client.NewRequest("DELETE", u, nil, options)