Package org.gitlab4j.api
Class ProjectApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.ProjectApi
-
- All Implemented Interfaces:
Constants
public class ProjectApi extends AbstractApi implements Constants
This class provides an entry point to all the GitLab API project calls.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.api.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
-
-
Field Summary
-
Fields inherited from interface org.gitlab4j.api.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
-
-
Constructor Summary
Constructors Constructor Description ProjectApi(GitLabApi gitLabApi)
-
Method Summary
Modifier and Type Method Description ProjectHook
addHook(Object projectIdOrPath, String url, boolean doPushEvents, boolean doIssuesEvents, boolean doMergeRequestsEvents)
Adds a hook to project.ProjectHook
addHook(Object projectIdOrPath, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken)
Adds a hook to project.ProjectHook
addHook(String projectName, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken)
Adds a hook to project.Member
addMember(Object projectIdOrPath, Integer userId, Integer accessLevel)
Adds a user to a project team.Member
addMember(Object projectIdOrPath, Integer userId, Integer accessLevel, Date expiresAt)
Adds a user to a project team.Member
addMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel)
Adds a user to a project team.Member
addMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt)
Adds a user to a project team.Project
archiveProject(Object projectIdOrPath)
Archive a projectProject
createForkedFromRelationship(Object projectIdOrPath, Integer forkedFromId)
Create a forked from/to relation between existing projects.Project
createProject(Integer groupId, String projectName)
Create a new project in the specified group.Project
createProject(String projectName)
Create a new project with the current user's namespace.Project
createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean isPublic, Integer visibilityLevel, String importUrl)
Deprecated.As of release 4.2.0, replaced bycreateProject(String, Integer, String, Boolean, Boolean, Boolean, Boolean, Visibility, Integer, String)
Project
createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Visibility visibility, Integer visibilityLevel, Boolean printingMergeRequestLinkEnabled, String importUrl)
Creates a ProjectProject
createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Visibility visibility, Integer visibilityLevel, String importUrl)
Creates a ProjectProject
createProject(Project project)
Creates new project owned by the current user.Project
createProject(Project project, String importUrl)
Creates new project owned by the current user.PushRules
createPushRules(Object projectIdOrPath, PushRules pushRule)
Adds a push rule to a specified project.Snippet
createSnippet(Object projectIdOrPath, String title, String filename, String description, String code, Visibility visibility)
Creates a new project snippet.Variable
createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected)
Create a new project variable.Variable
createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope)
Create a new project variable.void
deleteForkedFromRelationship(Object projectIdOrPath)
Delete an existing forked from relationship.void
deleteHook(Object projectIdOrPath, Integer hookId)
Deletes a hook from the project.void
deleteHook(ProjectHook hook)
Deletes a hook from the project.void
deleteIssue(Object projectIdOrPath, Integer issueId)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.deleteIssue(Object, Integer)
void
deleteProject(Object projectIdOrPath)
Removes project with all resources(issues, merge requests etc).void
deletePushRules(Object projectIdOrPath)
Removes a push rule from a project.void
deleteSnippet(Object projectIdOrPath, Integer snippetId)
void
deleteVariable(Object projectIdOrPath, String key)
Deletes a project variable.Project
forkProject(Object projectIdOrPath, Integer namespaceId)
Forks a project into the user namespace of the authenticated user or the one provided.Project
forkProject(Object projectIdOrPath, String namespace)
Forks a project into the user namespace of the authenticated user or the one provided.List<Member>
getAllMembers(Object projectIdOrPath)
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups.Pager<Member>
getAllMembers(Object projectIdOrPath, int itemsPerPage)
Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups.List<Member>
getAllMembers(Object projectIdOrPath, int page, int perPage)
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups.Stream<Member>
getAllMembersStream(Object projectIdOrPath)
Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups.List<Project>
getForks(Object projectIdOrPath)
Get a list of projects that were forked from the specified project.Pager<Project>
getForks(Object projectIdOrPath, int itemsPerPage)
Get a Pager of projects that were forked from the specified project.List<Project>
getForks(Object projectIdOrPath, int page, int perPage)
Get a list of projects that were forked from the specified project and in the specified page range.Stream<Project>
getForksStream(Object projectIdOrPath)
Get a Stream of projects that were forked from the specified project.ProjectHook
getHook(Object projectIdOrPath, Integer hookId)
Get a specific hook for project.List<ProjectHook>
getHooks(Object projectIdOrPath)
Get a list of the project hooks for the specified project.Pager<ProjectHook>
getHooks(Object projectIdOrPath, int itemsPerPage)
Get Pager of project hooks.List<ProjectHook>
getHooks(Object projectIdOrPath, int page, int perPage)
Get list of project hooks in the specified page range.Stream<ProjectHook>
getHooksStream(Object projectIdOrPath)
Get a Stream of the project hooks for the specified project.Issue
getIssue(Object projectIdOrPath, Integer issueId)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssue(Object, Integer)
List<Issue>
getIssues(Object projectIdOrPath)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object)
Pager<Issue>
getIssues(Object projectIdOrPath, int itemsPerPage)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object, int)
List<Issue>
getIssues(Object projectIdOrPath, int page, int perPage)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object, int, int)
Stream<Issue>
getIssuesStream(Object projectIdOrPath)
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object)
Member
getMember(Object projectIdOrPath, Integer userId)
Gets a project team member.List<Project>
getMemberProjects()
Get a list of projects that the authenticated user is a member of.Pager<Project>
getMemberProjects(int itemsPerPage)
Get a Pager of projects that the authenticated user is a member of.List<Project>
getMemberProjects(int page, int perPage)
Get a list of projects that the authenticated user is a member of in the specified page range.Stream<Project>
getMemberProjectsStream()
Get a Stream of projects that the authenticated user is a member of.List<Member>
getMembers(Object projectIdOrPath)
Get a list of project team members.Pager<Member>
getMembers(Object projectIdOrPath, int itemsPerPage)
Get a Pager of project team members.List<Member>
getMembers(Object projectIdOrPath, int page, int perPage)
Get a list of project team members in the specified page range.Stream<Member>
getMembersStream(Object projectIdOrPath)
Get a Stream of project team members.Optional<ProjectHook>
getOptionalHook(Object projectIdOrPath, Integer hookId)
Get a specific hook for project as an Optional instance.Optional<Member>
getOptionalMember(Object projectIdOrPath, Integer userId)
Gets a project team member.Optional<Project>
getOptionalProject(Object projectIdOrPath)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.Optional<Project>
getOptionalProject(Object projectIdOrPath, Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.Optional<Project>
getOptionalProject(String namespace, String project)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.Optional<Project>
getOptionalProject(String namespace, String project, Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.Optional<String>
getOptionalRawSnippetContent(Object projectIdOrPath, Integer snippetId)
Get the raw project snippet plain text as an Optional instance.Optional<Snippet>
getOptionalSnippet(Object projectIdOrPath, Integer snippetId)
Get a single of project snippet as an Optional instance.Optional<Variable>
getOptionalVariable(Object projectIdOrPath, String key)
Get the details of a variable as an Optional instance.List<Project>
getOwnedProjects()
Get a list of projects owned by the authenticated user.Pager<Project>
getOwnedProjects(int itemsPerPage)
Get a Pager of projects owned by the authenticated user.List<Project>
getOwnedProjects(int page, int perPage)
Get a list of projects owned by the authenticated user in the specified page range.Stream<Project>
getOwnedProjectsStream()
Get a Stream of projects owned by the authenticated user.Project
getProject(Object projectIdOrPath)
Get a specific project, which is owned by the authentication user.Project
getProject(Object projectIdOrPath, Boolean includeStatistics)
Get a specific project, which is owned by the authentication user.Project
getProject(String namespace, String project)
Get a specific project, which is owned by the authentication user.Project
getProject(String namespace, String project, Boolean includeStatistics)
Get a specific project, which is owned by the authentication user.List<Event>
getProjectEvents(Object projectIdOrPath)
Get the project events for specific project.Pager<Event>
getProjectEvents(Object projectIdOrPath, int itemsPerPage)
Get a Pager of project events for specific project.List<Event>
getProjectEvents(Object projectIdOrPath, int page, int perPage)
Get the project events for specific project.Stream<Event>
getProjectEventsStream(Object projectIdOrPath)
Get a Stream of the project events for specific project.Map<String,Float>
getProjectLanguages(Object projectIdOrPath)
Get languages used in a project with percentage value.List<Project>
getProjects()
Get a list of projects accessible by the authenticated user.Pager<Project>
getProjects(int itemsPerPage)
Get a Pager instance of projects accessible by the authenticated user.List<Project>
getProjects(int page, int perPage)
Get a list of projects accessible by the authenticated user and in the specified page range.List<Project>
getProjects(Boolean archived, Visibility visibility, String orderBy, String sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics)
Deprecated.Will be removed in version 5.0, replaced bygetProjects(Boolean, Visibility, Constants.ProjectOrderBy, Constants.SortOrder, String, Boolean, Boolean, Boolean, Boolean, Boolean)
List<Project>
getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.Pager<Project>
getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics, int itemsPerPage)
Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters.List<Project>
getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics, int page, int perPage)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.List<Project>
getProjects(String search)
Get a list of projects accessible by the authenticated user that match the provided search string.Pager<Project>
getProjects(String search, int itemsPerPage)
Get a Pager of projects accessible by the authenticated user that match the provided search string.List<Project>
getProjects(String search, int page, int perPage)
Get a list of projects accessible by the authenticated user that match the provided search string.Stream<Project>
getProjectsStream()
Get a Stream of projects accessible by the authenticated user.Stream<Project>
getProjectsStream(String search)
Get a Stream of projects accessible by the authenticated user that match the provided search string.List<ProjectUser>
getProjectUsers(Object projectIdOrPath)
Get a list of project users.Pager<ProjectUser>
getProjectUsers(Object projectIdOrPath, int itemsPerPage)
Get a Pager of project users.List<ProjectUser>
getProjectUsers(Object projectIdOrPath, String search)
Get a list of project users matching the specified search string.Pager<ProjectUser>
getProjectUsers(Object projectIdOrPath, String search, int itemsPerPage)
Get a Pager of project users matching the specified search string.Stream<ProjectUser>
getProjectUsersStream(Object projectIdOrPath)
Get a Stream of project users.Stream<ProjectUser>
getProjectUsersStream(Object projectIdOrPath, String search)
Get a Stream of project users matching the specified search string.PushRules
getPushRules(Object projectIdOrPath)
Get the project's push rules.String
getRawSnippetContent(Object projectIdOrPath, Integer snippetId)
Get the raw project snippet as plain text.Snippet
getSnippet(Object projectIdOrPath, Integer snippetId)
Get a single of project snippet.List<Snippet>
getSnippets(Object projectIdOrPath)
Get a list of the project snippets.Pager<Snippet>
getSnippets(Object projectIdOrPath, int itemsPerPage)
Get a Pager of project's snippets.List<Snippet>
getSnippets(Object projectIdOrPath, int page, int perPage)
Get a list of project snippets.Stream<Snippet>
getSnippetsStream(Object projectIdOrPath)
Get a Stream of the project snippets.List<Project>
getStarredProjects()
Get a list of projects starred by the authenticated user.Pager<Project>
getStarredProjects(int itemsPerPage)
Get a Pager of projects starred by the authenticated user.List<Project>
getStarredProjects(int page, int perPage)
Get a list of projects starred by the authenticated user in the specified page range.Stream<Project>
getStarredProjectsStream()
Get a Stream of projects starred by the authenticated user.List<Project>
getUserProjects(Object userIdOrUsername, ProjectFilter filter)
Get a list of visible projects owned by the given user.Pager<Project>
getUserProjects(Object userIdOrUsername, ProjectFilter filter, int itemsPerPage)
Get a Pager of visible projects owned by the given user.List<Project>
getUserProjects(Object userIdOrUsername, ProjectFilter filter, int page, int perPage)
Get a list of visible projects owned by the given user in the specified page range.Stream<Project>
getUserProjectsStream(Object userIdOrUsername, ProjectFilter filter)
Get a Stream of visible projects owned by the given user.Variable
getVariable(Object projectIdOrPath, String key)
Get the details of a project variable.List<Variable>
getVariables(Object projectIdOrPath)
Get list of a project's variables.Pager<Variable>
getVariables(Object projectIdOrPath, int itemsPerPage)
Get a Pager of variables belonging to the specified project.List<Variable>
getVariables(Object projectIdOrPath, int page, int perPage)
Get a list of variables for the specified project in the specified page range.Stream<Variable>
getVariablesStream(Object projectIdOrPath)
Get a Stream of variables belonging to the specified project.ProjectHook
modifyHook(ProjectHook hook)
Modifies a hook for project.void
removeMember(Object projectIdOrPath, Integer userId)
Removes user from project team.Project
setProjectAvatar(Object projectIdOrPath, File avatarFile)
Uploads and sets the project avatar for the specified project.void
shareProject(Object projectIdOrPath, Integer groupId, AccessLevel accessLevel, Date expiresAt)
Share a project with the specified group.Project
starProject(Object projectIdOrPath)
Star a project.Project
transferProject(Object projectIdOrPath, String namespace)
Transfer a project to a new namespace.Project
unarchiveProject(Object projectIdOrPath)
Unarchive a projectvoid
unshareProject(Object projectIdOrPath, Integer groupId)
Unshare the project from the group.Project
unstarProject(Object projectIdOrPath)
Unstar a project.Member
updateMember(Object projectIdOrPath, Integer userId, Integer accessLevel)
Updates a member of a project.Member
updateMember(Object projectIdOrPath, Integer userId, Integer accessLevel, Date expiresAt)
Updates a member of a project.Member
updateMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel)
Updates a member of a project.Member
updateMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt)
Updates a member of a project.Project
updateProject(Project project)
Updates a project.PushRules
updatePushRules(Object projectIdOrPath, PushRules pushRule)
Updates a push rule for the specified project.Snippet
updateSnippet(Object projectIdOrPath, Integer snippetId, String title, String filename, String description, String code, Visibility visibility)
Updates an existing project snippet.Variable
updateVariable(Object projectIdOrPath, String key, String value, Boolean isProtected)
Update a project variable.Variable
updateVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope)
Update a project variable.FileUpload
uploadFile(Object projectIdOrPath, File fileToUpload)
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.FileUpload
uploadFile(Object projectIdOrPath, File fileToUpload, String mediaType)
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
ProjectApi
public ProjectApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getProjects
public List<Project> getProjects() throws GitLabApiException
Get a list of projects accessible by the authenticated user.GET /projects
- Returns:
- a list of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public List<Project> getProjects(int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user and in the specified page range.GET /projects
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<Project> getProjects(int itemsPerPage) throws GitLabApiException
Get a Pager instance of projects accessible by the authenticated user.GET /projects
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager instance of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectsStream
public Stream<Project> getProjectsStream() throws GitLabApiException
Get a Stream of projects accessible by the authenticated user.GET /projects
- Returns:
- a Stream of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
@Deprecated public List<Project> getProjects(Boolean archived, Visibility visibility, String orderBy, String sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced bygetProjects(Boolean, Visibility, Constants.ProjectOrderBy, Constants.SortOrder, String, Boolean, Boolean, Boolean, Boolean, Boolean)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields, default is created_atsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statistics- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public List<Project> getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics) throws GitLabApiException
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statistics- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public List<Project> getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics, int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statisticspage
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<Project> getProjects(Boolean archived, Visibility visibility, Constants.ProjectOrderBy orderBy, Constants.SortOrder sort, String search, Boolean simple, Boolean owned, Boolean membership, Boolean starred, Boolean statistics, int itemsPerPage) throws GitLabApiException
Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statisticsitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public List<Project> getProjects(String search) throws GitLabApiException
Get a list of projects accessible by the authenticated user that match the provided search string.GET /projects?search=search
- Parameters:
search
- the project name search criteria- Returns:
- a list of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public List<Project> getProjects(String search, int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user that match the provided search string.GET /projects?search=search
- Parameters:
search
- the project name search criteriapage
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<Project> getProjects(String search, int itemsPerPage) throws GitLabApiException
Get a Pager of projects accessible by the authenticated user that match the provided search string.GET /projects?search=search
- Parameters:
search
- the project name search criteriaitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectsStream
public Stream<Project> getProjectsStream(String search) throws GitLabApiException
Get a Stream of projects accessible by the authenticated user that match the provided search string.GET /projects?search=search
- Parameters:
search
- the project name search criteria- Returns:
- a Stream of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public List<Project> getMemberProjects() throws GitLabApiException
Get a list of projects that the authenticated user is a member of.GET /projects?membership=true
- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public List<Project> getMemberProjects(int page, int perPage) throws GitLabApiException
Get a list of projects that the authenticated user is a member of in the specified page range.GET /projects?membership=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public Pager<Project> getMemberProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects that the authenticated user is a member of.GET /projects?membership=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager o Project instances that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjectsStream
public Stream<Project> getMemberProjectsStream() throws GitLabApiException
Get a Stream of projects that the authenticated user is a member of.GET /projects?membership=true
- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public List<Project> getOwnedProjects() throws GitLabApiException
Get a list of projects owned by the authenticated user.GET /projects?owned=true
- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public List<Project> getOwnedProjects(int page, int perPage) throws GitLabApiException
Get a list of projects owned by the authenticated user in the specified page range.GET /projects?owned=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public Pager<Project> getOwnedProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects owned by the authenticated user.GET /projects?owned=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjectsStream
public Stream<Project> getOwnedProjectsStream() throws GitLabApiException
Get a Stream of projects owned by the authenticated user.GET /projects?owned=true
- Returns:
- a Stream of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public List<Project> getStarredProjects() throws GitLabApiException
Get a list of projects starred by the authenticated user.GET /projects?starred=true
- Returns:
- a list of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public List<Project> getStarredProjects(int page, int perPage) throws GitLabApiException
Get a list of projects starred by the authenticated user in the specified page range.GET /projects?starred=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public Pager<Project> getStarredProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects starred by the authenticated user.GET /projects?starred=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjectsStream
public Stream<Project> getStarredProjectsStream() throws GitLabApiException
Get a Stream of projects starred by the authenticated user.GET /projects?starred=true
- Returns:
- a Stream of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public List<Project> getUserProjects(Object userIdOrUsername, ProjectFilter filter) throws GitLabApiException
Get a list of visible projects owned by the given user.GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a list of visible projects owned by the given use
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public List<Project> getUserProjects(Object userIdOrUsername, ProjectFilter filter, int page, int perPage) throws GitLabApiException
Get a list of visible projects owned by the given user in the specified page range.GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the querypage
- the page to getperPage
- the number of projects per page- Returns:
- a list of visible projects owned by the given use
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public Pager<Project> getUserProjects(Object userIdOrUsername, ProjectFilter filter, int itemsPerPage) throws GitLabApiException
Get a Pager of visible projects owned by the given user.GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the queryitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of visible projects owned by the given use
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjectsStream
public Stream<Project> getUserProjectsStream(Object userIdOrUsername, ProjectFilter filter) throws GitLabApiException
Get a Stream of visible projects owned by the given user.GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a Stream of visible projects owned by the given use
- Throws:
GitLabApiException
- if any exception occurs
-
getProject
public Project getProject(Object projectIdOrPath) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public Optional<Project> getOptionalProject(Object projectIdOrPath)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- an Optional instance with the specified project as a value
-
getProject
public Project getProject(Object projectIdOrPath, Boolean includeStatistics) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceincludeStatistics
- include project statistics- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public Optional<Project> getOptionalProject(Object projectIdOrPath, Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceincludeStatistics
- include project statistics- Returns:
- an Optional instance with the specified project as a value
-
getProject
public Project getProject(String namespace, String project) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project to get- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public Optional<Project> getOptionalProject(String namespace, String project)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project- Returns:
- an Optional instance with the specified project as a value
-
getProject
public Project getProject(String namespace, String project, Boolean includeStatistics) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project to getincludeStatistics
- include project statistics- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public Optional<Project> getOptionalProject(String namespace, String project, Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the projectincludeStatistics
- include project statistics- Returns:
- an Optional instance with the specified project as a value
-
createProject
public Project createProject(Integer groupId, String projectName) throws GitLabApiException
Create a new project in the specified group.- Parameters:
groupId
- the group ID to create the project underprojectName
- the name of the project top create- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public Project createProject(String projectName) throws GitLabApiException
Create a new project with the current user's namespace.- Parameters:
projectName
- the name of the project top create- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public Project createProject(Project project) throws GitLabApiException
Creates new project owned by the current user.- Parameters:
project
- the Project instance with the configuration for the new project- Returns:
- a Project instance with the newly created project info
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public Project createProject(Project project, String importUrl) throws GitLabApiException
Creates new project owned by the current user. The following properties on the Project instance are utilized in the creation of the project: name (name or path are required) - new project name path (name or path are required) - new project path defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private visibilityLevel (optional) issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lLfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push initialize_with_readme (optional) - Initialize project with README file packagesEnabled (optional) - Enable or disable mvn packages repository feature- Parameters:
project
- the Project instance with the configuration for the new projectimportUrl
- the URL to import the repository from- Returns:
- a Project instance with the newly created project info
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public Project createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Visibility visibility, Integer visibilityLevel, String importUrl) throws GitLabApiException
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultvisibility
- The visibility of the project, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public Project createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Visibility visibility, Integer visibilityLevel, Boolean printingMergeRequestLinkEnabled, String importUrl) throws GitLabApiException
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultvisibility
- The visibility of the project, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultprintingMergeRequestLinkEnabled
- Show link to create/view merge request when pushing from the command lineimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
@Deprecated public Project createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean isPublic, Integer visibilityLevel, String importUrl) throws GitLabApiException
Deprecated.As of release 4.2.0, replaced bycreateProject(String, Integer, String, Boolean, Boolean, Boolean, Boolean, Visibility, Integer, String)
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultisPublic
- Whether the project is public or private, if true same as setting visibilityLevel = 20, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
updateProject
public Project updateProject(Project project) throws GitLabApiException
Updates a project. The following properties on the Project instance are utilized in the edit of the project, null values are not updated: id (required) - existing project id, either id or path must be provided name (optional) - project name path (optional) - project path, either id or path must be provided defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lLfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push packagesEnabled (optional) - Enable or disable mvn packages repository feature NOTE: The following parameters specified by the GitLab API edit project are not supported: import_url tag_list array avatar ci_config_path initialize_with_readme- Parameters:
project
- the Project instance with the configuration for the new project- Returns:
- a Project instance with the newly updated project info
- Throws:
GitLabApiException
- if any exception occurs
-
deleteProject
public void deleteProject(Object projectIdOrPath) throws GitLabApiException
Removes project with all resources(issues, merge requests etc).DELETE /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Throws:
GitLabApiException
- if any exception occurs
-
forkProject
public Project forkProject(Object projectIdOrPath, String namespace) throws GitLabApiException
Forks a project into the user namespace of the authenticated user or the one provided. The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately.POST /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancenamespace
- path of the namespace that the project will be forked to- Returns:
- the newly forked Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
forkProject
public Project forkProject(Object projectIdOrPath, Integer namespaceId) throws GitLabApiException
Forks a project into the user namespace of the authenticated user or the one provided. The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately.POST /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancenamespaceId
- ID of the namespace that the project will be forked to- Returns:
- the newly forked Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
createForkedFromRelationship
public Project createForkedFromRelationship(Object projectIdOrPath, Integer forkedFromId) throws GitLabApiException
Create a forked from/to relation between existing projects.POST /projects/:id/fork/:forkFromId
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceforkedFromId
- the ID of the project that was forked from- Returns:
- the updated Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteForkedFromRelationship
public void deleteForkedFromRelationship(Object projectIdOrPath) throws GitLabApiException
Delete an existing forked from relationship.DELETE /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public List<Member> getMembers(Object projectIdOrPath) throws GitLabApiException
Get a list of project team members.GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public List<Member> getMembers(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of project team members in the specified page range.GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Member instances per page- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public Pager<Member> getMembers(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project team members.GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembersStream
public Stream<Member> getMembersStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of project team members.GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- a Stream of the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public List<Member> getAllMembers(Object projectIdOrPath) throws GitLabApiException
Gets a list of project 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 project/group and of one or more ancestor group.GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public List<Member> getAllMembers(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Gets a list of project 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 project/group and of one or more ancestor group.GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Member instances per page- Returns:
- the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public Pager<Member> getAllMembers(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Gets a Pager of project 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 project/group and of one or more ancestor group.GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembersStream
public Stream<Member> getAllMembersStream(Object projectIdOrPath) throws GitLabApiException
Gets a Stream of project 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 project/group and of one or more ancestor group.GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- a Stream of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getMember
public Member getMember(Object projectIdOrPath, Integer userId) throws GitLabApiException
Gets a project team member.GET /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member- Returns:
- the member specified by the project ID/user ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalMember
public Optional<Member> getOptionalMember(Object projectIdOrPath, Integer userId)
Gets a project team member.GET /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member- Returns:
- the member specified by the project ID/user ID pair
-
addMember
public Member addMember(Object projectIdOrPath, Integer userId, Integer accessLevel) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, required- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public Member addMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, required- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public Member addMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to addaccessLevel
- the access level for the new memberexpiresAt
- the date the membership in the group will expire- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public Member addMember(Object projectIdOrPath, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to addaccessLevel
- the access level for the new memberexpiresAt
- the date the membership in the group will expire- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public Member updateMember(Object projectIdOrPath, Integer userId, Integer accessLevel) throws GitLabApiException
Updates a member of a project.PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, required- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public Member updateMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel) throws GitLabApiException
Updates a member of a project.PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, required- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public Member updateMember(Object projectIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
Updates a member of a project.PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceuserId
- 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, optional- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public Member updateMember(Object projectIdOrPath, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException
Updates a member of a project.PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, 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, optional- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
removeMember
public void removeMember(Object projectIdOrPath, Integer userId) throws GitLabApiException
Removes user from project team.DELETE /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireduserId
- the user ID of the member to remove- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public List<ProjectUser> getProjectUsers(Object projectIdOrPath) throws GitLabApiException
Get a list of project users. This list includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- the users belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public Pager<ProjectUser> getProjectUsers(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project users. This Pager includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsersStream
public Stream<ProjectUser> getProjectUsersStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of project users. This Stream includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of the users belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public List<ProjectUser> getProjectUsers(Object projectIdOrPath, String search) throws GitLabApiException
Get a list of project users matching the specified search string. This list includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsearch
- the string to match specific users- Returns:
- the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public Pager<ProjectUser> getProjectUsers(Object projectIdOrPath, String search, int itemsPerPage) throws GitLabApiException
Get a Pager of project users matching the specified search string. This Pager includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancesearch
- the string to match specific usersitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsersStream
public Stream<ProjectUser> getProjectUsersStream(Object projectIdOrPath, String search) throws GitLabApiException
Get a Stream of project users matching the specified search string. This Stream includes all project members and all users assigned to project parent groups.GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsearch
- the string to match specific users- Returns:
- a Stream of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public List<Event> getProjectEvents(Object projectIdOrPath) throws GitLabApiException
Get the project events for specific project. Sorted from newest to latest.GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public List<Event> getProjectEvents(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get the project events for specific project. Sorted from newest to latest in the specified page range.GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of Event instances per page- Returns:
- the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public Pager<Event> getProjectEvents(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project events for specific project. Sorted from newest to latest.GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEventsStream
public Stream<Event> getProjectEventsStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project events for specific project. Sorted from newest to latest.GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public List<ProjectHook> getHooks(Object projectIdOrPath) throws GitLabApiException
Get a list of the project hooks for the specified project.GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a list of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public List<ProjectHook> getHooks(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get list of project hooks in the specified page range.GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of ProjectHook instances per page- Returns:
- a list of project hooks for the specified project in the specified page range
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public Pager<ProjectHook> getHooks(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get Pager of project hooks.GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooksStream
public Stream<ProjectHook> getHooksStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project hooks for the specified project.GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHook
public ProjectHook getHook(Object projectIdOrPath, Integer hookId) throws GitLabApiException
Get a specific hook for project.GET /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredhookId
- the ID of the hook to get- Returns:
- the project hook for the specified project ID/hook ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalHook
public Optional<ProjectHook> getOptionalHook(Object projectIdOrPath, Integer hookId)
Get a specific hook for project as an Optional instance.GET /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredhookId
- the ID of the hook to get- Returns:
- the project hook for the specified project ID/hook ID pair as an Optional instance
-
addHook
public ProjectHook addHook(String projectName, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
Adds a hook to project.POST /projects/:id/hooks
- Parameters:
projectName
- the name of the projecturl
- the callback URL for the hookenabledHooks
- a ProjectHook instance specifying which hooks to enableenableSslVerification
- enable SSL verificationsecretToken
- the secret token to pass back to the hook- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
addHook
public ProjectHook addHook(Object projectIdOrPath, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
Adds a hook to project.POST /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredurl
- the callback URL for the hookenabledHooks
- a ProjectHook instance specifying which hooks to enableenableSslVerification
- enable SSL verificationsecretToken
- the secret token to pass back to the hook- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
addHook
public ProjectHook addHook(Object projectIdOrPath, String url, boolean doPushEvents, boolean doIssuesEvents, boolean doMergeRequestsEvents) throws GitLabApiException
Adds a hook to project.POST /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredurl
- the callback URL for the hookdoPushEvents
- flag specifying whether to do push eventsdoIssuesEvents
- flag specifying whether to do issues eventsdoMergeRequestsEvents
- flag specifying whether to do merge requests events- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteHook
public void deleteHook(Object projectIdOrPath, Integer hookId) throws GitLabApiException
Deletes a hook from the project.DELETE /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredhookId
- the project hook ID to delete- Throws:
GitLabApiException
- if any exception occurs
-
deleteHook
public void deleteHook(ProjectHook hook) throws GitLabApiException
Deletes a hook from the project.DELETE /projects/:id/hooks/:hook_id
- Parameters:
hook
- the ProjectHook instance to remove- Throws:
GitLabApiException
- if any exception occurs
-
modifyHook
public ProjectHook modifyHook(ProjectHook hook) throws GitLabApiException
Modifies a hook for project.PUT /projects/:id/hooks/:hook_id
- Parameters:
hook
- the ProjectHook instance that contains the project hook info to modify- Returns:
- the modified project hook
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public List<Issue> getIssues(Object projectIdOrPath) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object)
Get a list of the project's issues.GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a list of project's issues
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public List<Issue> getIssues(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object, int, int)
Get a list of project's issues using the specified page and per page settings.GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of issues per page- Returns:
- the list of issues in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public Pager<Issue> getIssues(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object, int)
Get a Pager of project's issues.GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of issues per page- Returns:
- the list of issues in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getIssuesStream
@Deprecated public Stream<Issue> getIssuesStream(Object projectIdOrPath) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssues(Object)
Get a Stream of the project's issues.GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of the project's issues
- Throws:
GitLabApiException
- if any exception occurs
-
getIssue
@Deprecated public Issue getIssue(Object projectIdOrPath, Integer issueId) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.getIssue(Object, Integer)
Get a single project issue.GET /projects/:id/issues/:issue_iid
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredissueId
- the internal ID of a project's issue- Returns:
- the specified Issue instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteIssue
@Deprecated public void deleteIssue(Object projectIdOrPath, Integer issueId) throws GitLabApiException
Deprecated.Will be removed in version 5.0, replaced byIssuesApi.deleteIssue(Object, Integer)
Delete a project issue.DELETE /projects/:id/issues/:issue_iid
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredissueId
- the internal ID of a project's issue- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public List<Snippet> getSnippets(Object projectIdOrPath) throws GitLabApiException
Get a list of the project snippets.GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a list of the project's snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public List<Snippet> getSnippets(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of project snippets.GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of snippets per page- Returns:
- a list of project's snippets for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public Pager<Snippet> getSnippets(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project's snippets.GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of snippets per page- Returns:
- the Pager of snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippetsStream
public Stream<Snippet> getSnippetsStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project snippets.GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of the project's snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippet
public Snippet getSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException
Get a single of project snippet.GET /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the specified project Snippet
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalSnippet
public Optional<Snippet> getOptionalSnippet(Object projectIdOrPath, Integer snippetId)
Get a single of project snippet as an Optional instance.GET /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the specified project Snippet as an Optional instance
-
createSnippet
public Snippet createSnippet(Object projectIdOrPath, String title, String filename, String description, String code, Visibility visibility) throws GitLabApiException
Creates a new project snippet. The user must have permission to create new snippets.POST /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredtitle
- the title of a snippet, requiredfilename
- the name of a snippet file, requireddescription
- the description of a snippet, optionalcode
- the content of a snippet, requiredvisibility
- the snippet's visibility, required- Returns:
- a Snippet instance with info on the created snippet
- Throws:
GitLabApiException
- if any exception occurs
-
updateSnippet
public Snippet updateSnippet(Object projectIdOrPath, Integer snippetId, String title, String filename, String description, String code, Visibility visibility) throws GitLabApiException
Updates an existing project snippet. The user must have permission to change an existing snippet.PUT /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsnippetId
- the ID of a project's snippet, requiredtitle
- the title of a snippet, optionalfilename
- the name of a snippet file, optionaldescription
- the description of a snippet, optioptionalonalcode
- the content of a snippet, optionalvisibility
- the snippet's visibility, reqoptionaluired- Returns:
- a Snippet instance with info on the updated snippet
- Throws:
GitLabApiException
- if any exception occurs
-
deleteSnippet
public void deleteSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException
- Throws:
GitLabApiException
-
getRawSnippetContent
public String getRawSnippetContent(Object projectIdOrPath, Integer snippetId) throws GitLabApiException
Get the raw project snippet as plain text.GET /projects/:id/snippets/:snippet_id/raw
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the raw project snippet plain text as an Optional instance
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalRawSnippetContent
public Optional<String> getOptionalRawSnippetContent(Object projectIdOrPath, Integer snippetId)
Get the raw project snippet plain text as an Optional instance.GET /projects/:id/snippets/:snippet_id/raw
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the raw project snippet plain text as an Optional instance
-
shareProject
public void shareProject(Object projectIdOrPath, Integer groupId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
Share a project with the specified group.POST /projects/:id/share
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredgroupId
- the ID of the group to share with, requiredaccessLevel
- the permissions level to grant the group, requiredexpiresAt
- the share expiration date, optional- Throws:
GitLabApiException
- if any exception occurs
-
unshareProject
public void unshareProject(Object projectIdOrPath, Integer groupId) throws GitLabApiException
Unshare the project from the group.DELETE /projects/:id/share/:group_id
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredgroupId
- the ID of the group to unshare, required- Throws:
GitLabApiException
- if any exception occurs
-
archiveProject
public Project archiveProject(Object projectIdOrPath) throws GitLabApiException
Archive a projectPOST /projects/:id/archive
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- the archived GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
unarchiveProject
public Project unarchiveProject(Object projectIdOrPath) throws GitLabApiException
Unarchive a projectPOST /projects/:id/unarchive
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- the unarchived GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
uploadFile
public FileUpload uploadFile(Object projectIdOrPath, File fileToUpload) throws GitLabApiException
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.POST /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, required- Returns:
- a FileUpload instance with information on the just uploaded file
- Throws:
GitLabApiException
- if any exception occurs
-
uploadFile
public FileUpload uploadFile(Object projectIdOrPath, File fileToUpload, String mediaType) throws GitLabApiException
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.POST /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, requiredmediaType
- the media type of the file to upload, optional- Returns:
- a FileUpload instance with information on the just uploaded file
- Throws:
GitLabApiException
- if any exception occurs
-
getPushRules
public PushRules getPushRules(Object projectIdOrPath) throws GitLabApiException
Get the project's push rules.GET /projects/:id/push_rule
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- the push rules for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
createPushRules
public PushRules createPushRules(Object projectIdOrPath, PushRules pushRule) throws GitLabApiException
Adds a push rule to a specified project.
The following properties on the PushRules instance are utilized in the creation of the push rule:POST /projects/:id/push_rule
denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpushRule
- the PushRule instance containing the push rule configuration to add- Returns:
- a PushRules instance with the newly created push rule info
- Throws:
GitLabApiException
- if any exception occurs
-
updatePushRules
public PushRules updatePushRules(Object projectIdOrPath, PushRules pushRule) throws GitLabApiException
Updates a push rule for the specified project.
The following properties on the PushRules instance are utilized when updating the push rule:PUT /projects/:id/push_rule/:push_rule_id
denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpushRule
- the PushRules instance containing the push rule configuration to update- Returns:
- a PushRules instance with the newly created push rule info
- Throws:
GitLabApiException
- if any exception occurs
-
deletePushRules
public void deletePushRules(Object projectIdOrPath) throws GitLabApiException
Removes a push rule from a project. This is an idempotent method and can be called multiple times. Either the push rule is available or not.DELETE /projects/:id/push_rule
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public List<Project> getForks(Object projectIdOrPath) throws GitLabApiException
Get a list of projects that were forked from the specified project.GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a List of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public List<Project> getForks(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of projects that were forked from the specified project and in the specified page range.GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of projects per page- Returns:
- a List of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public Pager<Project> getForks(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of projects that were forked from the specified project.GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForksStream
public Stream<Project> getForksStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of projects that were forked from the specified project.GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
starProject
public Project starProject(Object projectIdOrPath) throws GitLabApiException
Star a project.POST /projects/:id/star
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Project instance with the new project info
- Throws:
GitLabApiException
- if any exception occurs
-
unstarProject
public Project unstarProject(Object projectIdOrPath) throws GitLabApiException
Unstar a project.POST /projects/:id/unstar
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Project instance with the new project info
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectLanguages
public Map<String,Float> getProjectLanguages(Object projectIdOrPath) throws GitLabApiException
Get languages used in a project with percentage value.GET /projects/:id/languages
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Map instance with the language as the key and the percentage as the value
- Throws:
GitLabApiException
- if any exception occurs- Since:
- GitLab 10.8
-
transferProject
public Project transferProject(Object projectIdOrPath, String namespace) throws GitLabApiException
Transfer a project to a new namespace. This was added in GitLab 11.1PUT /projects/:id/transfer.
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requirednamespace
- the namespace to transfer the project to- Returns:
- the updated Project
- Throws:
GitLabApiException
- if any exception occurs
-
setProjectAvatar
public Project setProjectAvatar(Object projectIdOrPath, File avatarFile) throws GitLabApiException
Uploads and sets the project avatar for the specified project.PUT /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredavatarFile
- the File instance of the avatar file to upload- Returns:
- the updated Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public List<Variable> getVariables(Object projectIdOrPath) throws GitLabApiException
Get list of a project's variables.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a list of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public List<Variable> getVariables(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of variables for the specified project in the specified page range.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of Variable instances per page- Returns:
- a list of variables belonging to the specified project in the specified page range
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public Pager<Variable> getVariables(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of variables belonging to the specified project.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requireditemsPerPage
- the number of Variable instances that will be fetched per page- Returns:
- a Pager of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariablesStream
public Stream<Variable> getVariablesStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of variables belonging to the specified project.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, required- Returns:
- a Stream of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariable
public Variable getVariable(Object projectIdOrPath, String key) throws GitLabApiException
Get the details of a project variable.GitLab Endpoint: GET /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Returns:
- the Variable instance for the specified variable
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalVariable
public Optional<Variable> getOptionalVariable(Object projectIdOrPath, String key)
Get the details of a variable as an Optional instance.GitLab Endpoint: GET /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Returns:
- the Variable for the specified variable as an Optional instance
-
createVariable
public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected) throws GitLabApiException
Create a new project variable.GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
createVariable
public Variable createVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope) throws GitLabApiException
Create a new project variable.NOTE: Setting the environmentScope is only available on GitLab EE.
GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optionalenvironmentScope
- the environment_scope of the variable, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public Variable updateVariable(Object projectIdOrPath, String key, String value, Boolean isProtected) throws GitLabApiException
Update a project variable.GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optional- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public Variable updateVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope) throws GitLabApiException
Update a project variable.NOTE: Updating the environmentScope is only available on GitLab EE.
GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optionalenvironmentScope
- the environment_scope of the variable, optional.- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
deleteVariable
public void deleteVariable(Object projectIdOrPath, String key) throws GitLabApiException
Deletes a project variable.DELETE /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Throws:
GitLabApiException
- if any exception occurs
-
-