public class GitlabAPI extends Object
Modifier and Type | Field and Description |
---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
Modifier and Type | Method and Description |
---|---|
GitlabMergeRequest |
acceptMergeRequest(GitlabProject project,
Integer mergeRequestId,
String mergeCommitMessage) |
GitlabGroupMember |
addGroupMember(GitlabGroup group,
GitlabUser user,
GitlabAccessLevel accessLevel)
Add a group member.
|
GitlabGroupMember |
addGroupMember(Integer groupId,
Integer userId,
GitlabAccessLevel accessLevel)
Add a group member.
|
GitlabProjectHook |
addProjectHook(GitlabProject project,
String url) |
GitlabProjectHook |
addProjectHook(Serializable projectId,
String url,
boolean pushEvents,
boolean issuesEvents,
boolean mergeRequestEvents,
boolean sslVerification) |
GitlabProjectMember |
addProjectMember(GitlabProject project,
GitlabUser user,
GitlabAccessLevel accessLevel)
Add a project member.
|
GitlabProjectMember |
addProjectMember(Integer projectId,
Integer userId,
GitlabAccessLevel accessLevel)
Add a project member.
|
GitlabSystemHook |
addSystemHook(String url)
Add new system hook hook
|
void |
blockUser(Integer targetUserId)
Block a user
|
static GitlabAPI |
connect(String hostUrl,
String apiToken) |
static GitlabSession |
connect(String hostUrl,
String username,
String password) |
static GitlabAPI |
connect(String hostUrl,
String apiToken,
TokenType tokenType) |
static GitlabAPI |
connect(String hostUrl,
String apiToken,
TokenType tokenType,
AuthMethod method) |
CommitComment |
createCommitComment(Integer projectId,
String sha,
String note,
String path,
String line,
String line_type)
Post comment to commit
|
GitlabCommitStatus |
createCommitStatus(GitlabProject project,
String commitHash,
String state,
String ref,
String name,
String targetUrl,
String description) |
GitlabSSHKey |
createDeployKey(Integer targetProjectId,
String title,
String key)
Create a new deploy key for the project
|
GitlabGroup |
createGroup(String name)
Creates a Group
|
GitlabGroup |
createGroup(String name,
String path)
Creates a Group
|
GitlabGroup |
createGroup(String name,
String path,
String ldapCn,
GitlabAccessLevel ldapAccess)
Creates a Group
|
GitlabGroup |
createGroup(String name,
String path,
String ldapCn,
GitlabAccessLevel ldapAccess,
GitlabUser sudoUser)
Creates a Group
|
GitlabGroup |
createGroupViaSudo(String name,
String path,
GitlabUser sudoUser)
Creates a Group
|
GitlabIssue |
createIssue(int projectId,
int assigneeId,
int milestoneId,
String labels,
String description,
String title) |
GitlabLabel |
createLabel(Serializable projectId,
GitlabLabel label)
Creates a new label.
|
GitlabLabel |
createLabel(Serializable projectId,
String name,
String color)
Creates a new label.
|
GitlabMilestone |
createMilestone(Serializable projectId,
GitlabMilestone milestone)
Creates a new project milestone.
|
GitlabMilestone |
createMilestone(Serializable projectId,
String title,
String description,
Date dueDate)
Cretaes a new project milestone.
|
GitlabNote |
createNote(GitlabIssue issue,
String message) |
GitlabNote |
createNote(GitlabMergeRequest mergeRequest,
String body) |
GitlabNote |
createNote(Serializable projectId,
Integer issueId,
String message) |
GitlabProject |
createProject(String name)
Creates a private Project
|
GitlabProject |
createProject(String name,
Integer namespaceId,
String description,
Boolean issuesEnabled,
Boolean wallEnabled,
Boolean mergeRequestsEnabled,
Boolean wikiEnabled,
Boolean snippetsEnabled,
Boolean publik,
Integer visibilityLevel,
String importUrl)
Creates a Project
|
GitlabSSHKey |
createSSHKey(Integer targetUserId,
String title,
String key)
Create a new ssh key for the user
|
GitlabUser |
createUser(String email,
String password,
String username,
String fullName,
String skypeId,
String linkedIn,
String twitter,
String website_url,
Integer projects_limit,
String extern_uid,
String extern_provider_name,
String bio,
Boolean isAdmin,
Boolean can_create_group,
Boolean skip_confirmation)
Create a new User
|
GitlabProject |
createUserProject(Integer userId,
String name)
Creates a Project for a specific User
|
GitlabProject |
createUserProject(Integer userId,
String name,
String description,
String defaultBranch,
Boolean issuesEnabled,
Boolean wallEnabled,
Boolean mergeRequestsEnabled,
Boolean wikiEnabled,
Boolean snippetsEnabled,
Boolean publik,
Integer visibilityLevel,
String importUrl)
Creates a Project for a specific User
|
void |
deleteBranch(Serializable projectId,
String branchName)
Delete Branch.
|
void |
deleteDeployKey(Integer targetProjectId,
Integer targetKeyId)
Delete a deploy key for a project
|
void |
deleteGroup(Integer groupId)
Delete a group.
|
void |
deleteGroupMember(GitlabGroup group,
GitlabUser user)
Delete a group member.
|
void |
deleteGroupMember(Integer groupId,
Integer userId)
Delete a group member.
|
void |
deleteLabel(Serializable projectId,
GitlabLabel label)
Deletes an existing label.
|
void |
deleteLabel(Serializable projectId,
String name)
Deletes an existing label.
|
void |
deleteProject(Serializable projectId)
Delete a Project.
|
void |
deleteProjectHook(GitlabProjectHook hook) |
void |
deleteProjectHook(GitlabProject project,
String hookId) |
void |
deleteProjectMember(GitlabProject project,
GitlabUser user)
Delete a project team member.
|
void |
deleteProjectMember(Integer projectId,
Integer userId)
Delete a project team member.
|
void |
deleteSSHKey(Integer targetUserId,
Integer targetKeyId)
Delete user's ssh key
|
GitlabSystemHook |
deleteSystemHook(Integer hookId)
Delete system hook
|
void |
deleteUser(Integer targetUserId)
Delete a user
|
GitlabHTTPRequestor |
dispatch() |
GitlabIssue |
editIssue(int projectId,
int issueId,
int assigneeId,
int milestoneId,
String labels,
String description,
String title,
GitlabIssue.Action action) |
GitlabProjectHook |
editProjectHook(GitlabProject project,
String hookId,
String url) |
List<GitlabUser> |
findUsers(String emailOrUsername)
Finds users by email address or username.
|
List<GitlabCommit> |
getAllCommits(Serializable projectId) |
List<GitlabCommit> |
getAllCommits(Serializable projectId,
Pagination pagination,
String branchOrTag) |
List<GitlabCommit> |
getAllCommits(Serializable projectId,
String branchOrTag) |
List<GitlabMergeRequest> |
getAllMergeRequests(GitlabProject project) |
List<GitlabNote> |
getAllNotes(GitlabMergeRequest mergeRequest) |
List<GitlabProject> |
getAllProjects()
Get's all projects in Gitlab, requires sudo user
|
URL |
getAPIUrl(String tailAPIUrl) |
GitlabBranch |
getBranch(GitlabProject project,
String branchName) |
List<GitlabBranch> |
getBranches(GitlabProject project) |
List<GitlabBranch> |
getBranches(Serializable projectId) |
GitlabCommit |
getCommit(Serializable projectId,
String commitHash) |
List<CommitComment> |
getCommitComments(Integer projectId,
String sha)
Get the comments of a commit
|
List<GitlabCommitDiff> |
getCommitDiffs(Serializable projectId,
String commitHash) |
List<GitlabCommitDiff> |
getCommitDiffs(Serializable projectId,
String commitHash,
Pagination pagination) |
List<GitlabCommit> |
getCommits(GitlabMergeRequest mergeRequest) |
List<GitlabCommit> |
getCommits(GitlabMergeRequest mergeRequest,
Pagination pagination) |
List<GitlabCommit> |
getCommits(Serializable projectId,
Pagination pagination,
String branchOrTag) |
List<GitlabCommitStatus> |
getCommitStatuses(GitlabProject project,
String commitHash) |
List<GitlabCommitStatus> |
getCommitStatuses(GitlabProject project,
String commitHash,
Pagination pagination) |
GitlabSession |
getCurrentSession() |
List<GitlabSSHKey> |
getDeployKeys(Integer targetProjectId)
Gets all deploy keys for a project
|
byte[] |
getFileArchive(GitlabProject project)
Get an archive of the repository
|
GitlabGroup |
getGroup(Integer groupId) |
List<GitlabGroupMember> |
getGroupMembers(GitlabGroup group)
Gets all members of a Group
|
List<GitlabGroupMember> |
getGroupMembers(Integer groupId)
Gets all members of a Group
|
List<GitlabProject> |
getGroupProjects(GitlabGroup group)
Get all the projects for a group.
|
List<GitlabProject> |
getGroupProjects(Integer groupId)
Get all the projects for a group.
|
List<GitlabGroup> |
getGroups() |
GitlabIssue |
getIssue(Serializable projectId,
Integer issueId) |
List<GitlabIssue> |
getIssues(GitlabProject project) |
List<GitlabLabel> |
getLabels(GitlabProject project)
Gets labels associated with a project.
|
List<GitlabLabel> |
getLabels(Serializable projectId)
Gets labels associated with a project.
|
List<GitlabCommit> |
getLastCommits(Serializable projectId) |
List<GitlabCommit> |
getLastCommits(Serializable projectId,
String branchOrTag) |
GitlabMergeRequest |
getMergeRequest(GitlabProject project,
Integer mergeRequestId) |
GitlabMergeRequest |
getMergeRequestByIid(Serializable projectId,
Integer mergeRequestIid)
Return Merge Request.
|
GitlabMergeRequest |
getMergeRequestChanges(Serializable projectId,
Integer mergeRequestId)
Return a Merge Request including its changes.
|
List<GitlabMergeRequest> |
getMergeRequests(GitlabProject project) |
List<GitlabMergeRequest> |
getMergeRequests(Serializable projectId) |
List<GitlabMilestone> |
getMilestones(GitlabProject project) |
List<GitlabMilestone> |
getMilestones(Serializable projectId) |
List<GitlabProjectMember> |
getNamespaceMembers(GitlabNamespace namespace)
This will fail, if the given namespace is a user and not a group
|
List<GitlabProjectMember> |
getNamespaceMembers(Integer namespaceId)
This will fail, if the given namespace is a user and not a group
|
GitlabNote |
getNote(GitlabMergeRequest mergeRequest,
Integer noteId)
Get a Note from a Merge Request.
|
List<GitlabNote> |
getNotes(GitlabIssue issue) |
List<GitlabNote> |
getNotes(GitlabMergeRequest mergeRequest) |
List<GitlabMergeRequest> |
getOpenMergeRequests(GitlabProject project) |
List<GitlabMergeRequest> |
getOpenMergeRequests(Serializable projectId) |
GitlabProject |
getProject(Serializable projectId) |
GitlabProjectHook |
getProjectHook(GitlabProject project,
String hookId) |
List<GitlabProjectHook> |
getProjectHooks(GitlabProject project) |
List<GitlabProjectHook> |
getProjectHooks(Serializable projectId) |
List<GitlabProjectMember> |
getProjectMembers(GitlabProject project) |
List<GitlabProjectMember> |
getProjectMembers(Serializable projectId) |
List<GitlabProject> |
getProjects()
Get a list of projects accessible by the authenticated user.
|
List<GitlabProject> |
getProjectsViaSudo(GitlabUser user)
Get a list of projects accessible by the authenticated user.
|
byte[] |
getRawBlobContent(GitlabProject project,
String sha)
Get the raw file contents for a blob by blob SHA.
|
byte[] |
getRawFileContent(GitlabProject project,
String sha,
String filepath)
Get raw file content
|
List<GitlabRepositoryTree> |
getRepositoryTree(GitlabProject project,
String path,
String ref_name)
Get an archive of the repository
|
int |
getRequestTimeout() |
GitlabSSHKey |
getSSHKey(Integer keyId)
Get key with user information by ID of an SSH key.
|
List<GitlabSSHKey> |
getSSHKeys(Integer targetUserId)
Gets all ssh keys for a user
|
List<GitlabSystemHook> |
getSystemHooks()
Get list of system hooks
|
URL |
getUrl(String tailAPIUrl) |
GitlabUser |
getUser()
Return API User
|
GitlabUser |
getUser(Integer userId) |
List<GitlabUser> |
getUsers() |
GitlabUser |
getUserViaSudo(String username) |
GitlabAPI |
ignoreCertificateErrors(boolean ignoreCertificateErrors) |
boolean |
isIgnoreCertificateErrors() |
void |
protectBranch(GitlabProject project,
String branchName) |
GitlabHTTPRequestor |
retrieve() |
GitlabAPI |
setRequestTimeout(int requestTimeout) |
void |
testSystemHook(Integer hookId)
Test system hook
|
void |
transfer(Integer namespaceId,
Integer projectId)
Transfer a project to the given namespace
|
void |
unblockUser(Integer targetUserId)
Unblock a user
|
void |
unprotectBranch(GitlabProject project,
String branchName) |
GitlabLabel |
updateLabel(Serializable projectId,
String name,
String newName,
String newColor)
Updates an existing label.
|
GitlabMergeRequest |
updateMergeRequest(Serializable projectId,
Integer mergeRequestId,
String targetBranch,
Integer assigneeId,
String title,
String description,
String stateEvent,
String labels)
Updates a Merge Request
|
GitlabMilestone |
updateMilestone(GitlabMilestone edited,
String stateEvent)
Updates an existing project milestone.
|
GitlabMilestone |
updateMilestone(Serializable projectId,
GitlabMilestone edited,
String stateEvent)
Updates an existing project milestone.
|
GitlabMilestone |
updateMilestone(Serializable projectId,
int milestoneId,
String title,
String description,
Date dueDate,
String stateEvent)
Updates an existing project milestone.
|
GitlabNote |
updateNote(GitlabMergeRequest mergeRequest,
Integer noteId,
String body)
Update a Merge Request Note
|
GitlabProject |
updateProject(Integer projectId,
String name,
String description,
Boolean issuesEnabled,
Boolean wallEnabled,
Boolean mergeRequestsEnabled,
Boolean wikiEnabled,
Boolean snippetsEnabled,
Boolean publik,
Integer visibilityLevel)
Updates a Project
|
GitlabUser |
updateUser(Integer targetUserId,
String email,
String password,
String username,
String fullName,
String skypeId,
String linkedIn,
String twitter,
String website_url,
Integer projects_limit,
String extern_uid,
String extern_provider_name,
String bio,
Boolean isAdmin,
Boolean can_create_group)
Update a user
|
public static GitlabSession connect(String hostUrl, String username, String password) throws IOException
IOException
public static GitlabAPI connect(String hostUrl, String apiToken, TokenType tokenType, AuthMethod method)
public GitlabAPI ignoreCertificateErrors(boolean ignoreCertificateErrors)
public int getRequestTimeout()
public GitlabAPI setRequestTimeout(int requestTimeout)
public GitlabHTTPRequestor retrieve()
public GitlabHTTPRequestor dispatch()
public boolean isIgnoreCertificateErrors()
public URL getAPIUrl(String tailAPIUrl) throws IOException
IOException
public URL getUrl(String tailAPIUrl) throws IOException
IOException
public List<GitlabUser> getUsers() throws IOException
IOException
public List<GitlabUser> findUsers(String emailOrUsername) throws IOException
emailOrUsername
- Some portion of the email address or usernameIOException
public GitlabUser getUser() throws IOException
IOException
public GitlabUser getUser(Integer userId) throws IOException
IOException
public GitlabUser getUserViaSudo(String username) throws IOException
IOException
public GitlabUser createUser(String email, String password, String username, String fullName, String skypeId, String linkedIn, String twitter, String website_url, Integer projects_limit, String extern_uid, String extern_provider_name, String bio, Boolean isAdmin, Boolean can_create_group, Boolean skip_confirmation) throws IOException
email
- User emailpassword
- Passwordusername
- User namefullName
- Full nameskypeId
- Skype IdlinkedIn
- LinkedIntwitter
- Twitterwebsite_url
- Website URLprojects_limit
- Projects limitextern_uid
- External User IDextern_provider_name
- External Provider Namebio
- BioisAdmin
- Is Admincan_create_group
- Can Create Groupskip_confirmation
- Skip ConfirmationIOException
- on gitlab api call errorpublic GitlabUser updateUser(Integer targetUserId, String email, String password, String username, String fullName, String skypeId, String linkedIn, String twitter, String website_url, Integer projects_limit, String extern_uid, String extern_provider_name, String bio, Boolean isAdmin, Boolean can_create_group) throws IOException
targetUserId
- User IDemail
- User emailpassword
- Passwordusername
- User namefullName
- Full nameskypeId
- Skype IdlinkedIn
- LinkedIntwitter
- Twitterwebsite_url
- Website URLprojects_limit
- Projects limitextern_uid
- External User IDextern_provider_name
- External Provider Namebio
- BioisAdmin
- Is Admincan_create_group
- Can Create GroupIOException
- on gitlab api call errorpublic void blockUser(Integer targetUserId) throws IOException
targetUserId
- The id of the Gitlab userIOException
- on gitlab api call errorpublic void unblockUser(Integer targetUserId) throws IOException
targetUserId
- The id of the Gitlab userIOException
- on gitlab api call errorpublic GitlabSSHKey createSSHKey(Integer targetUserId, String title, String key) throws IOException
targetUserId
- The id of the Gitlab usertitle
- The title of the ssh keykey
- The public keyIOException
- on gitlab api call errorpublic void deleteSSHKey(Integer targetUserId, Integer targetKeyId) throws IOException
targetUserId
- The id of the Gitlab usertargetKeyId
- The id of the Gitlab ssh keyIOException
- on gitlab api call errorpublic List<GitlabSSHKey> getSSHKeys(Integer targetUserId) throws IOException
targetUserId
- The id of the GitLab UserIOException
- on gitlab api call errorpublic GitlabSSHKey getSSHKey(Integer keyId) throws IOException
keyId
- The ID of an SSH keyIOException
- on gitlab api call errorpublic void deleteUser(Integer targetUserId) throws IOException
targetUserId
- The target User IDIOException
- on gitlab api call errorpublic GitlabGroup getGroup(Integer groupId) throws IOException
IOException
public List<GitlabGroup> getGroups() throws IOException
IOException
public List<GitlabProject> getGroupProjects(GitlabGroup group) throws IOException
group
- the target groupIOException
public List<GitlabProject> getGroupProjects(Integer groupId) throws IOException
groupId
- the target group's id.IOException
public List<GitlabGroupMember> getGroupMembers(GitlabGroup group) throws IOException
group
- The GitLab GroupIOException
- on gitlab api call errorpublic List<GitlabGroupMember> getGroupMembers(Integer groupId) throws IOException
groupId
- The id of the GitLab GroupIOException
- on gitlab api call errorpublic GitlabGroup createGroup(String name) throws IOException
name
- The name of the group. The
name will also be used as the path
of the group.IOException
- on gitlab api call errorpublic GitlabGroup createGroup(String name, String path) throws IOException
name
- The name of the grouppath
- The path for the groupIOException
- on gitlab api call errorpublic GitlabGroup createGroupViaSudo(String name, String path, GitlabUser sudoUser) throws IOException
name
- The name of the grouppath
- The path for the groupsudoUser
- The user to create the group on behalf ofIOException
- on gitlab api call errorpublic GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess) throws IOException
name
- The name of the grouppath
- The path for the groupldapCn
- LDAP Group Name to sync with, null otherwiseldapAccess
- Access level for LDAP group members, null otherwiseIOException
- on gitlab api call errorpublic GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess, GitlabUser sudoUser) throws IOException
name
- The name of the grouppath
- The path for the groupldapCn
- LDAP Group Name to sync with, null otherwiseldapAccess
- Access level for LDAP group members, null otherwisesudoUser
- The user to create the group on behalf ofIOException
- on gitlab api call errorpublic GitlabGroupMember addGroupMember(GitlabGroup group, GitlabUser user, GitlabAccessLevel accessLevel) throws IOException
group
- the GitlabGroupuser
- the GitlabUseraccessLevel
- the GitlabAccessLevelIOException
- on gitlab api call errorpublic GitlabGroupMember addGroupMember(Integer groupId, Integer userId, GitlabAccessLevel accessLevel) throws IOException
groupId
- the group iduserId
- the user idaccessLevel
- the GitlabAccessLevelIOException
- on gitlab api call errorpublic void deleteGroupMember(GitlabGroup group, GitlabUser user) throws IOException
group
- the GitlabGroupuser
- the GitlabUserIOException
- on gitlab api call errorpublic void deleteGroupMember(Integer groupId, Integer userId) throws IOException
groupId
- the group iduserId
- the user idIOException
- on gitlab api call errorpublic void deleteGroup(Integer groupId) throws IOException
groupId
- the group idIOException
- on gitlab api call errorpublic GitlabProject getProject(Serializable projectId) throws IOException
IOException
public List<GitlabProject> getProjects() throws IOException
IOException
public List<GitlabProject> getProjectsViaSudo(GitlabUser user) throws IOException
IOException
public List<GitlabProject> getAllProjects() throws IOException
IOException
public GitlabProject createProject(String name) throws IOException
name
- The name of the projectIOException
- on gitlab api call errorpublic GitlabProject createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel, String importUrl) throws IOException
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 defaultwallEnabled
- Whether The Wall 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 defaultpublik
- 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 nullIOException
- on gitlab api call errorpublic GitlabProject createUserProject(Integer userId, String name) throws IOException
userId
- The id of the user to create the project forname
- The name of the projectIOException
- on gitlab api call errorpublic GitlabProject createUserProject(Integer userId, String name, String description, String defaultBranch, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel, String importUrl) throws IOException
userId
- The id of the user to create the project forname
- The name of the projectdescription
- A description for the project, null otherwisedefaultBranch
- The default branch for the project, otherwise null indicates to use GitLab default (master)issuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultwallEnabled
- Whether The Wall 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 defaultpublik
- 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 nullIOException
- on gitlab api call errorpublic GitlabProject updateProject(Integer projectId, String name, String description, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel) throws IOException
projectId
- The id of the project to updatename
- The name of the projectdescription
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultwallEnabled
- Whether The Wall 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 defaultpublik
- 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 defaultIOException
- on gitlab api call errorpublic void deleteProject(Serializable projectId) throws IOException
projectId
- The id of the project to deleteIOException
- on gitlab api call errorpublic List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException
IOException
public List<GitlabMergeRequest> getOpenMergeRequests(GitlabProject project) throws IOException
IOException
public List<GitlabMergeRequest> getMergeRequests(Serializable projectId) throws IOException
IOException
public List<GitlabMergeRequest> getMergeRequests(GitlabProject project) throws IOException
IOException
public List<GitlabMergeRequest> getAllMergeRequests(GitlabProject project) throws IOException
IOException
public GitlabMergeRequest getMergeRequestByIid(Serializable projectId, Integer mergeRequestIid) throws IOException
projectId
- The id of the projectmergeRequestIid
- The iid of the merge requestIOException
- on gitlab api call errorpublic GitlabMergeRequest getMergeRequestChanges(Serializable projectId, Integer mergeRequestId) throws IOException
projectId
- The id of the projectmergeRequestId
- The id of the merge requestIOException
- on gitlab api call errorpublic GitlabMergeRequest getMergeRequest(GitlabProject project, Integer mergeRequestId) throws IOException
IOException
public GitlabMergeRequest updateMergeRequest(Serializable projectId, Integer mergeRequestId, String targetBranch, Integer assigneeId, String title, String description, String stateEvent, String labels) throws IOException
projectId
- The id of the projectmergeRequestId
- The id of the merge request to updatetargetBranch
- The target branch of the merge request, otherwise null to leave it untouchedassigneeId
- The id of the assignee, otherwise null to leave it untouchedtitle
- The title of the merge request, otherwise null to leave it untoucheddescription
- The description of the merge request, otherwise null to leave it untouchedstateEvent
- The state (close|reopen|merge) of the merge request, otherwise null to leave it untouchedlabels
- A comma separated list of labels, otherwise null to leave it untouchedIOException
- on gitlab api call errorpublic GitlabMergeRequest acceptMergeRequest(GitlabProject project, Integer mergeRequestId, String mergeCommitMessage) throws IOException
project
- The ProjectmergeRequestId
- Merge Request IDmergeCommitMessage
- optional merge commit message. Null if not setIOException
- on gitlab api call errorpublic GitlabNote getNote(GitlabMergeRequest mergeRequest, Integer noteId) throws IOException
mergeRequest
- The merge requestnoteId
- The id of the noteIOException
- on gitlab api call errorpublic List<GitlabNote> getNotes(GitlabMergeRequest mergeRequest) throws IOException
IOException
public List<GitlabNote> getAllNotes(GitlabMergeRequest mergeRequest) throws IOException
IOException
public GitlabCommit getCommit(Serializable projectId, String commitHash) throws IOException
IOException
public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest) throws IOException
IOException
public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest, Pagination pagination) throws IOException
IOException
public List<GitlabCommit> getLastCommits(Serializable projectId) throws IOException
IOException
public List<GitlabCommit> getLastCommits(Serializable projectId, String branchOrTag) throws IOException
IOException
public List<GitlabCommit> getCommits(Serializable projectId, Pagination pagination, String branchOrTag) throws IOException
IOException
public List<GitlabCommit> getAllCommits(Serializable projectId) throws IOException
IOException
public List<GitlabCommit> getAllCommits(Serializable projectId, String branchOrTag) throws IOException
IOException
public List<GitlabCommit> getAllCommits(Serializable projectId, Pagination pagination, String branchOrTag) throws IOException
IOException
public List<GitlabCommitDiff> getCommitDiffs(Serializable projectId, String commitHash) throws IOException
IOException
public List<GitlabCommitDiff> getCommitDiffs(Serializable projectId, String commitHash, Pagination pagination) throws IOException
IOException
public List<GitlabCommitStatus> getCommitStatuses(GitlabProject project, String commitHash) throws IOException
IOException
public List<GitlabCommitStatus> getCommitStatuses(GitlabProject project, String commitHash, Pagination pagination) throws IOException
IOException
public GitlabCommitStatus createCommitStatus(GitlabProject project, String commitHash, String state, String ref, String name, String targetUrl, String description) throws IOException
IOException
public byte[] getRawFileContent(GitlabProject project, String sha, String filepath) throws IOException
project
- The Projectsha
- The commit or branch namefilepath
- The path of the fileIOException
- on gitlab api call errorpublic byte[] getRawBlobContent(GitlabProject project, String sha) throws IOException
project
- The Projectsha
- The commit or branch nameIOException
- on gitlab api call errorpublic byte[] getFileArchive(GitlabProject project) throws IOException
project
- The ProjectIOException
- on gitlab api call errorpublic List<GitlabRepositoryTree> getRepositoryTree(GitlabProject project, String path, String ref_name) throws IOException
project
- The Projectpath
- The path inside the repository. Used to get content of subdirectories (optional)ref_name
- The name of a repository branch or tag or if not given the default branch (optional)IOException
- on gitlab api call errorpublic GitlabNote updateNote(GitlabMergeRequest mergeRequest, Integer noteId, String body) throws IOException
mergeRequest
- The merge requestnoteId
- The id of the notebody
- The content of the noteIOException
- on gitlab api call errorpublic GitlabNote createNote(GitlabMergeRequest mergeRequest, String body) throws IOException
IOException
public List<GitlabBranch> getBranches(Serializable projectId) throws IOException
IOException
public List<GitlabBranch> getBranches(GitlabProject project) throws IOException
IOException
public void deleteBranch(Serializable projectId, String branchName) throws IOException
projectId
- The id of the projectbranchName
- The name of the branch to deleteIOException
- on gitlab api call errorpublic GitlabBranch getBranch(GitlabProject project, String branchName) throws IOException
IOException
public void protectBranch(GitlabProject project, String branchName) throws IOException
IOException
public void unprotectBranch(GitlabProject project, String branchName) throws IOException
IOException
public List<GitlabProjectHook> getProjectHooks(Serializable projectId) throws IOException
IOException
public List<GitlabProjectHook> getProjectHooks(GitlabProject project) throws IOException
IOException
public GitlabProjectHook getProjectHook(GitlabProject project, String hookId) throws IOException
IOException
public GitlabProjectHook addProjectHook(GitlabProject project, String url) throws IOException
IOException
public GitlabProjectHook addProjectHook(Serializable projectId, String url, boolean pushEvents, boolean issuesEvents, boolean mergeRequestEvents, boolean sslVerification) throws IOException
IOException
public GitlabProjectHook editProjectHook(GitlabProject project, String hookId, String url) throws IOException
IOException
public void deleteProjectHook(GitlabProjectHook hook) throws IOException
IOException
public void deleteProjectHook(GitlabProject project, String hookId) throws IOException
IOException
public List<GitlabIssue> getIssues(GitlabProject project) throws IOException
IOException
public GitlabIssue getIssue(Serializable projectId, Integer issueId) throws IOException
IOException
public GitlabIssue createIssue(int projectId, int assigneeId, int milestoneId, String labels, String description, String title) throws IOException
IOException
public GitlabIssue editIssue(int projectId, int issueId, int assigneeId, int milestoneId, String labels, String description, String title, GitlabIssue.Action action) throws IOException
IOException
public List<GitlabNote> getNotes(GitlabIssue issue) throws IOException
IOException
public GitlabNote createNote(Serializable projectId, Integer issueId, String message) throws IOException
IOException
public GitlabNote createNote(GitlabIssue issue, String message) throws IOException
IOException
public List<GitlabLabel> getLabels(Serializable projectId) throws IOException
projectId
- The ID of the project.IOException
public List<GitlabLabel> getLabels(GitlabProject project) throws IOException
project
- The project associated with labels.IOException
public GitlabLabel createLabel(Serializable projectId, String name, String color) throws IOException
projectId
- The ID of the project containing the new label.name
- The name of the label.color
- The color of the label (eg #ff0000).IOException
public GitlabLabel createLabel(Serializable projectId, GitlabLabel label) throws IOException
projectId
- The ID of the project containing the label.label
- The label to create.IOException
public void deleteLabel(Serializable projectId, String name) throws IOException
projectId
- The ID of the project containing the label.name
- The name of the label to delete.IOException
public void deleteLabel(Serializable projectId, GitlabLabel label) throws IOException
projectId
- The ID of the project containing the label.label
- The label to delete.IOException
public GitlabLabel updateLabel(Serializable projectId, String name, String newName, String newColor) throws IOException
projectId
- The ID of the project containing the label.name
- The name of the label to update.newName
- The updated name.newColor
- The updated color.IOException
public List<GitlabMilestone> getMilestones(GitlabProject project) throws IOException
IOException
public List<GitlabMilestone> getMilestones(Serializable projectId) throws IOException
IOException
public GitlabMilestone createMilestone(Serializable projectId, String title, String description, Date dueDate) throws IOException
projectId
- The ID of the project.title
- The title of the milestone.description
- The description of the milestone. (Optional)dueDate
- The date the milestone is due. (Optional)IOException
public GitlabMilestone createMilestone(Serializable projectId, GitlabMilestone milestone) throws IOException
projectId
- The ID of the project.milestone
- The milestone to create.IOException
public GitlabMilestone updateMilestone(Serializable projectId, int milestoneId, String title, String description, Date dueDate, String stateEvent) throws IOException
projectId
- The ID of the project.milestoneId
- The ID of the milestone.title
- The title of the milestone. (Optional)description
- The description of the milestone. (Optional)dueDate
- The date the milestone is due. (Optional)stateEvent
- A value used to update the state of the milestone.
(Optional) (activate | close)IOException
public GitlabMilestone updateMilestone(Serializable projectId, GitlabMilestone edited, String stateEvent) throws IOException
projectId
- The ID of the project.edited
- The already edited milestone.stateEvent
- A value used to update the state of the milestone.
(Optional) (activate | close)IOException
public GitlabMilestone updateMilestone(GitlabMilestone edited, String stateEvent) throws IOException
edited
- The already edited milestone.stateEvent
- A value used to update the state of the milestone.
(Optional) (activate | close)IOException
public GitlabProjectMember addProjectMember(GitlabProject project, GitlabUser user, GitlabAccessLevel accessLevel) throws IOException
project
- the GitlabProjectuser
- the GitlabUseraccessLevel
- the GitlabAccessLevelIOException
- on gitlab api call errorpublic GitlabProjectMember addProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException
projectId
- the project iduserId
- the user idaccessLevel
- the GitlabAccessLevelIOException
- on gitlab api call errorpublic void deleteProjectMember(GitlabProject project, GitlabUser user) throws IOException
project
- the GitlabProjectuser
- the GitlabUserIOException
- on gitlab api call errorpublic void deleteProjectMember(Integer projectId, Integer userId) throws IOException
projectId
- the project iduserId
- the user idIOException
- on gitlab api call errorpublic List<GitlabProjectMember> getProjectMembers(GitlabProject project) throws IOException
IOException
public List<GitlabProjectMember> getProjectMembers(Serializable projectId) throws IOException
IOException
public List<GitlabProjectMember> getNamespaceMembers(GitlabNamespace namespace) throws IOException
namespace
- The namespaceIOException
- on gitlab api call errorpublic List<GitlabProjectMember> getNamespaceMembers(Integer namespaceId) throws IOException
namespaceId
- Namespace IDIOException
- on gitlab api call errorpublic void transfer(Integer namespaceId, Integer projectId) throws IOException
namespaceId
- Namespace IDprojectId
- Project IDIOException
- on gitlab api call errorpublic GitlabSSHKey createDeployKey(Integer targetProjectId, String title, String key) throws IOException
targetProjectId
- The id of the Gitlab projecttitle
- The title of the ssh keykey
- The public keyIOException
- on gitlab api call errorpublic void deleteDeployKey(Integer targetProjectId, Integer targetKeyId) throws IOException
targetProjectId
- The id of the Gitlab projecttargetKeyId
- The id of the Gitlab ssh keyIOException
- on gitlab api call errorpublic List<GitlabSSHKey> getDeployKeys(Integer targetProjectId) throws IOException
targetProjectId
- The id of the Gitlab projectIOException
- on gitlab api call errorpublic GitlabSession getCurrentSession() throws IOException
IOException
public List<GitlabSystemHook> getSystemHooks() throws IOException
IOException
- on gitlab api call errorpublic GitlabSystemHook addSystemHook(String url) throws IOException
url
- System hook urlIOException
- on gitlab api call errorpublic void testSystemHook(Integer hookId) throws IOException
IOException
- on gitlab api call errorpublic GitlabSystemHook deleteSystemHook(Integer hookId) throws IOException
IOException
- on gitlab api call errorpublic CommitComment createCommitComment(Integer projectId, String sha, String note, String path, String line, String line_type) throws IOException
projectId
- (required) - The ID of a projectsha
- (required) - The name of a repository branch or tag or if not given the default branchnote
- (required) - Text of commentpath
- (optional) - The file pathline
- (optional) - The line numberline_type
- (optional) - The line type (new or old)IOException
- on gitlab api call errorpublic List<CommitComment> getCommitComments(Integer projectId, String sha) throws IOException
projectId
- (required) - The ID of a projectsha
- (required) - The name of a repository branch or tag or if not given the default branchIOException
- on gitlab api call errorCopyright © 2015. All Rights Reserved.