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

namespace Google\Cloud\Dialogflow\Cx\V3\ResponseMessage;

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

/**
 * The text response message.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.ResponseMessage.Text</code>
 */
class Text extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A collection of text response variants. If multiple variants
     * are defined, only one text response variant is returned at runtime.
     *
     * Generated from protobuf field <code>repeated string text = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $text;
    /**
     * Output only. Whether the playback of this message can be interrupted by
     * the end user's speech and the client can then starts the next Dialogflow
     * request.
     *
     * Generated from protobuf field <code>bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $allow_playback_interruption = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[] $text
     *           Required. A collection of text response variants. If multiple variants
     *           are defined, only one text response variant is returned at runtime.
     *     @type bool $allow_playback_interruption
     *           Output only. Whether the playback of this message can be interrupted by
     *           the end user's speech and the client can then starts the next Dialogflow
     *           request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\ResponseMessage::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. A collection of text response variants. If multiple variants
     * are defined, only one text response variant is returned at runtime.
     *
     * Generated from protobuf field <code>repeated string text = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<string>
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Required. A collection of text response variants. If multiple variants
     * are defined, only one text response variant is returned at runtime.
     *
     * Generated from protobuf field <code>repeated string text = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string[] $var
     * @return $this
     */
    public function setText($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->text = $arr;

        return $this;
    }

    /**
     * Output only. Whether the playback of this message can be interrupted by
     * the end user's speech and the client can then starts the next Dialogflow
     * request.
     *
     * Generated from protobuf field <code>bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getAllowPlaybackInterruption()
    {
        return $this->allow_playback_interruption;
    }

    /**
     * Output only. Whether the playback of this message can be interrupted by
     * the end user's speech and the client can then starts the next Dialogflow
     * request.
     *
     * Generated from protobuf field <code>bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowPlaybackInterruption($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_playback_interruption = $var;

        return $this;
    }

}

