Search in sources :

Example 1 with UpdateHmacKeyRequest

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

the class AsyncUpdateHmacKey method asyncUpdateHmacKey.

public static void asyncUpdateHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateHmacKeyRequest request = UpdateHmacKeyRequest.newBuilder().setHmacKey(HmacKeyMetadata.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        ApiFuture<HmacKeyMetadata> future = storageClient.updateHmacKeyCallable().futureCall(request);
        // Do something.
        HmacKeyMetadata response = future.get();
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient) UpdateHmacKeyRequest(com.google.storage.v2.UpdateHmacKeyRequest)

Example 2 with UpdateHmacKeyRequest

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

the class SyncUpdateHmacKey method syncUpdateHmacKey.

public static void syncUpdateHmacKey() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateHmacKeyRequest request = UpdateHmacKeyRequest.newBuilder().setHmacKey(HmacKeyMetadata.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        HmacKeyMetadata response = storageClient.updateHmacKey(request);
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient) UpdateHmacKeyRequest(com.google.storage.v2.UpdateHmacKeyRequest)

Aggregations

HmacKeyMetadata (com.google.storage.v2.HmacKeyMetadata)2 StorageClient (com.google.storage.v2.StorageClient)2 UpdateHmacKeyRequest (com.google.storage.v2.UpdateHmacKeyRequest)2