use of com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest in project gapic-generator-java by googleapis.
the class AsyncRestoreCryptoKeyVersion method asyncRestoreCryptoKeyVersion.
public static void asyncRestoreCryptoKeyVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
RestoreCryptoKeyVersionRequest request = RestoreCryptoKeyVersionRequest.newBuilder().setName(CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]").toString()).build();
ApiFuture<CryptoKeyVersion> future = keyManagementServiceClient.restoreCryptoKeyVersionCallable().futureCall(request);
// Do something.
CryptoKeyVersion response = future.get();
}
}
use of com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest in project gapic-generator-java by googleapis.
the class SyncRestoreCryptoKeyVersion method syncRestoreCryptoKeyVersion.
public static void syncRestoreCryptoKeyVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
RestoreCryptoKeyVersionRequest request = RestoreCryptoKeyVersionRequest.newBuilder().setName(CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]").toString()).build();
CryptoKeyVersion response = keyManagementServiceClient.restoreCryptoKeyVersion(request);
}
}
Aggregations