BatchWrite requests are not replay protected, meaning that each mutation group may be + * applied more than once. Replays of non-idempotent mutations may have undesirable effects. For + * example, replays of an insert mutation may produce an already exists error or if you use + * generated or commit timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be idempotent to avoid this + * issue. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpannerClient spannerClient = SpannerClient.create()) {
+ * BatchWriteRequest request =
+ * BatchWriteRequest.newBuilder()
+ * .setSession(
+ * SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString())
+ * .setRequestOptions(RequestOptions.newBuilder().build())
+ * .addAllMutationGroups(new ArrayList())
+ * .build();
+ * ServerStream stream = spannerClient.batchWriteCallable().call(request);
+ * for (BatchWriteResponse response : stream) {
+ * // Do something when a response is received.
+ * }
+ * }
+ * }
+ */
+ public final ServerStreamingCallable+ * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + *+ */ + default void batchWrite( + com.google.spanner.v1.BatchWriteRequest request, + io.grpc.stub.StreamObserver
+ * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + *+ */ + public void batchWrite( + com.google.spanner.v1.BatchWriteRequest request, + io.grpc.stub.StreamObserver
+ * Batches the supplied mutation groups in a collection of efficient + * transactions. All mutations in a group are committed atomically. However, + * mutations across groups can be committed non-atomically in an unspecified + * order and thus, they must be independent of each other. Partial failure is + * possible, i.e., some groups may have been committed successfully, while + * some may have failed. The results of individual batches are streamed into + * the response as the batches are applied. + * BatchWrite requests are not replay protected, meaning that each mutation + * group may be applied more than once. Replays of non-idempotent mutations + * may have undesirable effects. For example, replays of an insert mutation + * may produce an already exists error or if you use generated or commit + * timestamp-based keys, it may result in additional rows being added to the + * mutation's table. We recommend structuring your mutation groups to be + * idempotent to avoid this issue. + *+ */ + public java.util.Iterator
+ * The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteRequest} + */ +public final class BatchWriteRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.BatchWriteRequest) + BatchWriteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchWriteRequest.newBuilder() to construct. + private BatchWriteRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private BatchWriteRequest() { + session_ = ""; + mutationGroups_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchWriteRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.BatchWriteRequest.class, + com.google.spanner.v1.BatchWriteRequest.Builder.class); + } + + public interface MutationGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.BatchWriteRequest.MutationGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ java.util.List+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.spanner.v1.Mutation getMutations(int index);
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ int getMutationsCount();
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ java.util.List extends com.google.spanner.v1.MutationOrBuilder> getMutationsOrBuilderList();
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.spanner.v1.MutationOrBuilder getMutationsOrBuilder(int index);
+ }
+ /**
+ *
+ *
+ * + * A group of mutations to be committed together. Related mutations should be + * placed in a group. For example, two mutations inserting rows with the same + * primary key prefix in both parent and child tables are related. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteRequest.MutationGroup} + */ + public static final class MutationGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.BatchWriteRequest.MutationGroup) + MutationGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use MutationGroup.newBuilder() to construct. + private MutationGroup(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private MutationGroup() { + mutations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MutationGroup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteRequest_MutationGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteRequest_MutationGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.BatchWriteRequest.MutationGroup.class, + com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder.class); + } + + public static final int MUTATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List
+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public java.util.List+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.spanner.v1.MutationOrBuilder>
+ getMutationsOrBuilderList() {
+ return mutations_;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public int getMutationsCount() {
+ return mutations_.size();
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.Mutation getMutations(int index) {
+ return mutations_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.MutationOrBuilder getMutationsOrBuilder(int index) {
+ return mutations_.get(index);
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ for (int i = 0; i < mutations_.size(); i++) {
+ output.writeMessage(1, mutations_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < mutations_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, mutations_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.spanner.v1.BatchWriteRequest.MutationGroup)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.v1.BatchWriteRequest.MutationGroup other =
+ (com.google.spanner.v1.BatchWriteRequest.MutationGroup) obj;
+
+ if (!getMutationsList().equals(other.getMutationsList())) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getMutationsCount() > 0) {
+ hash = (37 * hash) + MUTATIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getMutationsList().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest.MutationGroup parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.spanner.v1.BatchWriteRequest.MutationGroup prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ * + * A group of mutations to be committed together. Related mutations should be + * placed in a group. For example, two mutations inserting rows with the same + * primary key prefix in both parent and child tables are related. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteRequest.MutationGroup} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List+ * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public int getMutationsCount() {
+ if (mutationsBuilder_ == null) {
+ return mutations_.size();
+ } else {
+ return mutationsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.Mutation getMutations(int index) {
+ if (mutationsBuilder_ == null) {
+ return mutations_.get(index);
+ } else {
+ return mutationsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setMutations(int index, com.google.spanner.v1.Mutation value) {
+ if (mutationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationsIsMutable();
+ mutations_.set(index, value);
+ onChanged();
+ } else {
+ mutationsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setMutations(
+ int index, com.google.spanner.v1.Mutation.Builder builderForValue) {
+ if (mutationsBuilder_ == null) {
+ ensureMutationsIsMutable();
+ mutations_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ mutationsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutations(com.google.spanner.v1.Mutation value) {
+ if (mutationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationsIsMutable();
+ mutations_.add(value);
+ onChanged();
+ } else {
+ mutationsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutations(int index, com.google.spanner.v1.Mutation value) {
+ if (mutationsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationsIsMutable();
+ mutations_.add(index, value);
+ onChanged();
+ } else {
+ mutationsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutations(com.google.spanner.v1.Mutation.Builder builderForValue) {
+ if (mutationsBuilder_ == null) {
+ ensureMutationsIsMutable();
+ mutations_.add(builderForValue.build());
+ onChanged();
+ } else {
+ mutationsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutations(
+ int index, com.google.spanner.v1.Mutation.Builder builderForValue) {
+ if (mutationsBuilder_ == null) {
+ ensureMutationsIsMutable();
+ mutations_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ mutationsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addAllMutations(
+ java.lang.Iterable extends com.google.spanner.v1.Mutation> values) {
+ if (mutationsBuilder_ == null) {
+ ensureMutationsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutations_);
+ onChanged();
+ } else {
+ mutationsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearMutations() {
+ if (mutationsBuilder_ == null) {
+ mutations_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ mutationsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder removeMutations(int index) {
+ if (mutationsBuilder_ == null) {
+ ensureMutationsIsMutable();
+ mutations_.remove(index);
+ onChanged();
+ } else {
+ mutationsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.Mutation.Builder getMutationsBuilder(int index) {
+ return getMutationsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.MutationOrBuilder getMutationsOrBuilder(int index) {
+ if (mutationsBuilder_ == null) {
+ return mutations_.get(index);
+ } else {
+ return mutationsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List extends com.google.spanner.v1.MutationOrBuilder>
+ getMutationsOrBuilderList() {
+ if (mutationsBuilder_ != null) {
+ return mutationsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(mutations_);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.Mutation.Builder addMutationsBuilder() {
+ return getMutationsFieldBuilder()
+ .addBuilder(com.google.spanner.v1.Mutation.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.Mutation.Builder addMutationsBuilder(int index) {
+ return getMutationsFieldBuilder()
+ .addBuilder(index, com.google.spanner.v1.Mutation.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Required. The mutations in this group. + *+ * + *
+ * repeated .google.spanner.v1.Mutation mutations = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List+ * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The session.
+ */
+ @java.lang.Override
+ public java.lang.String getSession() {
+ java.lang.Object ref = session_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ session_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for session.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getSessionBytes() {
+ java.lang.Object ref = session_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ session_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int REQUEST_OPTIONS_FIELD_NUMBER = 3;
+ private com.google.spanner.v1.RequestOptions requestOptions_;
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return Whether the requestOptions field is set.
+ */
+ @java.lang.Override
+ public boolean hasRequestOptions() {
+ return requestOptions_ != null;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return The requestOptions.
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.RequestOptions getRequestOptions() {
+ return requestOptions_ == null
+ ? com.google.spanner.v1.RequestOptions.getDefaultInstance()
+ : requestOptions_;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.RequestOptionsOrBuilder getRequestOptionsOrBuilder() {
+ return requestOptions_ == null
+ ? com.google.spanner.v1.RequestOptions.getDefaultInstance()
+ : requestOptions_;
+ }
+
+ public static final int MUTATION_GROUPS_FIELD_NUMBER = 4;
+
+ @SuppressWarnings("serial")
+ private java.util.List+ * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public java.util.List+ * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder>
+ getMutationGroupsOrBuilderList() {
+ return mutationGroups_;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public int getMutationGroupsCount() {
+ return mutationGroups_.size();
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroup getMutationGroups(int index) {
+ return mutationGroups_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder getMutationGroupsOrBuilder(
+ int index) {
+ return mutationGroups_.get(index);
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(session_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_);
+ }
+ if (requestOptions_ != null) {
+ output.writeMessage(3, getRequestOptions());
+ }
+ for (int i = 0; i < mutationGroups_.size(); i++) {
+ output.writeMessage(4, mutationGroups_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(session_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_);
+ }
+ if (requestOptions_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestOptions());
+ }
+ for (int i = 0; i < mutationGroups_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, mutationGroups_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.spanner.v1.BatchWriteRequest)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.v1.BatchWriteRequest other = (com.google.spanner.v1.BatchWriteRequest) obj;
+
+ if (!getSession().equals(other.getSession())) return false;
+ if (hasRequestOptions() != other.hasRequestOptions()) return false;
+ if (hasRequestOptions()) {
+ if (!getRequestOptions().equals(other.getRequestOptions())) return false;
+ }
+ if (!getMutationGroupsList().equals(other.getMutationGroupsList())) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + SESSION_FIELD_NUMBER;
+ hash = (53 * hash) + getSession().hashCode();
+ if (hasRequestOptions()) {
+ hash = (37 * hash) + REQUEST_OPTIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getRequestOptions().hashCode();
+ }
+ if (getMutationGroupsCount() > 0) {
+ hash = (37 * hash) + MUTATION_GROUPS_FIELD_NUMBER;
+ hash = (53 * hash) + getMutationGroupsList().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.spanner.v1.BatchWriteRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ * + * The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite]. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The session.
+ */
+ public java.lang.String getSession() {
+ java.lang.Object ref = session_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ session_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for session.
+ */
+ public com.google.protobuf.ByteString getSessionBytes() {
+ java.lang.Object ref = session_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ session_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The session to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSession(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ session_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearSession() {
+ session_ = getDefaultInstance().getSession();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The bytes for session to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSessionBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ session_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return this;
+ }
+
+ private com.google.spanner.v1.RequestOptions requestOptions_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.spanner.v1.RequestOptions,
+ com.google.spanner.v1.RequestOptions.Builder,
+ com.google.spanner.v1.RequestOptionsOrBuilder>
+ requestOptionsBuilder_;
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return Whether the requestOptions field is set.
+ */
+ public boolean hasRequestOptions() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return The requestOptions.
+ */
+ public com.google.spanner.v1.RequestOptions getRequestOptions() {
+ if (requestOptionsBuilder_ == null) {
+ return requestOptions_ == null
+ ? com.google.spanner.v1.RequestOptions.getDefaultInstance()
+ : requestOptions_;
+ } else {
+ return requestOptionsBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public Builder setRequestOptions(com.google.spanner.v1.RequestOptions value) {
+ if (requestOptionsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ requestOptions_ = value;
+ } else {
+ requestOptionsBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public Builder setRequestOptions(com.google.spanner.v1.RequestOptions.Builder builderForValue) {
+ if (requestOptionsBuilder_ == null) {
+ requestOptions_ = builderForValue.build();
+ } else {
+ requestOptionsBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public Builder mergeRequestOptions(com.google.spanner.v1.RequestOptions value) {
+ if (requestOptionsBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0)
+ && requestOptions_ != null
+ && requestOptions_ != com.google.spanner.v1.RequestOptions.getDefaultInstance()) {
+ getRequestOptionsBuilder().mergeFrom(value);
+ } else {
+ requestOptions_ = value;
+ }
+ } else {
+ requestOptionsBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public Builder clearRequestOptions() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ requestOptions_ = null;
+ if (requestOptionsBuilder_ != null) {
+ requestOptionsBuilder_.dispose();
+ requestOptionsBuilder_ = null;
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public com.google.spanner.v1.RequestOptions.Builder getRequestOptionsBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getRequestOptionsFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ public com.google.spanner.v1.RequestOptionsOrBuilder getRequestOptionsOrBuilder() {
+ if (requestOptionsBuilder_ != null) {
+ return requestOptionsBuilder_.getMessageOrBuilder();
+ } else {
+ return requestOptions_ == null
+ ? com.google.spanner.v1.RequestOptions.getDefaultInstance()
+ : requestOptions_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.spanner.v1.RequestOptions,
+ com.google.spanner.v1.RequestOptions.Builder,
+ com.google.spanner.v1.RequestOptionsOrBuilder>
+ getRequestOptionsFieldBuilder() {
+ if (requestOptionsBuilder_ == null) {
+ requestOptionsBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.spanner.v1.RequestOptions,
+ com.google.spanner.v1.RequestOptions.Builder,
+ com.google.spanner.v1.RequestOptionsOrBuilder>(
+ getRequestOptions(), getParentForChildren(), isClean());
+ requestOptions_ = null;
+ }
+ return requestOptionsBuilder_;
+ }
+
+ private java.util.List+ * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List+ * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public int getMutationGroupsCount() {
+ if (mutationGroupsBuilder_ == null) {
+ return mutationGroups_.size();
+ } else {
+ return mutationGroupsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroup getMutationGroups(int index) {
+ if (mutationGroupsBuilder_ == null) {
+ return mutationGroups_.get(index);
+ } else {
+ return mutationGroupsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setMutationGroups(
+ int index, com.google.spanner.v1.BatchWriteRequest.MutationGroup value) {
+ if (mutationGroupsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.set(index, value);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setMutationGroups(
+ int index, com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder builderForValue) {
+ if (mutationGroupsBuilder_ == null) {
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutationGroups(com.google.spanner.v1.BatchWriteRequest.MutationGroup value) {
+ if (mutationGroupsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.add(value);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutationGroups(
+ int index, com.google.spanner.v1.BatchWriteRequest.MutationGroup value) {
+ if (mutationGroupsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.add(index, value);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutationGroups(
+ com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder builderForValue) {
+ if (mutationGroupsBuilder_ == null) {
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.add(builderForValue.build());
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addMutationGroups(
+ int index, com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder builderForValue) {
+ if (mutationGroupsBuilder_ == null) {
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder addAllMutationGroups(
+ java.lang.Iterable extends com.google.spanner.v1.BatchWriteRequest.MutationGroup>
+ values) {
+ if (mutationGroupsBuilder_ == null) {
+ ensureMutationGroupsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutationGroups_);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearMutationGroups() {
+ if (mutationGroupsBuilder_ == null) {
+ mutationGroups_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder removeMutationGroups(int index) {
+ if (mutationGroupsBuilder_ == null) {
+ ensureMutationGroupsIsMutable();
+ mutationGroups_.remove(index);
+ onChanged();
+ } else {
+ mutationGroupsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder getMutationGroupsBuilder(
+ int index) {
+ return getMutationGroupsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder
+ getMutationGroupsOrBuilder(int index) {
+ if (mutationGroupsBuilder_ == null) {
+ return mutationGroups_.get(index);
+ } else {
+ return mutationGroupsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List extends com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder>
+ getMutationGroupsOrBuilderList() {
+ if (mutationGroupsBuilder_ != null) {
+ return mutationGroupsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(mutationGroups_);
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder
+ addMutationGroupsBuilder() {
+ return getMutationGroupsFieldBuilder()
+ .addBuilder(com.google.spanner.v1.BatchWriteRequest.MutationGroup.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.spanner.v1.BatchWriteRequest.MutationGroup.Builder addMutationGroupsBuilder(
+ int index) {
+ return getMutationGroupsFieldBuilder()
+ .addBuilder(
+ index, com.google.spanner.v1.BatchWriteRequest.MutationGroup.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public java.util.List+ * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The session.
+ */
+ java.lang.String getSession();
+ /**
+ *
+ *
+ * + * Required. The session in which the batch request is to be run. + *+ * + *
+ * string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for session.
+ */
+ com.google.protobuf.ByteString getSessionBytes();
+
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return Whether the requestOptions field is set.
+ */
+ boolean hasRequestOptions();
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ *
+ * @return The requestOptions.
+ */
+ com.google.spanner.v1.RequestOptions getRequestOptions();
+ /**
+ *
+ *
+ * + * Common options for this request. + *+ * + *
.google.spanner.v1.RequestOptions request_options = 3;
+ */
+ com.google.spanner.v1.RequestOptionsOrBuilder getRequestOptionsOrBuilder();
+
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ java.util.List+ * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.spanner.v1.BatchWriteRequest.MutationGroup getMutationGroups(int index);
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ int getMutationGroupsCount();
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ java.util.List extends com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder>
+ getMutationGroupsOrBuilderList();
+ /**
+ *
+ *
+ * + * Required. The groups of mutations to be applied. + *+ * + *
+ * repeated .google.spanner.v1.BatchWriteRequest.MutationGroup mutation_groups = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.spanner.v1.BatchWriteRequest.MutationGroupOrBuilder getMutationGroupsOrBuilder(
+ int index);
+}
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchWriteResponse.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchWriteResponse.java
new file mode 100644
index 00000000000..b7525340d07
--- /dev/null
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchWriteResponse.java
@@ -0,0 +1,1221 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/spanner/v1/spanner.proto
+
+package com.google.spanner.v1;
+
+/**
+ *
+ *
+ * + * The result of applying a batch of mutations. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteResponse} + */ +public final class BatchWriteResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.BatchWriteResponse) + BatchWriteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchWriteResponse.newBuilder() to construct. + private BatchWriteResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private BatchWriteResponse() { + indexes_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchWriteResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.SpannerProto + .internal_static_google_spanner_v1_BatchWriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.BatchWriteResponse.class, + com.google.spanner.v1.BatchWriteResponse.Builder.class); + } + + public static final int INDEXES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList indexes_; + /** + * + * + *
+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return A list containing the indexes.
+ */
+ @java.lang.Override
+ public java.util.List+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return The count of indexes.
+ */
+ public int getIndexesCount() {
+ return indexes_.size();
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The indexes at the given index.
+ */
+ public int getIndexes(int index) {
+ return indexes_.getInt(index);
+ }
+
+ private int indexesMemoizedSerializedSize = -1;
+
+ public static final int STATUS_FIELD_NUMBER = 2;
+ private com.google.rpc.Status status_;
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return Whether the status field is set.
+ */
+ @java.lang.Override
+ public boolean hasStatus() {
+ return status_ != null;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return The status.
+ */
+ @java.lang.Override
+ public com.google.rpc.Status getStatus() {
+ return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ @java.lang.Override
+ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
+ return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+ }
+
+ public static final int COMMIT_TIMESTAMP_FIELD_NUMBER = 3;
+ private com.google.protobuf.Timestamp commitTimestamp_;
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return Whether the commitTimestamp field is set.
+ */
+ @java.lang.Override
+ public boolean hasCommitTimestamp() {
+ return commitTimestamp_ != null;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return The commitTimestamp.
+ */
+ @java.lang.Override
+ public com.google.protobuf.Timestamp getCommitTimestamp() {
+ return commitTimestamp_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : commitTimestamp_;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() {
+ return commitTimestamp_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : commitTimestamp_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ getSerializedSize();
+ if (getIndexesList().size() > 0) {
+ output.writeUInt32NoTag(10);
+ output.writeUInt32NoTag(indexesMemoizedSerializedSize);
+ }
+ for (int i = 0; i < indexes_.size(); i++) {
+ output.writeInt32NoTag(indexes_.getInt(i));
+ }
+ if (status_ != null) {
+ output.writeMessage(2, getStatus());
+ }
+ if (commitTimestamp_ != null) {
+ output.writeMessage(3, getCommitTimestamp());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ {
+ int dataSize = 0;
+ for (int i = 0; i < indexes_.size(); i++) {
+ dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(indexes_.getInt(i));
+ }
+ size += dataSize;
+ if (!getIndexesList().isEmpty()) {
+ size += 1;
+ size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
+ }
+ indexesMemoizedSerializedSize = dataSize;
+ }
+ if (status_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus());
+ }
+ if (commitTimestamp_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommitTimestamp());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.spanner.v1.BatchWriteResponse)) {
+ return super.equals(obj);
+ }
+ com.google.spanner.v1.BatchWriteResponse other = (com.google.spanner.v1.BatchWriteResponse) obj;
+
+ if (!getIndexesList().equals(other.getIndexesList())) return false;
+ if (hasStatus() != other.hasStatus()) return false;
+ if (hasStatus()) {
+ if (!getStatus().equals(other.getStatus())) return false;
+ }
+ if (hasCommitTimestamp() != other.hasCommitTimestamp()) return false;
+ if (hasCommitTimestamp()) {
+ if (!getCommitTimestamp().equals(other.getCommitTimestamp())) return false;
+ }
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getIndexesCount() > 0) {
+ hash = (37 * hash) + INDEXES_FIELD_NUMBER;
+ hash = (53 * hash) + getIndexesList().hashCode();
+ }
+ if (hasStatus()) {
+ hash = (37 * hash) + STATUS_FIELD_NUMBER;
+ hash = (53 * hash) + getStatus().hashCode();
+ }
+ if (hasCommitTimestamp()) {
+ hash = (37 * hash) + COMMIT_TIMESTAMP_FIELD_NUMBER;
+ hash = (53 * hash) + getCommitTimestamp().hashCode();
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.spanner.v1.BatchWriteResponse prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ * + * The result of applying a batch of mutations. + *+ * + * Protobuf type {@code google.spanner.v1.BatchWriteResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return A list containing the indexes.
+ */
+ public java.util.List+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return The count of indexes.
+ */
+ public int getIndexesCount() {
+ return indexes_.size();
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The indexes at the given index.
+ */
+ public int getIndexes(int index) {
+ return indexes_.getInt(index);
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param index The index to set the value at.
+ * @param value The indexes to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIndexes(int index, int value) {
+
+ ensureIndexesIsMutable();
+ indexes_.setInt(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param value The indexes to add.
+ * @return This builder for chaining.
+ */
+ public Builder addIndexes(int value) {
+
+ ensureIndexesIsMutable();
+ indexes_.addInt(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param values The indexes to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllIndexes(java.lang.Iterable extends java.lang.Integer> values) {
+ ensureIndexesIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexes_);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearIndexes() {
+ indexes_ = emptyIntList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+
+ private com.google.rpc.Status status_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
+ statusBuilder_;
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return Whether the status field is set.
+ */
+ public boolean hasStatus() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return The status.
+ */
+ public com.google.rpc.Status getStatus() {
+ if (statusBuilder_ == null) {
+ return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+ } else {
+ return statusBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public Builder setStatus(com.google.rpc.Status value) {
+ if (statusBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ status_ = value;
+ } else {
+ statusBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
+ if (statusBuilder_ == null) {
+ status_ = builderForValue.build();
+ } else {
+ statusBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public Builder mergeStatus(com.google.rpc.Status value) {
+ if (statusBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) != 0)
+ && status_ != null
+ && status_ != com.google.rpc.Status.getDefaultInstance()) {
+ getStatusBuilder().mergeFrom(value);
+ } else {
+ status_ = value;
+ }
+ } else {
+ statusBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public Builder clearStatus() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ status_ = null;
+ if (statusBuilder_ != null) {
+ statusBuilder_.dispose();
+ statusBuilder_ = null;
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public com.google.rpc.Status.Builder getStatusBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getStatusFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
+ if (statusBuilder_ != null) {
+ return statusBuilder_.getMessageOrBuilder();
+ } else {
+ return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+ }
+ }
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
+ getStatusFieldBuilder() {
+ if (statusBuilder_ == null) {
+ statusBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.rpc.Status,
+ com.google.rpc.Status.Builder,
+ com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean());
+ status_ = null;
+ }
+ return statusBuilder_;
+ }
+
+ private com.google.protobuf.Timestamp commitTimestamp_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ commitTimestampBuilder_;
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return Whether the commitTimestamp field is set.
+ */
+ public boolean hasCommitTimestamp() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return The commitTimestamp.
+ */
+ public com.google.protobuf.Timestamp getCommitTimestamp() {
+ if (commitTimestampBuilder_ == null) {
+ return commitTimestamp_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : commitTimestamp_;
+ } else {
+ return commitTimestampBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public Builder setCommitTimestamp(com.google.protobuf.Timestamp value) {
+ if (commitTimestampBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ commitTimestamp_ = value;
+ } else {
+ commitTimestampBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public Builder setCommitTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (commitTimestampBuilder_ == null) {
+ commitTimestamp_ = builderForValue.build();
+ } else {
+ commitTimestampBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public Builder mergeCommitTimestamp(com.google.protobuf.Timestamp value) {
+ if (commitTimestampBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) != 0)
+ && commitTimestamp_ != null
+ && commitTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
+ getCommitTimestampBuilder().mergeFrom(value);
+ } else {
+ commitTimestamp_ = value;
+ }
+ } else {
+ commitTimestampBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public Builder clearCommitTimestamp() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ commitTimestamp_ = null;
+ if (commitTimestampBuilder_ != null) {
+ commitTimestampBuilder_.dispose();
+ commitTimestampBuilder_ = null;
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public com.google.protobuf.Timestamp.Builder getCommitTimestampBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getCommitTimestampFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() {
+ if (commitTimestampBuilder_ != null) {
+ return commitTimestampBuilder_.getMessageOrBuilder();
+ } else {
+ return commitTimestamp_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : commitTimestamp_;
+ }
+ }
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ getCommitTimestampFieldBuilder() {
+ if (commitTimestampBuilder_ == null) {
+ commitTimestampBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>(
+ getCommitTimestamp(), getParentForChildren(), isClean());
+ commitTimestamp_ = null;
+ }
+ return commitTimestampBuilder_;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.spanner.v1.BatchWriteResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.spanner.v1.BatchWriteResponse)
+ private static final com.google.spanner.v1.BatchWriteResponse DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.spanner.v1.BatchWriteResponse();
+ }
+
+ public static com.google.spanner.v1.BatchWriteResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return A list containing the indexes.
+ */
+ java.util.List+ * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @return The count of indexes.
+ */
+ int getIndexesCount();
+ /**
+ *
+ *
+ * + * The mutation groups applied in this batch. The values index into the + * `mutation_groups` field in the corresponding `BatchWriteRequest`. + *+ * + *
repeated int32 indexes = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The indexes at the given index.
+ */
+ int getIndexes(int index);
+
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return Whether the status field is set.
+ */
+ boolean hasStatus();
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ *
+ * @return The status.
+ */
+ com.google.rpc.Status getStatus();
+ /**
+ *
+ *
+ * + * An `OK` status indicates success. Any other status indicates a failure. + *+ * + *
.google.rpc.Status status = 2;
+ */
+ com.google.rpc.StatusOrBuilder getStatusOrBuilder();
+
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return Whether the commitTimestamp field is set.
+ */
+ boolean hasCommitTimestamp();
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ *
+ * @return The commitTimestamp.
+ */
+ com.google.protobuf.Timestamp getCommitTimestamp();
+ /**
+ *
+ *
+ * + * The commit timestamp of the transaction that applied this batch. + * Present if `status` is `OK`, absent otherwise. + *+ * + *
.google.protobuf.Timestamp commit_timestamp = 3;
+ */
+ com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder();
+}
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
index e17a35fc518..daa5ed9f50e 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
@@ -135,6 +135,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
internal_static_google_spanner_v1_RollbackRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_spanner_v1_RollbackRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_v1_BatchWriteRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_v1_BatchWriteRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_v1_BatchWriteRequest_MutationGroup_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_v1_BatchWriteRequest_MutationGroup_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_v1_BatchWriteResponse_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_v1_BatchWriteResponse_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
@@ -277,86 +289,102 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "equestOptionsB\r\n\013transaction\"i\n\017Rollback"
+ "Request\0228\n\007session\030\001 \001(\tB\'\342A\001\002\372A \n\036spann"
+ "er.googleapis.com/Session\022\034\n\016transaction"
- + "_id\030\002 \001(\014B\004\342A\001\0022\300\026\n\007Spanner\022\246\001\n\rCreateSe"
- + "ssion\022\'.google.spanner.v1.CreateSessionR"
- + "equest\032\032.google.spanner.v1.Session\"P\332A\010d"
- + "atabase\202\323\344\223\002?\":/v1/{database=projects/*/"
- + "instances/*/databases/*}/sessions:\001*\022\340\001\n"
- + "\023BatchCreateSessions\022-.google.spanner.v1"
- + ".BatchCreateSessionsRequest\032..google.spa"
- + "nner.v1.BatchCreateSessionsResponse\"j\332A\026"
- + "database,session_count\202\323\344\223\002K\"F/v1/{datab"
- + "ase=projects/*/instances/*/databases/*}/"
- + "sessions:batchCreate:\001*\022\227\001\n\nGetSession\022$"
- + ".google.spanner.v1.GetSessionRequest\032\032.g"
- + "oogle.spanner.v1.Session\"G\332A\004name\202\323\344\223\002:\022"
- + "8/v1/{name=projects/*/instances/*/databa"
- + "ses/*/sessions/*}\022\256\001\n\014ListSessions\022&.goo"
- + "gle.spanner.v1.ListSessionsRequest\032\'.goo"
- + "gle.spanner.v1.ListSessionsResponse\"M\332A\010"
- + "database\202\323\344\223\002<\022:/v1/{database=projects/*"
- + "/instances/*/databases/*}/sessions\022\231\001\n\rD"
- + "eleteSession\022\'.google.spanner.v1.DeleteS"
- + "essionRequest\032\026.google.protobuf.Empty\"G\332"
- + "A\004name\202\323\344\223\002:*8/v1/{name=projects/*/insta"
- + "nces/*/databases/*/sessions/*}\022\243\001\n\nExecu"
- + "teSql\022$.google.spanner.v1.ExecuteSqlRequ"
- + "est\032\034.google.spanner.v1.ResultSet\"Q\202\323\344\223\002"
- + "K\"F/v1/{session=projects/*/instances/*/d"
- + "atabases/*/sessions/*}:executeSql:\001*\022\276\001\n"
- + "\023ExecuteStreamingSql\022$.google.spanner.v1"
- + ".ExecuteSqlRequest\032#.google.spanner.v1.P"
- + "artialResultSet\"Z\202\323\344\223\002T\"O/v1/{session=pr"
- + "ojects/*/instances/*/databases/*/session"
- + "s/*}:executeStreamingSql:\001*0\001\022\300\001\n\017Execut"
- + "eBatchDml\022).google.spanner.v1.ExecuteBat"
- + "chDmlRequest\032*.google.spanner.v1.Execute"
- + "BatchDmlResponse\"V\202\323\344\223\002P\"K/v1/{session=p"
+ + "_id\030\002 \001(\014B\004\342A\001\002\"\243\002\n\021BatchWriteRequest\0228\n"
+ + "\007session\030\001 \001(\tB\'\342A\001\002\372A \n\036spanner.googlea"
+ + "pis.com/Session\022:\n\017request_options\030\003 \001(\013"
+ + "2!.google.spanner.v1.RequestOptions\022Q\n\017m"
+ + "utation_groups\030\004 \003(\01322.google.spanner.v1"
+ + ".BatchWriteRequest.MutationGroupB\004\342A\001\002\032E"
+ + "\n\rMutationGroup\0224\n\tmutations\030\001 \003(\0132\033.goo"
+ + "gle.spanner.v1.MutationB\004\342A\001\002\"\177\n\022BatchWr"
+ + "iteResponse\022\017\n\007indexes\030\001 \003(\005\022\"\n\006status\030\002"
+ + " \001(\0132\022.google.rpc.Status\0224\n\020commit_times"
+ + "tamp\030\003 \001(\0132\032.google.protobuf.Timestamp2\213"
+ + "\030\n\007Spanner\022\246\001\n\rCreateSession\022\'.google.sp"
+ + "anner.v1.CreateSessionRequest\032\032.google.s"
+ + "panner.v1.Session\"P\332A\010database\202\323\344\223\002?\":/v"
+ + "1/{database=projects/*/instances/*/datab"
+ + "ases/*}/sessions:\001*\022\340\001\n\023BatchCreateSessi"
+ + "ons\022-.google.spanner.v1.BatchCreateSessi"
+ + "onsRequest\032..google.spanner.v1.BatchCrea"
+ + "teSessionsResponse\"j\332A\026database,session_"
+ + "count\202\323\344\223\002K\"F/v1/{database=projects/*/in"
+ + "stances/*/databases/*}/sessions:batchCre"
+ + "ate:\001*\022\227\001\n\nGetSession\022$.google.spanner.v"
+ + "1.GetSessionRequest\032\032.google.spanner.v1."
+ + "Session\"G\332A\004name\202\323\344\223\002:\0228/v1/{name=projec"
+ + "ts/*/instances/*/databases/*/sessions/*}"
+ + "\022\256\001\n\014ListSessions\022&.google.spanner.v1.Li"
+ + "stSessionsRequest\032\'.google.spanner.v1.Li"
+ + "stSessionsResponse\"M\332A\010database\202\323\344\223\002<\022:/"
+ + "v1/{database=projects/*/instances/*/data"
+ + "bases/*}/sessions\022\231\001\n\rDeleteSession\022\'.go"
+ + "ogle.spanner.v1.DeleteSessionRequest\032\026.g"
+ + "oogle.protobuf.Empty\"G\332A\004name\202\323\344\223\002:*8/v1"
+ + "/{name=projects/*/instances/*/databases/"
+ + "*/sessions/*}\022\243\001\n\nExecuteSql\022$.google.sp"
+ + "anner.v1.ExecuteSqlRequest\032\034.google.span"
+ + "ner.v1.ResultSet\"Q\202\323\344\223\002K\"F/v1/{session=p"
+ "rojects/*/instances/*/databases/*/sessio"
- + "ns/*}:executeBatchDml:\001*\022\221\001\n\004Read\022\036.goog"
- + "le.spanner.v1.ReadRequest\032\034.google.spann"
- + "er.v1.ResultSet\"K\202\323\344\223\002E\"@/v1/{session=pr"
- + "ojects/*/instances/*/databases/*/session"
- + "s/*}:read:\001*\022\254\001\n\rStreamingRead\022\036.google."
- + "spanner.v1.ReadRequest\032#.google.spanner."
- + "v1.PartialResultSet\"T\202\323\344\223\002N\"I/v1/{sessio"
- + "n=projects/*/instances/*/databases/*/ses"
- + "sions/*}:streamingRead:\001*0\001\022\311\001\n\020BeginTra"
- + "nsaction\022*.google.spanner.v1.BeginTransa"
- + "ctionRequest\032\036.google.spanner.v1.Transac"
- + "tion\"i\332A\017session,options\202\323\344\223\002Q\"L/v1/{ses"
- + "sion=projects/*/instances/*/databases/*/"
- + "sessions/*}:beginTransaction:\001*\022\353\001\n\006Comm"
- + "it\022 .google.spanner.v1.CommitRequest\032!.g"
- + "oogle.spanner.v1.CommitResponse\"\233\001\332A ses"
- + "sion,transaction_id,mutations\332A(session,"
- + "single_use_transaction,mutations\202\323\344\223\002G\"B"
+ + "ns/*}:executeSql:\001*\022\276\001\n\023ExecuteStreaming"
+ + "Sql\022$.google.spanner.v1.ExecuteSqlReques"
+ + "t\032#.google.spanner.v1.PartialResultSet\"Z"
+ + "\202\323\344\223\002T\"O/v1/{session=projects/*/instance"
+ + "s/*/databases/*/sessions/*}:executeStrea"
+ + "mingSql:\001*0\001\022\300\001\n\017ExecuteBatchDml\022).googl"
+ + "e.spanner.v1.ExecuteBatchDmlRequest\032*.go"
+ + "ogle.spanner.v1.ExecuteBatchDmlResponse\""
+ + "V\202\323\344\223\002P\"K/v1/{session=projects/*/instanc"
+ + "es/*/databases/*/sessions/*}:executeBatc"
+ + "hDml:\001*\022\221\001\n\004Read\022\036.google.spanner.v1.Rea"
+ + "dRequest\032\034.google.spanner.v1.ResultSet\"K"
+ + "\202\323\344\223\002E\"@/v1/{session=projects/*/instance"
+ + "s/*/databases/*/sessions/*}:read:\001*\022\254\001\n\r"
+ + "StreamingRead\022\036.google.spanner.v1.ReadRe"
+ + "quest\032#.google.spanner.v1.PartialResultS"
+ + "et\"T\202\323\344\223\002N\"I/v1/{session=projects/*/inst"
+ + "ances/*/databases/*/sessions/*}:streamin"
+ + "gRead:\001*0\001\022\311\001\n\020BeginTransaction\022*.google"
+ + ".spanner.v1.BeginTransactionRequest\032\036.go"
+ + "ogle.spanner.v1.Transaction\"i\332A\017session,"
+ + "options\202\323\344\223\002Q\"L/v1/{session=projects/*/i"
+ + "nstances/*/databases/*/sessions/*}:begin"
+ + "Transaction:\001*\022\353\001\n\006Commit\022 .google.spann"
+ + "er.v1.CommitRequest\032!.google.spanner.v1."
+ + "CommitResponse\"\233\001\332A session,transaction_"
+ + "id,mutations\332A(session,single_use_transa"
+ + "ction,mutations\202\323\344\223\002G\"B/v1/{session=proj"
+ + "ects/*/instances/*/databases/*/sessions/"
+ + "*}:commit:\001*\022\260\001\n\010Rollback\022\".google.spann"
+ + "er.v1.RollbackRequest\032\026.google.protobuf."
+ + "Empty\"h\332A\026session,transaction_id\202\323\344\223\002I\"D"
+ "/v1/{session=projects/*/instances/*/data"
- + "bases/*/sessions/*}:commit:\001*\022\260\001\n\010Rollba"
- + "ck\022\".google.spanner.v1.RollbackRequest\032\026"
- + ".google.protobuf.Empty\"h\332A\026session,trans"
- + "action_id\202\323\344\223\002I\"D/v1/{session=projects/*"
- + "/instances/*/databases/*/sessions/*}:rol"
- + "lback:\001*\022\267\001\n\016PartitionQuery\022(.google.spa"
- + "nner.v1.PartitionQueryRequest\032$.google.s"
- + "panner.v1.PartitionResponse\"U\202\323\344\223\002O\"J/v1"
- + "/{session=projects/*/instances/*/databas"
- + "es/*/sessions/*}:partitionQuery:\001*\022\264\001\n\rP"
- + "artitionRead\022\'.google.spanner.v1.Partiti"
- + "onReadRequest\032$.google.spanner.v1.Partit"
- + "ionResponse\"T\202\323\344\223\002N\"I/v1/{session=projec"
- + "ts/*/instances/*/databases/*/sessions/*}"
- + ":partitionRead:\001*\032w\312A\026spanner.googleapis"
- + ".com\322A[https://www.googleapis.com/auth/c"
- + "loud-platform,https://www.googleapis.com"
- + "/auth/spanner.dataB\221\002\n\025com.google.spanne"
- + "r.v1B\014SpannerProtoP\001Z5cloud.google.com/g"
- + "o/spanner/apiv1/spannerpb;spannerpb\252\002\027Go"
- + "ogle.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Spa"
- + "nner\\V1\352\002\032Google::Cloud::Spanner::V1\352A_\n"
- + "\037spanner.googleapis.com/Database\022One BatchWriteResponse can contain the results for multiple MutationGroups. Inspect the + * indexes field to determine the MutationGroups that the BatchWriteResponse is for. + * + *
The mutation groups may be applied more than once. This can lead to failures if the mutation + * groups are non-idempotent. For example, an insert that is replayed can return an {@link + * ErrorCode#ALREADY_EXISTS} error. For this reason, users of the library may prefer to use {@link + * #write(Iterable)} instead. However, {@code batchWriteAtLeastOnce()} method may be appropriate + * for non-atomically committing multiple mutation groups in a single RPC with low latency. + * + *
Example of BatchWriteAtLeastOnce + * + *
{@code
+ * Iterable mutationGroups =
+ * ImmutableList.of(
+ * MutationGroup.of(
+ * Mutation.newInsertBuilder("FOO1").set("ID").to(1L).set("NAME").to("Bar1").build(),
+ * Mutation.newInsertBuilder("FOO2").set("ID").to(2L).set("NAME").to("Bar2").build()),
+ * MutationGroup.of(
+ * Mutation.newInsertBuilder("FOO3").set("ID").to(3L).set("NAME").to("Bar3").build(),
+ * Mutation.newInsertBuilder("FOO4").set("ID").to(4L).set("NAME").to("Bar4").build()),
+ * MutationGroup.of(
+ * Mutation.newInsertBuilder("FOO4").set("ID").to(4L).set("NAME").to("Bar4").build(),
+ * Mutation.newInsertBuilder("FOO5").set("ID").to(5L).set("NAME").to("Bar5").build()),
+ * MutationGroup.of(
+ * Mutation.newInsertBuilder("FOO6").set("ID").to(6L).set("NAME").to("Bar6").build()));
+ * ServerStream responses =
+ * dbClient.batchWriteAtLeastOnce(mutationGroups, Options.tag("batch-write-tag"));
+ * for (BatchWriteResponse response : responses) {
+ * // Do something when a response is received.
+ * }
+ * }
+ *
+ * Options for a transaction can include:
+ *
+ *