diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2019-11-29 12:07:41 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-09 20:46:18 +0100 |
commit | c2eb881918dc2163e7a87d8c45e48ce471097302 (patch) | |
tree | 9eec8da3271ebaf32fc270ad99c7f27064b09695 /sonar-ws/src/main | |
parent | 2fb4e3512f289f548abe13a27aeb7b38e4e199c5 (diff) | |
download | sonarqube-c2eb881918dc2163e7a87d8c45e48ce471097302.tar.gz sonarqube-c2eb881918dc2163e7a87d8c45e48ce471097302.zip |
SONAR-12673 additional ITs
Diffstat (limited to 'sonar-ws/src/main')
2 files changed, 94 insertions, 6 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java index d1459a48009..7509be1cfc5 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java @@ -19,14 +19,13 @@ */ package org.sonarqube.ws.client.projectbranches; -import java.util.stream.Collectors; import javax.annotation.Generated; import org.sonarqube.ws.MediaTypes; +import org.sonarqube.ws.ProjectBranches.ListWsResponse; 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.ProjectBranches.ListWsResponse; /** * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches">Further information about this web service online</a> @@ -50,8 +49,7 @@ public class ProjectBranchesService extends BaseService { new PostRequest(path("delete")) .setParam("branch", request.getBranch()) .setParam("project", request.getProject()) - .setMediaType(MediaTypes.JSON) - ).content(); + .setMediaType(MediaTypes.JSON)).content(); } /** @@ -80,7 +78,15 @@ public class ProjectBranchesService extends BaseService { new PostRequest(path("rename")) .setParam("name", request.getName()) .setParam("project", request.getProject()) - .setMediaType(MediaTypes.JSON) - ).content(); + .setMediaType(MediaTypes.JSON)).content(); + } + + public void setAutomaticDeletionProtection(SetAutomaticDeletionProtectionRequest request) { + call( + new PostRequest(path("set_automatic_deletion_protection")) + .setParam("project", request.getProject()) + .setParam("branch", request.getBranch()) + .setParam("value", request.getValue()) + .setMediaType(MediaTypes.JSON)).content(); } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/SetAutomaticDeletionProtectionRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/SetAutomaticDeletionProtectionRequest.java new file mode 100644 index 00000000000..6ca13840fe1 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/SetAutomaticDeletionProtectionRequest.java @@ -0,0 +1,82 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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.projectbranches; + +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/project_branches/set_automatic_deletion_protection">Further information about this action online (including a response example)</a> + * @since 8.1 + */ +@Generated("sonar-ws-generator") +public class SetAutomaticDeletionProtectionRequest { + + private String branch; + private String project; + private String value; + + /** + * This is a mandatory parameter. + * Example value: "feature/my_branch" + */ + public SetAutomaticDeletionProtectionRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * This is a mandatory parameter. + * Example value: "my_project" + */ + public SetAutomaticDeletionProtectionRequest setProject(String project) { + this.project = project; + return this; + } + + public String getProject() { + return project; + } + + /** + * This is a mandatory parameter. + * Example value: "true" + * Possible values: + * <ul> + * <li>"true"</li> + * <li>"false"</li> + * <li>"yes"</li> + * <li>"no"</li> + * </ul> + */ + public SetAutomaticDeletionProtectionRequest setValue(String value) { + this.value = value; + return this; + } + + public String getValue() { + return value; + } +} |