20
20
import com .google .api .services .cloudresourcemanager .model .Project ;
21
21
import com .google .gcloud .resourcemanager .ResourceManagerException ;
22
22
23
+ import java .util .Collections ;
23
24
import java .util .List ;
24
25
25
26
public interface ResourceManagerRpc {
26
27
28
+ public enum Permission {
29
+ CREATE ,
30
+ DELETE ,
31
+ GET ,
32
+ LIST ,
33
+ UPDATE ,
34
+ GET_IAM_POLICY ,
35
+ SET_IAM_POLICY ;
36
+ }
37
+
27
38
class Tuple <X , Y > {
28
39
private final X x ;
29
40
private final Y y ;
@@ -49,20 +60,24 @@ public Y y() {
49
60
public class ListOptions {
50
61
private List <String > filters ;
51
62
private String pageToken ;
63
+ private int pageSize ;
52
64
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 );
54
67
55
- ListOptions (List <String > filters , String pageToken ) {
68
+ ListOptions (List <String > filters , String pageToken , int pageSize ) {
56
69
this .filters = filters ;
57
70
this .pageToken = pageToken ;
71
+ this .pageSize = pageSize ;
58
72
}
59
73
60
74
public static ListOptions getDefaultInstance () {
61
75
return DEFAULT_INSTANCE ;
62
76
}
63
77
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 );
66
81
}
67
82
68
83
public String pageToken () {
@@ -72,6 +87,10 @@ public String pageToken() {
72
87
public List <String > filters () {
73
88
return filters ;
74
89
}
90
+
91
+ public int pageSize () {
92
+ return pageSize ;
93
+ }
75
94
}
76
95
77
96
Project create (Project project ) throws ResourceManagerException ;
@@ -90,6 +109,6 @@ public List<String> filters() {
90
109
91
110
void setIamPolicy (String projectId , Policy policy ) throws ResourceManagerException ;
92
111
93
- boolean hasPermissions (String projectId , List < String > permissions )
112
+ List < Boolean > hasPermissions (String projectId , Permission first , Permission ... others )
94
113
throws ResourceManagerException ;
95
114
}
0 commit comments