diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index c431dec53..d6e4b2815 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -3972,6 +3972,44 @@ public List getBadges(Object projectIdOrPath, String bagdeName) throws Gi return (response.readEntity(new GenericType>() {})); } + /** + * Gets a pager of a project’s badges and its group badges. + * + *
GitLab Endpoint: GET /projects/:id/badges
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param itemsPerPage the number of Badge instances that will be fetched per page + * @return a pager of Badge instances for the specified project + * @throws GitLabApiException if any exception occurs + */ + public Pager getBadges(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { + return getBadges(projectIdOrPath, null, itemsPerPage); + } + + /** + * Gets a pager of a project’s badges and its group badges, case-sensitively filtered on bagdeName if non-null. + * + *
GitLab Endpoint: GET /projects/:id/badges?name=:name
+ * + * @param projectIdOrPath the project in the form of a Long(ID), String(path), or Project instance + * @param bagdeName The name to filter on (case-sensitive), ignored if null. + * @param itemsPerPage the number of Badge instances that will be fetched per page + * @return a pager of the GitLab item, case insensitively filtered on name. + * @throws GitLabApiException If any problem is encountered + */ + public Pager getBadges(Object projectIdOrPath, String bagdeName, int itemsPerPage) + throws GitLabApiException { + Form queryParam = new GitLabApiForm().withParam("name", bagdeName); + return new Pager( + this, + Badge.class, + itemsPerPage, + queryParam.asMap(), + "projects", + getProjectIdOrPath(projectIdOrPath), + "badges"); + } + /** * Gets a badge of a project. *