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

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

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

/**
 * Answer part with citation.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.DataStoreConnectionSignals.AnswerPart</code>
 */
class AnswerPart extends \Google\Protobuf\Internal\Message
{
    /**
     * Substring of the answer.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     */
    protected $text = '';
    /**
     * Citations for this answer part. Indices of `search_snippets`.
     *
     * Generated from protobuf field <code>repeated int32 supporting_indices = 2;</code>
     */
    private $supporting_indices;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Substring of the answer.
     *     @type int[] $supporting_indices
     *           Citations for this answer part. Indices of `search_snippets`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\DataStoreConnection::initOnce();
        parent::__construct($data);
    }

    /**
     * Substring of the answer.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Substring of the answer.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Citations for this answer part. Indices of `search_snippets`.
     *
     * Generated from protobuf field <code>repeated int32 supporting_indices = 2;</code>
     * @return RepeatedField<int>
     */
    public function getSupportingIndices()
    {
        return $this->supporting_indices;
    }

    /**
     * Citations for this answer part. Indices of `search_snippets`.
     *
     * Generated from protobuf field <code>repeated int32 supporting_indices = 2;</code>
     * @param int[] $var
     * @return $this
     */
    public function setSupportingIndices($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->supporting_indices = $arr;

        return $this;
    }

}

