Commit bbf3ee69 authored by Greg Messner's avatar Greg Messner Committed by GitHub
Browse files

Merge pull request #21 from matteofacchinetti/master

Added getIssues with page and per_page parameters
parents dadd2da0 65720abb
......@@ -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