Commit 65720abb authored by Matteo Facchinetti's avatar Matteo Facchinetti
Browse files

Added getIssues with page and per_page parameters



getIssues() unless parameter returns only first page of issues.

Override this method with page and per_page parameters,
provides a way to read all issues page by page.

Signed-off-by: default avatarMatteo Facchinetti <matteo.facchinetti@sirius-es.it>
parent dadd2da0
......@@ -682,7 +682,7 @@ public class ProjectApi extends AbstractApi {
}
/**
* Get a list of project's issues.
* Get a list of project's issues. Only returns the first page
*
* GET /projects/:id/issues
*
......@@ -695,4 +695,24 @@ public class ProjectApi extends AbstractApi {
return (response.readEntity(new GenericType<List<Issue>>() {
}));
}
/**
* Get a list of project's issues using the specified page and per page settings.
*
* GET /projects/:id/issues
*
* @param page the page to get
* @param perPage the number of issues per page
* @return the list of issues in the specified range
* @throws GitLabApiException if any exception occurs
*/
public List<Issue> getIssues(Integer projectId, int page, int perPage) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("page", page, false)
.withParam("per_page", perPage, false);
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "issues");
return (response.readEntity(new GenericType<List<Issue>>() {
}));
}
}
Supports Markdown
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