diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2018-08-30 11:07:00 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-09-07 20:20:56 +0200 |
commit | 469af3846a5ca3f78b2b190ec4a2b27e3c7fd11f (patch) | |
tree | 02d491f891943febf90f0baec493b953bad7703d /sonar-ws | |
parent | 8fc5a9f6296fef6d63b746ab7dae0a1080ab1272 (diff) | |
download | sonarqube-469af3846a5ca3f78b2b190ec4a2b27e3c7fd11f.tar.gz sonarqube-469af3846a5ca3f78b2b190ec4a2b27e3c7fd11f.zip |
SONAR-11185 Allow portfolio to define projects by tags
* SONAR-11199 Allow selection of no project mode
* Add tags in views definition
* Create api/views/set_tags_mode
* Return tags mode in api/views/show
* Take into account tags during portfolio computation
Diffstat (limited to 'sonar-ws')
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/views/SetTagsModeRequest.java | 60 | ||||
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/views/ViewsService.java | 17 |
2 files changed, 77 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/views/SetTagsModeRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/views/SetTagsModeRequest.java new file mode 100644 index 00000000000..7b429544393 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/views/SetTagsModeRequest.java @@ -0,0 +1,60 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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.views; + +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/views/set_tags_mode">Further information about this action online (including a response example)</a> + * @since 7.4 + */ +@Generated("sonar-ws-generator") +public class SetTagsModeRequest { + + private String portfolio; + private List<String> tags; + + /** + * This is a mandatory parameter. + */ + public SetTagsModeRequest setPortfolio(String portfolio) { + this.portfolio = portfolio; + return this; + } + + public String getPortfolio() { + return portfolio; + } + + /** + * This is a mandatory parameter. + */ + public SetTagsModeRequest setTags(List<String> tags) { + this.tags = tags; + return this; + } + + public List<String> getTags() { + return tags; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/views/ViewsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/views/ViewsService.java index 802a6688300..79839f0eb8e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/views/ViewsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/views/ViewsService.java @@ -19,6 +19,7 @@ */ package org.sonarqube.ws.client.views; +import java.util.stream.Collectors; import javax.annotation.Generated; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.client.BaseService; @@ -363,6 +364,22 @@ public class ViewsService 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/views/set_tags_mode">Further information about this action online (including a response example)</a> + * @since 7.4 + */ + public void setTagsMode(SetTagsModeRequest request) { + call( + new PostRequest(path("set_tags_mode")) + .setParam("portfolio", request.getPortfolio()) + .setParam("tags", request.getTags() == null ? null : request.getTags().stream().collect(Collectors.joining(","))) + .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/views/show">Further information about this action online (including a response example)</a> * @since 1.0 |