Search in sources :

Example 1 with DeleteNotificationRequest

use of com.google.storage.v2.DeleteNotificationRequest in project gapic-generator-java by googleapis.

the class AsyncDeleteNotification method asyncDeleteNotification.

public static void asyncDeleteNotification() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        DeleteNotificationRequest request = DeleteNotificationRequest.newBuilder().setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()).build();
        ApiFuture<Empty> future = storageClient.deleteNotificationCallable().futureCall(request);
        // Do something.
        future.get();
    }
}
Also used : Empty(com.google.protobuf.Empty) StorageClient(com.google.storage.v2.StorageClient) DeleteNotificationRequest(com.google.storage.v2.DeleteNotificationRequest)

Example 2 with DeleteNotificationRequest

use of com.google.storage.v2.DeleteNotificationRequest in project gapic-generator-java by googleapis.

the class SyncDeleteNotification method syncDeleteNotification.

public static void syncDeleteNotification() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        DeleteNotificationRequest request = DeleteNotificationRequest.newBuilder().setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()).build();
        storageClient.deleteNotification(request);
    }
}
Also used : StorageClient(com.google.storage.v2.StorageClient) DeleteNotificationRequest(com.google.storage.v2.DeleteNotificationRequest)

Aggregations

DeleteNotificationRequest (com.google.storage.v2.DeleteNotificationRequest)2 StorageClient (com.google.storage.v2.StorageClient)2 Empty (com.google.protobuf.Empty)1