<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/vertex_rag_data.proto

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * A RagChunk includes the content of a chunk of a RagFile, and associated
 * metadata.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.RagChunk</code>
 */
class RagChunk extends \Google\Protobuf\Internal\Message
{
    /**
     * The content of the chunk.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     */
    protected $text = '';
    /**
     * If populated, represents where the chunk starts and ends in the document.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.RagChunk.PageSpan page_span = 2;</code>
     */
    protected $page_span = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           The content of the chunk.
     *     @type \Google\Cloud\AIPlatform\V1\RagChunk\PageSpan $page_span
     *           If populated, represents where the chunk starts and ends in the document.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\VertexRagData::initOnce();
        parent::__construct($data);
    }

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

    /**
     * The content of the chunk.
     *
     * 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;
    }

    /**
     * If populated, represents where the chunk starts and ends in the document.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.RagChunk.PageSpan page_span = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\RagChunk\PageSpan|null
     */
    public function getPageSpan()
    {
        return $this->page_span;
    }

    public function hasPageSpan()
    {
        return isset($this->page_span);
    }

    public function clearPageSpan()
    {
        unset($this->page_span);
    }

    /**
     * If populated, represents where the chunk starts and ends in the document.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.RagChunk.PageSpan page_span = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\RagChunk\PageSpan $var
     * @return $this
     */
    public function setPageSpan($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagChunk\PageSpan::class);
        $this->page_span = $var;

        return $this;
    }

}

