Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
a6176bde
Commit
a6176bde
authored
Jul 30, 2016
by
Wayne Nugent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add delete notes functionality
parent
4d93aa57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+38
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
a6176bde
...
...
@@ -1230,6 +1230,19 @@ public class GitlabAPI {
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
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
GitlabBranch
.
URL
;
...
...
@@ -1420,6 +1433,31 @@ public class GitlabAPI {
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.
* @param projectId The ID of the project.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment