aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorBelen Pruvost <belen.pruvost@sonarsource.com>2021-06-03 12:42:55 +0200
committersonartech <sonartech@sonarsource.com>2021-06-03 20:31:41 +0000
commit49f0c52ea17416680df7317e542332770f8333b2 (patch)
treeda817ea4116a829d5453d2027d7fb85f157964c8 /sonar-ws
parent91199b1461fe0935a32c7118cdafced92a477587 (diff)
downloadsonarqube-49f0c52ea17416680df7317e542332770f8333b2.tar.gz
sonarqube-49f0c52ea17416680df7317e542332770f8333b2.zip
SONAR-14812 - BBC Integration Tests
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java32
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ImportBitbucketcloudRepoRequest.java59
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SearchBitbucketcloudReposRequest.java70
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SetPatRequest.java10
4 files changed, 171 insertions, 0 deletions
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 13c73ed4e67..479c8d04245 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
@@ -71,6 +71,22 @@ public class AlmIntegrationsService 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/alm_integrations/import_bitbucketcloud_project">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+ public Projects.CreateWsResponse importBitbucketcloudProject(ImportBitbucketcloudRepoRequest request) {
+ return call(
+ new PostRequest(path("import_bitbucketcloud_repo"))
+ .setParam("almSetting", request.getAlmSetting())
+ .setParam("repositorySlug", request.getRepositorySlug())
+ .setMediaType(MediaTypes.JSON),
+ Projects.CreateWsResponse.parser());
+ }
+
+ /**
* This is a POST request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/import_gitlab_project">Further information about this action online (including a response example)</a>
@@ -168,6 +184,21 @@ public class AlmIntegrationsService extends BaseService {
/**
* This is part of the internal API.
+ * This is a GET request.
+ *
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/search_bitbucketcloud_repos">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+ public AlmIntegrations.SearchBitbucketcloudReposWsResponse searchBitbucketcloudRepos(SearchBitbucketcloudReposRequest request) {
+ return call(
+ new GetRequest(path("search_bitbucketcloud_repos"))
+ .setParam("almSetting", request.getAlmSetting())
+ .setMediaType(MediaTypes.JSON),
+ AlmIntegrations.SearchBitbucketcloudReposWsResponse.parser());
+ }
+
+ /**
+ * This is part of the internal API.
* This is a POST request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/set_pat">Further information about this action online (including a response example)</a>
@@ -178,6 +209,7 @@ public class AlmIntegrationsService extends BaseService {
new PostRequest(path("set_pat"))
.setParam("almSetting", request.getAlmSetting())
.setParam("pat", request.getPat())
+ .setParam("username", request.getUsername())
.setMediaType(MediaTypes.JSON)
).content();
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ImportBitbucketcloudRepoRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ImportBitbucketcloudRepoRequest.java
new file mode 100644
index 00000000000..efd915341ad
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ImportBitbucketcloudRepoRequest.java
@@ -0,0 +1,59 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 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;
+
+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/alm_integrations/import_bitbucketcloud_repo">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+@Generated("sonar-ws-generator")
+public class ImportBitbucketcloudRepoRequest {
+
+ private String almSetting;
+ private String repositorySlug;
+
+ /**
+ * This is a mandatory parameter.
+ */
+ public ImportBitbucketcloudRepoRequest setAlmSetting(String almSetting) {
+ this.almSetting = almSetting;
+ return this;
+ }
+
+ public String getAlmSetting() {
+ return almSetting;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ */
+ public ImportBitbucketcloudRepoRequest setRepositorySlug(String repositorySlug) {
+ this.repositorySlug = repositorySlug;
+ return this;
+ }
+
+ public String getRepositorySlug() {
+ return repositorySlug;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SearchBitbucketcloudReposRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SearchBitbucketcloudReposRequest.java
new file mode 100644
index 00000000000..6246babd2f5
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SearchBitbucketcloudReposRequest.java
@@ -0,0 +1,70 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 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;
+
+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/alm_integrations/search_bibucketserver_repos">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+@Generated("sonar-ws-generator")
+public class SearchBitbucketcloudReposRequest {
+
+ private String almSetting;
+ private String projectName;
+ private String repositoryName;
+
+ /**
+ * This is a mandatory parameter.
+ */
+ public SearchBitbucketcloudReposRequest setAlmSetting(String almSetting) {
+ this.almSetting = almSetting;
+ return this;
+ }
+
+ public String getAlmSetting() {
+ return almSetting;
+ }
+
+ /**
+ */
+ public SearchBitbucketcloudReposRequest setProjectName(String projectName) {
+ this.projectName = projectName;
+ return this;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ /**
+ */
+ public SearchBitbucketcloudReposRequest setRepositoryName(String repositoryName) {
+ this.repositoryName = repositoryName;
+ return this;
+ }
+
+ public String getRepositoryName() {
+ return repositoryName;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SetPatRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SetPatRequest.java
index faa42bbe760..77986f21859 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SetPatRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SetPatRequest.java
@@ -32,6 +32,7 @@ public class SetPatRequest {
private String almSetting;
private String pat;
+ private String username;
/**
* This is a mandatory parameter.
@@ -56,4 +57,13 @@ public class SetPatRequest {
public String getPat() {
return pat;
}
+
+ public SetPatRequest setUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ public String getUsername() {
+ return username;
+ }
}