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
fe5a7913
Commit
fe5a7913
authored
Mar 23, 2014
by
Greg Messner
Browse files
Added getUsers(int page, int perPage).
parent
6e06a2a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/UserApi.java
View file @
fe5a7913
...
@@ -15,18 +15,38 @@ public class UserApi extends AbstractApi {
...
@@ -15,18 +15,38 @@ public class UserApi extends AbstractApi {
/**
/**
* Get a list of users.
* Get a list of users.
Only returns the first page
*
*
* GET /users
* GET /users
*
*
* @return
* @return
* @throws GitLabApiException
* @throws GitLabApiException
*/
*/
public
List
<
User
>
get
Project
s
()
throws
GitLabApiException
{
public
List
<
User
>
get
User
s
()
throws
GitLabApiException
{
ClientResponse
response
=
get
(
ClientResponse
.
Status
.
OK
,
null
,
"users"
);
ClientResponse
response
=
get
(
ClientResponse
.
Status
.
OK
,
null
,
"users"
);
return
(
response
.
getEntity
(
new
GenericType
<
List
<
User
>>()
{}));
return
(
response
.
getEntity
(
new
GenericType
<
List
<
User
>>()
{}));
}
}
/**
* Get a list of users using the specified page and per page settings.
*
* GET /users
*
* @param page
* @param perPage
* @return
* @throws GitLabApiException
*/
public
List
<
User
>
getUsers
(
int
page
,
int
perPage
)
throws
GitLabApiException
{
Form
formData
=
new
Form
();
addFormParam
(
formData
,
"page"
,
page
,
false
);
addFormParam
(
formData
,
"per_page"
,
perPage
,
false
);
ClientResponse
response
=
get
(
ClientResponse
.
Status
.
OK
,
formData
,
"users"
);
return
(
response
.
getEntity
(
new
GenericType
<
List
<
User
>>()
{}));
}
/**
/**
* Get a single user.
* Get a single user.
...
...
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