From 9cfcf1fead76fdaa16f22737f33859c52945481e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:31:35 -0800 Subject: [PATCH] feat: [recaptchaenterprise] A new enum `Challenge` is added (#5807) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: A new enum `Challenge` is added feat: A new field `challenge` is added to message `.google.cloud.recaptchaenterprise.v1.RiskAnalysis` PiperOrigin-RevId: 695828238 Source-Link: https://github.com/googleapis/googleapis/commit/2aabebcebc6be98ea7d0303d76fb7d47a80987d7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9ebf4d505635311dfa5678b35d01e7ff385ece37 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYWVudGVycHJpc2UvLk93bEJvdC55YW1sIiwiaCI6IjllYmY0ZDUwNTYzNTMxMWRmYTU2NzhiMzVkMDFlN2ZmMzg1ZWNlMzcifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../v1/recaptchaenterprise.proto | 19 +++++ .../protos/protos.d.ts | 14 ++++ .../protos/protos.js | 73 ++++++++++++++++++- .../protos/protos.json | 15 ++++ 4 files changed, 120 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 1dfcca4134b..aa9441ae1fc 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -996,6 +996,22 @@ message RiskAnalysis { SUSPECTED_CHARGEBACK = 7; } + // Challenge information for SCORE_AND_CHALLENGE keys + enum Challenge { + // Default unspecified type. + CHALLENGE_UNSPECIFIED = 0; + + // No challenge was presented for solving. + NOCAPTCHA = 1; + + // A solution was submitted that was correct. + PASSED = 2; + + // A solution was submitted that was incorrect or otherwise + // deemed suspicious. + FAILED = 3; + } + // Output only. Legitimate event score from 0.0 to 1.0. // (1.0 means very likely legitimate traffic while 0.0 means very likely // non-legitimate traffic). @@ -1009,6 +1025,9 @@ message RiskAnalysis { // The set of possible reasons is subject to change. repeated string extended_verdict_reasons = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Challenge information for SCORE_AND_CHALLENGE keys + Challenge challenge = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Properties of the provided event token. diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 41daee7dd52..88972ca4c46 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -2615,6 +2615,9 @@ export namespace google { /** RiskAnalysis extendedVerdictReasons */ extendedVerdictReasons?: (string[]|null); + + /** RiskAnalysis challenge */ + challenge?: (google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge|keyof typeof google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge|null); } /** Represents a RiskAnalysis. */ @@ -2635,6 +2638,9 @@ export namespace google { /** RiskAnalysis extendedVerdictReasons. */ public extendedVerdictReasons: string[]; + /** RiskAnalysis challenge. */ + public challenge: (google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge|keyof typeof google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge); + /** * Creates a new RiskAnalysis instance using the specified properties. * @param [properties] Properties to set @@ -2726,6 +2732,14 @@ export namespace google { SUSPECTED_CARDING = 6, SUSPECTED_CHARGEBACK = 7 } + + /** Challenge enum. */ + enum Challenge { + CHALLENGE_UNSPECIFIED = 0, + NOCAPTCHA = 1, + PASSED = 2, + FAILED = 3 + } } /** Properties of a TokenProperties. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 18b5fa735fc..2284e009b65 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -6678,6 +6678,7 @@ * @property {number|null} [score] RiskAnalysis score * @property {Array.|null} [reasons] RiskAnalysis reasons * @property {Array.|null} [extendedVerdictReasons] RiskAnalysis extendedVerdictReasons + * @property {google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge|null} [challenge] RiskAnalysis challenge */ /** @@ -6721,6 +6722,14 @@ */ RiskAnalysis.prototype.extendedVerdictReasons = $util.emptyArray; + /** + * RiskAnalysis challenge. + * @member {google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge} challenge + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @instance + */ + RiskAnalysis.prototype.challenge = 0; + /** * Creates a new RiskAnalysis instance using the specified properties. * @function create @@ -6756,6 +6765,8 @@ if (message.extendedVerdictReasons != null && message.extendedVerdictReasons.length) for (var i = 0; i < message.extendedVerdictReasons.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.extendedVerdictReasons[i]); + if (message.challenge != null && Object.hasOwnProperty.call(message, "challenge")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.challenge); return writer; }; @@ -6811,6 +6822,10 @@ message.extendedVerdictReasons.push(reader.string()); break; } + case 4: { + message.challenge = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -6874,6 +6889,16 @@ if (!$util.isString(message.extendedVerdictReasons[i])) return "extendedVerdictReasons: string[] expected"; } + if (message.challenge != null && message.hasOwnProperty("challenge")) + switch (message.challenge) { + default: + return "challenge: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; @@ -6943,6 +6968,30 @@ for (var i = 0; i < object.extendedVerdictReasons.length; ++i) message.extendedVerdictReasons[i] = String(object.extendedVerdictReasons[i]); } + switch (object.challenge) { + default: + if (typeof object.challenge === "number") { + message.challenge = object.challenge; + break; + } + break; + case "CHALLENGE_UNSPECIFIED": + case 0: + message.challenge = 0; + break; + case "NOCAPTCHA": + case 1: + message.challenge = 1; + break; + case "PASSED": + case 2: + message.challenge = 2; + break; + case "FAILED": + case 3: + message.challenge = 3; + break; + } return message; }; @@ -6963,8 +7012,10 @@ object.reasons = []; object.extendedVerdictReasons = []; } - if (options.defaults) + if (options.defaults) { object.score = 0; + object.challenge = options.enums === String ? "CHALLENGE_UNSPECIFIED" : 0; + } if (message.score != null && message.hasOwnProperty("score")) object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; if (message.reasons && message.reasons.length) { @@ -6977,6 +7028,8 @@ for (var j = 0; j < message.extendedVerdictReasons.length; ++j) object.extendedVerdictReasons[j] = message.extendedVerdictReasons[j]; } + if (message.challenge != null && message.hasOwnProperty("challenge")) + object.challenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge[message.challenge] === undefined ? message.challenge : $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge[message.challenge] : message.challenge; return object; }; @@ -7032,6 +7085,24 @@ return values; })(); + /** + * Challenge enum. + * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge + * @enum {number} + * @property {number} CHALLENGE_UNSPECIFIED=0 CHALLENGE_UNSPECIFIED value + * @property {number} NOCAPTCHA=1 NOCAPTCHA value + * @property {number} PASSED=2 PASSED value + * @property {number} FAILED=3 FAILED value + */ + RiskAnalysis.Challenge = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHALLENGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOCAPTCHA"] = 1; + values[valuesById[2] = "PASSED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + return RiskAnalysis; })(); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index caef139ccf5..84bb1db2062 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1286,6 +1286,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "challenge": { + "type": "Challenge", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1300,6 +1307,14 @@ "SUSPECTED_CARDING": 6, "SUSPECTED_CHARGEBACK": 7 } + }, + "Challenge": { + "values": { + "CHALLENGE_UNSPECIFIED": 0, + "NOCAPTCHA": 1, + "PASSED": 2, + "FAILED": 3 + } } } },