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

/**
 * One response of different type of suggestion response which is used in
 * the response of [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and
 * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent], as well as [HumanAgentAssistantEvent][google.cloud.dialogflow.v2.HumanAgentAssistantEvent].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.SuggestionResult</code>
 */
class SuggestionResult extends \Google\Protobuf\Internal\Message
{
    protected $suggestion_response;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Rpc\Status $error
     *           Error status if the request failed.
     *     @type \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $suggest_articles_response
     *           SuggestArticlesResponse if request is for ARTICLE_SUGGESTION.
     *     @type \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $suggest_faq_answers_response
     *           SuggestFaqAnswersResponse if request is for FAQ_ANSWER.
     *     @type \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $suggest_smart_replies_response
     *           SuggestSmartRepliesResponse if request is for SMART_REPLY.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce();
        parent::__construct($data);
    }

    /**
     * Error status if the request failed.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 1;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getError()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Error status if the request failed.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 1;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2;</code>
     * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse|null
     */
    public function getSuggestArticlesResponse()
    {
        return $this->readOneof(2);
    }

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

    /**
     * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2;</code>
     * @param \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $var
     * @return $this
     */
    public function setSuggestArticlesResponse($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * SuggestFaqAnswersResponse if request is for FAQ_ANSWER.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3;</code>
     * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse|null
     */
    public function getSuggestFaqAnswersResponse()
    {
        return $this->readOneof(3);
    }

    public function hasSuggestFaqAnswersResponse()
    {
        return $this->hasOneof(3);
    }

    /**
     * SuggestFaqAnswersResponse if request is for FAQ_ANSWER.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3;</code>
     * @param \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $var
     * @return $this
     */
    public function setSuggestFaqAnswersResponse($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * SuggestSmartRepliesResponse if request is for SMART_REPLY.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4;</code>
     * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse|null
     */
    public function getSuggestSmartRepliesResponse()
    {
        return $this->readOneof(4);
    }

    public function hasSuggestSmartRepliesResponse()
    {
        return $this->hasOneof(4);
    }

    /**
     * SuggestSmartRepliesResponse if request is for SMART_REPLY.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4;</code>
     * @param \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $var
     * @return $this
     */
    public function setSuggestSmartRepliesResponse($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

