Skip to content

Commit 7cd9f26

Browse files
Xephigmessner
authored andcommitted
Add a way to get only one member of a group (#96)
1 parent 995c7aa commit 7cd9f26

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/org/gitlab4j/api/GroupApi.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,21 @@ public Pager<Member> getMembers(int groupId, int itemsPerPage) throws GitLabApiE
339339
return (new Pager<Member>(this, Member.class, itemsPerPage, null, "groups", groupId, "members"));
340340
}
341341

342+
/**
343+
* Get a group member viewable by the authenticated user.
344+
*
345+
* GET /groups/:id/members/:id
346+
*
347+
* @param groupId the group ID to get the member for
348+
* @param userId the member ID of the member to get
349+
* @return a member viewable by the authenticated user
350+
* @throws GitLabApiException if any exception occurs
351+
*/
352+
public Member getMember(int groupId, int userId) throws GitLabApiException {
353+
Response response = get(Response.Status.OK, getDefaultPerPageParam(), "groups", groupId, "members", userId);
354+
return (response.readEntity(new GenericType<Member>() {}));
355+
}
356+
342357
/**
343358
* Adds a user to the list of group members.
344359
*

0 commit comments

Comments
 (0)