Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
9f32ecb9
Commit
9f32ecb9
authored
7 years ago
by
Greg Messner
Browse files
Options
Download
Email Patches
Plain Diff
Added getForks() methods that return List.
parent
639ca5a5
main
5.0.x
5.0.x.jdk17
6.x
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/gitlab4j/api/ProjectApi.java
+31
-2
src/main/java/org/gitlab4j/api/ProjectApi.java
with
31 additions
and
2 deletions
+31
-2
src/main/java/org/gitlab4j/api/ProjectApi.java
+
31
-
2
View file @
9f32ecb9
...
...
@@ -2054,13 +2054,42 @@ public class ProjectApi extends AbstractApi implements Constants {
delete
(
Response
.
Status
.
OK
,
null
,
"projects"
,
projectId
,
"push_rule"
);
}
/**
* Get a
Pager
of projects that were forked from the specified project.
* Get a
list
of projects that were forked from the specified project.
*
* GET /projects/:id/forks
*
* @param projectId the ID of the project
* @return a List of forked projects
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getForks
(
Integer
projectId
)
throws
GitLabApiException
{
return
(
getForks
(
projectId
,
1
,
getDefaultPerPage
()));
}
/**
* Get a list of projects that were forked from the specified project and in the specified page range.
*
* GET /projects/:id/forks
*
* @param projectId the ID of the project
* @param page the page to get
* @param perPage the number of projects per page
* @return a List of forked projects
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getForks
(
Integer
projectId
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
page
,
perPage
),
"projects"
,
projectId
,
"forks"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Project
>>()
{
}));
}
/**
* Get a Pager of projects that were forked from the specified project.
*
* GET /projects/:id/forks
*
* @param projectId the ID of the project
* @param itemsPerPage the number of Project instances that will be fetched per page
* @return a Pager of projects
* @throws GitLabApiException if any exception occurs
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets