| 33 | // const jobTriggerName = 'your-job-trigger-name'; |
| 34 | |
| 35 | async function updateTrigger() { |
| 36 | // Construct inspect configuration to match PERSON_NAME infotype |
| 37 | const inspectConfig = { |
| 38 | infoTypes: [{name: 'PERSON_NAME'}], |
| 39 | minLikelihood: 'LIKELY', |
| 40 | }; |
| 41 | |
| 42 | // Configure the job trigger we want to update. |
| 43 | const jobTrigger = {inspectJob: {inspectConfig}}; |
| 44 | |
| 45 | const updateMask = { |
| 46 | paths: [ |
| 47 | 'inspect_job.inspect_config.info_types', |
| 48 | 'inspect_job.inspect_config.min_likelihood', |
| 49 | ], |
| 50 | }; |
| 51 | |
| 52 | // Combine configurations into a request for the service. |
| 53 | const request = { |
| 54 | name: `projects/${projectId}/jobTriggers/${jobTriggerName}`, |
| 55 | jobTrigger, |
| 56 | updateMask, |
| 57 | }; |
| 58 | |
| 59 | // Send the request and receive response from the service |
| 60 | const [updatedJobTrigger] = await dlpClient.updateJobTrigger(request); |
| 61 | |
| 62 | // Print the results |
| 63 | console.log(`Updated Trigger: ${JSON.stringify(updatedJobTrigger)}`); |
| 64 | } |
| 65 | updateTrigger(projectId, jobTriggerName); |
| 66 | // [END dlp_update_trigger] |
| 67 | } |