<?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;

/**
 * A recaptcha assessment resource.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.Assessment</code>
 */
class Assessment extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name for the Assessment in the format
     * "projects/{project}/assessments/{assessment}".
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * The event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.Event event = 2;</code>
     */
    private $event = null;
    /**
     * Output only. The risk analysis result for the event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $risk_analysis = null;
    /**
     * Output only. Properties of the provided event token.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $token_properties = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The resource name for the Assessment in the format
     *           "projects/{project}/assessments/{assessment}".
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\Event $event
     *           The event being assessed.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $risk_analysis
     *           Output only. The risk analysis result for the event being assessed.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $token_properties
     *           Output only. Properties of the provided event token.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name for the Assessment in the format
     * "projects/{project}/assessments/{assessment}".
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The resource name for the Assessment in the format
     * "projects/{project}/assessments/{assessment}".
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.Event event = 2;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\Event|null
     */
    public function getEvent()
    {
        return isset($this->event) ? $this->event : null;
    }

    public function hasEvent()
    {
        return isset($this->event);
    }

    public function clearEvent()
    {
        unset($this->event);
    }

    /**
     * The event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.Event event = 2;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\Event $var
     * @return $this
     */
    public function setEvent($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\Event::class);
        $this->event = $var;

        return $this;
    }

    /**
     * Output only. The risk analysis result for the event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis|null
     */
    public function getRiskAnalysis()
    {
        return isset($this->risk_analysis) ? $this->risk_analysis : null;
    }

    public function hasRiskAnalysis()
    {
        return isset($this->risk_analysis);
    }

    public function clearRiskAnalysis()
    {
        unset($this->risk_analysis);
    }

    /**
     * Output only. The risk analysis result for the event being assessed.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.RiskAnalysis risk_analysis = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis $var
     * @return $this
     */
    public function setRiskAnalysis($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis::class);
        $this->risk_analysis = $var;

        return $this;
    }

    /**
     * Output only. Properties of the provided event token.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties|null
     */
    public function getTokenProperties()
    {
        return isset($this->token_properties) ? $this->token_properties : null;
    }

    public function hasTokenProperties()
    {
        return isset($this->token_properties);
    }

    public function clearTokenProperties()
    {
        unset($this->token_properties);
    }

    /**
     * Output only. Properties of the provided event token.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TokenProperties token_properties = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties $var
     * @return $this
     */
    public function setTokenProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TokenProperties::class);
        $this->token_properties = $var;

        return $this;
    }

}

