public class GitlabAPI extends Object
Modifier and Type | Field and Description |
---|---|
static org.codehaus.jackson.map.ObjectMapper |
MAPPER |
public static GitlabSession connect(String hostUrl, String username, String password) throws IOException
IOException
public GitlabAPI ignoreCertificateErrors(boolean ignoreCertificateErrors)
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 GitlabGroup getGroup(Integer groupId) throws IOException
IOException
public List<GitlabGroup> getGroups() throws IOException
IOException
public List<GitlabGroupMember> getGroupMembers(GitlabGroup group) throws IOException
group
- The GitLab GroupIOException
public List<GitlabGroupMember> getGroupMembers(Integer groupId) throws IOException
groupId
- The id of the GitLab GroupIOException
public 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
public GitlabGroup createGroup(String name, String path) throws IOException
name
- The name of the grouppath
- The path for the groupIOException
public 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
public GitlabProject getProject(Integer projectId) throws IOException
IOException
public List<GitlabProject> getProjects() throws IOException
IOException
public List<GitlabProject> getAllProjects() throws IOException
IOException
public GitlabProject createProject(String name) throws IOException
name
- The name of the projectIOException
public 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
public GitlabProject createUserProject(Integer userId, String name) throws IOException
userId
- The id of the user to create the project forname
- The name of the projectIOException
public GitlabProject createUserProject(Integer userId, String name, String description, String defaultBranch, Boolean issuesEnabled, Boolean wallEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean publik, Integer visibilityLevel) 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 defaultIOException
public List<GitlabMergeRequest> getOpenMergeRequests(GitlabProject project) throws IOException
IOException
public List<GitlabMergeRequest> getMergeRequests(Integer projectId) throws IOException
IOException
public List<GitlabMergeRequest> getMergeRequests(GitlabProject project) throws IOException
IOException
public List<GitlabMergeRequest> getAllMergeRequests(GitlabProject project) throws IOException
IOException
public GitlabMergeRequest getMergeRequest(GitlabProject project, Integer mergeRequestId) throws IOException
IOException
public List<GitlabNote> getNotes(GitlabMergeRequest mergeRequest) throws IOException
IOException
public List<GitlabNote> getAllNotes(GitlabMergeRequest mergeRequest) throws IOException
IOException
public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest) throws IOException
IOException
public GitlabNote createNote(GitlabMergeRequest mergeRequest, String body) throws IOException
IOException
public List<GitlabBranch> getBranches(GitlabProject project) throws IOException
IOException
public 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(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 editProjectHook(GitlabProject project, String hookId, String url) 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(Integer 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(Integer projectId, Integer issueId, String message) throws IOException
IOException
public GitlabNote createNote(GitlabIssue issue, String message) throws IOException
IOException
public List<GitlabMilestone> getMilestones(GitlabProject project) throws IOException
IOException
public List<GitlabMilestone> getMilestones(Integer projectId) throws IOException
IOException
public List<GitlabProjectMember> getProjectMembers(GitlabProject project) throws IOException
IOException
public List<GitlabProjectMember> getProjectMembers(Integer projectId) throws IOException
IOException
public List<GitlabProjectMember> getNamespaceMembers(GitlabNamespace namespace) throws IOException
namespace
- IOException
public List<GitlabProjectMember> getNamespaceMembers(Integer namespaceId) throws IOException
namespaceId
- IOException
public GitlabSession getCurrentSession() throws IOException
IOException
Copyright © 2014. All Rights Reserved.