Commit fe9c89b1 authored by Tim Olshansky's avatar Tim Olshansky Committed by GitHub

Merge pull request #148 from wnugent/gitlab-delete-notes

Gitlab delete notes
parents 01b8e03d a6176bde
...@@ -1230,6 +1230,19 @@ public class GitlabAPI { ...@@ -1230,6 +1230,19 @@ public class GitlabAPI {
return dispatch().with("body", body).to(tailUrl, GitlabNote.class); return dispatch().with("body", body).to(tailUrl, GitlabNote.class);
} }
/**
* Delete a Merge Request Note
*
* @param mergeRequest The merge request
* @param noteToDelete The note to delete
* @throws IOException on gitlab api call error
*/
public void deleteNote(GitlabMergeRequest mergeRequest, GitlabNote noteToDelete) throws IOException {
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/"
+ mergeRequest.getId() + GitlabNote.URL + "/" + noteToDelete.getId();
retrieve().method("DELETE").to(tailUrl, GitlabNote.class);
}
public List<GitlabBranch> getBranches(Serializable projectId) throws IOException { public List<GitlabBranch> getBranches(Serializable projectId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBranch.URL; String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBranch.URL;
...@@ -1420,6 +1433,31 @@ public class GitlabAPI { ...@@ -1420,6 +1433,31 @@ public class GitlabAPI {
return createNote(String.valueOf(issue.getProjectId()), issue.getId(), message); return createNote(String.valueOf(issue.getProjectId()), issue.getId(), message);
} }
/**
* Delete an Issue Note
*
* @param projectId The project id
* @param issueId The issue id
* @param noteToDelete The note to delete
* @throws IOException on gitlab api call error
*/
public void deleteNote(Serializable projectId, Integer issueId, GitlabNote noteToDelete) throws IOException {
String tailUrl = GitlabProject.URL + "/" + projectId + GitlabIssue.URL + "/"
+ issueId + GitlabNote.URL + "/" + noteToDelete.getId();
retrieve().method("DELETE").to(tailUrl, GitlabNote.class);
}
/**
* Delete an Issue Note
*
* @param issue The issue
* @param noteToDelete The note to delete
* @throws IOException on gitlab api call error
*/
public void deleteNote(GitlabIssue issue, GitlabNote noteToDelete) throws IOException {
deleteNote(String.valueOf(issue.getProjectId()), issue.getId(), noteToDelete);
}
/** /**
* Gets labels associated with a project. * Gets labels associated with a project.
* @param projectId The ID of the project. * @param projectId The ID of the project.
......
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