<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto

namespace Google\Cloud\RecaptchaEnterprise\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Information about SMS toll fraud.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict</code>
 */
class SmsTollFraudVerdict extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Probability of an SMS event being fraudulent.
     * Values are from 0.0 (lowest) to 1.0 (highest).
     *
     * Generated from protobuf field <code>float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $risk = 0.0;
    /**
     * Output only. Reasons contributing to the SMS toll fraud verdict.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $reasons;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $risk
     *           Output only. Probability of an SMS event being fraudulent.
     *           Values are from 0.0 (lowest) to 1.0 (highest).
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $reasons
     *           Output only. Reasons contributing to the SMS toll fraud verdict.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Probability of an SMS event being fraudulent.
     * Values are from 0.0 (lowest) to 1.0 (highest).
     *
     * Generated from protobuf field <code>float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return float
     */
    public function getRisk()
    {
        return $this->risk;
    }

    /**
     * Output only. Probability of an SMS event being fraudulent.
     * Values are from 0.0 (lowest) to 1.0 (highest).
     *
     * Generated from protobuf field <code>float risk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param float $var
     * @return $this
     */
    public function setRisk($var)
    {
        GPBUtil::checkFloat($var);
        $this->risk = $var;

        return $this;
    }

    /**
     * Output only. Reasons contributing to the SMS toll fraud verdict.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getReasons()
    {
        return $this->reasons;
    }

    /**
     * Output only. Reasons contributing to the SMS toll fraud verdict.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason reasons = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setReasons($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\RecaptchaEnterprise\V1\SmsTollFraudVerdict\SmsTollFraudReason::class);
        $this->reasons = $arr;

        return $this;
    }

}

