Commit c451eb16 authored by Peter Mikula's avatar Peter Mikula Committed by Sander van Harmelen

add support for paging to ListGroupMembers (#115)

* add support for paging to ListGroupMembers

* making the ListGroupMembersOptions explicit
parent eeb802d2
......@@ -200,19 +200,28 @@ type GroupMember struct {
AccessLevel AccessLevelValue `json:"access_level"`
}
// ListGroupMembersOptions represents the available ListGroupMembers()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/groups.html#list-group-members
type ListGroupMembersOptions struct {
ListOptions
}
// ListGroupMembers get a list of group members viewable by the authenticated
// user.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/groups.html#list-group-members
func (s *GroupsService) ListGroupMembers(gid interface{}) ([]*GroupMember, *Response, error) {
func (s *GroupsService) ListGroupMembers(gid interface{}, opt *ListGroupMembersOptions) ([]*GroupMember, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/members", group)
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest("GET", u, opt)
if err != nil {
return nil, nil, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment