|
13 | 13 | import org.gitlab4j.api.models.Group;
|
14 | 14 | import org.gitlab4j.api.models.Member;
|
15 | 15 | import org.gitlab4j.api.models.Project;
|
16 |
| -import org.gitlab4j.api.models.ProjectOfGroupFilter; |
| 16 | +import org.gitlab4j.api.models.GroupProjectsFilter; |
17 | 17 | import org.gitlab4j.api.models.Visibility;
|
18 | 18 |
|
19 | 19 | /**
|
@@ -226,19 +226,36 @@ public Pager<Group> getSubGroups(Integer groupId, List<Integer> skipGroups, Bool
|
226 | 226 | }
|
227 | 227 |
|
228 | 228 | /**
|
229 |
| - * Get a list of projects belonging to the specified group ID. |
| 229 | + * Get a list of projects belonging to the specified group ID and filter. |
230 | 230 | *
|
231 | 231 | * GET /groups/:id/projects
|
232 | 232 | *
|
233 | 233 | * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
|
234 |
| - * @param filter the ProjectOfGroupFilter instance holding the filter values for the query |
| 234 | + * @param filter the GroupProjectsFilter instance holding the filter values for the query |
| 235 | + * @return a List containing Project instances that belong to the group and match the provided filter |
235 | 236 | * @throws GitLabApiException if any exception occurs
|
236 | 237 | */
|
237 |
| - public List<Project> getProjects(Object groupIdOrPath, ProjectOfGroupFilter filter) throws GitLabApiException { |
238 |
| - GitLabApiForm formData = filter.getQueryParams(); |
239 |
| - Response response = get(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "projects"); |
240 |
| - return (response.readEntity(new GenericType<List<Project>>() {})); |
241 |
| - } |
| 238 | + public List<Project> getProjects(Object groupIdOrPath, GroupProjectsFilter filter) throws GitLabApiException { |
| 239 | + GitLabApiForm formData = filter.getQueryParams(); |
| 240 | + Response response = get(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "projects"); |
| 241 | + return (response.readEntity(new GenericType<List<Project>>() {})); |
| 242 | + } |
| 243 | + |
| 244 | + /** |
| 245 | + * Get a Pager of projects belonging to the specified group ID and filter. |
| 246 | + * |
| 247 | + * GET /groups/:id/projects |
| 248 | + * |
| 249 | + * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path |
| 250 | + * @param filter the GroupProjectsFilter instance holding the filter values for the query |
| 251 | + * @param itemsPerPage the number of Project instances that will be fetched per page |
| 252 | + * @return a Pager containing Project instances that belong to the group and match the provided filter |
| 253 | + * @throws GitLabApiException if any exception occurs |
| 254 | + */ |
| 255 | + public Pager<Project> getProjects(Object groupIdOrPath, GroupProjectsFilter filter, int itemsPerPage) throws GitLabApiException { |
| 256 | + GitLabApiForm formData = filter.getQueryParams(); |
| 257 | + return (new Pager<Project>(this, Project.class, itemsPerPage, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "projects")); |
| 258 | + } |
242 | 259 |
|
243 | 260 | /**
|
244 | 261 | * Get a list of projects belonging to the specified group ID.
|
|
0 commit comments