Commit ce81b13b authored by Thomas Oster's avatar Thomas Oster Committed by Greg Messner
Browse files

Add Group Issue API support (#452)

parent a6b0b431
...@@ -265,6 +265,40 @@ public class IssuesApi extends AbstractApi implements Constants { ...@@ -265,6 +265,40 @@ public class IssuesApi extends AbstractApi implements Constants {
return (getIssues(filter, getDefaultPerPage()).stream()); return (getIssues(filter, getDefaultPerPage()).stream());
} }
/**
* Get a list of groups's issues.
*
* <pre><code>GitLab Endpoint: GET /groups/:id/issues</code></pre>
*
* @param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
* @param itemsPerPage the number of Project instances that will be fetched per page.
* @return the Pager of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public Pager<Issue> getGroupIssues(Object groupIdOrPath, IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "issues"));
}
/**
* Get a list of project's issues.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/issues</code></pre>
*
* @param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
* @param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
* @param page the page to get.
* @param perPage the number of projects per page.
* @return the list of issues in the specified range.
* @throws GitLabApiException if any exception occurs
*/
public List<Issue> getGroupIssues(Object groupIdOrPath, IssueFilter filter, int page, int perPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams(page, perPage);
Response response = get(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "issues");
return (response.readEntity(new GenericType<List<Issue>>() {}));
}
/** /**
* Get a single project issue. * Get a single project 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