aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main/java
diff options
context:
space:
mode:
authorJacek <52388493+jacek-poreda-sonarsource@users.noreply.github.com>2019-08-20 18:10:16 +0200
committerSonarTech <sonartech@sonarsource.com>2019-09-24 20:21:14 +0200
commitd170d4e4812844d37a7ec0355ba968bc9ef55545 (patch)
tree4c27016e637ee8dd890ed6616fab6ec70fe30357 /sonar-ws/src/main/java
parent4a83bd0b281d118c23e94102ea0fc07ee788cffb (diff)
downloadsonarqube-d170d4e4812844d37a7ec0355ba968bc9ef55545.tar.gz
sonarqube-d170d4e4812844d37a7ec0355ba968bc9ef55545.zip
SONAR-12366 update endpoint ws urls (#2013)
Diffstat (limited to 'sonar-ws/src/main/java')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java8
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java3
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/NewCodePeriodsService.java89
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/SetRequest.java86
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/ShowRequest.java60
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/UnsetRequest.java60
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/package-info.java26
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java50
8 files changed, 332 insertions, 50 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
index 587899c7824..b532a4145e7 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
@@ -40,6 +40,7 @@ import org.sonarqube.ws.client.languages.LanguagesService;
import org.sonarqube.ws.client.measures.MeasuresService;
import org.sonarqube.ws.client.metrics.MetricsService;
import org.sonarqube.ws.client.navigation.NavigationService;
+import org.sonarqube.ws.client.newcodeperiods.NewCodePeriodsService;
import org.sonarqube.ws.client.notifications.NotificationsService;
import org.sonarqube.ws.client.organizations.OrganizationsService;
import org.sonarqube.ws.client.permissions.PermissionsService;
@@ -103,6 +104,7 @@ class DefaultWsClient implements WsClient {
private final MeasuresService measuresService;
private final MetricsService metricsService;
private final NavigationService navigationService;
+ private final NewCodePeriodsService newCodePeriodsService;
private final NotificationsService notificationsService;
private final OrganizationsService organizationsService;
private final PermissionsService permissionsService;
@@ -159,6 +161,7 @@ class DefaultWsClient implements WsClient {
this.measuresService = new MeasuresService(wsConnector);
this.metricsService = new MetricsService(wsConnector);
this.navigationService = new NavigationService(wsConnector);
+ this.newCodePeriodsService = new NewCodePeriodsService(wsConnector);
this.notificationsService = new NotificationsService(wsConnector);
this.organizationsService = new OrganizationsService(wsConnector);
this.permissionsService = new PermissionsService(wsConnector);
@@ -296,6 +299,11 @@ class DefaultWsClient implements WsClient {
}
@Override
+ public NewCodePeriodsService newCodePeriods() {
+ return newCodePeriodsService;
+ }
+
+ @Override
public NotificationsService notifications() {
return notificationsService;
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
index 5fdba68259d..45bda4afc9d 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
@@ -40,6 +40,7 @@ import org.sonarqube.ws.client.languages.LanguagesService;
import org.sonarqube.ws.client.measures.MeasuresService;
import org.sonarqube.ws.client.metrics.MetricsService;
import org.sonarqube.ws.client.navigation.NavigationService;
+import org.sonarqube.ws.client.newcodeperiods.NewCodePeriodsService;
import org.sonarqube.ws.client.notifications.NotificationsService;
import org.sonarqube.ws.client.organizations.OrganizationsService;
import org.sonarqube.ws.client.permissions.PermissionsService;
@@ -134,6 +135,8 @@ public interface WsClient {
NavigationService navigation();
+ NewCodePeriodsService newCodePeriods();
+
NotificationsService notifications();
OrganizationsService organizations();
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/NewCodePeriodsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/NewCodePeriodsService.java
new file mode 100644
index 00000000000..ca470c3af25
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/NewCodePeriodsService.java
@@ -0,0 +1,89 @@
+/*
+ * 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.newcodeperiods;
+
+import javax.annotation.Generated;
+import org.sonarqube.ws.MediaTypes;
+import org.sonarqube.ws.NewCodePeriods;
+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/new_code_periods">Further information about this web service online</a>
+ */
+@Generated("sonar-ws-generator")
+public class NewCodePeriodsService extends BaseService {
+
+ public NewCodePeriodsService(WsConnector wsConnector) {
+ super(wsConnector, "api/new_code_periods");
+ }
+
+ /**
+ * This is part of the internal API.
+ * This is a POST request.
+ *
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/new_code_periods/set">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+ public void set(SetRequest request) {
+ call(
+ new PostRequest(path("set"))
+ .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/new_code_periods/show">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+ public NewCodePeriods.ShowWSResponse show(ShowRequest request) {
+ return call(
+ new GetRequest(path("show"))
+ .setParam("branch", request.getBranch())
+ .setParam("project", request.getProject())
+ .setMediaType(MediaTypes.JSON),
+ NewCodePeriods.ShowWSResponse.parser());
+ }
+
+ /**
+ * This is part of the internal API.
+ * This is a POST request.
+ *
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/new_code_periods/unset">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+ public void unset(UnsetRequest request) {
+ call(
+ new PostRequest(path("unset"))
+ .setParam("branch", request.getBranch())
+ .setParam("project", request.getProject())
+ .setMediaType(MediaTypes.JSON)
+ ).content();
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/SetRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/SetRequest.java
new file mode 100644
index 00000000000..7baadac2f2c
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/SetRequest.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.newcodeperiods;
+
+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/new_code_periods/set">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+@Generated("sonar-ws-generator")
+public class SetRequest {
+
+ private String branch;
+ private String project;
+ private String type;
+ private String value;
+
+ /**
+ *
+ */
+ public SetRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ *
+ */
+ public SetRequest setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ */
+ public SetRequest setType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ /**
+ *
+ */
+ public SetRequest setValue(String value) {
+ this.value = value;
+ return this;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/ShowRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/ShowRequest.java
new file mode 100644
index 00000000000..bb861d0fe23
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/ShowRequest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.newcodeperiods;
+
+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/new_code_periods/show">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+@Generated("sonar-ws-generator")
+public class ShowRequest {
+
+ private String branch;
+ private String project;
+
+ /**
+ *
+ */
+ public ShowRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ *
+ */
+ public ShowRequest 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/newcodeperiods/UnsetRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/UnsetRequest.java
new file mode 100644
index 00000000000..985a1cef159
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/UnsetRequest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.newcodeperiods;
+
+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/new_code_periods/unset">Further information about this action online (including a response example)</a>
+ * @since 8.0
+ */
+@Generated("sonar-ws-generator")
+public class UnsetRequest {
+
+ private String branch;
+ private String project;
+
+ /**
+ *
+ */
+ public UnsetRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ *
+ */
+ public UnsetRequest 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/newcodeperiods/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/package-info.java
new file mode 100644
index 00000000000..b7e60ae1992
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/newcodeperiods/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+@ParametersAreNonnullByDefault
+@Generated("sonar-ws-generator")
+package org.sonarqube.ws.client.newcodeperiods;
+
+import javax.annotation.Generated;
+import javax.annotation.ParametersAreNonnullByDefault;
+
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 bcb034d4797..90feda2e5b8 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,7 +22,6 @@ package org.sonarqube.ws.client.settings;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.Settings;
import org.sonarqube.ws.Settings.CheckSecretKeyWsResponse;
import org.sonarqube.ws.Settings.EncryptWsResponse;
import org.sonarqube.ws.Settings.GenerateSecretKeyWsResponse;
@@ -57,22 +56,6 @@ 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/delete_new_code_period">Further information about this action online (including a response example)</a>
- * @since 8.0
- */
- public void deleteNewCodePeriod(DeleteNewCodePeriodRequest request) {
- call(
- new GetRequest(path("delete_new_code_period"))
- .setParam("branch", request.getBranch())
- .setParam("project", request.getProject())
- .setMediaType(MediaTypes.JSON)
- ).content();
- }
-
- /**
* This is part of the internal API.
* This is a GET request.
*
@@ -158,39 +141,6 @@ 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/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
*/