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

namespace Google\Cloud\Dialogflow\Cx\V3;

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

/**
 * Response of [MatchIntent][].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.MatchIntentResponse</code>
 */
class MatchIntentResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Match results, if more than one, ordered descendingly by the confidence
     * we have that the particular intent matches the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Match matches = 4;</code>
     */
    private $matches;
    /**
     * The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all
     * fields are filled in this message, including but not limited to `name` and
     * `display_name`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Page current_page = 5;</code>
     */
    protected $current_page = null;
    protected $query;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was
     *           provided as input, this field will contain a copy of the text.
     *     @type string $trigger_intent
     *           If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as
     *           input, this field will contain a copy of the intent identifier. Format:
     *           `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
     *     @type string $transcript
     *           If [natural language speech
     *           audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input,
     *           this field will contain the transcript for the audio.
     *     @type string $trigger_event
     *           If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as
     *           input, this field will contain a copy of the event name.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\PBMatch[] $matches
     *           Match results, if more than one, ordered descendingly by the confidence
     *           we have that the particular intent matches the query.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\Page $current_page
     *           The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all
     *           fields are filled in this message, including but not limited to `name` and
     *           `display_name`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Session::initOnce();
        parent::__construct($data);
    }

    /**
     * If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was
     * provided as input, this field will contain a copy of the text.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @return string
     */
    public function getText()
    {
        return $this->readOneof(1);
    }

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

    /**
     * If [natural language text][google.cloud.dialogflow.cx.v3.TextInput] was
     * provided as input, this field will contain a copy of the text.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as
     * input, this field will contain a copy of the intent identifier. Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
     *
     * Generated from protobuf field <code>string trigger_intent = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getTriggerIntent()
    {
        return $this->readOneof(2);
    }

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

    /**
     * If an [intent][google.cloud.dialogflow.cx.v3.IntentInput] was provided as
     * input, this field will contain a copy of the intent identifier. Format:
     * `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
     *
     * Generated from protobuf field <code>string trigger_intent = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setTriggerIntent($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * If [natural language speech
     * audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input,
     * this field will contain the transcript for the audio.
     *
     * Generated from protobuf field <code>string transcript = 3;</code>
     * @return string
     */
    public function getTranscript()
    {
        return $this->readOneof(3);
    }

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

    /**
     * If [natural language speech
     * audio][google.cloud.dialogflow.cx.v3.AudioInput] was provided as input,
     * this field will contain the transcript for the audio.
     *
     * Generated from protobuf field <code>string transcript = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setTranscript($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as
     * input, this field will contain a copy of the event name.
     *
     * Generated from protobuf field <code>string trigger_event = 6;</code>
     * @return string
     */
    public function getTriggerEvent()
    {
        return $this->readOneof(6);
    }

    public function hasTriggerEvent()
    {
        return $this->hasOneof(6);
    }

    /**
     * If an [event][google.cloud.dialogflow.cx.v3.EventInput] was provided as
     * input, this field will contain a copy of the event name.
     *
     * Generated from protobuf field <code>string trigger_event = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setTriggerEvent($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Match results, if more than one, ordered descendingly by the confidence
     * we have that the particular intent matches the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Match matches = 4;</code>
     * @return RepeatedField<\Google\Cloud\Dialogflow\Cx\V3\PBMatch>
     */
    public function getMatches()
    {
        return $this->matches;
    }

    /**
     * Match results, if more than one, ordered descendingly by the confidence
     * we have that the particular intent matches the query.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.cx.v3.Match matches = 4;</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\PBMatch[] $var
     * @return $this
     */
    public function setMatches($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\Cx\V3\PBMatch::class);
        $this->matches = $arr;

        return $this;
    }

    /**
     * The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all
     * fields are filled in this message, including but not limited to `name` and
     * `display_name`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Page current_page = 5;</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\Page|null
     */
    public function getCurrentPage()
    {
        return $this->current_page;
    }

    public function hasCurrentPage()
    {
        return isset($this->current_page);
    }

    public function clearCurrentPage()
    {
        unset($this->current_page);
    }

    /**
     * The current [Page][google.cloud.dialogflow.cx.v3.Page]. Some, not all
     * fields are filled in this message, including but not limited to `name` and
     * `display_name`.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Page current_page = 5;</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\Page $var
     * @return $this
     */
    public function setCurrentPage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\Page::class);
        $this->current_page = $var;

        return $this;
    }

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

}

