From 09707f55b082fc04cf0954c1dbb19c2270eb7a04 Mon Sep 17 00:00:00 2001 From: Sita Lakshmi Sangameswaran Date: Thu, 17 Feb 2022 23:55:45 +0530 Subject: [PATCH] docs(dlp-samples): modified region tags and fixed comment (#330) * docs(dlp-samples): modified region tags and fixed comment * lint fix --- .../google-cloud-dlp/samples/snippets/deid.py | 15 ++++++++------- .../samples/snippets/templates.py | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-dlp/samples/snippets/deid.py b/packages/google-cloud-dlp/samples/snippets/deid.py index fbdea49b78fc..5d79064d7af2 100644 --- a/packages/google-cloud-dlp/samples/snippets/deid.py +++ b/packages/google-cloud-dlp/samples/snippets/deid.py @@ -473,18 +473,19 @@ def reidentify_with_fpe( def reidentify_with_deterministic( project, input_str, surrogate_type=None, key_name=None, wrapped_key=None, ): - """Deidentifies sensitive data in a string using deterministic encryption. + """Re-identifies content that was previously de-identified through deterministic encryption. Args: - project: The Google Cloud project id to use as a parent resource. - input_str: The string to deidentify (will be treated as text). - surrogate_type: The name of the surrogate custom info type to used + project: The Google Cloud project ID to use as a parent resource. + input_str: The string to be re-identified. Provide the entire token. Example: + EMAIL_ADDRESS_TOKEN(52):AVAx2eIEnIQP5jbNEr2j9wLOAd5m4kpSBR/0jjjGdAOmryzZbE/q + surrogate_type: The name of the surrogate custom infoType used during the encryption process. - key_name: The name of the Cloud KMS key used to encrypt ('wrap') the + key_name: The name of the Cloud KMS key used to encrypt ("wrap") the AES-256 key. Example: keyName = 'projects/YOUR_GCLOUD_PROJECT/locations/YOUR_LOCATION/ keyRings/YOUR_KEYRING_NAME/cryptoKeys/YOUR_KEY_NAME' - wrapped_key: The encrypted ('wrapped') AES-256 key to use. This key - should be encrypted using the Cloud KMS key specified by key_name. + wrapped_key: The encrypted ("wrapped") AES-256 key previously used to encrypt the content. + This key must have been encrypted using the Cloud KMS key specified by key_name. Returns: None; the response from the API is printed to the terminal. """ diff --git a/packages/google-cloud-dlp/samples/snippets/templates.py b/packages/google-cloud-dlp/samples/snippets/templates.py index 3c00d1e1368a..009dc08f2746 100644 --- a/packages/google-cloud-dlp/samples/snippets/templates.py +++ b/packages/google-cloud-dlp/samples/snippets/templates.py @@ -20,7 +20,7 @@ import os -# [START dlp_create_template] +# [START dlp_create_inspect_template] def create_inspect_template( project, info_types, @@ -87,7 +87,7 @@ def create_inspect_template( print("Successfully created template {}".format(response.name)) -# [END dlp_create_template] +# [END dlp_create_inspect_template] # [START dlp_list_templates] @@ -134,7 +134,7 @@ def list_inspect_templates(project): # [END dlp_list_templates] -# [START dlp_delete_template] +# [START dlp_delete_inspect_template] def delete_inspect_template(project, template_id): """Deletes a Data Loss Prevention API template. Args: @@ -162,7 +162,7 @@ def delete_inspect_template(project, template_id): print("Template {} successfully deleted.".format(template_resource)) -# [END dlp_delete_template] +# [END dlp_delete_inspect_template] if __name__ == "__main__":