<?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;
    /**
     * Assessment returned by Account Defender when a hashed_account_id is
     * provided.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6;</code>
     */
    private $account_defender_assessment = 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.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $account_defender_assessment
     *           Assessment returned by Account Defender when a hashed_account_id is
     *           provided.
     * }
     */
    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 $this->event;
    }

    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 $this->risk_analysis;
    }

    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 $this->token_properties;
    }

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

    /**
     * Assessment returned by Account Defender when a hashed_account_id is
     * provided.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment|null
     */
    public function getAccountDefenderAssessment()
    {
        return $this->account_defender_assessment;
    }

    public function hasAccountDefenderAssessment()
    {
        return isset($this->account_defender_assessment);
    }

    public function clearAccountDefenderAssessment()
    {
        unset($this->account_defender_assessment);
    }

    /**
     * Assessment returned by Account Defender when a hashed_account_id is
     * provided.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment account_defender_assessment = 6;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment $var
     * @return $this
     */
    public function setAccountDefenderAssessment($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AccountDefenderAssessment::class);
        $this->account_defender_assessment = $var;

        return $this;
    }

}

