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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * Represents a Dialogflow assist answer.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.DialogflowAssistAnswer</code>
 */
class DialogflowAssistAnswer extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of answer record, in the format of
     * "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
     * ID>"
     *
     * Generated from protobuf field <code>string answer_record = 2;</code>
     */
    protected $answer_record = '';
    protected $result;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result
     *           Result from v2 agent.
     *     @type \Google\Cloud\Dialogflow\V2\IntentSuggestion $intent_suggestion
     *           An intent suggestion generated from conversation.
     *     @type string $answer_record
     *           The name of answer record, in the format of
     *           "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
     *           ID>"
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce();
        parent::__construct($data);
    }

    /**
     * Result from v2 agent.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.QueryResult query_result = 1;</code>
     * @return \Google\Cloud\Dialogflow\V2\QueryResult|null
     */
    public function getQueryResult()
    {
        return $this->readOneof(1);
    }

    public function hasQueryResult()
    {
        return $this->hasOneof(1);
    }

    /**
     * Result from v2 agent.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.QueryResult query_result = 1;</code>
     * @param \Google\Cloud\Dialogflow\V2\QueryResult $var
     * @return $this
     */
    public function setQueryResult($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * An intent suggestion generated from conversation.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5;</code>
     * @return \Google\Cloud\Dialogflow\V2\IntentSuggestion|null
     */
    public function getIntentSuggestion()
    {
        return $this->readOneof(5);
    }

    public function hasIntentSuggestion()
    {
        return $this->hasOneof(5);
    }

    /**
     * An intent suggestion generated from conversation.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5;</code>
     * @param \Google\Cloud\Dialogflow\V2\IntentSuggestion $var
     * @return $this
     */
    public function setIntentSuggestion($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentSuggestion::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * The name of answer record, in the format of
     * "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
     * ID>"
     *
     * Generated from protobuf field <code>string answer_record = 2;</code>
     * @return string
     */
    public function getAnswerRecord()
    {
        return $this->answer_record;
    }

    /**
     * The name of answer record, in the format of
     * "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
     * ID>"
     *
     * Generated from protobuf field <code>string answer_record = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAnswerRecord($var)
    {
        GPBUtil::checkString($var, True);
        $this->answer_record = $var;

        return $this;
    }

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

}

