From 0f292cb6088c27beed5d18433cefc2a1e244ba44 Mon Sep 17 00:00:00 2001 From: Ajay Kannan Date: Tue, 3 Nov 2015 10:20:18 -0800 Subject: [PATCH] add return values to delete, undelete, and setIamPolicy --- .../google/gcloud/spi/ResourceManagerRpc.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java index de412b87278e..7511114a4500 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java @@ -38,6 +38,22 @@ public enum Permission { SET_IAM_POLICY } + public enum DeleteResult { + SUCCESS, + ALREADY_DELETED + } + + public enum UndeleteResult { + SUCCESS, + DELETE_IN_PROGRESS, + GONE + } + + public enum SetIamPolicyResult { + SUCCESS, + ETAG_NOT_MATCH + } + class Tuple { private final X x; private final Y y; @@ -98,19 +114,19 @@ public int pageSize() { Project create(Project project) throws ResourceManagerException; - void delete(String projectId) throws ResourceManagerException; + DeleteResult delete(String projectId) throws ResourceManagerException; Project get(String projectId) throws ResourceManagerException; Tuple> list(ListOptions listOptions) throws ResourceManagerException; - void undelete(String projectId) throws ResourceManagerException; + UndeleteResult undelete(String projectId) throws ResourceManagerException; Project update(Project project) throws ResourceManagerException; Policy getIamPolicy(String projectId) throws ResourceManagerException; - void setIamPolicy(String projectId, Policy policy) throws ResourceManagerException; + SetIamPolicyResult setIamPolicy(String projectId, Policy policy) throws ResourceManagerException; List hasPermissions(String projectId, List permissions) throws ResourceManagerException;