Class GroupApi

    • Constructor Detail

      • GroupApi

        public GroupApi​(GitLabApi gitLabApi)
    • Method Detail

      • getGroups

        public List<Group> getGroups()
                              throws GitLabApiException
        Get a list of groups. (As user: my groups, as admin: all groups)
        GitLab Endpoint: GET /groups
        Returns:
        the list of groups viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public List<Group> getGroups​(int page,
                                     int perPage)
                              throws GitLabApiException
        Get a list of groups (As user: my groups, as admin: all groups) and in the specified page range.
        GitLab Endpoint: GET /groups
        Parameters:
        page - the page to get
        perPage - the number of Group instances per page
        Returns:
        the list of groups viewable by the authenticated userin the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public Pager<Group> getGroups​(int itemsPerPage)
                               throws GitLabApiException
        Get a Pager of groups. (As user: my groups, as admin: all groups)
        GitLab Endpoint: GET /groups
        Parameters:
        itemsPerPage - the number of Group instances that will be fetched per page
        Returns:
        the list of groups viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupsStream

        public Stream<Group> getGroupsStream()
                                      throws GitLabApiException
        Get a Stream of groups. (As user: my groups, as admin: all groups)
        GitLab Endpoint: GET /groups
        Returns:
        a Stream of groups viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public List<Group> getGroups​(String search)
                              throws GitLabApiException
        Get all groups that match your string in their name or path.
        Parameters:
        search - the group name or path search criteria
        Returns:
        a List containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public List<Group> getGroups​(String search,
                                     int page,
                                     int perPage)
                              throws GitLabApiException
        Get all groups that match your string in their name or path.
        Parameters:
        search - the group name or path search criteria
        page - the page to get
        perPage - the number of Group instances per page
        Returns:
        a List containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public Pager<Group> getGroups​(String search,
                                      int itemsPerPage)
                               throws GitLabApiException
        Get all groups that match your string in their name or path.
        Parameters:
        search - the group name or path search criteria
        itemsPerPage - the number of Group instances that will be fetched per page
        Returns:
        a Pager containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupsStream

        public Stream<Group> getGroupsStream​(String search)
                                      throws GitLabApiException
        Get all groups that match your string in their name or path as a Stream.
        Parameters:
        search - the group name or path search criteria
        Returns:
        a Stream containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public List<Group> getGroups​(GroupFilter filter)
                              throws GitLabApiException
        Get a list of visible groups for the authenticated user using the provided filter.
        GitLab Endpoint: GET /groups
        Parameters:
        filter - the GroupFilter to match against
        Returns:
        a List<Group> of the matching groups
        Throws:
        GitLabApiException - if any exception occurs
      • getGroups

        public Pager<Group> getGroups​(GroupFilter filter,
                                      int itemsPerPage)
                               throws GitLabApiException
        Get a Pager of visible groups for the authenticated user using the provided filter.
        GitLab Endpoint: GET /groups
        Parameters:
        filter - the GroupFilter to match against
        itemsPerPage - the number of Group instances that will be fetched per page
        Returns:
        a Pager containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupsStream

        public Stream<Group> getGroupsStream​(GroupFilter filter)
                                      throws GitLabApiException
        Get a Stream of visible groups for the authenticated user using the provided filter.
        GitLab Endpoint: GET /groups
        Parameters:
        filter - the GroupFilter to match against
        Returns:
        a Stream<Group> of the matching groups
        Throws:
        GitLabApiException - if any exception occurs
      • getSubGroups

        public List<Group> getSubGroups​(Object groupIdOrPath)
                                 throws GitLabApiException
        Get a list of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        Returns:
        a List<Group> containing the group's sub-groups
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroups

        public Pager<Group> getSubGroups​(Object groupIdOrPath,
                                         int itemsPerPage)
                                  throws GitLabApiException
        Get a Pager of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        itemsPerPage - the number of Group instances that will be fetched per page
        Returns:
        a Pager containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroupsStream

        public Stream<Group> getSubGroupsStream​(Object groupIdOrPath)
                                         throws GitLabApiException
        Get a Stream of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        Returns:
        a Stream<Group> containing the group's sub-groups
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroups

        public List<Group> getSubGroups​(Object groupIdOrPath,
                                        List<Integer> skipGroups,
                                        Boolean allAvailable,
                                        String search,
                                        Constants.GroupOrderBy orderBy,
                                        Constants.SortOrder sortOrder,
                                        Boolean statistics,
                                        Boolean owned)
                                 throws GitLabApiException
        Get a list of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        skipGroups - skip the group IDs passed
        allAvailable - show all the groups you have access to (defaults to false for authenticated users)
        search - return the list of authorized groups matching the search criteria
        orderBy - order groups by NAME or PATH. Default is NAME
        sortOrder - order groups in ASC or DESC order. Default is ASC
        statistics - include group statistics (admins only)
        owned - limit to groups owned by the current user
        Returns:
        a List<Group> of the matching subgroups
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroups

        public List<Group> getSubGroups​(Object groupIdOrPath,
                                        List<Integer> skipGroups,
                                        Boolean allAvailable,
                                        String search,
                                        Constants.GroupOrderBy orderBy,
                                        Constants.SortOrder sortOrder,
                                        Boolean statistics,
                                        Boolean owned,
                                        int page,
                                        int perPage)
                                 throws GitLabApiException
        Get a list of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        skipGroups - skip the group IDs passed
        allAvailable - show all the groups you have access to (defaults to false for authenticated users)
        search - return the list of authorized groups matching the search criteria
        orderBy - order groups by NAME or PATH. Default is NAME
        sortOrder - order groups in ASC or DESC order. Default is ASC
        statistics - include group statistics (admins only)
        owned - limit to groups owned by the current user
        page - the page to get
        perPage - the number of Group instances per page
        Returns:
        a List<Group> of the matching subgroups
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroups

        public Pager<Group> getSubGroups​(Object groupIdOrPath,
                                         List<Integer> skipGroups,
                                         Boolean allAvailable,
                                         String search,
                                         Constants.GroupOrderBy orderBy,
                                         Constants.SortOrder sortOrder,
                                         Boolean statistics,
                                         Boolean owned,
                                         int itemsPerPage)
                                  throws GitLabApiException
        Get a Pager of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        skipGroups - skip the group IDs passed
        allAvailable - show all the groups you have access to (defaults to false for authenticated users)
        search - return the list of authorized groups matching the search criteria
        orderBy - order groups by NAME or PATH. Default is NAME
        sortOrder - order groups in ASC or DESC order. Default is ASC
        statistics - include group statistics (admins only)
        owned - limit to groups owned by the current user
        itemsPerPage - the number of Group instances that will be fetched per page
        Returns:
        a Pager containing matching Group instances
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getSubGroupsStream

        public Stream<Group> getSubGroupsStream​(Object groupIdOrPath,
                                                List<Integer> skipGroups,
                                                Boolean allAvailable,
                                                String search,
                                                Constants.GroupOrderBy orderBy,
                                                Constants.SortOrder sortOrder,
                                                Boolean statistics,
                                                Boolean owned)
                                         throws GitLabApiException
        Get a Stream of visible direct subgroups in this group.
        GitLab Endpoint: GET /groups/:id/subgroups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        skipGroups - skip the group IDs passed
        allAvailable - show all the groups you have access to (defaults to false for authenticated users)
        search - return the list of authorized groups matching the search criteria
        orderBy - order groups by NAME or PATH. Default is NAME
        sortOrder - order groups in ASC or DESC order. Default is ASC
        statistics - include group statistics (admins only)
        owned - limit to groups owned by the current user
        Returns:
        a Stream<Group> of the matching subgroups
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.3.0
      • getProjects

        public List<Project> getProjects​(Object groupIdOrPath,
                                         GroupProjectsFilter filter)
                                  throws GitLabApiException
        Get a list of projects belonging to the specified group ID and filter.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        filter - the GroupProjectsFilter instance holding the filter values for the query
        Returns:
        a List containing Project instances that belong to the group and match the provided filter
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public Pager<Project> getProjects​(Object groupIdOrPath,
                                          GroupProjectsFilter filter,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager of projects belonging to the specified group ID and filter.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        filter - the GroupProjectsFilter instance holding the filter values for the query
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager containing Project instances that belong to the group and match the provided filter
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectsStream

        public Stream<Project> getProjectsStream​(Object groupIdOrPath,
                                                 GroupProjectsFilter filter)
                                          throws GitLabApiException
        Get a Stream of projects belonging to the specified group ID and filter.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        filter - the GroupProjectsFilter instance holding the filter values for the query
        Returns:
        a Stream containing Project instances that belong to the group and match the provided filter
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(Object groupIdOrPath)
                                  throws GitLabApiException
        Get a list of projects belonging to the specified group ID.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a list of projects belonging to the specified group ID
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(Object groupIdOrPath,
                                         int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of projects belonging to the specified group ID in the specified page range.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        page - the page to get
        perPage - the number of Project instances per page
        Returns:
        a list of projects belonging to the specified group ID in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public Pager<Project> getProjects​(Object groupIdOrPath,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager of projects belonging to the specified group ID.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of projects belonging to the specified group ID
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectsStream

        public Stream<Project> getProjectsStream​(Object groupIdOrPath)
                                          throws GitLabApiException
        Get a Stream of projects belonging to the specified group ID.
        GitLab Endpoint: GET /groups/:id/projects
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a Stream of projects belonging to the specified group ID
        Throws:
        GitLabApiException - if any exception occurs
      • getGroup

        public Group getGroup​(Object groupIdOrPath)
                       throws GitLabApiException
        Get all details of a group.
        GitLab Endpoint: GET /groups/:id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        the Group instance for the specified group path
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalGroup

        public Optional<Group> getOptionalGroup​(Object groupIdOrPath)
        Get all details of a group as an Optional instance.
        GitLab Endpoint: GET /groups/:id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        the Group for the specified group path as an Optional instance
      • addGroup

        public Group addGroup​(String name,
                              String path)
                       throws GitLabApiException
        Creates a new project group. Available only for users who can create groups.
        GitLab Endpoint: POST /groups
        Parameters:
        name - the name of the group to add
        path - the path for the group
        Returns:
        the created Group instance
        Throws:
        GitLabApiException - if any exception occurs
      • addGroup

        public Group addGroup​(String name,
                              String path,
                              String description,
                              Visibility visibility,
                              Boolean lfsEnabled,
                              Boolean requestAccessEnabled,
                              Integer parentId)
                       throws GitLabApiException
        Creates a new project group. Available only for users who can create groups.
        GitLab Endpoint: POST /groups
        Parameters:
        name - the name of the group to add
        path - the path for the group
        description - (optional) - The group's description
        visibility - (optional) - The group's visibility. Can be private, internal, or public.
        lfsEnabled - (optional) - Enable/disable Large File Storage (LFS) for the projects in this group
        requestAccessEnabled - (optional) - Allow users to request member access
        parentId - (optional) - The parent group id for creating nested group
        Returns:
        the created Group instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateGroup

        public Group updateGroup​(Group group)
                          throws GitLabApiException
        Updates a project group. Available only for users who can create groups.
        GitLab Endpoint: PUT /groups
        Parameters:
        group - to update
        Returns:
        updated group instance
        Throws:
        GitLabApiException - at any exception
      • updateGroup

        public Group updateGroup​(Object groupIdOrPath,
                                 String name,
                                 String path,
                                 String description,
                                 Visibility visibility,
                                 Boolean lfsEnabled,
                                 Boolean requestAccessEnabled,
                                 Integer parentId)
                          throws GitLabApiException
        Updates a project group. Available only for users who can create groups.
        GitLab Endpoint: PUT /groups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        name - the name of the group to add
        path - the path for the group
        description - (optional) - The group's description
        visibility - (optional) - The group's visibility. Can be private, internal, or public.
        lfsEnabled - (optional) - Enable/disable Large File Storage (LFS) for the projects in this group
        requestAccessEnabled - (optional) - Allow users to request member access
        parentId - (optional) - The parent group id for creating nested group
        Returns:
        the updated Group instance
        Throws:
        GitLabApiException - if any exception occurs
      • addGroup

        public Group addGroup​(String name,
                              String path,
                              String description,
                              Boolean membershipLock,
                              Boolean shareWithGroupLock,
                              Visibility visibility,
                              Boolean lfsEnabled,
                              Boolean requestAccessEnabled,
                              Integer parentId,
                              Integer sharedRunnersMinutesLimit)
                       throws GitLabApiException
        Deprecated.
        Creates a new project group. Available only for users who can create groups.
        GitLab Endpoint: POST /groups
        Parameters:
        name - the name of the group to add
        path - the path for the group
        description - (optional) - The group's description
        membershipLock - (optional, boolean) - Prevent adding new members to project membership within this group
        shareWithGroupLock - (optional, boolean) - Prevent sharing a project with another group within this group
        visibility - (optional) - The group's visibility. Can be private, internal, or public.
        lfsEnabled - (optional) - Enable/disable Large File Storage (LFS) for the projects in this group
        requestAccessEnabled - (optional) - Allow users to request member access.
        parentId - (optional) - The parent group id for creating nested group.
        sharedRunnersMinutesLimit - (optional) - (admin-only) Pipeline minutes quota for this group
        Returns:
        the created Group instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateGroup

        public Group updateGroup​(Object groupIdOrPath,
                                 String name,
                                 String path,
                                 String description,
                                 Boolean membershipLock,
                                 Boolean shareWithGroupLock,
                                 Visibility visibility,
                                 Boolean lfsEnabled,
                                 Boolean requestAccessEnabled,
                                 Integer parentId,
                                 Integer sharedRunnersMinutesLimit)
                          throws GitLabApiException
        Deprecated.
        Updates a project group. Available only for users who can create groups.
        GitLab Endpoint: PUT /groups
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        name - the name of the group to add
        path - the path for the group
        description - (optional) - The group's description
        membershipLock - (optional, boolean) - Prevent adding new members to project membership within this group
        shareWithGroupLock - (optional, boolean) - Prevent sharing a project with another group within this group
        visibility - (optional) - The group's visibility. Can be private, internal, or public.
        lfsEnabled - (optional) - Enable/disable Large File Storage (LFS) for the projects in this group
        requestAccessEnabled - (optional) - Allow users to request member access
        parentId - (optional) - The parent group id for creating nested group
        sharedRunnersMinutesLimit - (optional) - (admin-only) Pipeline minutes quota for this group
        Returns:
        the updated Group instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteGroup

        public void deleteGroup​(Object groupIdOrPath)
                         throws GitLabApiException
        Removes group with all projects inside.
        GitLab Endpoint: DELETE /groups/:id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public List<Member> getMembers​(Object groupIdOrPath)
                                throws GitLabApiException
        Get a list of group members viewable by the authenticated user.
        GitLab Endpoint: GET /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a list of group members viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public List<Member> getMembers​(Object groupIdOrPath,
                                       int page,
                                       int perPage)
                                throws GitLabApiException
        Get a list of group members viewable by the authenticated user in the specified page range.
        GitLab Endpoint: GET /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        page - the page to get
        perPage - the number of Member instances per page
        Returns:
        a list of group members viewable by the authenticated user in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public Pager<Member> getMembers​(Object groupIdOrPath,
                                        int itemsPerPage)
                                 throws GitLabApiException
        Get a Pager of group members viewable by the authenticated user.
        GitLab Endpoint: GET /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        itemsPerPage - the number of Member instances that will be fetched per page
        Returns:
        a list of group members viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getMembersStream

        public Stream<Member> getMembersStream​(Object groupIdOrPath)
                                        throws GitLabApiException
        Get a Stream of group members viewable by the authenticated user.
        GitLab Endpoint: GET /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a Stream of group members viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getMember

        public Member getMember​(Object groupIdOrPath,
                                int userId)
                         throws GitLabApiException
        Get a group member viewable by the authenticated user.
        GitLab Endpoint: GET /groups/:id/members/:id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the member ID of the member to get
        Returns:
        a member viewable by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalMember

        public Optional<Member> getOptionalMember​(Object groupIdOrPath,
                                                  int userId)
        Get a group member viewable by the authenticated user as an Optional instance.
        GitLab Endpoint: GET /groups/:id/members/:id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the member ID of the member to get
        Returns:
        a member viewable by the authenticated user as an Optional instance
      • getAllMembers

        public List<Member> getAllMembers​(Object groupIdOrPath)
                                   throws GitLabApiException
        Gets a list of group members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the group and of one or more ancestor group.
        GitLab Endpoint: GET /groups/:id/members/all
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a list of group members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembers

        public List<Member> getAllMembers​(Object groupIdOrPath,
                                          int page,
                                          int perPage)
                                   throws GitLabApiException
        Gets a list of group members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the group and of one or more ancestor group.
        GitLab Endpoint: GET /groups/:id/members/all
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        page - the page to get
        perPage - the number of Member instances per page
        Returns:
        a list of group members viewable by the authenticated user, including inherited members through ancestor groups in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembers

        public Pager<Member> getAllMembers​(Object groupIdOrPath,
                                           int itemsPerPage)
                                    throws GitLabApiException
        Gets a Pager of group members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the group and of one or more ancestor group.
        GitLab Endpoint: GET /groups/:id/members/all
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        itemsPerPage - the number of Member instances that will be fetched per page
        Returns:
        a Pager of group members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembersStream

        public Stream<Member> getAllMembersStream​(Object groupIdOrPath)
                                           throws GitLabApiException
        Gets a Stream of group members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the group and of one or more ancestor group.
        GitLab Endpoint: GET /groups/:id/members/all
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a Stream of group members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object groupIdOrPath,
                                Integer userId,
                                Integer accessLevel)
                         throws GitLabApiException
        Adds a user to the list of group members.
        GitLab Endpoint: POST /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        Returns:
        a Member instance for the added user
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object groupIdOrPath,
                                Integer userId,
                                AccessLevel accessLevel)
                         throws GitLabApiException
        Adds a user to the list of group members.
        GitLab Endpoint: POST /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        Returns:
        a Member instance for the added user
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object groupIdOrPath,
                                Integer userId,
                                AccessLevel accessLevel,
                                Date expiresAt)
                         throws GitLabApiException
        Adds a user to the list of group members.
        GitLab Endpoint: POST /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        a Member instance for the added user
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object groupIdOrPath,
                                Integer userId,
                                Integer accessLevel,
                                Date expiresAt)
                         throws GitLabApiException
        Adds a user to the list of group members.
        GitLab Endpoint: POST /groups/:id/members
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        a Member instance for the added user
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object groupIdOrPath,
                                   Integer userId,
                                   Integer accessLevel)
                            throws GitLabApiException
        Updates a member of a group.
        GitLab Endpoint: PUT /groups/:groupId/members/:userId
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object groupIdOrPath,
                                   Integer userId,
                                   AccessLevel accessLevel)
                            throws GitLabApiException
        Updates a member of a group.
        GitLab Endpoint: PUT /groups/:groupId/members/:userId
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object groupIdOrPath,
                                   Integer userId,
                                   AccessLevel accessLevel,
                                   Date expiresAt)
                            throws GitLabApiException
        Updates a member of a group.
        GitLab Endpoint: PUT /groups/:groupId/members/:userId
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object groupIdOrPath,
                                   Integer userId,
                                   Integer accessLevel,
                                   Date expiresAt)
                            throws GitLabApiException
        Updates a member of a group.
        GitLab Endpoint: PUT /groups/:groupId/members/:userId
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • removeMember

        public void removeMember​(Object groupIdOrPath,
                                 Integer userId)
                          throws GitLabApiException
        Removes member from the group.
        GitLab Endpoint: DELETE /groups/:id/members/:user_id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        userId - the user ID of the member to remove
        Throws:
        GitLabApiException - if any exception occurs
      • ldapSync

        public void ldapSync​(Object groupIdOrPath)
                      throws GitLabApiException
        Syncs the group with its linked LDAP group. Only available to group owners and administrators.
        GitLab Endpoint: POST /groups/:id/ldap_sync
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Throws:
        GitLabApiException - if any exception occurs
      • addLdapGroupLink

        public void addLdapGroupLink​(Object groupIdOrPath,
                                     String cn,
                                     AccessLevel groupAccess,
                                     String provider)
                              throws GitLabApiException
        Adds an LDAP group link.
        GitLab Endpoint: POST /groups/:id/ldap_group_links
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        cn - the CN of a LDAP group
        groupAccess - the minimum access level for members of the LDAP group
        provider - the LDAP provider for the LDAP group
        Throws:
        GitLabApiException - if any exception occurs
      • addLdapGroupLink

        public void addLdapGroupLink​(Object groupIdOrPath,
                                     String cn,
                                     Integer groupAccess,
                                     String provider)
                              throws GitLabApiException
        Adds an LDAP group link.
        GitLab Endpoint: POST /groups/:id/ldap_group_links
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        cn - the CN of a LDAP group
        groupAccess - the minimum access level for members of the LDAP group
        provider - the LDAP provider for the LDAP group
        Throws:
        GitLabApiException - if any exception occurs
      • deleteLdapGroupLink

        public void deleteLdapGroupLink​(Object groupIdOrPath,
                                        String cn)
                                 throws GitLabApiException
        Deletes an LDAP group link.
        GitLab Endpoint: DELETE /groups/:id/ldap_group_links/:cn
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        cn - the CN of the LDAP group link to delete
        Throws:
        GitLabApiException - if any exception occurs
      • deleteLdapGroupLink

        public void deleteLdapGroupLink​(Object groupIdOrPath,
                                        String cn,
                                        String provider)
                                 throws GitLabApiException
        Deletes an LDAP group link for a specific LDAP provider.
        GitLab Endpoint: DELETE /groups/:id/ldap_group_links/:provider/:cn
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        cn - the CN of the LDAP group link to delete
        provider - the name of the LDAP provider
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public List<Variable> getVariables​(Object groupIdOrPath)
                                    throws GitLabApiException
        Get list of a group’s variables.
        GitLab Endpoint: GET /groups/:id/variables
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a list of variables belonging to the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public List<Variable> getVariables​(Object groupIdOrPath,
                                           int page,
                                           int perPage)
                                    throws GitLabApiException
        Get a list of variables for the specified group in the specified page range.
        GitLab Endpoint: GET /groups/:id/variables
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        page - the page to get
        perPage - the number of Variable instances per page
        Returns:
        a list of variables belonging to the specified group in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public Pager<Variable> getVariables​(Object groupIdOrPath,
                                            int itemsPerPage)
                                     throws GitLabApiException
        Get a Pager of variables belonging to the specified group.
        GitLab Endpoint: GET /groups/:id/variables
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        itemsPerPage - the number of Variable instances that will be fetched per page
        Returns:
        a Pager of variables belonging to the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getVariablesStream

        public Stream<Variable> getVariablesStream​(Object groupIdOrPath)
                                            throws GitLabApiException
        Get a Stream of variables belonging to the specified group.
        GitLab Endpoint: GET /groups/:id/variables
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a Stream of variables belonging to the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getVariable

        public Variable getVariable​(Object groupIdOrPath,
                                    String key)
                             throws GitLabApiException
        Get the details of a group variable.
        GitLab Endpoint: GET /groups/:id/variables/:key
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        key - the key of an existing variable, required
        Returns:
        the Variable instance for the specified group variable
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalVariable

        public Optional<Variable> getOptionalVariable​(Object groupIdOrPath,
                                                      String key)
        Get the details of a group variable as an Optional instance.
        GitLab Endpoint: GET /groups/:id/variables/:key
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        key - the key of an existing variable, required
        Returns:
        the Variable for the specified group variable as an Optional instance
      • createVariable

        public Variable createVariable​(Object groupIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected)
                                throws GitLabApiException
        Create a new group variable.
        GitLab Endpoint: POST /groups/:id/variables
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        key - the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        Returns:
        a Variable instance with the newly created variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • updateVariable

        public Variable updateVariable​(Object groupIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected)
                                throws GitLabApiException
        Update a group variable.
        GitLab Endpoint: PUT /groups/:id/variables/:key
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        key - the key of an existing variable, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        Returns:
        a Variable instance with the updated variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • deleteVariable

        public void deleteVariable​(Object groupIdOrPath,
                                   String key)
                            throws GitLabApiException
        Deletes a group variable.
        GitLab Endpoint: DELETE /groups/:id/variables/:key
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        key - the key of an existing variable, required
        Throws:
        GitLabApiException - if any exception occurs
      • transferProject

        public Project transferProject​(Object groupIdOrPath,
                                       Object projectIdOrPath)
                                throws GitLabApiException
        Transfer a project to the Group namespace. Available only for admin users.
        GitLab Endpoint: POST /groups/:id/projects/:project_id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path, required
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the transfered Project instance
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getAccessRequests

        public List<AccessRequest> getAccessRequests​(Object groupIdOrPath)
                                              throws GitLabApiException
        Get a List of the group access requests viewable by the authenticated user.
        GET /group/:id/access_requests
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a List of project AccessRequest instances accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getAccessRequests

        public Pager<AccessRequest> getAccessRequests​(Object groupIdOrPath,
                                                      int itemsPerPage)
                                               throws GitLabApiException
        Get a Pager of the group access requests viewable by the authenticated user.
        GET /groups/:id/access_requests
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        itemsPerPage - the number of AccessRequest instances that will be fetched per page
        Returns:
        a Pager of group AccessRequest instances accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getAccessRequestsStream

        public Stream<AccessRequest> getAccessRequestsStream​(Object groupIdOrPath)
                                                      throws GitLabApiException
        Get a Stream of the group access requests viewable by the authenticated user.
        GET /groups/:id/access_requests
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        a Stream of group AccessRequest instances accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • requestAccess

        public AccessRequest requestAccess​(Object groupIdOrPath)
                                    throws GitLabApiException
        Requests access for the authenticated user to the specified group.
        POST /groups/:id/access_requests
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        Returns:
        the created AccessRequest instance
        Throws:
        GitLabApiException - if any exception occurs
      • approveAccessRequest

        public AccessRequest approveAccessRequest​(Object groupIdOrPath,
                                                  Integer userId,
                                                  AccessLevel accessLevel)
                                           throws GitLabApiException
        Approve access for the specified user to the specified group.
        PUT /groups/:id/access_requests/:user_id/approve
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the user ID to approve access for
        accessLevel - the access level the user is approved for, if null will be developer (30)
        Returns:
        the approved AccessRequest instance
        Throws:
        GitLabApiException - if any exception occurs
      • denyAccessRequest

        public void denyAccessRequest​(Object groupIdOrPath,
                                      Integer userId)
                               throws GitLabApiException
        Deny access for the specified user to the specified group.
        DELETE /groups/:id/access_requests/:user_id
        Parameters:
        groupIdOrPath - the group ID, path of the group, or a Group instance holding the group ID or path
        userId - the user ID to deny access for
        Throws:
        GitLabApiException - if any exception occurs