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
3d855d1f
Commit
3d855d1f
authored
May 12, 2015
by
六幻
Browse files
add findUsers method.
parent
04a31e4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/UserApi.java
View file @
3d855d1f
...
@@ -62,6 +62,24 @@ public class UserApi extends AbstractApi {
...
@@ -62,6 +62,24 @@ public class UserApi extends AbstractApi {
return
(
response
.
getEntity
(
User
.
class
));
return
(
response
.
getEntity
(
User
.
class
));
}
}
// Search users by Email or username
// GET /users?search=:email_or_username
/**
* Search users by Email or username
*
* GET /users?search=:email_or_username
*
* @param emailOrUsername
* @return the User List with the email or username like emailOrUsername
* @throws GitLabApiException
*/
public
List
<
User
>
findUsers
(
String
emailOrUsername
)
throws
GitLabApiException
{
Form
formData
=
new
Form
();
addFormParam
(
formData
,
"search"
,
emailOrUsername
,
true
);
ClientResponse
response
=
get
(
ClientResponse
.
Status
.
OK
,
formData
,
"users"
);
return
(
response
.
getEntity
(
new
GenericType
<
List
<
User
>>()
{}));
}
/**
/**
* Creates a new user. Note only administrators can create new users.
* Creates a new user. Note only administrators can create new users.
...
...
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