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

namespace Google\Cloud\Spanner\V1\TransactionOptions;

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

/**
 * Message type to initiate a read-write transaction. Currently this
 * transaction type has no options.
 *
 * Generated from protobuf message <code>google.spanner.v1.TransactionOptions.ReadWrite</code>
 */
class ReadWrite extends \Google\Protobuf\Internal\Message
{
    /**
     * Read lock mode for the transaction.
     *
     * Generated from protobuf field <code>.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 1;</code>
     */
    private $read_lock_mode = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $read_lock_mode
     *           Read lock mode for the transaction.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\V1\Transaction::initOnce();
        parent::__construct($data);
    }

    /**
     * Read lock mode for the transaction.
     *
     * Generated from protobuf field <code>.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 1;</code>
     * @return int
     */
    public function getReadLockMode()
    {
        return $this->read_lock_mode;
    }

    /**
     * Read lock mode for the transaction.
     *
     * Generated from protobuf field <code>.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setReadLockMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Spanner\V1\TransactionOptions\ReadWrite\ReadLockMode::class);
        $this->read_lock_mode = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ReadWrite::class, \Google\Cloud\Spanner\V1\TransactionOptions_ReadWrite::class);

