Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
7cd9f262
Commit
7cd9f262
authored
Nov 26, 2017
by
Alexandre Vanhecke
Committed by
Greg Messner
Nov 25, 2017
Browse files
Add a way to get only one member of a group (#96)
parent
995c7aac
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
7cd9f262
...
...
@@ -339,6 +339,21 @@ public class GroupApi extends AbstractApi {
return
(
new
Pager
<
Member
>(
this
,
Member
.
class
,
itemsPerPage
,
null
,
"groups"
,
groupId
,
"members"
));
}
/**
* Get a group member viewable by the authenticated user.
*
* GET /groups/:id/members/:id
*
* @param groupId the group ID to get the member for
* @param userId the member ID of the member to get
* @return a member viewable by the authenticated user
* @throws GitLabApiException if any exception occurs
*/
public
Member
getMember
(
int
groupId
,
int
userId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"groups"
,
groupId
,
"members"
,
userId
);
return
(
response
.
readEntity
(
new
GenericType
<
Member
>()
{}));
}
/**
* Adds a user to the list of group members.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment