|
23 | 23 | import com.google.api.client.http.HttpRequestInitializer; |
24 | 24 | import com.google.api.client.http.HttpTransport; |
25 | 25 | import com.google.api.client.json.jackson.JacksonFactory; |
26 | | -import com.google.api.services.cloudresourcemanager.Cloudresourcemanager; |
| 26 | +import com.google.api.services.cloudresourcemanager.CloudResourceManager; |
27 | 27 | import com.google.api.services.cloudresourcemanager.model.GetIamPolicyRequest; |
28 | 28 | import com.google.api.services.cloudresourcemanager.model.ListProjectsResponse; |
29 | 29 | import com.google.api.services.cloudresourcemanager.model.Policy; |
30 | 30 | import com.google.api.services.cloudresourcemanager.model.Project; |
31 | 31 | import com.google.api.services.cloudresourcemanager.model.SetIamPolicyRequest; |
32 | 32 | import com.google.api.services.cloudresourcemanager.model.TestIamPermissionsRequest; |
33 | 33 | import com.google.api.services.cloudresourcemanager.model.TestIamPermissionsResponse; |
| 34 | +import com.google.api.services.cloudresourcemanager.model.UndeleteProjectRequest; |
34 | 35 | import com.google.cloud.Tuple; |
35 | 36 | import com.google.cloud.http.HttpTransportOptions; |
36 | 37 | import com.google.cloud.resourcemanager.ResourceManagerException; |
|
44 | 45 |
|
45 | 46 | public class HttpResourceManagerRpc implements ResourceManagerRpc { |
46 | 47 |
|
47 | | - private final Cloudresourcemanager resourceManager; |
| 48 | + private final CloudResourceManager resourceManager; |
48 | 49 |
|
49 | 50 | public HttpResourceManagerRpc(ResourceManagerOptions options) { |
50 | 51 | HttpTransportOptions transportOptions = (HttpTransportOptions) options.getTransportOptions(); |
51 | 52 | HttpTransport transport = transportOptions.getHttpTransportFactory().create(); |
52 | 53 | HttpRequestInitializer initializer = transportOptions.getHttpRequestInitializer(options); |
53 | 54 | resourceManager = |
54 | | - new Cloudresourcemanager.Builder(transport, new JacksonFactory(), initializer) |
| 55 | + new CloudResourceManager.Builder(transport, new JacksonFactory(), initializer) |
55 | 56 | .setRootUrl(options.getHost()) |
56 | 57 | .setApplicationName(options.getApplicationName()) |
57 | 58 | .build(); |
@@ -117,7 +118,7 @@ public Tuple<String, Iterable<Project>> list(Map<Option, ?> options) { |
117 | 118 | @Override |
118 | 119 | public void undelete(String projectId) { |
119 | 120 | try { |
120 | | - resourceManager.projects().undelete(projectId).execute(); |
| 121 | + resourceManager.projects().undelete(projectId, new UndeleteProjectRequest()).execute(); |
121 | 122 | } catch (IOException ex) { |
122 | 123 | throw translate(ex); |
123 | 124 | } |
|
0 commit comments