Skip to content

Commit

Permalink
Support pagination for listing group hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
timofurrer committed Aug 19, 2022
1 parent 1be04ff commit 4ddb5b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions group_hooks.go
Expand Up @@ -47,17 +47,22 @@ type GroupHook struct {
CreatedAt *time.Time `json:"created_at"`
}

// ListGroupHooksOptions represents the available ListGroupHooks() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#list-group-hooks
type ListGroupHooksOptions ListOptions

// ListGroupHooks gets a list of group hooks.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#list-group-hooks
func (s *GroupsService) ListGroupHooks(gid interface{}, options ...RequestOptionFunc) ([]*GroupHook, *Response, error) {
func (s *GroupsService) ListGroupHooks(gid interface{}, opt *ListGroupHooksOptions, options ...RequestOptionFunc) ([]*GroupHook, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/hooks", PathEscape(group))

req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 4ddb5b2

Please sign in to comment.