public class GroupApi extends AbstractApi
Constants.ActionType, Constants.ImpersonationState, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Modifier and Type | Method and Description |
---|---|
Group |
addGroup(String name,
String path)
Creates a new project group.
|
Group |
addGroup(String name,
String path,
String description,
Boolean membershipLock,
Boolean shareWithGroupLock,
Visibility visibility,
Boolean lfsEnabled,
Boolean requestAccessEnabled,
Integer parentId,
Integer sharedRunnersMinutesLimit)
Deprecated.
Will be removed in version 5.0, replaced by
addGroup(String, String, String, Visibility,
Boolean, Boolean, Integer) |
Group |
addGroup(String name,
String path,
String description,
Visibility visibility,
Boolean lfsEnabled,
Boolean requestAccessEnabled,
Integer parentId)
Creates a new project group.
|
Member |
addMember(Integer groupId,
Integer userId,
AccessLevel accessLevel)
Adds a user to the list of group members.
|
Member |
addMember(Integer groupId,
Integer userId,
AccessLevel accessLevel,
Date expiresAt)
Adds a user to the list of group members.
|
Member |
addMember(Integer groupId,
Integer userId,
Integer accessLevel)
Adds a user to the list of group members.
|
Member |
addMember(Integer groupId,
Integer userId,
Integer accessLevel,
Date expiresAt)
Adds a user to the list of group members.
|
void |
deleteGroup(Group group)
Removes group with all projects inside.
|
void |
deleteGroup(Integer groupId)
Removes group with all projects inside.
|
Group |
getGroup(Integer groupId)
Get all details of a group.
|
Group |
getGroup(String groupPath)
Get all details of a group.
|
List<Group> |
getGroups()
Get a list of groups.
|
Pager<Group> |
getGroups(int itemsPerPage)
Get a Pager of groups.
|
List<Group> |
getGroups(int page,
int perPage)
Get a list of groups (As user: my groups, as admin: all groups) and in the specified page range.
|
List<Group> |
getGroups(String search)
Get all groups that match your string in their name or path.
|
Pager<Group> |
getGroups(String search,
int itemsPerPage)
Get all groups that match your string in their name or path.
|
List<Group> |
getGroups(String search,
int page,
int perPage)
Get all groups that match your string in their name or path.
|
Member |
getMember(int groupId,
int userId)
Get a group member viewable by the authenticated user.
|
List<Member> |
getMembers(int groupId)
Get a list of group members viewable by the authenticated user.
|
Pager<Member> |
getMembers(int groupId,
int itemsPerPage)
Get a Pager of group members viewable by the authenticated user.
|
List<Member> |
getMembers(int groupId,
int page,
int perPage)
Get a list of group members viewable by the authenticated user in the specified page range.
|
List<Project> |
getProjects(int groupId)
Get a list of projects belonging to the specified group ID.
|
Pager<Project> |
getProjects(int groupId,
int itemsPerPage)
Get a Pager of projects belonging to the specified group ID.
|
List<Project> |
getProjects(int groupId,
int page,
int perPage)
Get a list of projects belonging to the specified group ID in the specified page range.
|
void |
removeMember(Integer groupId,
Integer userId)
Removes member from the group.
|
Group |
updateGroup(Integer groupId,
String name,
String path,
String description,
Boolean membershipLock,
Boolean shareWithGroupLock,
Visibility visibility,
Boolean lfsEnabled,
Boolean requestAccessEnabled,
Integer parentId,
Integer sharedRunnersMinutesLimit)
Deprecated.
Will be removed in version 5.0, replaced by
updateGroup(Integer, String, String, String,
Visibility, Boolean, Boolean, Integer) |
Group |
updateGroup(Integer groupId,
String name,
String path,
String description,
Visibility visibility,
Boolean lfsEnabled,
Boolean requestAccessEnabled,
Integer parentId)
Updates a project group.
|
Member |
updateMember(Integer groupId,
Integer userId,
AccessLevel accessLevel)
Updates a member of a group.
|
Member |
updateMember(Integer groupId,
Integer userId,
AccessLevel accessLevel,
Date expiresAt)
Updates a member of a group.
|
Member |
updateMember(Integer groupId,
Integer userId,
Integer accessLevel)
Updates a member of a group.
|
Member |
updateMember(Integer groupId,
Integer userId,
Integer accessLevel,
Date expiresAt)
Updates a member of a group.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getPageQueryParams, getWithAccepts, handle, isApiVersion, post, post, post, put, put, putWithFormData, urlEncode, validate
public GroupApi(GitLabApi gitLabApi)
public List<Group> getGroups() throws GitLabApiException
GitLabApiException
- if any exception occurspublic List<Group> getGroups(int page, int perPage) throws GitLabApiException
page
- the page to getperPage
- the number of Group instances per pageGitLabApiException
- if any exception occurspublic Pager<Group> getGroups(int itemsPerPage) throws GitLabApiException
itemsPerPage
- the number of Group instances that will be fetched per pageGitLabApiException
- if any exception occurspublic List<Group> getGroups(String search) throws GitLabApiException
search
- the group name or path search criteriaGitLabApiException
- if any exception occurspublic List<Group> getGroups(String search, int page, int perPage) throws GitLabApiException
search
- the group name or path search criteriapage
- the page to getperPage
- the number of Group instances per pageGitLabApiException
- if any exception occurspublic Pager<Group> getGroups(String search, int itemsPerPage) throws GitLabApiException
search
- the group name or path search criteriaitemsPerPage
- the number of Group instances that will be fetched per pageGitLabApiException
- if any exception occurspublic List<Project> getProjects(int groupId) throws GitLabApiException
groupId
- the group ID to list the projects forGitLabApiException
- if any exception occurspublic List<Project> getProjects(int groupId, int page, int perPage) throws GitLabApiException
groupId
- the group ID to list the projects forpage
- the page to getperPage
- the number of Project instances per pageGitLabApiException
- if any exception occurspublic Pager<Project> getProjects(int groupId, int itemsPerPage) throws GitLabApiException
groupId
- the group ID to list the projects foritemsPerPage
- the number of Project instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Group getGroup(Integer groupId) throws GitLabApiException
groupId
- the group ID to getGitLabApiException
- if any exception occurspublic Group getGroup(String groupPath) throws GitLabApiException
groupPath
- the path of the group to get details forGitLabApiException
- if any exception occurspublic Group addGroup(String name, String path) throws GitLabApiException
name
- the name of the group to addpath
- the path for the groupGitLabApiException
- if any exception occurspublic Group addGroup(String name, String path, String description, Visibility visibility, Boolean lfsEnabled, Boolean requestAccessEnabled, Integer parentId) throws GitLabApiException
name
- the name of the group to addpath
- the path for the groupdescription
- (optional) - The group's descriptionvisibility
- (optional) - The group's visibility. Can be private, internal, or public.lfsEnabled
- (optional) - Enable/disable Large File Storage (LFS) for the projects in this grouprequestAccessEnabled
- (optional) - Allow users to request member accessparentId
- (optional) - The parent group id for creating nested groupGitLabApiException
- if any exception occurspublic Group updateGroup(Integer groupId, String name, String path, String description, Visibility visibility, Boolean lfsEnabled, Boolean requestAccessEnabled, Integer parentId) throws GitLabApiException
groupId
- the ID of the group to updatename
- the name of the group to addpath
- the path for the groupdescription
- (optional) - The group's descriptionvisibility
- (optional) - The group's visibility. Can be private, internal, or public.lfsEnabled
- (optional) - Enable/disable Large File Storage (LFS) for the projects in this grouprequestAccessEnabled
- (optional) - Allow users to request member accessparentId
- (optional) - The parent group id for creating nested groupGitLabApiException
- if any exception occurspublic Group addGroup(String name, String path, String description, Boolean membershipLock, Boolean shareWithGroupLock, Visibility visibility, Boolean lfsEnabled, Boolean requestAccessEnabled, Integer parentId, Integer sharedRunnersMinutesLimit) throws GitLabApiException
addGroup(String, String, String, Visibility,
Boolean, Boolean, Integer)
name
- the name of the group to addpath
- the path for the groupdescription
- (optional) - The group's descriptionmembershipLock
- (optional, boolean) - Prevent adding new members to project membership within this groupshareWithGroupLock
- (optional, boolean) - Prevent sharing a project with another group within this groupvisibility
- (optional) - The group's visibility. Can be private, internal, or public.lfsEnabled
- (optional) - Enable/disable Large File Storage (LFS) for the projects in this grouprequestAccessEnabled
- (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 groupGitLabApiException
- if any exception occurspublic Group updateGroup(Integer groupId, String name, String path, String description, Boolean membershipLock, Boolean shareWithGroupLock, Visibility visibility, Boolean lfsEnabled, Boolean requestAccessEnabled, Integer parentId, Integer sharedRunnersMinutesLimit) throws GitLabApiException
updateGroup(Integer, String, String, String,
Visibility, Boolean, Boolean, Integer)
groupId
- the ID of the group to updatename
- the name of the group to addpath
- the path for the groupdescription
- (optional) - The group's descriptionmembershipLock
- (optional, boolean) - Prevent adding new members to project membership within this groupshareWithGroupLock
- (optional, boolean) - Prevent sharing a project with another group within this groupvisibility
- (optional) - The group's visibility. Can be private, internal, or public.lfsEnabled
- (optional) - Enable/disable Large File Storage (LFS) for the projects in this grouprequestAccessEnabled
- (optional) - Allow users to request member accessparentId
- (optional) - The parent group id for creating nested groupsharedRunnersMinutesLimit
- (optional) - (admin-only) Pipeline minutes quota for this groupGitLabApiException
- if any exception occurspublic void deleteGroup(Integer groupId) throws GitLabApiException
groupId
- the group ID to deleteGitLabApiException
- if any exception occurspublic void deleteGroup(Group group) throws GitLabApiException
group
- the Group instance to deleteGitLabApiException
- if any exception occurspublic List<Member> getMembers(int groupId) throws GitLabApiException
groupId
- the group ID to list the members forGitLabApiException
- if any exception occurspublic List<Member> getMembers(int groupId, int page, int perPage) throws GitLabApiException
groupId
- the group ID to list the members forpage
- the page to getperPage
- the number of Member instances per pageGitLabApiException
- if any exception occurspublic Pager<Member> getMembers(int groupId, int itemsPerPage) throws GitLabApiException
groupId
- the group ID to list the members foritemsPerPage
- the number of Member instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Member getMember(int groupId, int userId) throws GitLabApiException
groupId
- the group ID to get the member foruserId
- the member ID of the member to getGitLabApiException
- if any exception occurspublic Member addMember(Integer groupId, Integer userId, Integer accessLevel) throws GitLabApiException
groupId
- the project ID to add the member to, requireduserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, requiredGitLabApiException
- if any exception occurspublic Member addMember(Integer groupId, Integer userId, AccessLevel accessLevel) throws GitLabApiException
groupId
- the project ID to add the member to, requireduserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, requiredGitLabApiException
- if any exception occurspublic Member addMember(Integer groupId, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
groupId
- the project ID to add the member to, requireduserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, requiredexpiresAt
- the date the membership in the group will expire, optionalGitLabApiException
- if any exception occurspublic Member addMember(Integer groupId, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException
groupId
- the project ID to add the member to, requireduserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, requiredexpiresAt
- the date the membership in the group will expire, optionalGitLabApiException
- if any exception occurspublic Member updateMember(Integer groupId, Integer userId, Integer accessLevel) throws GitLabApiException
groupId
- the group ID the member belongs to, requireduserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredGitLabApiException
- if any exception occurspublic Member updateMember(Integer groupId, Integer userId, AccessLevel accessLevel) throws GitLabApiException
groupId
- the group ID the member belongs to, requireduserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredGitLabApiException
- if any exception occurspublic Member updateMember(Integer groupId, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
groupId
- the group ID the member belongs to, requireduserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredexpiresAt
- the date the membership in the group will expire, optionalGitLabApiException
- if any exception occurspublic Member updateMember(Integer groupId, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException
groupId
- the group ID the member belongs to, requireduserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredexpiresAt
- the date the membership in the group will expire, optionalGitLabApiException
- if any exception occurspublic void removeMember(Integer groupId, Integer userId) throws GitLabApiException
groupId
- the group ID to remove the member fromuserId
- the user ID of the member to removeGitLabApiException
- if any exception occursCopyright © 2017. All rights reserved.