我确实在https://googleapis.dev/ruby/google-cloud-recaptcha_enterprise-v1/latest/index.html上关注了他们的文档
我首先添加了环境变量RECAPTCHA_ENTERPRISE_CREDENTIALS
,然后运行
client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
文档说response = client.create_assessment request
,但文档没有添加示例请求,所以我确实假设它看起来像本文档https://cloud.google.com/recaptcha-enterprise/docs/create-assessment
{
"event": {
"token": "token",
"siteKey": "key"
}
}
但是当我执行时client.create_assessment
它给了我错误ArgumentError: Unknown field name 'event' in initialization map entry.
我还尝试遵循此https://googleapis.dev/ruby/google-cloud-recaptcha_enterprise-v1/latest/Google/Cloud/RecaptchaEnterprise/V1/RecaptchaEnterpriseService/Client.html#create_assessment-instance_method
,其中参数是请求以及给我错误ArgumentError: Unknown field name 'request' in initialization map entry.
创建评估的正确参数/请求可能是什么?
我使用的宝石是google-cloud-recaptcha_enterprise-v1
和google-cloud-recaptcha_enterprise