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