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

namespace Google\Cloud\DocumentAI\V1\Document;

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

/**
 * Contains past or forward revisions of this document.
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.Document.Revision</code>
 */
class Revision extends \Google\Protobuf\Internal\Message
{
    /**
     * Id of the revision, internally generated by doc proto storage.
     * Unique within the context of the document.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    private $id = '';
    /**
     * The revisions that this revision is based on.  This can include one or
     * more parent (when documents are merged.)  This field represents the
     * index into the `revisions` field.
     *
     * Generated from protobuf field <code>repeated int32 parent = 2 [deprecated = true];</code>
     * @deprecated
     */
    private $parent;
    /**
     * The revisions that this revision is based on. Must include all the ids
     * that have anything to do with this revision - eg. there are
     * `provenance.parent.revision` fields that index into this field.
     *
     * Generated from protobuf field <code>repeated string parent_ids = 7;</code>
     */
    private $parent_ids;
    /**
     * The time that the revision was created, internally generated by
     * doc proto storage at the time of create.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     */
    private $create_time = null;
    /**
     * Human Review information of this revision.
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6;</code>
     */
    private $human_review = null;
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $agent
     *           If the change was made by a person specify the name or id of that
     *           person.
     *     @type string $processor
     *           If the annotation was made by processor identify the processor by its
     *           resource name.
     *     @type string $id
     *           Id of the revision, internally generated by doc proto storage.
     *           Unique within the context of the document.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $parent
     *           The revisions that this revision is based on.  This can include one or
     *           more parent (when documents are merged.)  This field represents the
     *           index into the `revisions` field.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $parent_ids
     *           The revisions that this revision is based on. Must include all the ids
     *           that have anything to do with this revision - eg. there are
     *           `provenance.parent.revision` fields that index into this field.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           The time that the revision was created, internally generated by
     *           doc proto storage at the time of create.
     *     @type \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $human_review
     *           Human Review information of this revision.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * If the change was made by a person specify the name or id of that
     * person.
     *
     * Generated from protobuf field <code>string agent = 4;</code>
     * @return string
     */
    public function getAgent()
    {
        return $this->readOneof(4);
    }

    public function hasAgent()
    {
        return $this->hasOneof(4);
    }

    /**
     * If the change was made by a person specify the name or id of that
     * person.
     *
     * Generated from protobuf field <code>string agent = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAgent($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * If the annotation was made by processor identify the processor by its
     * resource name.
     *
     * Generated from protobuf field <code>string processor = 5;</code>
     * @return string
     */
    public function getProcessor()
    {
        return $this->readOneof(5);
    }

    public function hasProcessor()
    {
        return $this->hasOneof(5);
    }

    /**
     * If the annotation was made by processor identify the processor by its
     * resource name.
     *
     * Generated from protobuf field <code>string processor = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setProcessor($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Id of the revision, internally generated by doc proto storage.
     * Unique within the context of the document.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Id of the revision, internally generated by doc proto storage.
     * Unique within the context of the document.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The revisions that this revision is based on.  This can include one or
     * more parent (when documents are merged.)  This field represents the
     * index into the `revisions` field.
     *
     * Generated from protobuf field <code>repeated int32 parent = 2 [deprecated = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     * @deprecated
     */
    public function getParent()
    {
        @trigger_error('parent is deprecated.', E_USER_DEPRECATED);
        return $this->parent;
    }

    /**
     * The revisions that this revision is based on.  This can include one or
     * more parent (when documents are merged.)  This field represents the
     * index into the `revisions` field.
     *
     * Generated from protobuf field <code>repeated int32 parent = 2 [deprecated = true];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     * @deprecated
     */
    public function setParent($var)
    {
        @trigger_error('parent is deprecated.', E_USER_DEPRECATED);
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->parent = $arr;

        return $this;
    }

    /**
     * The revisions that this revision is based on. Must include all the ids
     * that have anything to do with this revision - eg. there are
     * `provenance.parent.revision` fields that index into this field.
     *
     * Generated from protobuf field <code>repeated string parent_ids = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getParentIds()
    {
        return $this->parent_ids;
    }

    /**
     * The revisions that this revision is based on. Must include all the ids
     * that have anything to do with this revision - eg. there are
     * `provenance.parent.revision` fields that index into this field.
     *
     * Generated from protobuf field <code>repeated string parent_ids = 7;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setParentIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->parent_ids = $arr;

        return $this;
    }

    /**
     * The time that the revision was created, internally generated by
     * doc proto storage at the time of create.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * The time that the revision was created, internally generated by
     * doc proto storage at the time of create.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Human Review information of this revision.
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6;</code>
     * @return \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview|null
     */
    public function getHumanReview()
    {
        return $this->human_review;
    }

    public function hasHumanReview()
    {
        return isset($this->human_review);
    }

    public function clearHumanReview()
    {
        unset($this->human_review);
    }

    /**
     * Human Review information of this revision.
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6;</code>
     * @param \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $var
     * @return $this
     */
    public function setHumanReview($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview::class);
        $this->human_review = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSource()
    {
        return $this->whichOneof("source");
    }

}


