Search in sources :

Example 1 with GetNotificationRequest

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();
    }
}
Also used : StorageClient(com.google.storage.v2.StorageClient) GetNotificationRequest(com.google.storage.v2.GetNotificationRequest) Notification(com.google.storage.v2.Notification)

Example 2 with GetNotificationRequest

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);
    }
}
Also used : StorageClient(com.google.storage.v2.StorageClient) GetNotificationRequest(com.google.storage.v2.GetNotificationRequest) Notification(com.google.storage.v2.Notification)

Aggregations

GetNotificationRequest (com.google.storage.v2.GetNotificationRequest)2 Notification (com.google.storage.v2.Notification)2 StorageClient (com.google.storage.v2.StorageClient)2