diff --git a/Spanner/metadata/V1/CommitResponse.php b/Spanner/metadata/V1/CommitResponse.php index 46823eb678dc..b5451ada8ff4 100644 Binary files a/Spanner/metadata/V1/CommitResponse.php and b/Spanner/metadata/V1/CommitResponse.php differ diff --git a/Spanner/metadata/V1/ResultSet.php b/Spanner/metadata/V1/ResultSet.php index 2f63b0c51704..f702c5d7c9b9 100644 Binary files a/Spanner/metadata/V1/ResultSet.php and b/Spanner/metadata/V1/ResultSet.php differ diff --git a/Spanner/metadata/V1/Spanner.php b/Spanner/metadata/V1/Spanner.php index fc4f6b042fe2..77fd087bda7a 100644 Binary files a/Spanner/metadata/V1/Spanner.php and b/Spanner/metadata/V1/Spanner.php differ diff --git a/Spanner/metadata/V1/Transaction.php b/Spanner/metadata/V1/Transaction.php index be467b14b3f6..d7fd2b4b2856 100644 Binary files a/Spanner/metadata/V1/Transaction.php and b/Spanner/metadata/V1/Transaction.php differ diff --git a/Spanner/src/V1/BeginTransactionRequest.php b/Spanner/src/V1/BeginTransactionRequest.php index 6a29f61758dd..8e65dbc9c804 100644 --- a/Spanner/src/V1/BeginTransactionRequest.php +++ b/Spanner/src/V1/BeginTransactionRequest.php @@ -38,6 +38,17 @@ class BeginTransactionRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.RequestOptions request_options = 3; */ private $request_options = null; + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $mutation_key = null; /** * @param string $session Required. The session in which the transaction runs. Please see @@ -71,6 +82,13 @@ public static function build(string $session, \Google\Cloud\Spanner\V1\Transacti * request_options struct will not do anything. To set the priority for a * transaction, set it on the reads and writes that are part of this * transaction instead. + * @type \Google\Cloud\Spanner\V1\Mutation $mutation_key + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -184,5 +202,51 @@ public function setRequestOptions($var) return $this; } + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\Mutation|null + */ + public function getMutationKey() + { + return $this->mutation_key; + } + + public function hasMutationKey() + { + return isset($this->mutation_key); + } + + public function clearMutationKey() + { + unset($this->mutation_key); + } + + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\Mutation $var + * @return $this + */ + public function setMutationKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\Mutation::class); + $this->mutation_key = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/CommitRequest.php b/Spanner/src/V1/CommitRequest.php index b1e61d74be46..7c3e8d1a8e5e 100644 --- a/Spanner/src/V1/CommitRequest.php +++ b/Spanner/src/V1/CommitRequest.php @@ -53,6 +53,17 @@ class CommitRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.RequestOptions request_options = 6; */ private $request_options = null; + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; protected $transaction; /** @@ -139,6 +150,13 @@ public static function buildFromSessionSingleUseTransactionMutations(string $ses * and 500 ms. * @type \Google\Cloud\Spanner\V1\RequestOptions $request_options * Common options for this request. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -390,6 +408,52 @@ public function setRequestOptions($var) return $this; } + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + /** * @return string */ diff --git a/Spanner/src/V1/CommitResponse.php b/Spanner/src/V1/CommitResponse.php index fd2bb2d3d365..a6d684a73fbe 100644 --- a/Spanner/src/V1/CommitResponse.php +++ b/Spanner/src/V1/CommitResponse.php @@ -29,6 +29,7 @@ class CommitResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.CommitResponse.CommitStats commit_stats = 2; */ private $commit_stats = null; + protected $MultiplexedSessionRetry; /** * Constructor. @@ -42,6 +43,9 @@ class CommitResponse extends \Google\Protobuf\Internal\Message * The statistics about this Commit. Not returned by default. * For more information, see * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. * } */ public function __construct($data = NULL) { @@ -125,5 +129,46 @@ public function setCommitStats($var) return $this; } + /** + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 4; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->readOneof(4); + } + + public function hasPrecommitToken() + { + return $this->hasOneof(4); + } + + /** + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 4; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMultiplexedSessionRetry() + { + return $this->whichOneof("MultiplexedSessionRetry"); + } + } diff --git a/Spanner/src/V1/ExecuteBatchDmlResponse.php b/Spanner/src/V1/ExecuteBatchDmlResponse.php index d6ca0ae8042f..e1564ca76883 100644 --- a/Spanner/src/V1/ExecuteBatchDmlResponse.php +++ b/Spanner/src/V1/ExecuteBatchDmlResponse.php @@ -59,6 +59,18 @@ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.rpc.Status status = 2; */ private $status = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -78,6 +90,14 @@ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message * @type \Google\Rpc\Status $status * If all DML statements are executed successfully, the status is `OK`. * Otherwise, the error status of the first failed statement. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -163,5 +183,53 @@ public function setStatus($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/Gapic/SpannerGapicClient.php b/Spanner/src/V1/Gapic/SpannerGapicClient.php index 7b28cd26a3f0..fc2159eb9d3e 100644 --- a/Spanner/src/V1/Gapic/SpannerGapicClient.php +++ b/Spanner/src/V1/Gapic/SpannerGapicClient.php @@ -55,6 +55,7 @@ use Google\Cloud\Spanner\V1\KeySet; use Google\Cloud\Spanner\V1\ListSessionsRequest; use Google\Cloud\Spanner\V1\ListSessionsResponse; +use Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken; use Google\Cloud\Spanner\V1\Mutation; use Google\Cloud\Spanner\V1\PartialResultSet; use Google\Cloud\Spanner\V1\PartitionOptions; @@ -534,6 +535,13 @@ public function batchWrite( * request_options struct will not do anything. To set the priority for a * transaction, set it on the reads and writes that are part of this * transaction instead. + * @type Mutation $mutationKey + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -558,6 +566,10 @@ public function beginTransaction( $request->setRequestOptions($optionalArgs['requestOptions']); } + if (isset($optionalArgs['mutationKey'])) { + $request->setMutationKey($optionalArgs['mutationKey']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -631,6 +643,13 @@ public function beginTransaction( * and 500 ms. * @type RequestOptions $requestOptions * Common options for this request. + * @type MultiplexedSessionPrecommitToken $precommitToken + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -670,6 +689,10 @@ public function commit($session, $mutations, array $optionalArgs = []) $request->setRequestOptions($optionalArgs['requestOptions']); } + if (isset($optionalArgs['precommitToken'])) { + $request->setPrecommitToken($optionalArgs['precommitToken']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/Spanner/src/V1/MultiplexedSessionPrecommitToken.php b/Spanner/src/V1/MultiplexedSessionPrecommitToken.php new file mode 100644 index 000000000000..120fb93f232b --- /dev/null +++ b/Spanner/src/V1/MultiplexedSessionPrecommitToken.php @@ -0,0 +1,112 @@ +google.spanner.v1.MultiplexedSessionPrecommitToken + */ +class MultiplexedSessionPrecommitToken extends \Google\Protobuf\Internal\Message +{ + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + */ + private $precommit_token = ''; + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + */ + private $seq_num = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $precommit_token + * Opaque precommit token. + * @type int $seq_num + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\V1\Transaction::initOnce(); + parent::__construct($data); + } + + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + * @return string + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + * @param string $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkString($var, False); + $this->precommit_token = $var; + + return $this; + } + + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + * @return int + */ + public function getSeqNum() + { + return $this->seq_num; + } + + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + * @param int $var + * @return $this + */ + public function setSeqNum($var) + { + GPBUtil::checkInt32($var); + $this->seq_num = $var; + + return $this; + } + +} + diff --git a/Spanner/src/V1/PartialResultSet.php b/Spanner/src/V1/PartialResultSet.php index e85ac14eb057..f82b53a2f1a8 100644 --- a/Spanner/src/V1/PartialResultSet.php +++ b/Spanner/src/V1/PartialResultSet.php @@ -117,6 +117,18 @@ class PartialResultSet extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.ResultSetStats stats = 5; */ private $stats = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -204,6 +216,14 @@ class PartialResultSet extends \Google\Protobuf\Internal\Message * only once with the last response in the stream. * This field will also be present in the last response for DML * statements. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -501,5 +521,53 @@ public function setStats($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/ResultSet.php b/Spanner/src/V1/ResultSet.php index dd8bce450a52..995b37ac22ea 100644 --- a/Spanner/src/V1/ResultSet.php +++ b/Spanner/src/V1/ResultSet.php @@ -46,6 +46,18 @@ class ResultSet extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.ResultSetStats stats = 3; */ private $stats = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -71,6 +83,14 @@ class ResultSet extends \Google\Protobuf\Internal\Message * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -200,5 +220,53 @@ public function setStats($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/Transaction.php b/Spanner/src/V1/Transaction.php index 7907d4aa6d78..52a69eaaf99e 100644 --- a/Spanner/src/V1/Transaction.php +++ b/Spanner/src/V1/Transaction.php @@ -37,6 +37,20 @@ class Transaction extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp read_timestamp = 2; */ private $read_timestamp = null; + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + */ + private $precommit_token = null; /** * Constructor. @@ -58,6 +72,16 @@ class Transaction extends \Google\Protobuf\Internal\Message * [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. * A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. * Example: `"2014-10-02T15:01:23.045123456Z"`. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -147,5 +171,57 @@ public function setReadTimestamp($var) return $this; } + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/TransactionOptions/ReadWrite.php b/Spanner/src/V1/TransactionOptions/ReadWrite.php index debc2477f577..cec00ef88464 100644 --- a/Spanner/src/V1/TransactionOptions/ReadWrite.php +++ b/Spanner/src/V1/TransactionOptions/ReadWrite.php @@ -22,6 +22,16 @@ class ReadWrite extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 1; */ private $read_lock_mode = 0; + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $multiplexed_session_previous_transaction_id = ''; /** * Constructor. @@ -31,6 +41,12 @@ class ReadWrite extends \Google\Protobuf\Internal\Message * * @type int $read_lock_mode * Read lock mode for the transaction. + * @type string $multiplexed_session_previous_transaction_id + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -64,6 +80,40 @@ public function setReadLockMode($var) return $this; } + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMultiplexedSessionPreviousTransactionId() + { + return $this->multiplexed_session_previous_transaction_id; + } + + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMultiplexedSessionPreviousTransactionId($var) + { + GPBUtil::checkString($var, False); + $this->multiplexed_session_previous_transaction_id = $var; + + return $this; + } + } // Adding a class alias for backwards compatibility with the previous class name.