Commit 484cf71e authored by Greg Messner's avatar Greg Messner
Browse files

Cleaned up Javadocs.

parent 5efce766
......@@ -12,9 +12,9 @@ import org.gitlab4j.api.models.Pipeline;
*/
public class PipelineApi extends AbstractApi {
public PipelineApi(GitLabApi gitLabApi) {
super(gitLabApi);
}
public PipelineApi(GitLabApi gitLabApi) {
super(gitLabApi);
}
/**
* Get a list of pipelines in a project.
......@@ -30,26 +30,26 @@ public class PipelineApi extends AbstractApi {
return (response.readEntity(new GenericType<List<Pipeline>>() {
}));
}
/**
* Get a list of pipelines in a project.
*
* GET /projects/:id/pipelines
*
* @param projectId the project ID to get the list of pipelines for
* @param scope
* @param status
* @param ref
* @param yamlErrors
* @param name
* @param username
* @param orderBy
* @param sort
* @param scope the scope of pipelines, one of: running, pending, finished, branches, tags
* @param status the status of pipelines, one of: running, pending, success, failed, canceled, skipped
* @param ref the ref of pipelines
* @param yamlErrors returns pipelines with invalid configurations
* @param name the name of the user who triggered pipelines
* @param username the username of the user who triggered pipelines
* @param orderBy order pipelines by id, status, ref, or user_id (default: id)
* @param sort sort pipelines in asc or desc order (default: desc)
* @return a list containing the pipelines for the specified project ID
* @throws GitLabApiException if any exception occurs during execution
*/
public List<Pipeline> getPipelines(int projectId, String scope, String status, String ref,
boolean yamlErrors, String name, String username, String orderBy, String sort) throws GitLabApiException {
public List<Pipeline> getPipelines(int projectId, String scope, String status, String ref, boolean yamlErrors,
String name, String username, String orderBy, String sort) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("scope", scope)
.withParam("status", status)
......@@ -61,8 +61,8 @@ public class PipelineApi extends AbstractApi {
.withParam("sort", sort);
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "pipelines");
return (response.readEntity(new GenericType<List<Pipeline>>() {
}));
return (response.readEntity(new GenericType<List<Pipeline>>() {
}));
}
/**
......@@ -76,28 +76,27 @@ public class PipelineApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs during execution
*/
public Pipeline getPipeline(int projectId, int pipelineId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "pipelines", pipelineId);
return (response.readEntity(Pipeline.class));
Response response = get(Response.Status.OK, null, "projects", projectId, "pipelines", pipelineId);
return (response.readEntity(Pipeline.class));
}
/**
* Create a pipelines in a project.
*
* POST /projects/:id/pipelines
*
* @param projectId the project ID to create a pipeline in
* @param ref
* @param ref reference to commit
* @return a Pipeline instance with the newly created pipeline info
* @throws GitLabApiException if any exception occurs during execution
*/
public Pipeline createPipeline(int projectId, String ref) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("ref", ref);
Response response = post(Response.Status.OK, formData.asMap(), "projects", projectId, "pipelines");
return (response.readEntity(Pipeline.class));
GitLabApiForm formData = new GitLabApiForm().withParam("ref", ref);
Response response = post(Response.Status.OK, formData.asMap(), "projects", projectId, "pipelines");
return (response.readEntity(Pipeline.class));
}
/**
* Retry a job in specified pipelines in a project.
*
......@@ -109,11 +108,11 @@ public class PipelineApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs during execution
*/
public Pipeline retryPipelineJob(int projectId, int pipelineId) throws GitLabApiException {
GitLabApiForm formData = null;
Response response = post(Response.Status.OK, formData, "projects", projectId, "pipelines", pipelineId, "retry");
return (response.readEntity(Pipeline.class));
GitLabApiForm formData = null;
Response response = post(Response.Status.OK, formData, "projects", projectId, "pipelines", pipelineId, "retry");
return (response.readEntity(Pipeline.class));
}
/**
* Cancel jobs of specified pipelines in a project.
*
......@@ -125,8 +124,8 @@ public class PipelineApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs during execution
*/
public Pipeline cancelPipelineJobs(int projectId, int pipelineId) throws GitLabApiException {
GitLabApiForm formData = null;
Response response = post(Response.Status.OK, formData, "projects", projectId, "pipelines", pipelineId, "cancel");
return (response.readEntity(Pipeline.class));
GitLabApiForm formData = null;
Response response = post(Response.Status.OK, formData, "projects", projectId, "pipelines", pipelineId, "cancel");
return (response.readEntity(Pipeline.class));
}
}
......@@ -783,6 +783,7 @@ public class ProjectApi extends AbstractApi {
*
* GET /projects/:id/issues
*
* @param projectId the project ID to get the issues for
* @param page the page to get
* @param perPage the number of issues per page
* @return the list of issues in the specified range
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment