Commit 612cb968 authored by Madhav Ponugoti's avatar Madhav Ponugoti

Added createMergeRequest to API and also added merge_status to MergeRequest

parent 43272126
......@@ -814,6 +814,34 @@ public class GitlabAPI {
return retrieve().to(tailUrl, GitlabMergeRequest.class);
}
/**
* Create a new MergeRequest
*
* @param projectId
* @param sourceBranch
* @param targetBranch
* @param assigneeId
* @param title
* @return GitlabMergeRequest
* @throws IOException on gitlab api call error
*/
public GitlabMergeRequest createMergeRequest(Serializable projectId, String sourceBranch, String targetBranch,
Integer assigneeId, String title) throws IOException {
Query query = new Query()
.appendIf("target_branch", targetBranch)
.appendIf("source_branch", sourceBranch)
.appendIf("assignee_id", assigneeId)
.appendIf("title", title);
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + query.toString();
return dispatch().to(tailUrl, GitlabMergeRequest.class);
}
/**
* Updates a Merge Request
*
......
......@@ -49,6 +49,10 @@ public class GitlabMergeRequest {
@JsonProperty("created_at")
private Date createdAt;
@JsonProperty("merge_status")
private String mergeStatus;
public Integer getId() {
return id;
}
......@@ -234,4 +238,8 @@ public class GitlabMergeRequest {
public void setChanges(List<GitlabCommitDiff> changes) {
this.changes = changes;
}
public String getMergeStatus() { return mergeStatus; }
public void setMergeStatus(String mergeStatus) { this.mergeStatus = mergeStatus; }
}
Markdown is supported
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