@@ -479,14 +479,73 @@ public Stream<Project> getStarredProjectsStream() throws GitLabApiException {
479
479
return (getStarredProjects (getDefaultPerPage ()).stream ());
480
480
}
481
481
482
+ /**
483
+ * Get a list of all visible projects across GitLab for the authenticated user using the provided filter.
484
+ *
485
+ * <pre><code>GET /projects</code></pre>
486
+ *
487
+ * @param filter the ProjectFilter instance holding the filter values for the query
488
+ * @return a list of all visible projects across GitLab for the authenticated use
489
+ * @throws GitLabApiException if any exception occurs
490
+ */
491
+ public List <Project > getProjects (ProjectFilter filter ) throws GitLabApiException {
492
+ return (getProjects (filter , getDefaultPerPage ()).all ());
493
+ }
494
+
495
+ /**
496
+ * Get a list of all visible projects across GitLab for the authenticated user in the specified page range
497
+ * using the provided filter.
498
+ *
499
+ * <pre><code>GET /projects</code></pre>
500
+ *
501
+ * @param filter the ProjectFilter instance holding the filter values for the query
502
+ * @param page the page to get
503
+ * @param perPage the number of projects per page
504
+ * @return a list of all visible projects across GitLab for the authenticated use
505
+ * @throws GitLabApiException if any exception occurs
506
+ */
507
+ public List <Project > getProjects (ProjectFilter filter , int page , int perPage ) throws GitLabApiException {
508
+ GitLabApiForm formData = filter .getQueryParams (page , perPage );
509
+ Response response = get (Response .Status .OK , formData .asMap (), "projects" );
510
+ return (response .readEntity (new GenericType <List <Project >>() {}));
511
+ }
512
+
513
+ /**
514
+ * Get a Pager of all visible projects across GitLab for the authenticated user using the provided filter.
515
+ *
516
+ * <pre><code>GET /projects</code></pre>
517
+ *
518
+ * @param filter the ProjectFilter instance holding the filter values for the query
519
+ * @param itemsPerPage the number of Project instances that will be fetched per page
520
+ * @return a Pager of all visible projects across GitLab for the authenticated use
521
+ * @throws GitLabApiException if any exception occurs
522
+ */
523
+ public Pager <Project > getProjects (ProjectFilter filter , int itemsPerPage ) throws GitLabApiException {
524
+ GitLabApiForm formData = filter .getQueryParams ();
525
+ return (new Pager <Project >(this , Project .class , itemsPerPage , formData .asMap (), "projects" ));
526
+ }
527
+
528
+ /**
529
+ * Get a Stream of all visible projects across GitLab for the authenticated user using the provided filter.
530
+ *
531
+ * <pre><code>GET /projects</code></pre>
532
+ *
533
+ * @param filter the ProjectFilter instance holding the filter values for the query
534
+ * @return a Stream of all visible projects across GitLab for the authenticated use
535
+ * @throws GitLabApiException if any exception occurs
536
+ */
537
+ public Stream <Project > getProjectsStream (ProjectFilter filter ) throws GitLabApiException {
538
+ return (getProjects (filter , getDefaultPerPage ()).stream ());
539
+ }
540
+
482
541
/**
483
542
* Get a list of visible projects owned by the given user.
484
543
*
485
544
* <pre><code>GET /users/:user_id/projects</code></pre>
486
545
*
487
546
* @param userIdOrUsername the user ID, username of the user, or a User instance holding the user ID or username
488
547
* @param filter the ProjectFilter instance holding the filter values for the query
489
- * @return a list of visible projects owned by the given use
548
+ * @return a list of visible projects owned by the given user
490
549
* @throws GitLabApiException if any exception occurs
491
550
*/
492
551
public List <Project > getUserProjects (Object userIdOrUsername , ProjectFilter filter ) throws GitLabApiException {
@@ -502,7 +561,7 @@ public List<Project> getUserProjects(Object userIdOrUsername, ProjectFilter filt
502
561
* @param filter the ProjectFilter instance holding the filter values for the query
503
562
* @param page the page to get
504
563
* @param perPage the number of projects per page
505
- * @return a list of visible projects owned by the given use
564
+ * @return a list of visible projects owned by the given user
506
565
* @throws GitLabApiException if any exception occurs
507
566
*/
508
567
public List <Project > getUserProjects (Object userIdOrUsername , ProjectFilter filter , int page , int perPage ) throws GitLabApiException {
@@ -520,7 +579,7 @@ public List<Project> getUserProjects(Object userIdOrUsername, ProjectFilter filt
520
579
* @param userIdOrUsername the user ID, username of the user, or a User instance holding the user ID or username
521
580
* @param filter the ProjectFilter instance holding the filter values for the query
522
581
* @param itemsPerPage the number of Project instances that will be fetched per page
523
- * @return a Pager of visible projects owned by the given use
582
+ * @return a Pager of visible projects owned by the given user
524
583
* @throws GitLabApiException if any exception occurs
525
584
*/
526
585
public Pager <Project > getUserProjects (Object userIdOrUsername , ProjectFilter filter , int itemsPerPage ) throws GitLabApiException {
@@ -536,7 +595,7 @@ public Pager<Project> getUserProjects(Object userIdOrUsername, ProjectFilter fil
536
595
*
537
596
* @param userIdOrUsername the user ID, username of the user, or a User instance holding the user ID or username
538
597
* @param filter the ProjectFilter instance holding the filter values for the query
539
- * @return a Stream of visible projects owned by the given use
598
+ * @return a Stream of visible projects owned by the given user
540
599
* @throws GitLabApiException if any exception occurs
541
600
*/
542
601
public Stream <Project > getUserProjectsStream (Object userIdOrUsername , ProjectFilter filter ) throws GitLabApiException {
0 commit comments