From 347294d72cb62a0420ebd0aee2d2433f829300ed Mon Sep 17 00:00:00 2001 From: Belen Pruvost Date: Wed, 11 Nov 2020 11:06:12 +0200 Subject: SONAR-14057 list ado projects --- .../almintegrations/AlmIntegrationsService.java | 15 ++++++++ .../almintegrations/ListAzureProjectsRequest.java | 43 ++++++++++++++++++++++ .../src/main/protobuf/ws-alm_integrations.proto | 9 ++++- 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ListAzureProjectsRequest.java (limited to 'sonar-ws') diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java index f8832483ca1..cc5e31f1730 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java @@ -101,6 +101,21 @@ public class AlmIntegrationsService extends BaseService { AlmIntegrations.SearchGitlabReposWsResponse.parser()); } + /** + * + * This is part of the internal API. + * This is a GET request. + * @see Further information about this action online (including a response example) + * @since 8.2 + */ + public AlmIntegrations.ListAzureProjectsWsResponse listAzureProjects(ListAzureProjectsRequest request) { + return call( + new GetRequest(path("list_azure_projects")) + .setParam("almSetting", request.getAlmSetting()) + .setMediaType(MediaTypes.JSON), + AlmIntegrations.ListAzureProjectsWsResponse.parser()); + } + /** * * This is part of the internal API. diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ListAzureProjectsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ListAzureProjectsRequest.java new file mode 100644 index 00000000000..e66848551ca --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ListAzureProjectsRequest.java @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2020 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.almintegrations; + +/** + * This is part of the internal API. + * This is a POST request. + * @see Further information about this action online (including a response example) + * @since 8.6 + */ +public class ListAzureProjectsRequest { + + private String almSetting; + + /** + * This is a mandatory parameter. + */ + public ListAzureProjectsRequest setAlmSetting(String almSetting) { + this.almSetting = almSetting; + return this; + } + + public String getAlmSetting() { + return almSetting; + } +} diff --git a/sonar-ws/src/main/protobuf/ws-alm_integrations.proto b/sonar-ws/src/main/protobuf/ws-alm_integrations.proto index 97417220fb5..0dfa28e438e 100644 --- a/sonar-ws/src/main/protobuf/ws-alm_integrations.proto +++ b/sonar-ws/src/main/protobuf/ws-alm_integrations.proto @@ -34,7 +34,12 @@ message SearchBitbucketserverReposWsResponse { // WS api/alm_integrations/list_bibucketserver_projects message ListBitbucketserverProjectsWsResponse { - repeated BBSProject projects = 1; + repeated AlmProject projects = 1; +} + +// WS api/alm_integrations/list_azure_projects +message ListAzureProjectsWsResponse { + repeated AlmProject projects = 1; } message BBSRepo { @@ -45,7 +50,7 @@ message BBSRepo { optional string projectKey = 5; } -message BBSProject { +message AlmProject { optional string key = 1; optional string name = 2; } -- cgit v1.2.3