| 38 | }; |
| 39 | |
| 40 | async function redactText() { |
| 41 | // Construct redaction request |
| 42 | const request = { |
| 43 | parent: `projects/${projectId}/locations/global`, |
| 44 | item: { |
| 45 | value: string, |
| 46 | }, |
| 47 | deidentifyConfig: { |
| 48 | infoTypeTransformations: { |
| 49 | transformations: [replaceWithInfoTypeTransformation], |
| 50 | }, |
| 51 | }, |
| 52 | inspectConfig: { |
| 53 | minLikelihood: minLikelihood, |
| 54 | infoTypes: infoTypes, |
| 55 | }, |
| 56 | }; |
| 57 | |
| 58 | // Run string redaction |
| 59 | const [response] = await dlp.deidentifyContent(request); |
| 60 | const resultString = response.item.value; |
| 61 | console.log(`Redacted text: ${resultString}`); |
| 62 | } |
| 63 | redactText(); |
| 64 | // [END dlp_redact_text] |
| 65 | } |