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

namespace Google\Cloud\Firestore\V1;

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

/**
 * The response from
 * [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite].
 *
 * Generated from protobuf message <code>google.firestore.v1.BatchWriteResponse</code>
 */
class BatchWriteResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.WriteResult write_results = 1;</code>
     */
    private $write_results;
    /**
     * The status of applying the writes.
     * This i-th write status corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status status = 2;</code>
     */
    private $status;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results
     *           The result of applying the writes.
     *           This i-th write result corresponds to the i-th write in the
     *           request.
     *     @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $status
     *           The status of applying the writes.
     *           This i-th write status corresponds to the i-th write in the
     *           request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\Firestore::initOnce();
        parent::__construct($data);
    }

    /**
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.WriteResult write_results = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getWriteResults()
    {
        return $this->write_results;
    }

    /**
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.WriteResult write_results = 1;</code>
     * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setWriteResults($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class);
        $this->write_results = $arr;

        return $this;
    }

    /**
     * The status of applying the writes.
     * This i-th write status corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status status = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * The status of applying the writes.
     * This i-th write status corresponds to the i-th write in the
     * request.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status status = 2;</code>
     * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setStatus($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class);
        $this->status = $arr;

        return $this;
    }

}

