use of com.google.storage.v2.GetNotificationRequest in project gapic-generator-java by googleapis.
the class AsyncGetNotification method asyncGetNotification.
public static void asyncGetNotification() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
GetNotificationRequest request = GetNotificationRequest.newBuilder().setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()).build();
ApiFuture<Notification> future = storageClient.getNotificationCallable().futureCall(request);
// Do something.
Notification response = future.get();
}
}
use of com.google.storage.v2.GetNotificationRequest in project gapic-generator-java by googleapis.
the class SyncGetNotification method syncGetNotification.
public static void syncGetNotification() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
GetNotificationRequest request = GetNotificationRequest.newBuilder().setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()).build();
Notification response = storageClient.getNotification(request);
}
}
Aggregations