Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Fix example code in README.md
Browse files Browse the repository at this point in the history
Function `searchUris` takes an object with `uri` field which is a string and a `threatTypes` field which is array of numbers, not strings.
  • Loading branch information
juffalow authored Mar 3, 2022
1 parent e94ff4e commit d681412
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ npm install @google-cloud/web-risk
*/
async function quickstart(uri) {
// Create the WebRisk client library.
const {WebRiskServiceClient} = require('@google-cloud/web-risk');
const {WebRiskServiceClient, protos} = require('@google-cloud/web-risk');
const client = new WebRiskServiceClient();

// Create an API request to check for malware, social engineering,
// and unwanted software.
const request = {
uri: uri,
threatTypes: ['MALWARE', 'SOCIAL_ENGINEERING', 'UNWANTED_SOFTWARE'],
threatTypes: [
protos.google.cloud.webrisk.v1.ThreatType.MALWARE,
protos.google.cloud.webrisk.v1.ThreatType.SOCIAL_ENGINEERING,
protos.google.cloud.webrisk.v1.ThreatType.UNWANTED_SOFTWARE,
],
};

// call the WebRisk searchUris API.
Expand Down

0 comments on commit d681412

Please sign in to comment.