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

namespace Google\Cloud\DocumentAI\V1\Document\TextAnchor;

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

/**
 * A text segment in the
 * [Document.text][google.cloud.documentai.v1.Document.text]. The indices
 * may be out of bounds which indicate that the text extends into another
 * document shard for large sharded documents. See
 * [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.Document.TextAnchor.TextSegment</code>
 */
class TextSegment extends \Google\Protobuf\Internal\Message
{
    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * start UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 start_index = 1;</code>
     */
    private $start_index = 0;
    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * half open end UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 end_index = 2;</code>
     */
    private $end_index = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $start_index
     *           [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     *           start UTF-8 char index in the
     *           [Document.text][google.cloud.documentai.v1.Document.text].
     *     @type int|string $end_index
     *           [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     *           half open end UTF-8 char index in the
     *           [Document.text][google.cloud.documentai.v1.Document.text].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * start UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 start_index = 1;</code>
     * @return int|string
     */
    public function getStartIndex()
    {
        return $this->start_index;
    }

    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * start UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 start_index = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartIndex($var)
    {
        GPBUtil::checkInt64($var);
        $this->start_index = $var;

        return $this;
    }

    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * half open end UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 end_index = 2;</code>
     * @return int|string
     */
    public function getEndIndex()
    {
        return $this->end_index;
    }

    /**
     * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
     * half open end UTF-8 char index in the
     * [Document.text][google.cloud.documentai.v1.Document.text].
     *
     * Generated from protobuf field <code>int64 end_index = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setEndIndex($var)
    {
        GPBUtil::checkInt64($var);
        $this->end_index = $var;

        return $this;
    }

}


