@@ -74,8 +74,7 @@ def encrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id,
7474 client = kms_v1 .KeyManagementServiceClient ()
7575
7676 # The resource name of the CryptoKey.
77- name = client .crypto_key_path_path (project_id , location_id , key_ring_id ,
78- crypto_key_id )
77+ name = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
7978
8079 # Use the KMS API to encrypt the data.
8180 response = client .encrypt (name , plaintext )
@@ -94,8 +93,7 @@ def decrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id,
9493 client = kms_v1 .KeyManagementServiceClient ()
9594
9695 # The resource name of the CryptoKey.
97- name = client .crypto_key_path_path (project_id , location_id , key_ring_id ,
98- crypto_key_id )
96+ name = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
9997 # Use the KMS API to decrypt the data.
10098 response = client .decrypt (name , ciphertext )
10199 return response .plaintext
@@ -219,8 +217,7 @@ def add_member_to_crypto_key_policy(
219217 client = kms_v1 .KeyManagementServiceClient ()
220218
221219 # The resource name of the CryptoKey.
222- resource = client .crypto_key_path_path (project_id , location_id ,
223- key_ring_id , crypto_key_id )
220+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
224221 # Get the current IAM policy.
225222 policy = client .get_iam_policy (resource )
226223
@@ -282,8 +279,8 @@ def remove_member_from_crypto_key_policy(
282279 client = kms_v1 .KeyManagementServiceClient ()
283280
284281 # The resource name of the CryptoKey.
285- resource = client .crypto_key_path_path (project_id , location_id ,
286- key_ring_id , crypto_key_id )
282+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
283+
287284 # Get the current IAM policy.
288285 policy = client .get_iam_policy (resource )
289286
@@ -365,8 +362,7 @@ def get_crypto_key_policy(project_id, location_id, key_ring_id, crypto_key_id):
365362 client = kms_v1 .KeyManagementServiceClient ()
366363
367364 # The resource name of the CryptoKey.
368- resource = client .crypto_key_path_path (project_id , location_id ,
369- key_ring_id , crypto_key_id )
365+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
370366
371367 # Get the current IAM policy.
372368 policy = client .get_iam_policy (resource )
0 commit comments