From 37844cbfe1f348df180f19648ee18d718e8f9f64 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 20:00:11 -0500 Subject: [PATCH] feat: A new enum `Challenge` is added (#7831) 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: eyJwIjoiUmVjYXB0Y2hhRW50ZXJwcmlzZS8uT3dsQm90LnlhbWwiLCJoIjoiOWViZjRkNTA1NjM1MzExZGZhNTY3OGIzNWQwMWU3ZmYzODVlY2UzNyJ9 --- .../metadata/V1/Recaptchaenterprise.php | Bin 24536 -> 24700 bytes RecaptchaEnterprise/src/V1/RiskAnalysis.php | 34 +++++++++ .../src/V1/RiskAnalysis/Challenge.php | 72 ++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 RecaptchaEnterprise/src/V1/RiskAnalysis/Challenge.php diff --git a/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php b/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php index c7e9e4a574c14ed42143dc54e05fb36d13918590..0577623efb24959f2671829c3bfaea1d19557ea5 100644 GIT binary patch delta 119 zcmcbypYhKD#tqCYtjl*Wa@kJww%zQ?;xEaxon`Vg*%kak!Cail8HqVLsd?$C5-gJ^ zcxq2RAi%?==L{2^Y$^9iz?X{?E+8byB|2HkR9&2li!H!0IM~%ifJq3*c60Rf0kWAl JYss&3000J=BHI7} delta 39 xcmV+?0NDThzya950k8uE1%tN%3O$iaJ+nmwPZrepeated string extended_verdict_reasons = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $extended_verdict_reasons; + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $challenge = 0; /** * Constructor. @@ -52,6 +58,8 @@ class RiskAnalysis extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $extended_verdict_reasons * Output only. Extended verdict reasons to be used for experimentation only. * The set of possible reasons is subject to change. + * @type int $challenge + * Output only. Challenge information for SCORE_AND_CHALLENGE keys * } */ public function __construct($data = NULL) { @@ -143,5 +151,31 @@ public function setExtendedVerdictReasons($var) return $this; } + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getChallenge() + { + return $this->challenge; + } + + /** + * Output only. Challenge information for SCORE_AND_CHALLENGE keys + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge challenge = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setChallenge($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis\Challenge::class); + $this->challenge = $var; + + return $this; + } + } diff --git a/RecaptchaEnterprise/src/V1/RiskAnalysis/Challenge.php b/RecaptchaEnterprise/src/V1/RiskAnalysis/Challenge.php new file mode 100644 index 000000000000..52ab37b3ff85 --- /dev/null +++ b/RecaptchaEnterprise/src/V1/RiskAnalysis/Challenge.php @@ -0,0 +1,72 @@ +google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge + */ +class Challenge +{ + /** + * Default unspecified type. + * + * Generated from protobuf enum CHALLENGE_UNSPECIFIED = 0; + */ + const CHALLENGE_UNSPECIFIED = 0; + /** + * No challenge was presented for solving. + * + * Generated from protobuf enum NOCAPTCHA = 1; + */ + const NOCAPTCHA = 1; + /** + * A solution was submitted that was correct. + * + * Generated from protobuf enum PASSED = 2; + */ + const PASSED = 2; + /** + * A solution was submitted that was incorrect or otherwise + * deemed suspicious. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::CHALLENGE_UNSPECIFIED => 'CHALLENGE_UNSPECIFIED', + self::NOCAPTCHA => 'NOCAPTCHA', + self::PASSED => 'PASSED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Challenge::class, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis_Challenge::class); +