Using the @google-cloud/recaptcha-enterprise library I try to include reasons in a request to annotate an assessment as follows:
const {RecaptchaEnterpriseServiceClient} = require("@google-cloud/recaptcha-enterprise");
const client = new RecaptchaEnterpriseServiceClient({
credentials: JSON_FILE
});
const response = client.annotateAssessment({
name:projects/111111111111/assessments/11111111111111111,
annotation: "LEGITIMATE",
reasons:["REASON_UNSPECIFIED"]
});
I get a response with the following error:
Error: 3 INVALID_ARGUMENT: Invalid reason.
The reasons listed are supposed to be an enum. But I'm not sure how to implement that. I've tried replacing the reasons with numbers and this still doesn't work. I know the reasons available can be found here:
I've also examined this:
Thanks for your help.