aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorGuillaume Jambet <guillaume.jambet@sonarsource.com>2018-02-15 17:14:59 +0100
committerGuillaume Jambet <guillaume.jambet@gmail.com>2018-03-01 15:21:05 +0100
commit74745908c3dd0c19cdde5e5a44fb9bb43c451d9b (patch)
treed597bd30061cc0ced0b43db3f9f49293207ea231 /sonar-ws
parentd535686f89484af334723467ed820a685fba4fb0 (diff)
downloadsonarqube-74745908c3dd0c19cdde5e5a44fb9bb43c451d9b.tar.gz
sonarqube-74745908c3dd0c19cdde5e5a44fb9bb43c451d9b.zip
SONAR-10346 Add latest deliveries information to webhooks search ws.
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/DeliveriesRequest.java40
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/WebhooksService.java18
-rw-r--r--sonar-ws/src/main/protobuf/ws-webhooks.proto32
3 files changed, 65 insertions, 25 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/DeliveriesRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/DeliveriesRequest.java
index 4b001cf6ddf..871bc1b2abb 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/DeliveriesRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/DeliveriesRequest.java
@@ -19,7 +19,6 @@
*/
package org.sonarqube.ws.client.webhooks;
-import java.util.List;
import javax.annotation.Generated;
/**
@@ -33,6 +32,9 @@ public class DeliveriesRequest {
private String ceTaskId;
private String componentKey;
+ private String p;
+ private String ps;
+ private String webhook;
/**
* Example value: "AU-Tpxb--iU5OvuD2FLy"
@@ -57,4 +59,40 @@ public class DeliveriesRequest {
public String getComponentKey() {
return componentKey;
}
+
+ /**
+ * Example value: "42"
+ */
+ public DeliveriesRequest setP(String p) {
+ this.p = p;
+ return this;
+ }
+
+ public String getP() {
+ return p;
+ }
+
+ /**
+ * Example value: "20"
+ */
+ public DeliveriesRequest setPs(String ps) {
+ this.ps = ps;
+ return this;
+ }
+
+ public String getPs() {
+ return ps;
+ }
+
+ /**
+ * Example value: "AU-TpxcA-iU5OvuD2FLz"
+ */
+ public DeliveriesRequest setWebhook(String webhook) {
+ this.webhook = webhook;
+ return this;
+ }
+
+ public String getWebhook() {
+ return webhook;
+ }
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/WebhooksService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/WebhooksService.java
index 7eb3b34a329..92bae24c990 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/WebhooksService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhooks/WebhooksService.java
@@ -19,17 +19,16 @@
*/
package org.sonarqube.ws.client.webhooks;
-import java.util.stream.Collectors;
import javax.annotation.Generated;
import org.sonarqube.ws.MediaTypes;
+import org.sonarqube.ws.Webhooks.CreateWsResponse;
+import org.sonarqube.ws.Webhooks.DeliveriesWsResponse;
+import org.sonarqube.ws.Webhooks.DeliveryWsResponse;
+import org.sonarqube.ws.Webhooks.ListResponse;
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.Webhooks.CreateWsResponse;
-import org.sonarqube.ws.Webhooks.DeliveriesWsResponse;
-import org.sonarqube.ws.Webhooks.DeliveryWsResponse;
-import org.sonarqube.ws.Webhooks.ListWsResponse;
/**
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/webhooks">Further information about this web service online</a>
@@ -84,7 +83,10 @@ public class WebhooksService extends BaseService {
return call(
new GetRequest(path("deliveries"))
.setParam("ceTaskId", request.getCeTaskId())
- .setParam("componentKey", request.getComponentKey()),
+ .setParam("componentKey", request.getComponentKey())
+ .setParam("p", request.getP())
+ .setParam("ps", request.getPs())
+ .setParam("webhook", request.getWebhook()),
DeliveriesWsResponse.parser());
}
@@ -109,12 +111,12 @@ public class WebhooksService extends BaseService {
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/webhooks/list">Further information about this action online (including a response example)</a>
* @since 7.1
*/
- public ListWsResponse list(ListRequest request) {
+ public ListResponse list(ListRequest request) {
return call(
new GetRequest(path("list"))
.setParam("organization", request.getOrganization())
.setParam("project", request.getProject()),
- ListWsResponse.parser());
+ ListResponse.parser());
}
/**
diff --git a/sonar-ws/src/main/protobuf/ws-webhooks.proto b/sonar-ws/src/main/protobuf/ws-webhooks.proto
index ea616f84955..81e45aa24fd 100644
--- a/sonar-ws/src/main/protobuf/ws-webhooks.proto
+++ b/sonar-ws/src/main/protobuf/ws-webhooks.proto
@@ -26,24 +26,24 @@ option java_package = "org.sonarqube.ws";
option java_outer_classname = "Webhooks";
option optimize_for = SPEED;
-// GET api/webhooks/list
-message ListWsResponse {
- repeated List webhooks = 1;
+message LatestDelivery {
+ optional string id = 1;
+ optional string at = 2;
+ optional bool success = 3;
+ optional int32 httpStatus = 4;
+ optional int32 durationMs = 5;
+}
- message List {
- optional string key = 1;
- optional string name = 2;
- optional string url = 3;
- optional LatestDelivery latestDelivery = 4;
+message ListResponseElement {
+ optional string key = 1;
+ optional string name = 2;
+ optional string url = 3;
+ optional LatestDelivery latestDelivery = 4;
+}
- message LatestDelivery {
- optional string id = 1;
- optional string at = 2;
- optional string success = 3;
- optional string httpStatus = 4;
- optional string durationMs = 5;
- }
- }
+// GET api/webhooks/list
+message ListResponse {
+ repeated ListResponseElement webhooks = 1;
}
// POST api/webhooks/create