aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2020-02-13 11:14:34 +0100
committerSonarTech <sonartech@sonarsource.com>2020-02-21 20:46:18 +0100
commit7421f46c36752c57290af1c53ea2e57e0cfa32fa (patch)
tree5c6199672477ed46cfca2ec9bf4a9955f9a2b433 /sonar-ws
parentb4545b42dba5949fdea5155b23dbf00ac695574f (diff)
downloadsonarqube-7421f46c36752c57290af1c53ea2e57e0cfa32fa.tar.gz
sonarqube-7421f46c36752c57290af1c53ea2e57e0cfa32fa.zip
SONAR-12922 add edit hotspot comment ws
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/EditCommentRequest.java61
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/HotspotsService.java17
2 files changed, 78 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/EditCommentRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/EditCommentRequest.java
new file mode 100644
index 00000000000..f52fcb56951
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/EditCommentRequest.java
@@ -0,0 +1,61 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/edit_comment">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+@Generated("sonar-ws-generator")
+public class EditCommentRequest {
+
+ private String comment;
+ private String text;
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "AU-Tpxb--iU5OvuD2FLy"
+ */
+ public EditCommentRequest setComment(String comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "Safe because it doesn't apply to the context"
+ */
+ public EditCommentRequest setText(String text) {
+ this.text = text;
+ return this;
+ }
+
+ public String getText() {
+ return text;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/HotspotsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/HotspotsService.java
index 4b37ba48a43..709876ac0a1 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/HotspotsService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/hotspots/HotspotsService.java
@@ -21,6 +21,7 @@ package org.sonarqube.ws.client.hotspots;
import java.util.stream.Collectors;
import javax.annotation.Generated;
+import org.sonarqube.ws.Common;
import org.sonarqube.ws.Hotspots;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.client.BaseService;
@@ -90,6 +91,22 @@ public class HotspotsService extends BaseService {
*
* This is part of the internal API.
* This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/edit_comment">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+ public Common.Comment editComment(EditCommentRequest request) {
+ return call(
+ new PostRequest(path("edit_comment"))
+ .setParam("comment", request.getComment())
+ .setParam("text", request.getText())
+ .setMediaType(MediaTypes.JSON),
+ Common.Comment.parser());
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a POST request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/delete_comment">Further information about this action online (including a response example)</a>
* @since 8.2
*/