diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-12 16:40:55 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-17 13:41:01 +0100 |
commit | 4b6363011a1770ea15c07cbc3158d8ff2d5a9a50 (patch) | |
tree | 3a3a2345a6626b2d3c15a09ea8afc16a9e6b399d /sonar-ws | |
parent | 326133c4a0bd828f649bf666630bfda47fe20d66 (diff) | |
download | sonarqube-4b6363011a1770ea15c07cbc3158d8ff2d5a9a50.tar.gz sonarqube-4b6363011a1770ea15c07cbc3158d8ff2d5a9a50.zip |
SONAR-6947 api/permissions/remove_group use RemoveGroupWsRequest
Diffstat (limited to 'sonar-ws')
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsClient.java | 9 | ||||
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java | 81 |
2 files changed, 90 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 6eb702f03a4..5db97477bd1 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 @@ -114,6 +114,15 @@ public class PermissionsWsClient { .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())); } + public void removeGroup(RemoveGroupWsRequest request) { + wsClient.execute(newPostRequest(action("remove_group")) + .setParam(PARAM_PERMISSION, request.getPermission()) + .setParam(PARAM_GROUP_ID, request.getGroupId()) + .setParam(PARAM_GROUP_NAME, request.getGroupName()) + .setParam(PARAM_PROJECT_ID, request.getProjectId()) + .setParam(PARAM_PROJECT_KEY, request.getProjectKey())); + } + private static String action(String action) { return PermissionsWsParameters.ENDPOINT + "/" + action; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java new file mode 100644 index 00000000000..8bc2bbf24c4 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java @@ -0,0 +1,81 @@ +/* + * 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; + +public class RemoveGroupWsRequest { + private String groupId; + private String groupName; + private String permission; + private String projectId; + private String projectKey; + + @CheckForNull + public String getGroupId() { + return groupId; + } + + public RemoveGroupWsRequest setGroupId(@Nullable String groupId) { + this.groupId = groupId; + return this; + } + + @CheckForNull + public String getGroupName() { + return groupName; + } + + public RemoveGroupWsRequest setGroupName(@Nullable String groupName) { + this.groupName = groupName; + return this; + } + + public String getPermission() { + return permission; + } + + public RemoveGroupWsRequest setPermission(String permission) { + this.permission = permission; + return this; + } + + @CheckForNull + public String getProjectId() { + return projectId; + } + + public RemoveGroupWsRequest setProjectId(@Nullable String projectId) { + this.projectId = projectId; + return this; + } + + @CheckForNull + public String getProjectKey() { + return projectKey; + } + + public RemoveGroupWsRequest setProjectKey(@Nullable String projectKey) { + this.projectKey = projectKey; + return this; + } +} |