use of com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest in project gapic-generator-java by googleapis.
the class SyncUpdateCryptoKeyPrimaryVersion method syncUpdateCryptoKeyPrimaryVersion.
public static void syncUpdateCryptoKeyPrimaryVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
UpdateCryptoKeyPrimaryVersionRequest request = UpdateCryptoKeyPrimaryVersionRequest.newBuilder().setName(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCryptoKeyVersionId("cryptoKeyVersionId987674581").build();
CryptoKey response = keyManagementServiceClient.updateCryptoKeyPrimaryVersion(request);
}
}
use of com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest in project gapic-generator-java by googleapis.
the class AsyncUpdateCryptoKeyPrimaryVersion method asyncUpdateCryptoKeyPrimaryVersion.
public static void asyncUpdateCryptoKeyPrimaryVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
UpdateCryptoKeyPrimaryVersionRequest request = UpdateCryptoKeyPrimaryVersionRequest.newBuilder().setName(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCryptoKeyVersionId("cryptoKeyVersionId987674581").build();
ApiFuture<CryptoKey> future = keyManagementServiceClient.updateCryptoKeyPrimaryVersionCallable().futureCall(request);
// Do something.
CryptoKey response = future.get();
}
}
Aggregations