public class ProjectApi extends AbstractApi
Constructor and Description |
---|
ProjectApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
ProjectHook |
addHook(Integer projectId,
String url,
boolean doPushEvents,
boolean doIssuesEvents,
boolean doMergeRequestsEvents)
Adds a hook to project.
|
ProjectHook |
addHook(Integer projectId,
String url,
ProjectHook enabledHooks,
boolean enableSslVerification,
String secretToken)
Adds a hook to project.
|
ProjectHook |
addHook(Project project,
String url,
boolean doPushEvents,
boolean doIssuesEvents,
boolean doMergeRequestsEvents)
Adds a hook to project.
|
ProjectHook |
addHook(Project project,
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(Integer projectId,
Integer userId,
Integer accessLevel)
Adds a user to a project team.
|
Project |
createProject(Integer groupId,
String projectName)
Create a new project in the specified group.
|
Project |
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.
|
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)
Creates a Project
|
void |
deleteHook(Integer projectId,
Integer hookId)
Deletes a hook from the project.
|
void |
deleteHook(ProjectHook hook)
Deletes a hook from the project.
|
void |
deleteProject(Integer projectId)
Removes project with all resources(issues, merge requests etc).
|
void |
deleteProject(Project project)
Removes project with all resources(issues, merge requests etc).
|
List<Project> |
getAllProjects()
Get a list of all GitLab projects (admin only).
|
ProjectHook |
getHook(Integer projectId,
Integer hookId)
Get a specific hook for project.
|
List<ProjectHook> |
getHooks(Integer projectId)
Get list of project hooks.
|
List<Issue> |
getIssues(Integer projectId)
Get a list of project's issues.
|
Member |
getMember(Integer projectId,
Integer userId)
Gets a project team member.
|
List<Member> |
getMembers(Integer projectId)
Get a list of project team members.
|
List<Project> |
getOwnedProjects()
Get a list of projects owned by the authenticated user.
|
Project |
getProject(Integer projectId)
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.
|
List<Event> |
getProjectEvents(Integer projectId)
Get a project events for specific project.
|
List<Project> |
getProjects()
Get a list of projects accessible by the authenticated user.
|
ProjectHook |
modifyHook(ProjectHook hook)
Modifies a hook for project.
|
void |
removeMember(Integer projectId,
Integer userId)
Removes user from project team.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, handle, post, post, post, put, put, validate
public ProjectApi(GitLabApi gitLabApi)
public List<Project> getProjects() throws GitLabApiException
GitLabApiException
- if any exception occurspublic List<Project> getAllProjects() throws GitLabApiException
GitLabApiException
- if any exception occurspublic List<Project> getOwnedProjects() throws GitLabApiException
GitLabApiException
- if any exception occurspublic Project getProject(Integer projectId) throws GitLabApiException
projectId
- the ID of the project to getGitLabApiException
- if any exception occurspublic Project getProject(String namespace, String project) throws GitLabApiException
namespace
- the name of the project namespace or groupproject
- the name of the project to getGitLabApiException
- if any exception occurspublic Project createProject(Integer groupId, String projectName) throws GitLabApiException
groupId
- the group ID to create the project underprojectName
- the name of the project top createGitLabApiException
- if any exception occurspublic Project createProject(String projectName) throws GitLabApiException
projectName
- the name of the project top createGitLabApiException
- if any exception occurspublic Project createProject(Project project) throws GitLabApiException
project
- the Project instance with the configuration for the new projectGitLabApiException
- if any exception occurspublic Project createProject(Project project, String importUrl) throws GitLabApiException
project
- the Project instance with the configuration for the new projectimportUrl
- the URL to import the repository fromGitLabApiException
- if any exception occurspublic Project createProject(String name, Integer namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Boolean isPublic, Integer visibilityLevel, String importUrl) throws GitLabApiException
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 nullGitLabApiException
- if any exception occurspublic void deleteProject(Integer projectId) throws GitLabApiException
projectId
- the project ID to removeGitLabApiException
- if any exception occurspublic void deleteProject(Project project) throws GitLabApiException
project
- the Project instance to removeGitLabApiException
- if any exception occurspublic List<Member> getMembers(Integer projectId) throws GitLabApiException
projectId
- the project ID to get team members forGitLabApiException
- if any exception occurspublic Member getMember(Integer projectId, Integer userId) throws GitLabApiException
projectId
- the project ID to get team member foruserId
- the user ID of the memberGitLabApiException
- if any exception occurspublic Member addMember(Integer projectId, Integer userId, Integer accessLevel) throws GitLabApiException
projectId
- the project ID to add the team member touserId
- the user ID of the member to addaccessLevel
- the access level for the new memberGitLabApiException
- if any exception occurspublic void removeMember(Integer projectId, Integer userId) throws GitLabApiException
projectId
- the project ID to remove the team member fromuserId
- the user ID of the member to removeGitLabApiException
- if any exception occurspublic List<Event> getProjectEvents(Integer projectId) throws GitLabApiException
projectId
- the project ID to get events forGitLabApiException
- if any exception occurspublic List<ProjectHook> getHooks(Integer projectId) throws GitLabApiException
projectId
- the project ID to get project hooks forGitLabApiException
- if any exception occurspublic ProjectHook getHook(Integer projectId, Integer hookId) throws GitLabApiException
projectId
- the project ID to get the hook forhookId
- the ID of the hook to getGitLabApiException
- if any exception occurspublic ProjectHook addHook(String projectName, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
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 hookGitLabApiException
- if any exception occurspublic ProjectHook addHook(Integer projectId, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
projectId
- the project ID to add the project hook tourl
- 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 hookGitLabApiException
- if any exception occurspublic ProjectHook addHook(Project project, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
project
- the Project instance to add the project hook tourl
- 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 hookGitLabApiException
- if any exception occurspublic ProjectHook addHook(Project project, String url, boolean doPushEvents, boolean doIssuesEvents, boolean doMergeRequestsEvents) throws GitLabApiException
project
- the Project instance to add the project hook tourl
- 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 eventsGitLabApiException
- if any exception occurspublic ProjectHook addHook(Integer projectId, String url, boolean doPushEvents, boolean doIssuesEvents, boolean doMergeRequestsEvents) throws GitLabApiException
projectId
- the project ID to add the project hook tourl
- 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 eventsGitLabApiException
- if any exception occurspublic void deleteHook(Integer projectId, Integer hookId) throws GitLabApiException
projectId
- the project ID to delete the project hook fromhookId
- the project hook ID to deleteGitLabApiException
- if any exception occurspublic void deleteHook(ProjectHook hook) throws GitLabApiException
hook
- the ProjectHook instance to removeGitLabApiException
- if any exception occurspublic ProjectHook modifyHook(ProjectHook hook) throws GitLabApiException
hook
- the ProjectHook instance that contains the project hook info to modifyGitLabApiException
- if any exception occurspublic List<Issue> getIssues(Integer projectId) throws GitLabApiException
projectId
- the project ID to get the issues forGitLabApiException
- if any exception occursCopyright © 2017. All rights reserved.