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

namespace Google\Cloud\Vision\V1;

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

/**
 * TextAnnotation contains a structured representation of OCR extracted text.
 * The hierarchy of an OCR extracted text structure is like this:
 *     TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
 * Each structural component, starting from Page, may further have their own
 * properties. Properties describe detected languages, breaks etc.. Please refer
 * to the [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] message definition below for more
 * detail.
 *
 * Generated from protobuf message <code>google.cloud.vision.v1.TextAnnotation</code>
 */
class TextAnnotation extends \Google\Protobuf\Internal\Message
{
    /**
     * List of pages detected by OCR.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Page pages = 1;</code>
     */
    private $pages;
    /**
     * UTF-8 text detected on the pages.
     *
     * Generated from protobuf field <code>string text = 2;</code>
     */
    private $text = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Vision\V1\Page>|\Google\Protobuf\Internal\RepeatedField $pages
     *           List of pages detected by OCR.
     *     @type string $text
     *           UTF-8 text detected on the pages.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vision\V1\TextAnnotation::initOnce();
        parent::__construct($data);
    }

    /**
     * List of pages detected by OCR.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Page pages = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPages()
    {
        return $this->pages;
    }

    /**
     * List of pages detected by OCR.
     *
     * Generated from protobuf field <code>repeated .google.cloud.vision.v1.Page pages = 1;</code>
     * @param array<\Google\Cloud\Vision\V1\Page>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Page::class);
        $this->pages = $arr;

        return $this;
    }

    /**
     * UTF-8 text detected on the pages.
     *
     * Generated from protobuf field <code>string text = 2;</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * UTF-8 text detected on the pages.
     *
     * Generated from protobuf field <code>string text = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

}

