Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcd9534

Browse files
author
Ajay Kannan
committed
minor changes to ResourceManagerRpc
1 parent 57df7ac commit dcd9534

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,21 @@
2020
import com.google.api.services.cloudresourcemanager.model.Project;
2121
import com.google.gcloud.resourcemanager.ResourceManagerException;
2222

23+
import java.util.Collections;
2324
import java.util.List;
2425

2526
public interface ResourceManagerRpc {
2627

28+
public enum Permission {
29+
CREATE,
30+
DELETE,
31+
GET,
32+
LIST,
33+
UPDATE,
34+
GET_IAM_POLICY,
35+
SET_IAM_POLICY;
36+
}
37+
2738
class Tuple<X, Y> {
2839
private final X x;
2940
private final Y y;
@@ -49,20 +60,24 @@ public Y y() {
4960
public class ListOptions {
5061
private List<String> filters;
5162
private String pageToken;
63+
private int pageSize;
5264

53-
private static final ListOptions DEFAULT_INSTANCE = new ListOptions(null, null);
65+
private static final ListOptions DEFAULT_INSTANCE =
66+
new ListOptions(Collections.<String>emptyList(), null, -1);
5467

55-
ListOptions(List<String> filters, String pageToken) {
68+
ListOptions(List<String> filters, String pageToken, int pageSize) {
5669
this.filters = filters;
5770
this.pageToken = pageToken;
71+
this.pageSize = pageSize;
5872
}
5973

6074
public static ListOptions getDefaultInstance() {
6175
return DEFAULT_INSTANCE;
6276
}
6377

64-
public static ListOptions createListOption(List<String> filters, String pageToken) {
65-
return new ListOptions(filters, pageToken);
78+
public static ListOptions createListOption(
79+
List<String> filters, String pageToken, int pageSize) {
80+
return new ListOptions(filters, pageToken, pageSize);
6681
}
6782

6883
public String pageToken() {
@@ -72,6 +87,10 @@ public String pageToken() {
7287
public List<String> filters() {
7388
return filters;
7489
}
90+
91+
public int pageSize() {
92+
return pageSize;
93+
}
7594
}
7695

7796
Project create(Project project) throws ResourceManagerException;
@@ -90,6 +109,6 @@ public List<String> filters() {
90109

91110
void setIamPolicy(String projectId, Policy policy) throws ResourceManagerException;
92111

93-
boolean hasPermissions(String projectId, List<String> permissions)
112+
List<Boolean> hasPermissions(String projectId, Permission first, Permission... others)
94113
throws ResourceManagerException;
95114
}

0 commit comments

Comments
 (0)