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
fa84f306
Commit
fa84f306
authored
Nov 07, 2018
by
Greg Messner
Browse files
Added getProject() that returns a Pager.
parent
714d4a87
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
fa84f306
...
...
@@ -13,7 +13,7 @@ import org.gitlab4j.api.models.AccessLevel;
import
org.gitlab4j.api.models.Group
;
import
org.gitlab4j.api.models.Member
;
import
org.gitlab4j.api.models.Project
;
import
org.gitlab4j.api.models.Project
OfGroup
Filter
;
import
org.gitlab4j.api.models.
Group
Project
s
Filter
;
import
org.gitlab4j.api.models.Visibility
;
/**
...
...
@@ -226,19 +226,36 @@ public class GroupApi extends AbstractApi {
}
/**
* Get a list of projects belonging to the specified group ID.
* Get a list of projects belonging to the specified group ID
and filter
.
*
* GET /groups/:id/projects
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @param filter the ProjectOfGroupFilter instance holding the filter values for the query
* @param filter the GroupProjectsFilter instance holding the filter values for the query
* @return a List containing Project instances that belong to the group and match the provided filter
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getProjects
(
Object
groupIdOrPath
,
ProjectOfGroupFilter
filter
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
();
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"projects"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Project
>>()
{}));
}
public
List
<
Project
>
getProjects
(
Object
groupIdOrPath
,
GroupProjectsFilter
filter
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
();
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"projects"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Project
>>()
{}));
}
/**
* Get a Pager of projects belonging to the specified group ID and filter.
*
* GET /groups/:id/projects
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @param filter the GroupProjectsFilter instance holding the filter values for the query
* @param itemsPerPage the number of Project instances that will be fetched per page
* @return a Pager containing Project instances that belong to the group and match the provided filter
* @throws GitLabApiException if any exception occurs
*/
public
Pager
<
Project
>
getProjects
(
Object
groupIdOrPath
,
GroupProjectsFilter
filter
,
int
itemsPerPage
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
();
return
(
new
Pager
<
Project
>(
this
,
Project
.
class
,
itemsPerPage
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"projects"
));
}
/**
* Get a list of projects belonging to the specified group ID.
...
...
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