diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-12-12 13:59:38 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-12-14 17:03:35 +0100 |
commit | a93fdfcffa23c125376d3e1f9e2e4abbc6b61a19 (patch) | |
tree | 7490954aa28615000d3c80dc2085395531a0ed37 /sonar-ws/src | |
parent | 4889f6cea0b2b0cc8d2b043de68a25b2aec2442e (diff) | |
download | sonarqube-a93fdfcffa23c125376d3e1f9e2e4abbc6b61a19.tar.gz sonarqube-a93fdfcffa23c125376d3e1f9e2e4abbc6b61a19.zip |
SONAR-10134 Add organization parameter in quality gates wsclient
Diffstat (limited to 'sonar-ws/src')
16 files changed, 256 insertions, 28 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CopyRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CopyRequest.java index f995619b0ec..1feda7bc21e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CopyRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CopyRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -33,6 +32,7 @@ public class CopyRequest { private String id; private String name; + private String organization; /** * This is a mandatory parameter. @@ -59,4 +59,16 @@ public class CopyRequest { public String getName() { return name; } + + /** + * Example value: "my-org" + */ + public CopyRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateConditionRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateConditionRequest.java index f0bd0551e53..2413177780e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateConditionRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateConditionRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -35,6 +34,7 @@ public class CreateConditionRequest { private String gateId; private String metric; private String op; + private String organization; private String period; private String warning; @@ -96,6 +96,18 @@ public class CreateConditionRequest { } /** + * Example value: "my-org" + */ + public CreateConditionRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Possible values: * <ul> * <li>"1"</li> diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateRequest.java index 86938326d7c..bbddb5efe18 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/CreateRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class CreateRequest { private String name; + private String organization; /** * This is a mandatory parameter. @@ -45,4 +45,16 @@ public class CreateRequest { public String getName() { return name; } + + /** + * Example value: "my-org" + */ + public CreateRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeleteConditionRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeleteConditionRequest.java index 209b77d4cc6..366cd99394e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeleteConditionRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeleteConditionRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class DeleteConditionRequest { private String id; + private String organization; /** * This is a mandatory parameter. @@ -45,4 +45,16 @@ public class DeleteConditionRequest { public String getId() { return id; } + + /** + * Example value: "my-org" + */ + public DeleteConditionRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeselectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeselectRequest.java index a1565475457..7d93b7e4f1f 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeselectRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DeselectRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -31,10 +30,23 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class DeselectRequest { + private String organization; private String projectId; private String projectKey; /** + * Example value: "my-org" + */ + public DeselectRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Example value: "AU-Tpxb--iU5OvuD2FLy" * @deprecated since 6.1 */ diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DestroyRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DestroyRequest.java index 9a2280e692c..50802428f66 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DestroyRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/DestroyRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class DestroyRequest { private String id; + private String organization; /** * This is a mandatory parameter. @@ -45,4 +45,16 @@ public class DestroyRequest { public String getId() { return id; } + + /** + * Example value: "my-org" + */ + public DestroyRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/GetByProjectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/GetByProjectRequest.java index 868d867fead..9b8032bcd3a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/GetByProjectRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/GetByProjectRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -31,9 +30,22 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class GetByProjectRequest { + private String organization; private String project; /** + * Example value: "my-org" + */ + public GetByProjectRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * This is a mandatory parameter. * Example value: "my_project" */ diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ListRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ListRequest.java new file mode 100644 index 00000000000..2a0f2388e2c --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ListRequest.java @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.qualitygates; + +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/qualitygates/list">Further information about this action online (including a response example)</a> + * @since 4.3 + */ +@Generated("sonar-ws-generator") +public class ListRequest { + + private String organization; + + /** + * Example value: "my-org" + */ + public ListRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ProjectStatusRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ProjectStatusRequest.java index 9152bdae30d..65423484335 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ProjectStatusRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ProjectStatusRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class ProjectStatusRequest { private String analysisId; + private String organization; private String projectId; private String projectKey; @@ -48,6 +48,18 @@ public class ProjectStatusRequest { } /** + * Example value: "my-org" + */ + public ProjectStatusRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Example value: "AU-Tpxb--iU5OvuD2FLy" */ public ProjectStatusRequest setProjectId(String projectId) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java index bfef940b019..362479b2f43 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java @@ -19,20 +19,20 @@ */ package org.sonarqube.ws.client.qualitygates; -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.Qualitygates.CreateResponse; import org.sonarqube.ws.Qualitygates.CreateConditionResponse; +import org.sonarqube.ws.Qualitygates.CreateResponse; import org.sonarqube.ws.Qualitygates.GetByProjectResponse; import org.sonarqube.ws.Qualitygates.ListWsResponse; import org.sonarqube.ws.Qualitygates.ProjectStatusResponse; +import org.sonarqube.ws.Qualitygates.SearchResponse; import org.sonarqube.ws.Qualitygates.ShowWsResponse; import org.sonarqube.ws.Qualitygates.UpdateConditionResponse; +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/qualitygates">Further information about this web service online</a> @@ -56,6 +56,7 @@ public class QualitygatesService extends BaseService { new PostRequest(path("copy")) .setParam("id", request.getId()) .setParam("name", request.getName()) + .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); } @@ -70,7 +71,8 @@ public class QualitygatesService extends BaseService { public CreateResponse create(CreateRequest request) { return call( new PostRequest(path("create")) - .setParam("name", request.getName()), + .setParam("name", request.getName()) + .setParam("organization", request.getOrganization()), CreateResponse.parser()); } @@ -88,6 +90,7 @@ public class QualitygatesService extends BaseService { .setParam("gateId", request.getGateId()) .setParam("metric", request.getMetric()) .setParam("op", request.getOp()) + .setParam("organization", request.getOrganization()) .setParam("period", request.getPeriod()) .setParam("warning", request.getWarning()), CreateConditionResponse.parser()); @@ -104,6 +107,7 @@ public class QualitygatesService extends BaseService { call( new PostRequest(path("delete_condition")) .setParam("id", request.getId()) + .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); } @@ -118,6 +122,7 @@ public class QualitygatesService extends BaseService { public void deselect(DeselectRequest request) { call( new PostRequest(path("deselect")) + .setParam("organization", request.getOrganization()) .setParam("projectId", request.getProjectId()) .setParam("projectKey", request.getProjectKey()) .setMediaType(MediaTypes.JSON) @@ -135,6 +140,7 @@ public class QualitygatesService extends BaseService { call( new PostRequest(path("destroy")) .setParam("id", request.getId()) + .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); } @@ -149,6 +155,7 @@ public class QualitygatesService extends BaseService { public GetByProjectResponse getByProject(GetByProjectRequest request) { return call( new GetRequest(path("get_by_project")) + .setParam("organization", request.getOrganization()) .setParam("project", request.getProject()), GetByProjectResponse.parser()); } @@ -160,9 +167,10 @@ public class QualitygatesService extends BaseService { * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/list">Further information about this action online (including a response example)</a> * @since 4.3 */ - public ListWsResponse list() { + public ListWsResponse list(ListRequest request) { return call( - new GetRequest(path("list")), + new GetRequest(path("list")) + .setParam("organization", request.getOrganization()), ListWsResponse.parser()); } @@ -177,6 +185,7 @@ public class QualitygatesService extends BaseService { return call( new GetRequest(path("project_status")) .setParam("analysisId", request.getAnalysisId()) + .setParam("organization", request.getOrganization()) .setParam("projectId", request.getProjectId()) .setParam("projectKey", request.getProjectKey()), ProjectStatusResponse.parser()); @@ -194,6 +203,7 @@ public class QualitygatesService extends BaseService { new PostRequest(path("rename")) .setParam("id", request.getId()) .setParam("name", request.getName()) + .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); } @@ -205,16 +215,16 @@ public class QualitygatesService extends BaseService { * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/search">Further information about this action online (including a response example)</a> * @since 4.3 */ - public String search(SearchRequest request) { + public SearchResponse search(SearchRequest request) { return call( new GetRequest(path("search")) .setParam("gateId", request.getGateId()) + .setParam("organization", request.getOrganization()) .setParam("page", request.getPage()) .setParam("pageSize", request.getPageSize()) .setParam("query", request.getQuery()) - .setParam("selected", request.getSelected()) - .setMediaType(MediaTypes.JSON) - ).content(); + .setParam("selected", request.getSelected()), + SearchResponse.parser()); } /** @@ -228,6 +238,7 @@ public class QualitygatesService extends BaseService { call( new PostRequest(path("select")) .setParam("gateId", request.getGateId()) + .setParam("organization", request.getOrganization()) .setParam("projectId", request.getProjectId()) .setParam("projectKey", request.getProjectKey()) .setMediaType(MediaTypes.JSON) @@ -245,6 +256,7 @@ public class QualitygatesService extends BaseService { call( new PostRequest(path("set_as_default")) .setParam("id", request.getId()) + .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); } @@ -260,7 +272,8 @@ public class QualitygatesService extends BaseService { return call( new GetRequest(path("show")) .setParam("id", request.getId()) - .setParam("name", request.getName()), + .setParam("name", request.getName()) + .setParam("organization", request.getOrganization()), ShowWsResponse.parser()); } @@ -294,6 +307,7 @@ public class QualitygatesService extends BaseService { .setParam("id", request.getId()) .setParam("metric", request.getMetric()) .setParam("op", request.getOp()) + .setParam("organization", request.getOrganization()) .setParam("period", request.getPeriod()) .setParam("warning", request.getWarning()), UpdateConditionResponse.parser()); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/RenameRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/RenameRequest.java index ae2edfa43b1..04f4cdebb04 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/RenameRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/RenameRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -33,6 +32,7 @@ public class RenameRequest { private String id; private String name; + private String organization; /** * This is a mandatory parameter. @@ -59,4 +59,16 @@ public class RenameRequest { public String getName() { return name; } + + /** + * Example value: "my-org" + */ + public RenameRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SearchRequest.java index 5506b0423d5..005f846820b 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SearchRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SearchRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class SearchRequest { private String gateId; + private String organization; private String page; private String pageSize; private String query; @@ -51,6 +51,18 @@ public class SearchRequest { } /** + * Example value: "my-org" + */ + public SearchRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Example value: "2" */ public SearchRequest setPage(String page) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SelectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SelectRequest.java index d83215d0eb4..75025f5cd6a 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SelectRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SelectRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class SelectRequest { private String gateId; + private String organization; private String projectId; private String projectKey; @@ -49,6 +49,18 @@ public class SelectRequest { } /** + * Example value: "my-org" + */ + public SelectRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Example value: "AU-Tpxb--iU5OvuD2FLy" */ public SelectRequest setProjectId(String projectId) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SetAsDefaultRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SetAsDefaultRequest.java index 15cd79e71e9..a9783aa7866 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SetAsDefaultRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/SetAsDefaultRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -32,6 +31,7 @@ import javax.annotation.Generated; public class SetAsDefaultRequest { private String id; + private String organization; /** * This is a mandatory parameter. @@ -45,4 +45,16 @@ public class SetAsDefaultRequest { public String getId() { return id; } + + /** + * Example value: "my-org" + */ + public SetAsDefaultRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ShowRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ShowRequest.java index 02902bd5617..0ad38ba5ab2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ShowRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/ShowRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -33,6 +32,7 @@ public class ShowRequest { private String id; private String name; + private String organization; /** * Example value: "1" @@ -57,4 +57,16 @@ public class ShowRequest { public String getName() { return name; } + + /** + * Example value: "my-org" + */ + public ShowRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/UpdateConditionRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/UpdateConditionRequest.java index 2291826d004..7e334059da2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/UpdateConditionRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/UpdateConditionRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client.qualitygates; -import java.util.List; import javax.annotation.Generated; /** @@ -35,6 +34,7 @@ public class UpdateConditionRequest { private String id; private String metric; private String op; + private String organization; private String period; private String warning; @@ -96,6 +96,18 @@ public class UpdateConditionRequest { } /** + * Example value: "my-org" + */ + public UpdateConditionRequest setOrganization(String organization) { + this.organization = organization; + return this; + } + + public String getOrganization() { + return organization; + } + + /** * Possible values: * <ul> * <li>"1"</li> |