From 5a723b74616683a844fe0cd97d66ce63b7eb71f9 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 9 Aug 2019 10:42:50 -0500 Subject: [PATCH] SONAR-12366 Add new WSs to tester --- .../ws/client/settings/SettingsService.java | 58 ++++++++++--- .../settings/ShowNewCodePeriodRequest.java | 58 +++++++++++++ .../settings/UpdateNewCodePeriodRequest.java | 86 +++++++++++++++++++ 3 files changed, 190 insertions(+), 12 deletions(-) create mode 100644 sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java create mode 100644 sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java 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 Further information about this web service online @@ -43,9 +44,9 @@ public class SettingsService extends BaseService { } /** - * * This is part of the internal API. * This is a GET request. + * * @see Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) + * @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 Further information about this action online (including a response example) + * @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 Further information about this action online (including a response example) * @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 Further information about this action online (including a response example) + * @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 Further information about this action online (including a response example) + * @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; + } +} -- 2.39.5