Search in sources :

Example 1 with GetHmacKeyRequest

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

the class AsyncGetHmacKey method asyncGetHmacKey.

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

Example 2 with GetHmacKeyRequest

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

the class SyncGetHmacKey method syncGetHmacKey.

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

Aggregations

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