diff --git a/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php b/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php index 8d57cc36a40b..969a45bf2739 100644 Binary files a/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php and b/RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php differ diff --git a/RecaptchaEnterprise/src/V1/Event.php b/RecaptchaEnterprise/src/V1/Event.php index dd520e9e0e4a..95c5df6a7b2c 100644 --- a/RecaptchaEnterprise/src/V1/Event.php +++ b/RecaptchaEnterprise/src/V1/Event.php @@ -119,6 +119,12 @@ class Event extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.UserInfo user_info = 15 [(.google.api.field_behavior) = OPTIONAL]; */ private $user_info = null; + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $fraud_prevention = 0; /** * Constructor. @@ -173,6 +179,8 @@ class Event extends \Google\Protobuf\Internal\Message * can be identified. They are often identified through the use of an account * for logged-in requests or login/registration requests, or by providing user * identifiers for guest actions like checkout. + * @type int $fraud_prevention + * Optional. The Fraud Prevention setting for this assessment. * } */ public function __construct($data = NULL) { @@ -606,5 +614,31 @@ public function setUserInfo($var) return $this; } + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFraudPrevention() + { + return $this->fraud_prevention; + } + + /** + * Optional. The Fraud Prevention setting for this assessment. + * + * Generated from protobuf field .google.cloud.recaptchaenterprise.v1.Event.FraudPrevention fraud_prevention = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFraudPrevention($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecaptchaEnterprise\V1\Event\FraudPrevention::class); + $this->fraud_prevention = $var; + + return $this; + } + } diff --git a/RecaptchaEnterprise/src/V1/Event/FraudPrevention.php b/RecaptchaEnterprise/src/V1/Event/FraudPrevention.php new file mode 100644 index 000000000000..5650681f23e6 --- /dev/null +++ b/RecaptchaEnterprise/src/V1/Event/FraudPrevention.php @@ -0,0 +1,70 @@ +google.cloud.recaptchaenterprise.v1.Event.FraudPrevention + */ +class FraudPrevention +{ + /** + * Default, unspecified setting. If opted in for automatic detection, + * `fraud_prevention_assessment` is returned based on the request. + * Otherwise, `fraud_prevention_assessment` is returned if + * `transaction_data` is present in the `Event` and Fraud Prevention is + * enabled in the Google Cloud console. + * + * Generated from protobuf enum FRAUD_PREVENTION_UNSPECIFIED = 0; + */ + const FRAUD_PREVENTION_UNSPECIFIED = 0; + /** + * Enable Fraud Prevention for this assessment, if Fraud Prevention is + * enabled in the Google Cloud console. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * Disable Fraud Prevention for this assessment, regardless of opt-in + * status or Google Cloud console settings. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::FRAUD_PREVENTION_UNSPECIFIED => 'FRAUD_PREVENTION_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + ]; + + 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(FraudPrevention::class, \Google\Cloud\RecaptchaEnterprise\V1\Event_FraudPrevention::class); +