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

namespace Google\Cloud\Firestore\V1;

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

/**
 * A [Document][google.firestore.v1.Document] has been deleted.
 * May be the result of multiple [writes][google.firestore.v1.Write], including updates, the
 * last of which deleted the [Document][google.firestore.v1.Document].
 * Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be returned for the same logical
 * delete, if multiple targets are affected.
 *
 * Generated from protobuf message <code>google.firestore.v1.DocumentDelete</code>
 */
class DocumentDelete extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
     *
     * Generated from protobuf field <code>string document = 1;</code>
     */
    private $document = '';
    /**
     * A set of target IDs for targets that previously matched this entity.
     *
     * Generated from protobuf field <code>repeated int32 removed_target_ids = 6;</code>
     */
    private $removed_target_ids;
    /**
     * The read timestamp at which the delete was observed.
     * Greater or equal to the `commit_time` of the delete.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp read_time = 4;</code>
     */
    private $read_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $document
     *           The resource name of the [Document][google.firestore.v1.Document] that was deleted.
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $removed_target_ids
     *           A set of target IDs for targets that previously matched this entity.
     *     @type \Google\Protobuf\Timestamp $read_time
     *           The read timestamp at which the delete was observed.
     *           Greater or equal to the `commit_time` of the delete.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\Write::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
     *
     * Generated from protobuf field <code>string document = 1;</code>
     * @return string
     */
    public function getDocument()
    {
        return $this->document;
    }

    /**
     * The resource name of the [Document][google.firestore.v1.Document] that was deleted.
     *
     * Generated from protobuf field <code>string document = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDocument($var)
    {
        GPBUtil::checkString($var, True);
        $this->document = $var;

        return $this;
    }

    /**
     * A set of target IDs for targets that previously matched this entity.
     *
     * Generated from protobuf field <code>repeated int32 removed_target_ids = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRemovedTargetIds()
    {
        return $this->removed_target_ids;
    }

    /**
     * A set of target IDs for targets that previously matched this entity.
     *
     * Generated from protobuf field <code>repeated int32 removed_target_ids = 6;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRemovedTargetIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->removed_target_ids = $arr;

        return $this;
    }

    /**
     * The read timestamp at which the delete was observed.
     * Greater or equal to the `commit_time` of the delete.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp read_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getReadTime()
    {
        return $this->read_time;
    }

    public function hasReadTime()
    {
        return isset($this->read_time);
    }

    public function clearReadTime()
    {
        unset($this->read_time);
    }

    /**
     * The read timestamp at which the delete was observed.
     * Greater or equal to the `commit_time` of the delete.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp read_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setReadTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->read_time = $var;

        return $this;
    }

}

