diff options
Diffstat (limited to 'sonar-ws')
5 files changed, 152 insertions, 0 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 bdbd30cb92a..9b7b205059c 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 @@ -58,6 +58,7 @@ import org.sonarqube.ws.client.properties.PropertiesService; import org.sonarqube.ws.client.push.SonarLintServerPushService; import org.sonarqube.ws.client.qualitygates.QualitygatesService; import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; +import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService; import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; import org.sonarqube.ws.client.securityreports.SecurityReportsService; @@ -139,6 +140,7 @@ class DefaultWsClient implements WsClient { private final WebservicesService webservicesService; private final BatchService batchService; private final SecurityReportsService securityReportsService; + private final RegulatoryReportsService regulatoryReportsService; private final SonarLintServerPushService sonarLintPushService; DefaultWsClient(WsConnector wsConnector) { @@ -198,6 +200,7 @@ class DefaultWsClient implements WsClient { this.batchService = new BatchService(wsConnector); this.securityReportsService = new SecurityReportsService(wsConnector); this.sonarLintPushService = new SonarLintServerPushService(wsConnector); + this.regulatoryReportsService = new RegulatoryReportsService(wsConnector); } @Override @@ -247,6 +250,11 @@ class DefaultWsClient implements WsClient { } @Override + public RegulatoryReportsService regulatoryReports() { + return regulatoryReportsService; + } + + @Override public DuplicationsService duplications() { return duplicationsService; } 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 f616d7574ed..c70da8022ae 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 @@ -58,6 +58,7 @@ import org.sonarqube.ws.client.properties.PropertiesService; import org.sonarqube.ws.client.push.SonarLintServerPushService; import org.sonarqube.ws.client.qualitygates.QualitygatesService; import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; +import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService; import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; import org.sonarqube.ws.client.securityreports.SecurityReportsService; @@ -202,6 +203,8 @@ public interface WsClient { SecurityReportsService securityReports(); + RegulatoryReportsService regulatoryReports(); + MonitoringService monitoring(); SonarLintServerPushService sonarLintPush(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java new file mode 100644 index 00000000000..c5c597d8082 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/DownloadRequest.java @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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.regulatoryreports; + +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/regulatory_reports/download">Further information about this action online (including a response example)</a> + * @since 9.5 + */ +@Generated("sonar-ws-generator") +public class DownloadRequest { + + private String branch; + private String project; + + /** + * Example value: "feature/my_branch" + */ + public DownloadRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * This is a mandatory parameter. + * Example value: "my_project" + */ + public DownloadRequest 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/regulatoryreports/RegulatoryReportsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/RegulatoryReportsService.java new file mode 100644 index 00000000000..360e7be8fd7 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/RegulatoryReportsService.java @@ -0,0 +1,54 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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.regulatoryreports; + +import java.io.InputStream; +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.WsConnector; + +/** + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/regulatory_reports">Further information about this web service online</a> + */ +@Generated("sonar-ws-generator") +public class RegulatoryReportsService extends BaseService { + + public RegulatoryReportsService(WsConnector wsConnector) { + super(wsConnector, "api/regulatory_reports"); + } + + /** + * + * This is part of the internal API. + * This is a GET request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/regulatory_reports/download">Further information about this action online (including a response example)</a> + * @since 9.5 + */ + public InputStream download(DownloadRequest request) { + return call( + new GetRequest(path("download")) + .setParam("branch", request.getBranch()) + .setParam("project", request.getProject()) + .setMediaType(MediaTypes.JSON) + ).contentStream(); + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java new file mode 100644 index 00000000000..5e9ab65cc48 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/regulatoryreports/package-info.java @@ -0,0 +1,26 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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.regulatoryreports; + +import javax.annotation.ParametersAreNonnullByDefault; +import javax.annotation.Generated; + |