diff --git a/kms/api-client/snippets.py b/kms/api-client/snippets.py index d4209e6b18fb..e09a3a799ace 100644 --- a/kms/api-client/snippets.py +++ b/kms/api-client/snippets.py @@ -74,8 +74,7 @@ def encrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id, client = kms_v1.KeyManagementServiceClient() # The resource name of the CryptoKey. - name = client.crypto_key_path_path(project_id, location_id, key_ring_id, - crypto_key_id) + name = client.crypto_key_path(project_id, location_id, key_ring_id, crypto_key_id) # Use the KMS API to encrypt the data. response = client.encrypt(name, plaintext) @@ -94,8 +93,7 @@ def decrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id, client = kms_v1.KeyManagementServiceClient() # The resource name of the CryptoKey. - name = client.crypto_key_path_path(project_id, location_id, key_ring_id, - crypto_key_id) + name = client.crypto_key_path(project_id, location_id, key_ring_id, crypto_key_id) # Use the KMS API to decrypt the data. response = client.decrypt(name, ciphertext) return response.plaintext @@ -219,8 +217,7 @@ def add_member_to_crypto_key_policy( client = kms_v1.KeyManagementServiceClient() # The resource name of the CryptoKey. - resource = client.crypto_key_path_path(project_id, location_id, - key_ring_id, crypto_key_id) + resource = client.crypto_key_path(project_id, location_id, key_ring_id, crypto_key_id) # Get the current IAM policy. policy = client.get_iam_policy(resource) @@ -282,8 +279,8 @@ def remove_member_from_crypto_key_policy( client = kms_v1.KeyManagementServiceClient() # The resource name of the CryptoKey. - resource = client.crypto_key_path_path(project_id, location_id, - key_ring_id, crypto_key_id) + resource = client.crypto_key_path(project_id, location_id, key_ring_id, crypto_key_id) + # Get the current IAM policy. policy = client.get_iam_policy(resource) @@ -365,8 +362,7 @@ def get_crypto_key_policy(project_id, location_id, key_ring_id, crypto_key_id): client = kms_v1.KeyManagementServiceClient() # The resource name of the CryptoKey. - resource = client.crypto_key_path_path(project_id, location_id, - key_ring_id, crypto_key_id) + resource = client.crypto_key_path(project_id, location_id, key_ring_id, crypto_key_id) # Get the current IAM policy. policy = client.get_iam_policy(resource)