diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-12 16:59:54 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-17 13:41:01 +0100 |
commit | a000d18795598ee8c666dc7b90aa57eb3904bdd1 (patch) | |
tree | 9a1551afb6617839c83611433ff7b7500a0b559e /sonar-ws | |
parent | 4b6363011a1770ea15c07cbc3158d8ff2d5a9a50 (diff) | |
download | sonarqube-a000d18795598ee8c666dc7b90aa57eb3904bdd1.tar.gz sonarqube-a000d18795598ee8c666dc7b90aa57eb3904bdd1.zip |
SONAR-6947 api/permissions/remove_group_from_template use RemoveGroupFromTemplateWsRequest
Diffstat (limited to 'sonar-ws')
2 files changed, 92 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsClient.java index 5db97477bd1..f8844c287e0 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsClient.java @@ -123,6 +123,15 @@ public class PermissionsWsClient { .setParam(PARAM_PROJECT_KEY, request.getProjectKey())); } + public void removeGroupFromTemplate(RemoveGroupFromTemplateWsRequest request) { + wsClient.execute(newPostRequest(action("remove_group_from_template")) + .setParam(PARAM_PERMISSION, request.getPermission()) + .setParam(PARAM_GROUP_ID, request.getGroupId()) + .setParam(PARAM_GROUP_NAME, request.getGroupName()) + .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) + .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())); + } + private static String action(String action) { return PermissionsWsParameters.ENDPOINT + "/" + action; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java new file mode 100644 index 00000000000..48b48e39398 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java @@ -0,0 +1,83 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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.permission; + +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; + +import static java.util.Objects.requireNonNull; + +public class RemoveGroupFromTemplateWsRequest { + private String permission; + private String groupId; + private String groupName; + private String templateId; + private String templateName; + + public String getPermission() { + return permission; + } + + public RemoveGroupFromTemplateWsRequest setPermission(String permission) { + this.permission = requireNonNull(permission); + return this; + } + + @CheckForNull + public String getGroupId() { + return groupId; + } + + public RemoveGroupFromTemplateWsRequest setGroupId(@Nullable String groupId) { + this.groupId = groupId; + return this; + } + + @CheckForNull + public String getGroupName() { + return groupName; + } + + public RemoveGroupFromTemplateWsRequest setGroupName(@Nullable String groupName) { + this.groupName = groupName; + return this; + } + + @CheckForNull + public String getTemplateId() { + return templateId; + } + + public RemoveGroupFromTemplateWsRequest setTemplateId(@Nullable String templateId) { + this.templateId = templateId; + return this; + } + + @CheckForNull + public String getTemplateName() { + return templateName; + } + + public RemoveGroupFromTemplateWsRequest setTemplateName(@Nullable String templateName) { + this.templateName = templateName; + return this; + } +} |