Skip to content

Commit 0f292cb

Browse files
author
Ajay Kannan
committed
add return values to delete, undelete, and setIamPolicy
1 parent 766716f commit 0f292cb

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ public enum Permission {
3838
SET_IAM_POLICY
3939
}
4040

41+
public enum DeleteResult {
42+
SUCCESS,
43+
ALREADY_DELETED
44+
}
45+
46+
public enum UndeleteResult {
47+
SUCCESS,
48+
DELETE_IN_PROGRESS,
49+
GONE
50+
}
51+
52+
public enum SetIamPolicyResult {
53+
SUCCESS,
54+
ETAG_NOT_MATCH
55+
}
56+
4157
class Tuple<X, Y> {
4258
private final X x;
4359
private final Y y;
@@ -98,19 +114,19 @@ public int pageSize() {
98114

99115
Project create(Project project) throws ResourceManagerException;
100116

101-
void delete(String projectId) throws ResourceManagerException;
117+
DeleteResult delete(String projectId) throws ResourceManagerException;
102118

103119
Project get(String projectId) throws ResourceManagerException;
104120

105121
Tuple<String, Iterable<Project>> list(ListOptions listOptions) throws ResourceManagerException;
106122

107-
void undelete(String projectId) throws ResourceManagerException;
123+
UndeleteResult undelete(String projectId) throws ResourceManagerException;
108124

109125
Project update(Project project) throws ResourceManagerException;
110126

111127
Policy getIamPolicy(String projectId) throws ResourceManagerException;
112128

113-
void setIamPolicy(String projectId, Policy policy) throws ResourceManagerException;
129+
SetIamPolicyResult setIamPolicy(String projectId, Policy policy) throws ResourceManagerException;
114130

115131
List<Boolean> hasPermissions(String projectId, List<Permission> permissions)
116132
throws ResourceManagerException;

0 commit comments

Comments
 (0)