Commit 9f4577da authored by Tim Olshansky's avatar Tim Olshansky

Merge pull request #84 from wikiwi/update-mr-note

Add Method to Update Merge Request Notes
parents 2ced002f e9fc80e2
...@@ -824,6 +824,25 @@ public class GitlabAPI { ...@@ -824,6 +824,25 @@ public class GitlabAPI {
return Arrays.asList(tree); return Arrays.asList(tree);
} }
/**
* Update a Merge Request Note
*
* @param mergeRequest The merge request
* @param noteId The id of the note
* @param body The content of the note
* @return the Gitlab Note
* @throws IOException on gitlab api call error
*/
public GitlabNote updateNote(GitlabMergeRequest mergeRequest, Integer noteId, String body) throws IOException {
Query query = new Query()
.appendIf("body", body);
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() +
GitlabMergeRequest.URL + "/" + mergeRequest.getId() + GitlabNote.URL + "/" + noteId + query.toString();
return retrieve().method("PUT").to(tailUrl, GitlabNote.class);
}
public GitlabNote createNote(GitlabMergeRequest mergeRequest, String body) throws IOException { public GitlabNote createNote(GitlabMergeRequest mergeRequest, String body) throws IOException {
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() +
GitlabMergeRequest.URL + "/" + mergeRequest.getId() + GitlabNote.URL; GitlabMergeRequest.URL + "/" + mergeRequest.getId() + GitlabNote.URL;
......
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