Search in sources :

Example 1 with DeleteHmacKeyRequest

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

the class AsyncDeleteHmacKey method asyncDeleteHmacKey.

public static void asyncDeleteHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        DeleteHmacKeyRequest request = DeleteHmacKeyRequest.newBuilder().setAccessId("accessId-2146437729").setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<Empty> future = storageClient.deleteHmacKeyCallable().futureCall(request);
        // Do something.
        future.get();
    }
}
Also used : DeleteHmacKeyRequest(com.google.storage.v2.DeleteHmacKeyRequest) Empty(com.google.protobuf.Empty) StorageClient(com.google.storage.v2.StorageClient)

Example 2 with DeleteHmacKeyRequest

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

the class SyncDeleteHmacKey method syncDeleteHmacKey.

public static void syncDeleteHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        DeleteHmacKeyRequest request = DeleteHmacKeyRequest.newBuilder().setAccessId("accessId-2146437729").setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        storageClient.deleteHmacKey(request);
    }
}
Also used : DeleteHmacKeyRequest(com.google.storage.v2.DeleteHmacKeyRequest) StorageClient(com.google.storage.v2.StorageClient)

Aggregations

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