]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12366 Add new WSs to tester
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 9 Aug 2019 15:42:50 +0000 (10:42 -0500)
committerSonarTech <sonartech@sonarsource.com>
Tue, 24 Sep 2019 18:21:13 +0000 (20:21 +0200)
sonar-ws/src/main/java/org/sonarqube/ws/client/settings/SettingsService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/settings/ShowNewCodePeriodRequest.java [new file with mode: 0644]
sonar-ws/src/main/java/org/sonarqube/ws/client/settings/UpdateNewCodePeriodRequest.java [new file with mode: 0644]

index 3fee664eb503978f79dad710d4912e524d3de10c..123900c217f10984fb7177406c688e4e6f183bf2 100644 (file)
@@ -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 (file)
index 0000000..72428c5
--- /dev/null
@@ -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 (file)
index 0000000..9091527
--- /dev/null
@@ -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;
+  }
+}