diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-11 11:45:39 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-17 13:40:18 +0100 |
commit | 1a0fdb1c93d6e0ebd01bdbaa3994b7bc04406f00 (patch) | |
tree | 9ffb1ee3434106604db1a23a23ccd571ef8526d0 /sonar-ws/src/main | |
parent | a3aa1505a13938c766cb40fb74e8c7532e5dfb34 (diff) | |
download | sonarqube-1a0fdb1c93d6e0ebd01bdbaa3994b7bc04406f00.tar.gz sonarqube-1a0fdb1c93d6e0ebd01bdbaa3994b7bc04406f00.zip |
SONAR-6947 api/permissions/groups use GroupsWsRequest
Diffstat (limited to 'sonar-ws/src/main')
3 files changed, 81 insertions, 35 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java new file mode 100644 index 00000000000..e43fb445862 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java @@ -0,0 +1,80 @@ +package org.sonarqube.ws.client.permission; + +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; + +public class GroupsWsRequest { + private String permission; + private String projectId; + private String projectKey; + private int page; + private int pageSize; + private String query; + private String selected; + + public String getPermission() { + return permission; + } + + public GroupsWsRequest setPermission(String permission) { + this.permission = permission; + return this; + } + + @CheckForNull + public String getProjectId() { + return projectId; + } + + public GroupsWsRequest setProjectId(String projectId) { + this.projectId = projectId; + return this; + } + + @CheckForNull + public String getProjectKey() { + return projectKey; + } + + public GroupsWsRequest setProjectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + + public int getPage() { + return page; + } + + public GroupsWsRequest setPage(int page) { + this.page = page; + return this; + } + + public int getPageSize() { + return pageSize; + } + + public GroupsWsRequest setPageSize(int pageSize) { + this.pageSize = pageSize; + return this; + } + + @CheckForNull + public String getQuery() { + return query; + } + + public GroupsWsRequest setQuery(@Nullable String query) { + this.query = query; + return this; + } + + public String getSelected() { + return selected; + } + + public GroupsWsRequest setSelected(String selected) { + this.selected = selected; + return this; + } +} 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 c84ebab181f..2f84930e96f 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 @@ -12,7 +12,7 @@ public class PermissionsWsClient { this.wsClient = wsClient; } - public WsPermissions.WsGroupsResponse groups(WsGroupsRequest request) { + public WsPermissions.WsGroupsResponse groups(GroupsWsRequest request) { return wsClient.execute(newGetRequest("api/permissions/groups") .setParam("permission", request.getPermission()) .setParam("projectId", request.getProjectId()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/WsGroupsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/WsGroupsRequest.java deleted file mode 100644 index e8d6da0a92f..00000000000 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/WsGroupsRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.sonarqube.ws.client.permission; - -public class WsGroupsRequest { - private String permission; - private String projectId; - private String projectKey; - - public String getPermission() { - return permission; - } - - public WsGroupsRequest setPermission(String permission) { - this.permission = permission; - return this; - } - - public String getProjectId() { - return projectId; - } - - public WsGroupsRequest setProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - public String getProjectKey() { - return projectKey; - } - - public WsGroupsRequest setProjectKey(String projectKey) { - this.projectKey = projectKey; - return this; - } -} |