2121
2222/**
2323 * This class implements the client side API for the GitLab groups calls.
24+ * @see <a href="https://docs.gitlab.com/ce/api/groups.html">Groups API at GitLab</a>
25+ * @see <a href="https://docs.gitlab.com/ee/api/members.html">Group and project members API at GitLab</a>
2426 */
2527public class GroupApi extends AbstractApi {
2628
@@ -729,7 +731,8 @@ public Stream<Member> getMembersStream(Object groupIdOrPath) throws GitLabApiExc
729731 * @throws GitLabApiException if any exception occurs
730732 */
731733 public Member getMember (Object groupIdOrPath , int userId ) throws GitLabApiException {
732- Response response = get (Response .Status .OK , getDefaultPerPageParam (), "groups" , getGroupIdOrPath (groupIdOrPath ), "members" , userId );
734+ Response response = get (Response .Status .OK , getDefaultPerPageParam (),
735+ "groups" , getGroupIdOrPath (groupIdOrPath ), "members" , userId );
733736 return (response .readEntity (new GenericType <Member >() {}));
734737 }
735738
@@ -750,6 +753,75 @@ public Optional<Member> getOptionalMember(Object groupIdOrPath, int userId) {
750753 }
751754 }
752755
756+ /**
757+ * Gets a list of group members viewable by the authenticated user, including inherited members
758+ * through ancestor groups. Returns multiple times the same user (with different member attributes)
759+ * when the user is a member of the group and of one or more ancestor group.
760+ *
761+ * <pre><code>GitLab Endpoint: GET /groups/:id/members/all</code></pre>
762+ *
763+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
764+ * @return a list of group members viewable by the authenticated user, including inherited members
765+ * through ancestor groups
766+ * @throws GitLabApiException if any exception occurs
767+ */
768+ public List <Member > getAllMembers (Object groupIdOrPath ) throws GitLabApiException {
769+ return (getAllMembers (groupIdOrPath , getDefaultPerPage ()).all ());
770+ }
771+
772+ /**
773+ * Gets a list of group members viewable by the authenticated user, including inherited members
774+ * through ancestor groups. Returns multiple times the same user (with different member attributes)
775+ * when the user is a member of the group and of one or more ancestor group.
776+ *
777+ * <pre><code>GitLab Endpoint: GET /groups/:id/members/all</code></pre>
778+ *
779+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
780+ * @param page the page to get
781+ * @param perPage the number of Member instances per page
782+ * @return a list of group members viewable by the authenticated user, including inherited members
783+ * through ancestor groups in the specified page range
784+ * @throws GitLabApiException if any exception occurs
785+ */
786+ public List <Member > getAllMembers (Object groupIdOrPath , int page , int perPage ) throws GitLabApiException {
787+ Response response = get (Response .Status .OK , getPageQueryParams (page , perPage ),
788+ "groups" , getGroupIdOrPath (groupIdOrPath ), "members" , "all" );
789+ return (response .readEntity (new GenericType <List <Member >>() {}));
790+ }
791+
792+ /**
793+ * Gets a Pager of group members viewable by the authenticated user, including inherited members
794+ * through ancestor groups. Returns multiple times the same user (with different member attributes)
795+ * when the user is a member of the group and of one or more ancestor group.
796+ *
797+ * <pre><code>GitLab Endpoint: GET /groups/:id/members/all</code></pre>
798+ *
799+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
800+ * @param itemsPerPage the number of Member instances that will be fetched per page
801+ * @return a Pager of group members viewable by the authenticated user, including inherited members
802+ * through ancestor groups
803+ * @throws GitLabApiException if any exception occurs
804+ */
805+ public Pager <Member > getAllMembers (Object groupIdOrPath , int itemsPerPage ) throws GitLabApiException {
806+ return (new Pager <Member >(this , Member .class , itemsPerPage , null , "groups" , getGroupIdOrPath (groupIdOrPath ), "members" , "all" ));
807+ }
808+
809+ /**
810+ * Gets a Stream of group members viewable by the authenticated user, including inherited members
811+ * through ancestor groups. Returns multiple times the same user (with different member attributes)
812+ * when the user is a member of the group and of one or more ancestor group.
813+ *
814+ * <pre><code>GitLab Endpoint: GET /groups/:id/members/all</code></pre>
815+ *
816+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
817+ * @return a Stream of group members viewable by the authenticated user, including inherited members
818+ * through ancestor groups
819+ * @throws GitLabApiException if any exception occurs
820+ */
821+ public Stream <Member > getAllMembersStream (Object groupIdOrPath ) throws GitLabApiException {
822+ return (getAllMembers (groupIdOrPath , getDefaultPerPage ()).stream ());
823+ }
824+
753825 /**
754826 * Adds a user to the list of group members.
755827 *
0 commit comments