aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main/java/org/sonarqube/ws/client/settings
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-08-09 10:42:50 -0500
committerSonarTech <sonartech@sonarsource.com>2019-09-24 20:21:13 +0200
commit5a723b74616683a844fe0cd97d66ce63b7eb71f9 (patch)
tree1cb13acc5081ff75c973fef3e95d0fdc40b801f1 /sonar-ws/src/main/java/org/sonarqube/ws/client/settings
parent4a7cdbda9c8cabc318012c822660a2ec9e09d0e4 (diff)
downloadsonarqube-5a723b74616683a844fe0cd97d66ce63b7eb71f9.tar.gz
sonarqube-5a723b74616683a844fe0cd97d66ce63b7eb71f9.zip
SONAR-12366 Add new WSs to tester
Diffstat (limited to 'sonar-ws/src/main/java/org/sonarqube/ws/client/settings')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java58
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java58
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java86
3 files changed, 190 insertions, 12 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java
index 3fee664eb50..123900c217f 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java
@@ -22,15 +22,16 @@ package org.sonarqube.ws.client.settings;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
+import org.sonarqube.ws.Settings;
import org.sonarqube.ws.Settings.CheckSecretKeyWsResponse;
import org.sonarqube.ws.Settings.EncryptWsResponse;
import org.sonarqube.ws.Settings.GenerateSecretKeyWsResponse;
import org.sonarqube.ws.Settings.ListDefinitionsWsResponse;
import org.sonarqube.ws.Settings.ValuesWsResponse;
+import org.sonarqube.ws.client.BaseService;
+import org.sonarqube.ws.client.GetRequest;
+import org.sonarqube.ws.client.PostRequest;
+import org.sonarqube.ws.client.WsConnector;
/**
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings">Further information about this web service online</a>
@@ -43,9 +44,9 @@ public class SettingsService extends BaseService {
}
/**
- *
* This is part of the internal API.
* This is a GET request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/check_secret_key">Further information about this action online (including a response example)</a>
* @since 6.1
*/
@@ -56,9 +57,9 @@ public class SettingsService extends BaseService {
}
/**
- *
* This is part of the internal API.
* This is a GET request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/encrypt">Further information about this action online (including a response example)</a>
* @since 6.1
*/
@@ -70,9 +71,9 @@ public class SettingsService extends BaseService {
}
/**
- *
* This is part of the internal API.
* This is a GET request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/generate_secret_key">Further information about this action online (including a response example)</a>
* @since 6.1
*/
@@ -83,9 +84,9 @@ public class SettingsService extends BaseService {
}
/**
- *
* This is part of the internal API.
* This is a GET request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/list_definitions">Further information about this action online (including a response example)</a>
* @since 6.3
*/
@@ -99,9 +100,9 @@ public class SettingsService 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/settings/reset">Further information about this action online (including a response example)</a>
* @since 6.1
*/
@@ -113,13 +114,13 @@ public class SettingsService extends BaseService {
.setParam("keys", request.getKeys() == null ? null : request.getKeys().stream().collect(Collectors.joining(",")))
.setParam("pullRequest", request.getPullRequest())
.setMediaType(MediaTypes.JSON)
- ).content();
+ ).content();
}
/**
- *
* This is part of the internal API.
* This is a POST request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/set">Further information about this action online (including a response example)</a>
* @since 6.1
*/
@@ -134,13 +135,46 @@ public class SettingsService extends BaseService {
.setParam("value", request.getValue())
.setParam("values", request.getValues() == null ? null : request.getValues())
.setMediaType(MediaTypes.JSON)
- ).content();
+ ).content();
}
/**
+ * This is part of the internal API.
+ * This is a GET request.
+ *
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/show_new_code_period">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+ public Settings.ShowNewCodePeriodResponse showNewCodePeriod(ShowNewCodePeriodRequest request) {
+ return call(
+ new GetRequest(path("show_new_code_period"))
+ .setParam("branch", request.getBranch())
+ .setParam("project", request.getProject()),
+ Settings.ShowNewCodePeriodResponse.parser());
+ }
+
+ /**
+ * This is part of the internal API.
+ * This is a GET request.
*
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/update_new_code_period">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+ public void updateNewCodePeriod(UpdateNewCodePeriodRequest request) {
+ call(
+ new GetRequest(path("update_new_code_period"))
+ .setParam("branch", request.getBranch())
+ .setParam("project", request.getProject())
+ .setParam("type", request.getType())
+ .setParam("value", request.getValue())
+ .setMediaType(MediaTypes.JSON)
+ ).content();
+ }
+
+ /**
* This is part of the internal API.
* This is a GET request.
+ *
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/values">Further information about this action online (including a response example)</a>
* @since 6.3
*/
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java
new file mode 100644
index 00000000000..72428c5c742
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java
@@ -0,0 +1,58 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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.settings;
+
+import java.util.List;
+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/settings/show_new_code_period">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+@Generated("sonar-ws-generator")
+public class ShowNewCodePeriodRequest {
+
+ private String branch;
+ private String project;
+
+ /**
+ */
+ public ShowNewCodePeriodRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ */
+ public ShowNewCodePeriodRequest setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public String getProject() {
+ return project;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java
new file mode 100644
index 00000000000..9091527e6e4
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java
@@ -0,0 +1,86 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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.settings;
+
+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/settings/update_new_code_period">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+@Generated("sonar-ws-generator")
+public class UpdateNewCodePeriodRequest {
+
+ private String branch;
+ private String project;
+ private String type;
+ private String value;
+
+ /**
+ *
+ */
+ public UpdateNewCodePeriodRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ *
+ */
+ public UpdateNewCodePeriodRequest setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ */
+ public UpdateNewCodePeriodRequest setType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ /**
+ *
+ */
+ public UpdateNewCodePeriodRequest setValue(String value) {
+ this.value = value;
+ return this;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}