use of com.google.storage.v2.Bucket 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.Bucket 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);
}
}
use of com.google.storage.v2.Bucket in project gapic-generator-java by googleapis.
the class SyncGetNotificationBucketname method syncGetNotificationBucketname.
public static void syncGetNotificationBucketname() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
BucketName name = BucketName.of("[PROJECT]", "[BUCKET]");
Notification response = storageClient.getNotification(name);
}
}
use of com.google.storage.v2.Bucket in project gapic-generator-java by googleapis.
the class SyncGetNotificationString method syncGetNotificationString.
public static void syncGetNotificationString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String name = BucketName.of("[PROJECT]", "[BUCKET]").toString();
Notification response = storageClient.getNotification(name);
}
}
use of com.google.storage.v2.Bucket in project gapic-generator-java by googleapis.
the class AsyncDeleteBucket method asyncDeleteBucket.
public static void asyncDeleteBucket() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<Empty> future = storageClient.deleteBucketCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations