Search in sources :

Example 1 with HmacKeyMetadata

use of com.google.storage.v2.HmacKeyMetadata 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 HmacKeyMetadata

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

the class SyncUpdateHmacKeyHmackeymetadataFieldmask method syncUpdateHmacKeyHmackeymetadataFieldmask.

public static void syncUpdateHmacKeyHmackeymetadataFieldmask() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build();
        FieldMask updateMask = FieldMask.newBuilder().build();
        HmacKeyMetadata response = storageClient.updateHmacKey(hmacKey, updateMask);
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient) FieldMask(com.google.protobuf.FieldMask)

Example 3 with HmacKeyMetadata

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

the class SyncGetHmacKeyStringProjectname method syncGetHmacKeyStringProjectname.

public static void syncGetHmacKeyStringProjectname() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        String accessId = "accessId-2146437729";
        ProjectName project = ProjectName.of("[PROJECT]");
        HmacKeyMetadata response = storageClient.getHmacKey(accessId, project);
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) ProjectName(com.google.storage.v2.ProjectName) StorageClient(com.google.storage.v2.StorageClient)

Example 4 with HmacKeyMetadata

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

the class SyncGetHmacKeyStringString method syncGetHmacKeyStringString.

public static void syncGetHmacKeyStringString() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        String accessId = "accessId-2146437729";
        String project = ProjectName.of("[PROJECT]").toString();
        HmacKeyMetadata response = storageClient.getHmacKey(accessId, project);
    }
}
Also used : HmacKeyMetadata(com.google.storage.v2.HmacKeyMetadata) StorageClient(com.google.storage.v2.StorageClient)

Example 5 with HmacKeyMetadata

use of com.google.storage.v2.HmacKeyMetadata 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)

Aggregations

HmacKeyMetadata (com.google.storage.v2.HmacKeyMetadata)9 StorageClient (com.google.storage.v2.StorageClient)9 AbstractMessage (com.google.protobuf.AbstractMessage)4 ListHmacKeysPagedResponse (com.google.storage.v2.StorageClient.ListHmacKeysPagedResponse)4 Test (org.junit.Test)4 ByteString (com.google.protobuf.ByteString)2 GetHmacKeyRequest (com.google.storage.v2.GetHmacKeyRequest)2 ListHmacKeysRequest (com.google.storage.v2.ListHmacKeysRequest)2 UpdateHmacKeyRequest (com.google.storage.v2.UpdateHmacKeyRequest)2 FieldMask (com.google.protobuf.FieldMask)1 ListHmacKeysResponse (com.google.storage.v2.ListHmacKeysResponse)1 ProjectName (com.google.storage.v2.ProjectName)1