use of com.google.storage.v2.GetServiceAccountRequest in project gapic-generator-java by googleapis.
the class AsyncGetServiceAccount method asyncGetServiceAccount.
public static void asyncGetServiceAccount() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<ServiceAccount> future = storageClient.getServiceAccountCallable().futureCall(request);
// Do something.
ServiceAccount response = future.get();
}
}
use of com.google.storage.v2.GetServiceAccountRequest in project gapic-generator-java by googleapis.
the class SyncGetServiceAccount method syncGetServiceAccount.
public static void syncGetServiceAccount() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ServiceAccount response = storageClient.getServiceAccount(request);
}
}
Aggregations