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
f16e0e19
Commit
f16e0e19
authored
8 years ago
by
Greg Messner
Browse files
Options
Download
Email Patches
Plain Diff
Added getProjects(int page, int perPage).
parent
97962d8e
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
+19
-0
src/main/java/org/gitlab4j/api/ProjectApi.java
with
19 additions
and
0 deletions
+19
-0
src/main/java/org/gitlab4j/api/ProjectApi.java
+
19
-
0
View file @
f16e0e19
...
@@ -40,6 +40,25 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -40,6 +40,25 @@ public class ProjectApi extends AbstractApi implements Constants {
}));
}));
}
}
/**
* Get a list of projects accessible by the authenticated user and in the specified page range.
*
* GET /projects
*
* @param page the page to get
* @param perPage the number of projects per page
* @return a list of projects accessible by the authenticated user
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getProjects
(
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"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Project
>>()
{
}));
}
/**
/**
* Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.
* Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.
* All filter parameters are optional.
* All filter parameters are optional.
...
...
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