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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents feedback the customer has about the quality & correctness of a
 * certain answer in a conversation.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.AnswerFeedback</code>
 */
class AnswerFeedback extends \Google\Protobuf\Internal\Message
{
    /**
     * The correctness level of the specific answer.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1;</code>
     */
    protected $correctness_level = 0;
    /**
     * Indicates whether the answer/item was clicked by the human agent
     * or not. Default to false.
     * For knowledge search and knowledge assist, the answer record is considered
     * to be clicked if the answer was copied or any URI was clicked.
     *
     * Generated from protobuf field <code>bool clicked = 3;</code>
     */
    protected $clicked = false;
    /**
     * Time when the answer/item was clicked.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp click_time = 5;</code>
     */
    protected $click_time = null;
    /**
     * Indicates whether the answer/item was displayed to the human
     * agent in the agent desktop UI. Default to false.
     *
     * Generated from protobuf field <code>bool displayed = 4;</code>
     */
    protected $displayed = false;
    /**
     * Time when the answer/item was displayed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp display_time = 6;</code>
     */
    protected $display_time = null;
    protected $detail_feedback;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $correctness_level
     *           The correctness level of the specific answer.
     *     @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $agent_assistant_detail_feedback
     *           Detail feedback of agent assist suggestions.
     *     @type bool $clicked
     *           Indicates whether the answer/item was clicked by the human agent
     *           or not. Default to false.
     *           For knowledge search and knowledge assist, the answer record is considered
     *           to be clicked if the answer was copied or any URI was clicked.
     *     @type \Google\Protobuf\Timestamp $click_time
     *           Time when the answer/item was clicked.
     *     @type bool $displayed
     *           Indicates whether the answer/item was displayed to the human
     *           agent in the agent desktop UI. Default to false.
     *     @type \Google\Protobuf\Timestamp $display_time
     *           Time when the answer/item was displayed.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce();
        parent::__construct($data);
    }

    /**
     * The correctness level of the specific answer.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1;</code>
     * @return int
     */
    public function getCorrectnessLevel()
    {
        return $this->correctness_level;
    }

    /**
     * The correctness level of the specific answer.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel correctness_level = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCorrectnessLevel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AnswerFeedback\CorrectnessLevel::class);
        $this->correctness_level = $var;

        return $this;
    }

    /**
     * Detail feedback of agent assist suggestions.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2;</code>
     * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback|null
     */
    public function getAgentAssistantDetailFeedback()
    {
        return $this->readOneof(2);
    }

    public function hasAgentAssistantDetailFeedback()
    {
        return $this->hasOneof(2);
    }

    /**
     * Detail feedback of agent assist suggestions.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.AgentAssistantFeedback agent_assistant_detail_feedback = 2;</code>
     * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback $var
     * @return $this
     */
    public function setAgentAssistantDetailFeedback($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Indicates whether the answer/item was clicked by the human agent
     * or not. Default to false.
     * For knowledge search and knowledge assist, the answer record is considered
     * to be clicked if the answer was copied or any URI was clicked.
     *
     * Generated from protobuf field <code>bool clicked = 3;</code>
     * @return bool
     */
    public function getClicked()
    {
        return $this->clicked;
    }

    /**
     * Indicates whether the answer/item was clicked by the human agent
     * or not. Default to false.
     * For knowledge search and knowledge assist, the answer record is considered
     * to be clicked if the answer was copied or any URI was clicked.
     *
     * Generated from protobuf field <code>bool clicked = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setClicked($var)
    {
        GPBUtil::checkBool($var);
        $this->clicked = $var;

        return $this;
    }

    /**
     * Time when the answer/item was clicked.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp click_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getClickTime()
    {
        return $this->click_time;
    }

    public function hasClickTime()
    {
        return isset($this->click_time);
    }

    public function clearClickTime()
    {
        unset($this->click_time);
    }

    /**
     * Time when the answer/item was clicked.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp click_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setClickTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->click_time = $var;

        return $this;
    }

    /**
     * Indicates whether the answer/item was displayed to the human
     * agent in the agent desktop UI. Default to false.
     *
     * Generated from protobuf field <code>bool displayed = 4;</code>
     * @return bool
     */
    public function getDisplayed()
    {
        return $this->displayed;
    }

    /**
     * Indicates whether the answer/item was displayed to the human
     * agent in the agent desktop UI. Default to false.
     *
     * Generated from protobuf field <code>bool displayed = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setDisplayed($var)
    {
        GPBUtil::checkBool($var);
        $this->displayed = $var;

        return $this;
    }

    /**
     * Time when the answer/item was displayed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp display_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getDisplayTime()
    {
        return $this->display_time;
    }

    public function hasDisplayTime()
    {
        return isset($this->display_time);
    }

    public function clearDisplayTime()
    {
        unset($this->display_time);
    }

    /**
     * Time when the answer/item was displayed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp display_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setDisplayTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->display_time = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getDetailFeedback()
    {
        return $this->whichOneof("detail_feedback");
    }

}

