use of com.google.storage.v2.CreateHmacKeyResponse in project gapic-generator-java by googleapis.
the class SyncCreateHmacKey method syncCreateHmacKey.
public static void syncCreateHmacKey() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
CreateHmacKeyRequest request = CreateHmacKeyRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setServiceAccountEmail("serviceAccountEmail1825953988").setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
CreateHmacKeyResponse response = storageClient.createHmacKey(request);
}
}
use of com.google.storage.v2.CreateHmacKeyResponse in project gapic-generator-java by googleapis.
the class SyncCreateHmacKeyStringString method syncCreateHmacKeyStringString.
public static void syncCreateHmacKeyStringString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
String project = ProjectName.of("[PROJECT]").toString();
String serviceAccountEmail = "serviceAccountEmail1825953988";
CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
}
}
use of com.google.storage.v2.CreateHmacKeyResponse in project gapic-generator-java by googleapis.
the class AsyncCreateHmacKey method asyncCreateHmacKey.
public static void asyncCreateHmacKey() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
CreateHmacKeyRequest request = CreateHmacKeyRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setServiceAccountEmail("serviceAccountEmail1825953988").setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<CreateHmacKeyResponse> future = storageClient.createHmacKeyCallable().futureCall(request);
// Do something.
CreateHmacKeyResponse response = future.get();
}
}
use of com.google.storage.v2.CreateHmacKeyResponse in project gapic-generator-java by googleapis.
the class SyncCreateHmacKeyProjectnameString method syncCreateHmacKeyProjectnameString.
public static void syncCreateHmacKeyProjectnameString() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
String serviceAccountEmail = "serviceAccountEmail1825953988";
CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail);
}
}
Aggregations