@@ -663,6 +663,34 @@ public List<Contributor> getContributors(Object projectIdOrPath, int page, int p
663663 return (response .readEntity (new GenericType <List <Contributor >>() { }));
664664 }
665665
666+ /**
667+ * Get a list of contributors from a project and in the specified page range, sorted by specified param.
668+ *
669+ * <pre><code>GitLab Endpoint: GET /projects/:id/repository/contributors</code></pre>
670+ *
671+ * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
672+ * @param page the page to get
673+ * @param perPage the number of projects per page
674+ * @param orderBy (optional param) returns contributors ordered by NAME, EMAIL, or COMMITS. Default is COMMITS
675+ * @param sortOrder (optional param) returns contributors sorted in ASC or DESC order. Default is ASC
676+ * @return a List containing the contributors for the specified project ID
677+ * @throws GitLabApiException if any exception occurs
678+ */
679+ public List <Contributor > getContributors (Object projectIdOrPath , int page , int perPage , ContributorOrderBy orderBy , SortOrder sortOrder ) throws GitLabApiException {
680+ GitLabApiForm formData = new GitLabApiForm ().withParam (PAGE_PARAM , page ).withParam (PER_PAGE_PARAM , perPage );
681+ if (sortOrder != null ) {
682+ formData .withParam ("sort" , sortOrder , false );
683+ }
684+
685+ if (orderBy != null ) {
686+ formData .withParam ("order_by" , orderBy , false );
687+ }
688+
689+ Response response = get (Response .Status .OK , formData .asMap (),
690+ "projects" , getProjectIdOrPath (projectIdOrPath ), "repository" , "contributors" );
691+ return (response .readEntity (new GenericType <List <Contributor >>() { }));
692+ }
693+
666694 /**
667695 * Get a Pager of contributors from a project.
668696 *
0 commit comments