in dlp_templates/create_template.py [0:0]
def create_deidentify_template (dlp_client, project_id, deidentify_name, deidentify_config_temp, deidentify_description):
try:
parent = f"projects/{project_id}"
deidentify_template = types.DeidentifyTemplate(
deidentify_config = deidentify_config_temp,
display_name = f"{deidentify_name}",
description= f"{deidentify_description}"
)
response =dlp_client.create_deidentify_template(parent=parent, deidentify_template=deidentify_template)
print(response.name
)
except Exception as e:
print(f"Failed to load JSON file: {e}")
return None