def delete_trigger(project, trigger_id): """Deletes a Data Loss Prevention API trigger. Args: project: The id of the Google Cloud project which owns the trigger. trigger_id: The id of the trigger to delete. Returns: None; the response from the API is printed to the terminal. """ # Import the client library import google.cloud.dlp # Instantiate a client. dlp = google.cloud.dlp.DlpServiceClient() # Convert the project id into a full resource id. parent = dlp.project_path(project) # Combine the trigger id with the parent id. trigger_resource = '{}/jobTriggers/{}'.format(parent, trigger_id) # Call the API. dlp.delete_job_trigger(trigger_resource) print('Trigger {} successfully deleted.'.format(trigger_resource))