samples: update sample to use protos, until typing can be fixed#311
samples: update sample to use protos, until typing can be fixed#311bcoe merged 5 commits intogoogleapis:mainfrom
Conversation
|
Warning: This pull request is touching the following templated files:
|
|
This is a bug in our generated types. We want to be able to accept the stringified versions of the enums which are more friendly. Filed googleapis/google-cloud-node#7769 on our types generator |
|
Thanks @chingor13. In the meantime, I think it makes sense to update the sample. @juffalow, the README is generated from the quickstart. Could you make these changes to samples/quickstart, and the changes will propagate to the README? Thanks. |
|
Thank @sofisl! I updated the code in |
|
Sorry, one more request, would you mind adding a TODO comment on the sample like so (above the START tag): |
|
Hi @sofisl! I added there the comment. Hope this is the place you mentioned. |
|
@juffalow thank you for the contribution 👏 |
Function
searchUristakes an object withurifield which is a string and athreatTypesfield which is array of numbers, not strings.If strings are used, it will show error:
Because
searchUrisfirst parameters is of typeprotos.google.cloud.webrisk.v1.ISearchUrisRequest:And
google.cloud.webrisk.v1.ThreatTypeis:Even in web_risk_service_client.ts it is declared as: