// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/spanner/v1/spanner.proto

package com.google.spanner.v1;

/**
 *
 *
 * <pre>
 * The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]
 * </pre>
 *
 * Protobuf type {@code google.spanner.v1.ExecuteBatchDmlRequest}
 */
public final class ExecuteBatchDmlRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.spanner.v1.ExecuteBatchDmlRequest)
    ExecuteBatchDmlRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ExecuteBatchDmlRequest.newBuilder() to construct.
  private ExecuteBatchDmlRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ExecuteBatchDmlRequest() {
    session_ = "";
    statements_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private ExecuteBatchDmlRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              session_ = s;
              break;
            }
          case 18:
            {
              com.google.spanner.v1.TransactionSelector.Builder subBuilder = null;
              if (transaction_ != null) {
                subBuilder = transaction_.toBuilder();
              }
              transaction_ =
                  input.readMessage(
                      com.google.spanner.v1.TransactionSelector.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(transaction_);
                transaction_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              if (!((mutable_bitField0_ & 0x00000004) != 0)) {
                statements_ =
                    new java.util.ArrayList<
                        com.google.spanner.v1.ExecuteBatchDmlRequest.Statement>();
                mutable_bitField0_ |= 0x00000004;
              }
              statements_.add(
                  input.readMessage(
                      com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.parser(),
                      extensionRegistry));
              break;
            }
          case 32:
            {
              seqno_ = input.readInt64();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000004) != 0)) {
        statements_ = java.util.Collections.unmodifiableList(statements_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.spanner.v1.SpannerProto
        .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.spanner.v1.SpannerProto
        .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.spanner.v1.ExecuteBatchDmlRequest.class,
            com.google.spanner.v1.ExecuteBatchDmlRequest.Builder.class);
  }

  public interface StatementOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.spanner.v1.ExecuteBatchDmlRequest.Statement)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Required. The DML string.
     * </pre>
     *
     * <code>string sql = 1;</code>
     */
    java.lang.String getSql();
    /**
     *
     *
     * <pre>
     * Required. The DML string.
     * </pre>
     *
     * <code>string sql = 1;</code>
     */
    com.google.protobuf.ByteString getSqlBytes();

    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    boolean hasParams();
    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    com.google.protobuf.Struct getParams();
    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    com.google.protobuf.StructOrBuilder getParamsOrBuilder();

    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    int getParamTypesCount();
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    boolean containsParamTypes(java.lang.String key);
    /** Use {@link #getParamTypesMap()} instead. */
    @java.lang.Deprecated
    java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypes();
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypesMap();
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    com.google.spanner.v1.Type getParamTypesOrDefault(
        java.lang.String key, com.google.spanner.v1.Type defaultValue);
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    com.google.spanner.v1.Type getParamTypesOrThrow(java.lang.String key);
  }
  /**
   *
   *
   * <pre>
   * A single DML statement.
   * </pre>
   *
   * Protobuf type {@code google.spanner.v1.ExecuteBatchDmlRequest.Statement}
   */
  public static final class Statement extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.spanner.v1.ExecuteBatchDmlRequest.Statement)
      StatementOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Statement.newBuilder() to construct.
    private Statement(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Statement() {
      sql_ = "";
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private Statement(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                java.lang.String s = input.readStringRequireUtf8();

                sql_ = s;
                break;
              }
            case 18:
              {
                com.google.protobuf.Struct.Builder subBuilder = null;
                if (params_ != null) {
                  subBuilder = params_.toBuilder();
                }
                params_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(params_);
                  params_ = subBuilder.buildPartial();
                }

                break;
              }
            case 26:
              {
                if (!((mutable_bitField0_ & 0x00000004) != 0)) {
                  paramTypes_ =
                      com.google.protobuf.MapField.newMapField(
                          ParamTypesDefaultEntryHolder.defaultEntry);
                  mutable_bitField0_ |= 0x00000004;
                }
                com.google.protobuf.MapEntry<java.lang.String, com.google.spanner.v1.Type>
                    paramTypes__ =
                        input.readMessage(
                            ParamTypesDefaultEntryHolder.defaultEntry.getParserForType(),
                            extensionRegistry);
                paramTypes_.getMutableMap().put(paramTypes__.getKey(), paramTypes__.getValue());
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.spanner.v1.SpannerProto
          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    @java.lang.Override
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 3:
          return internalGetParamTypes();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.v1.SpannerProto
          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.class,
              com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder.class);
    }

    private int bitField0_;
    public static final int SQL_FIELD_NUMBER = 1;
    private volatile java.lang.Object sql_;
    /**
     *
     *
     * <pre>
     * Required. The DML string.
     * </pre>
     *
     * <code>string sql = 1;</code>
     */
    public java.lang.String getSql() {
      java.lang.Object ref = sql_;
      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();
        sql_ = s;
        return s;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The DML string.
     * </pre>
     *
     * <code>string sql = 1;</code>
     */
    public com.google.protobuf.ByteString getSqlBytes() {
      java.lang.Object ref = sql_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sql_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PARAMS_FIELD_NUMBER = 2;
    private com.google.protobuf.Struct params_;
    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    public boolean hasParams() {
      return params_ != null;
    }
    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    public com.google.protobuf.Struct getParams() {
      return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_;
    }
    /**
     *
     *
     * <pre>
     * The DML string can contain parameter placeholders. A parameter
     * placeholder consists of `'&#64;'` followed by the parameter
     * name. Parameter names consist of any combination of letters,
     * numbers, and underscores.
     * Parameters can appear anywhere that a literal value is expected.  The
     * same parameter name can be used more than once, for example:
     *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
     * It is an error to execute an SQL statement with unbound parameters.
     * Parameter values are specified using `params`, which is a JSON
     * object whose keys are parameter names, and whose values are the
     * corresponding parameter values.
     * </pre>
     *
     * <code>.google.protobuf.Struct params = 2;</code>
     */
    public com.google.protobuf.StructOrBuilder getParamsOrBuilder() {
      return getParams();
    }

    public static final int PARAM_TYPES_FIELD_NUMBER = 3;

    private static final class ParamTypesDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<java.lang.String, com.google.spanner.v1.Type>
          defaultEntry =
              com.google.protobuf.MapEntry
                  .<java.lang.String, com.google.spanner.v1.Type>newDefaultInstance(
                      com.google.spanner.v1.SpannerProto
                          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_ParamTypesEntry_descriptor,
                      com.google.protobuf.WireFormat.FieldType.STRING,
                      "",
                      com.google.protobuf.WireFormat.FieldType.MESSAGE,
                      com.google.spanner.v1.Type.getDefaultInstance());
    }

    private com.google.protobuf.MapField<java.lang.String, com.google.spanner.v1.Type> paramTypes_;

    private com.google.protobuf.MapField<java.lang.String, com.google.spanner.v1.Type>
        internalGetParamTypes() {
      if (paramTypes_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ParamTypesDefaultEntryHolder.defaultEntry);
      }
      return paramTypes_;
    }

    public int getParamTypesCount() {
      return internalGetParamTypes().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    public boolean containsParamTypes(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      return internalGetParamTypes().getMap().containsKey(key);
    }
    /** Use {@link #getParamTypesMap()} instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypes() {
      return getParamTypesMap();
    }
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypesMap() {
      return internalGetParamTypes().getMap();
    }
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    public com.google.spanner.v1.Type getParamTypesOrDefault(
        java.lang.String key, com.google.spanner.v1.Type defaultValue) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, com.google.spanner.v1.Type> map =
          internalGetParamTypes().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * It is not always possible for Cloud Spanner to infer the right SQL type
     * from a JSON value.  For example, values of type `BYTES` and values
     * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
     * In these cases, `param_types` can be used to specify the exact
     * SQL type for some or all of the SQL statement parameters. See the
     * definition of [Type][google.spanner.v1.Type] for more information
     * about SQL types.
     * </pre>
     *
     * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
     */
    public com.google.spanner.v1.Type getParamTypesOrThrow(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, com.google.spanner.v1.Type> map =
          internalGetParamTypes().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    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 (!getSqlBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sql_);
      }
      if (params_ != null) {
        output.writeMessage(2, getParams());
      }
      com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
          output, internalGetParamTypes(), ParamTypesDefaultEntryHolder.defaultEntry, 3);
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getSqlBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sql_);
      }
      if (params_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParams());
      }
      for (java.util.Map.Entry<java.lang.String, com.google.spanner.v1.Type> entry :
          internalGetParamTypes().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.String, com.google.spanner.v1.Type> paramTypes__ =
            ParamTypesDefaultEntryHolder.defaultEntry
                .newBuilderForType()
                .setKey(entry.getKey())
                .setValue(entry.getValue())
                .build();
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, paramTypes__);
      }
      size += unknownFields.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.ExecuteBatchDmlRequest.Statement)) {
        return super.equals(obj);
      }
      com.google.spanner.v1.ExecuteBatchDmlRequest.Statement other =
          (com.google.spanner.v1.ExecuteBatchDmlRequest.Statement) obj;

      if (!getSql().equals(other.getSql())) return false;
      if (hasParams() != other.hasParams()) return false;
      if (hasParams()) {
        if (!getParams().equals(other.getParams())) return false;
      }
      if (!internalGetParamTypes().equals(other.internalGetParamTypes())) return false;
      if (!unknownFields.equals(other.unknownFields)) 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) + SQL_FIELD_NUMBER;
      hash = (53 * hash) + getSql().hashCode();
      if (hasParams()) {
        hash = (37 * hash) + PARAMS_FIELD_NUMBER;
        hash = (53 * hash) + getParams().hashCode();
      }
      if (!internalGetParamTypes().getMap().isEmpty()) {
        hash = (37 * hash) + PARAM_TYPES_FIELD_NUMBER;
        hash = (53 * hash) + internalGetParamTypes().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement 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.ExecuteBatchDmlRequest.Statement parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement 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.ExecuteBatchDmlRequest.Statement parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement 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.ExecuteBatchDmlRequest.Statement parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement 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.ExecuteBatchDmlRequest.Statement parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement 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.ExecuteBatchDmlRequest.Statement 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;
    }
    /**
     *
     *
     * <pre>
     * A single DML statement.
     * </pre>
     *
     * Protobuf type {@code google.spanner.v1.ExecuteBatchDmlRequest.Statement}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.spanner.v1.ExecuteBatchDmlRequest.Statement)
        com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.spanner.v1.SpannerProto
            .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(int number) {
        switch (number) {
          case 3:
            return internalGetParamTypes();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        switch (number) {
          case 3:
            return internalGetMutableParamTypes();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.spanner.v1.SpannerProto
            .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.class,
                com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder.class);
      }

      // Construct using com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        sql_ = "";

        if (paramsBuilder_ == null) {
          params_ = null;
        } else {
          params_ = null;
          paramsBuilder_ = null;
        }
        internalGetMutableParamTypes().clear();
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.spanner.v1.SpannerProto
            .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_Statement_descriptor;
      }

      @java.lang.Override
      public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement getDefaultInstanceForType() {
        return com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement build() {
        com.google.spanner.v1.ExecuteBatchDmlRequest.Statement result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement buildPartial() {
        com.google.spanner.v1.ExecuteBatchDmlRequest.Statement result =
            new com.google.spanner.v1.ExecuteBatchDmlRequest.Statement(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.sql_ = sql_;
        if (paramsBuilder_ == null) {
          result.params_ = params_;
        } else {
          result.params_ = paramsBuilder_.build();
        }
        result.paramTypes_ = internalGetParamTypes();
        result.paramTypes_.makeImmutable();
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.spanner.v1.ExecuteBatchDmlRequest.Statement) {
          return mergeFrom((com.google.spanner.v1.ExecuteBatchDmlRequest.Statement) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.spanner.v1.ExecuteBatchDmlRequest.Statement other) {
        if (other == com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.getDefaultInstance())
          return this;
        if (!other.getSql().isEmpty()) {
          sql_ = other.sql_;
          onChanged();
        }
        if (other.hasParams()) {
          mergeParams(other.getParams());
        }
        internalGetMutableParamTypes().mergeFrom(other.internalGetParamTypes());
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.spanner.v1.ExecuteBatchDmlRequest.Statement parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage =
              (com.google.spanner.v1.ExecuteBatchDmlRequest.Statement) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private java.lang.Object sql_ = "";
      /**
       *
       *
       * <pre>
       * Required. The DML string.
       * </pre>
       *
       * <code>string sql = 1;</code>
       */
      public java.lang.String getSql() {
        java.lang.Object ref = sql_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          sql_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * Required. The DML string.
       * </pre>
       *
       * <code>string sql = 1;</code>
       */
      public com.google.protobuf.ByteString getSqlBytes() {
        java.lang.Object ref = sql_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          sql_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * Required. The DML string.
       * </pre>
       *
       * <code>string sql = 1;</code>
       */
      public Builder setSql(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }

        sql_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The DML string.
       * </pre>
       *
       * <code>string sql = 1;</code>
       */
      public Builder clearSql() {

        sql_ = getDefaultInstance().getSql();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The DML string.
       * </pre>
       *
       * <code>string sql = 1;</code>
       */
      public Builder setSqlBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);

        sql_ = value;
        onChanged();
        return this;
      }

      private com.google.protobuf.Struct params_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Struct,
              com.google.protobuf.Struct.Builder,
              com.google.protobuf.StructOrBuilder>
          paramsBuilder_;
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public boolean hasParams() {
        return paramsBuilder_ != null || params_ != null;
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public com.google.protobuf.Struct getParams() {
        if (paramsBuilder_ == null) {
          return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_;
        } else {
          return paramsBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public Builder setParams(com.google.protobuf.Struct value) {
        if (paramsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          params_ = value;
          onChanged();
        } else {
          paramsBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public Builder setParams(com.google.protobuf.Struct.Builder builderForValue) {
        if (paramsBuilder_ == null) {
          params_ = builderForValue.build();
          onChanged();
        } else {
          paramsBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public Builder mergeParams(com.google.protobuf.Struct value) {
        if (paramsBuilder_ == null) {
          if (params_ != null) {
            params_ =
                com.google.protobuf.Struct.newBuilder(params_).mergeFrom(value).buildPartial();
          } else {
            params_ = value;
          }
          onChanged();
        } else {
          paramsBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public Builder clearParams() {
        if (paramsBuilder_ == null) {
          params_ = null;
          onChanged();
        } else {
          params_ = null;
          paramsBuilder_ = null;
        }

        return this;
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public com.google.protobuf.Struct.Builder getParamsBuilder() {

        onChanged();
        return getParamsFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      public com.google.protobuf.StructOrBuilder getParamsOrBuilder() {
        if (paramsBuilder_ != null) {
          return paramsBuilder_.getMessageOrBuilder();
        } else {
          return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_;
        }
      }
      /**
       *
       *
       * <pre>
       * The DML string can contain parameter placeholders. A parameter
       * placeholder consists of `'&#64;'` followed by the parameter
       * name. Parameter names consist of any combination of letters,
       * numbers, and underscores.
       * Parameters can appear anywhere that a literal value is expected.  The
       * same parameter name can be used more than once, for example:
       *   `"WHERE id &gt; &#64;msg_id AND id &lt; &#64;msg_id + 100"`
       * It is an error to execute an SQL statement with unbound parameters.
       * Parameter values are specified using `params`, which is a JSON
       * object whose keys are parameter names, and whose values are the
       * corresponding parameter values.
       * </pre>
       *
       * <code>.google.protobuf.Struct params = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Struct,
              com.google.protobuf.Struct.Builder,
              com.google.protobuf.StructOrBuilder>
          getParamsFieldBuilder() {
        if (paramsBuilder_ == null) {
          paramsBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.protobuf.Struct,
                  com.google.protobuf.Struct.Builder,
                  com.google.protobuf.StructOrBuilder>(
                  getParams(), getParentForChildren(), isClean());
          params_ = null;
        }
        return paramsBuilder_;
      }

      private com.google.protobuf.MapField<java.lang.String, com.google.spanner.v1.Type>
          paramTypes_;

      private com.google.protobuf.MapField<java.lang.String, com.google.spanner.v1.Type>
          internalGetParamTypes() {
        if (paramTypes_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              ParamTypesDefaultEntryHolder.defaultEntry);
        }
        return paramTypes_;
      }

      private com.google.protobuf.MapField<java.lang.String, com.google.spanner.v1.Type>
          internalGetMutableParamTypes() {
        onChanged();
        ;
        if (paramTypes_ == null) {
          paramTypes_ =
              com.google.protobuf.MapField.newMapField(ParamTypesDefaultEntryHolder.defaultEntry);
        }
        if (!paramTypes_.isMutable()) {
          paramTypes_ = paramTypes_.copy();
        }
        return paramTypes_;
      }

      public int getParamTypesCount() {
        return internalGetParamTypes().getMap().size();
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public boolean containsParamTypes(java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        return internalGetParamTypes().getMap().containsKey(key);
      }
      /** Use {@link #getParamTypesMap()} instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypes() {
        return getParamTypesMap();
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getParamTypesMap() {
        return internalGetParamTypes().getMap();
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public com.google.spanner.v1.Type getParamTypesOrDefault(
          java.lang.String key, com.google.spanner.v1.Type defaultValue) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        java.util.Map<java.lang.String, com.google.spanner.v1.Type> map =
            internalGetParamTypes().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public com.google.spanner.v1.Type getParamTypesOrThrow(java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        java.util.Map<java.lang.String, com.google.spanner.v1.Type> map =
            internalGetParamTypes().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearParamTypes() {
        internalGetMutableParamTypes().getMutableMap().clear();
        return this;
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public Builder removeParamTypes(java.lang.String key) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        internalGetMutableParamTypes().getMutableMap().remove(key);
        return this;
      }
      /** Use alternate mutation accessors instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, com.google.spanner.v1.Type> getMutableParamTypes() {
        return internalGetMutableParamTypes().getMutableMap();
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public Builder putParamTypes(java.lang.String key, com.google.spanner.v1.Type value) {
        if (key == null) {
          throw new java.lang.NullPointerException();
        }
        if (value == null) {
          throw new java.lang.NullPointerException();
        }
        internalGetMutableParamTypes().getMutableMap().put(key, value);
        return this;
      }
      /**
       *
       *
       * <pre>
       * It is not always possible for Cloud Spanner to infer the right SQL type
       * from a JSON value.  For example, values of type `BYTES` and values
       * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings.
       * In these cases, `param_types` can be used to specify the exact
       * SQL type for some or all of the SQL statement parameters. See the
       * definition of [Type][google.spanner.v1.Type] for more information
       * about SQL types.
       * </pre>
       *
       * <code>map&lt;string, .google.spanner.v1.Type&gt; param_types = 3;</code>
       */
      public Builder putAllParamTypes(
          java.util.Map<java.lang.String, com.google.spanner.v1.Type> values) {
        internalGetMutableParamTypes().getMutableMap().putAll(values);
        return this;
      }

      @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.ExecuteBatchDmlRequest.Statement)
    }

    // @@protoc_insertion_point(class_scope:google.spanner.v1.ExecuteBatchDmlRequest.Statement)
    private static final com.google.spanner.v1.ExecuteBatchDmlRequest.Statement DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.spanner.v1.ExecuteBatchDmlRequest.Statement();
    }

    public static com.google.spanner.v1.ExecuteBatchDmlRequest.Statement getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<Statement> PARSER =
        new com.google.protobuf.AbstractParser<Statement>() {
          @java.lang.Override
          public Statement parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            return new Statement(input, extensionRegistry);
          }
        };

    public static com.google.protobuf.Parser<Statement> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<Statement> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int bitField0_;
  public static final int SESSION_FIELD_NUMBER = 1;
  private volatile java.lang.Object session_;
  /**
   *
   *
   * <pre>
   * Required. The session in which the DML statements should be performed.
   * </pre>
   *
   * <code>string session = 1;</code>
   */
  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;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The session in which the DML statements should be performed.
   * </pre>
   *
   * <code>string session = 1;</code>
   */
  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 TRANSACTION_FIELD_NUMBER = 2;
  private com.google.spanner.v1.TransactionSelector transaction_;
  /**
   *
   *
   * <pre>
   * The transaction to use. A ReadWrite transaction is required. Single-use
   * transactions are not supported (to avoid replay).  The caller must either
   * supply an existing transaction ID or begin a new transaction.
   * </pre>
   *
   * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
   */
  public boolean hasTransaction() {
    return transaction_ != null;
  }
  /**
   *
   *
   * <pre>
   * The transaction to use. A ReadWrite transaction is required. Single-use
   * transactions are not supported (to avoid replay).  The caller must either
   * supply an existing transaction ID or begin a new transaction.
   * </pre>
   *
   * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
   */
  public com.google.spanner.v1.TransactionSelector getTransaction() {
    return transaction_ == null
        ? com.google.spanner.v1.TransactionSelector.getDefaultInstance()
        : transaction_;
  }
  /**
   *
   *
   * <pre>
   * The transaction to use. A ReadWrite transaction is required. Single-use
   * transactions are not supported (to avoid replay).  The caller must either
   * supply an existing transaction ID or begin a new transaction.
   * </pre>
   *
   * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
   */
  public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilder() {
    return getTransaction();
  }

  public static final int STATEMENTS_FIELD_NUMBER = 3;
  private java.util.List<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement> statements_;
  /**
   *
   *
   * <pre>
   * The list of statements to execute in this batch. Statements are executed
   * serially, such that the effects of statement i are visible to statement
   * i+1. Each statement must be a DML statement. Execution will stop at the
   * first failed statement; the remaining statements will not run.
   * REQUIRES: statements_size() &gt; 0.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
   */
  public java.util.List<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement>
      getStatementsList() {
    return statements_;
  }
  /**
   *
   *
   * <pre>
   * The list of statements to execute in this batch. Statements are executed
   * serially, such that the effects of statement i are visible to statement
   * i+1. Each statement must be a DML statement. Execution will stop at the
   * first failed statement; the remaining statements will not run.
   * REQUIRES: statements_size() &gt; 0.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
   */
  public java.util.List<? extends com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder>
      getStatementsOrBuilderList() {
    return statements_;
  }
  /**
   *
   *
   * <pre>
   * The list of statements to execute in this batch. Statements are executed
   * serially, such that the effects of statement i are visible to statement
   * i+1. Each statement must be a DML statement. Execution will stop at the
   * first failed statement; the remaining statements will not run.
   * REQUIRES: statements_size() &gt; 0.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
   */
  public int getStatementsCount() {
    return statements_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of statements to execute in this batch. Statements are executed
   * serially, such that the effects of statement i are visible to statement
   * i+1. Each statement must be a DML statement. Execution will stop at the
   * first failed statement; the remaining statements will not run.
   * REQUIRES: statements_size() &gt; 0.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
   */
  public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement getStatements(int index) {
    return statements_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The list of statements to execute in this batch. Statements are executed
   * serially, such that the effects of statement i are visible to statement
   * i+1. Each statement must be a DML statement. Execution will stop at the
   * first failed statement; the remaining statements will not run.
   * REQUIRES: statements_size() &gt; 0.
   * </pre>
   *
   * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
   */
  public com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder getStatementsOrBuilder(
      int index) {
    return statements_.get(index);
  }

  public static final int SEQNO_FIELD_NUMBER = 4;
  private long seqno_;
  /**
   *
   *
   * <pre>
   * A per-transaction sequence number used to identify this request. This is
   * used in the same space as the seqno in
   * [ExecuteSqlRequest][Spanner.ExecuteSqlRequest]. See more details
   * in [ExecuteSqlRequest][Spanner.ExecuteSqlRequest].
   * </pre>
   *
   * <code>int64 seqno = 4;</code>
   */
  public long getSeqno() {
    return seqno_;
  }

  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 (!getSessionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, session_);
    }
    if (transaction_ != null) {
      output.writeMessage(2, getTransaction());
    }
    for (int i = 0; i < statements_.size(); i++) {
      output.writeMessage(3, statements_.get(i));
    }
    if (seqno_ != 0L) {
      output.writeInt64(4, seqno_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getSessionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, session_);
    }
    if (transaction_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTransaction());
    }
    for (int i = 0; i < statements_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, statements_.get(i));
    }
    if (seqno_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, seqno_);
    }
    size += unknownFields.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.ExecuteBatchDmlRequest)) {
      return super.equals(obj);
    }
    com.google.spanner.v1.ExecuteBatchDmlRequest other =
        (com.google.spanner.v1.ExecuteBatchDmlRequest) obj;

    if (!getSession().equals(other.getSession())) return false;
    if (hasTransaction() != other.hasTransaction()) return false;
    if (hasTransaction()) {
      if (!getTransaction().equals(other.getTransaction())) return false;
    }
    if (!getStatementsList().equals(other.getStatementsList())) return false;
    if (getSeqno() != other.getSeqno()) return false;
    if (!unknownFields.equals(other.unknownFields)) 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 (hasTransaction()) {
      hash = (37 * hash) + TRANSACTION_FIELD_NUMBER;
      hash = (53 * hash) + getTransaction().hashCode();
    }
    if (getStatementsCount() > 0) {
      hash = (37 * hash) + STATEMENTS_FIELD_NUMBER;
      hash = (53 * hash) + getStatementsList().hashCode();
    }
    hash = (37 * hash) + SEQNO_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSeqno());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest 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.ExecuteBatchDmlRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest 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.ExecuteBatchDmlRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest 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.ExecuteBatchDmlRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest 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.ExecuteBatchDmlRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest 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.ExecuteBatchDmlRequest 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;
  }
  /**
   *
   *
   * <pre>
   * The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]
   * </pre>
   *
   * Protobuf type {@code google.spanner.v1.ExecuteBatchDmlRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.spanner.v1.ExecuteBatchDmlRequest)
      com.google.spanner.v1.ExecuteBatchDmlRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.spanner.v1.SpannerProto
          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.v1.SpannerProto
          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.v1.ExecuteBatchDmlRequest.class,
              com.google.spanner.v1.ExecuteBatchDmlRequest.Builder.class);
    }

    // Construct using com.google.spanner.v1.ExecuteBatchDmlRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getStatementsFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      session_ = "";

      if (transactionBuilder_ == null) {
        transaction_ = null;
      } else {
        transaction_ = null;
        transactionBuilder_ = null;
      }
      if (statementsBuilder_ == null) {
        statements_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        statementsBuilder_.clear();
      }
      seqno_ = 0L;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.spanner.v1.SpannerProto
          .internal_static_google_spanner_v1_ExecuteBatchDmlRequest_descriptor;
    }

    @java.lang.Override
    public com.google.spanner.v1.ExecuteBatchDmlRequest getDefaultInstanceForType() {
      return com.google.spanner.v1.ExecuteBatchDmlRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.spanner.v1.ExecuteBatchDmlRequest build() {
      com.google.spanner.v1.ExecuteBatchDmlRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.spanner.v1.ExecuteBatchDmlRequest buildPartial() {
      com.google.spanner.v1.ExecuteBatchDmlRequest result =
          new com.google.spanner.v1.ExecuteBatchDmlRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.session_ = session_;
      if (transactionBuilder_ == null) {
        result.transaction_ = transaction_;
      } else {
        result.transaction_ = transactionBuilder_.build();
      }
      if (statementsBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)) {
          statements_ = java.util.Collections.unmodifiableList(statements_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.statements_ = statements_;
      } else {
        result.statements_ = statementsBuilder_.build();
      }
      result.seqno_ = seqno_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.spanner.v1.ExecuteBatchDmlRequest) {
        return mergeFrom((com.google.spanner.v1.ExecuteBatchDmlRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.spanner.v1.ExecuteBatchDmlRequest other) {
      if (other == com.google.spanner.v1.ExecuteBatchDmlRequest.getDefaultInstance()) return this;
      if (!other.getSession().isEmpty()) {
        session_ = other.session_;
        onChanged();
      }
      if (other.hasTransaction()) {
        mergeTransaction(other.getTransaction());
      }
      if (statementsBuilder_ == null) {
        if (!other.statements_.isEmpty()) {
          if (statements_.isEmpty()) {
            statements_ = other.statements_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureStatementsIsMutable();
            statements_.addAll(other.statements_);
          }
          onChanged();
        }
      } else {
        if (!other.statements_.isEmpty()) {
          if (statementsBuilder_.isEmpty()) {
            statementsBuilder_.dispose();
            statementsBuilder_ = null;
            statements_ = other.statements_;
            bitField0_ = (bitField0_ & ~0x00000004);
            statementsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getStatementsFieldBuilder()
                    : null;
          } else {
            statementsBuilder_.addAllMessages(other.statements_);
          }
        }
      }
      if (other.getSeqno() != 0L) {
        setSeqno(other.getSeqno());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.spanner.v1.ExecuteBatchDmlRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.spanner.v1.ExecuteBatchDmlRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object session_ = "";
    /**
     *
     *
     * <pre>
     * Required. The session in which the DML statements should be performed.
     * </pre>
     *
     * <code>string session = 1;</code>
     */
    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;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The session in which the DML statements should be performed.
     * </pre>
     *
     * <code>string session = 1;</code>
     */
    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;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The session in which the DML statements should be performed.
     * </pre>
     *
     * <code>string session = 1;</code>
     */
    public Builder setSession(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      session_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The session in which the DML statements should be performed.
     * </pre>
     *
     * <code>string session = 1;</code>
     */
    public Builder clearSession() {

      session_ = getDefaultInstance().getSession();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The session in which the DML statements should be performed.
     * </pre>
     *
     * <code>string session = 1;</code>
     */
    public Builder setSessionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      session_ = value;
      onChanged();
      return this;
    }

    private com.google.spanner.v1.TransactionSelector transaction_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.spanner.v1.TransactionSelector,
            com.google.spanner.v1.TransactionSelector.Builder,
            com.google.spanner.v1.TransactionSelectorOrBuilder>
        transactionBuilder_;
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public boolean hasTransaction() {
      return transactionBuilder_ != null || transaction_ != null;
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public com.google.spanner.v1.TransactionSelector getTransaction() {
      if (transactionBuilder_ == null) {
        return transaction_ == null
            ? com.google.spanner.v1.TransactionSelector.getDefaultInstance()
            : transaction_;
      } else {
        return transactionBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public Builder setTransaction(com.google.spanner.v1.TransactionSelector value) {
      if (transactionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        transaction_ = value;
        onChanged();
      } else {
        transactionBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public Builder setTransaction(
        com.google.spanner.v1.TransactionSelector.Builder builderForValue) {
      if (transactionBuilder_ == null) {
        transaction_ = builderForValue.build();
        onChanged();
      } else {
        transactionBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public Builder mergeTransaction(com.google.spanner.v1.TransactionSelector value) {
      if (transactionBuilder_ == null) {
        if (transaction_ != null) {
          transaction_ =
              com.google.spanner.v1.TransactionSelector.newBuilder(transaction_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          transaction_ = value;
        }
        onChanged();
      } else {
        transactionBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public Builder clearTransaction() {
      if (transactionBuilder_ == null) {
        transaction_ = null;
        onChanged();
      } else {
        transaction_ = null;
        transactionBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public com.google.spanner.v1.TransactionSelector.Builder getTransactionBuilder() {

      onChanged();
      return getTransactionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilder() {
      if (transactionBuilder_ != null) {
        return transactionBuilder_.getMessageOrBuilder();
      } else {
        return transaction_ == null
            ? com.google.spanner.v1.TransactionSelector.getDefaultInstance()
            : transaction_;
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction to use. A ReadWrite transaction is required. Single-use
     * transactions are not supported (to avoid replay).  The caller must either
     * supply an existing transaction ID or begin a new transaction.
     * </pre>
     *
     * <code>.google.spanner.v1.TransactionSelector transaction = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.spanner.v1.TransactionSelector,
            com.google.spanner.v1.TransactionSelector.Builder,
            com.google.spanner.v1.TransactionSelectorOrBuilder>
        getTransactionFieldBuilder() {
      if (transactionBuilder_ == null) {
        transactionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.spanner.v1.TransactionSelector,
                com.google.spanner.v1.TransactionSelector.Builder,
                com.google.spanner.v1.TransactionSelectorOrBuilder>(
                getTransaction(), getParentForChildren(), isClean());
        transaction_ = null;
      }
      return transactionBuilder_;
    }

    private java.util.List<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement> statements_ =
        java.util.Collections.emptyList();

    private void ensureStatementsIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        statements_ =
            new java.util.ArrayList<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement>(
                statements_);
        bitField0_ |= 0x00000004;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.spanner.v1.ExecuteBatchDmlRequest.Statement,
            com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder,
            com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder>
        statementsBuilder_;

    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public java.util.List<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement>
        getStatementsList() {
      if (statementsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(statements_);
      } else {
        return statementsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public int getStatementsCount() {
      if (statementsBuilder_ == null) {
        return statements_.size();
      } else {
        return statementsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement getStatements(int index) {
      if (statementsBuilder_ == null) {
        return statements_.get(index);
      } else {
        return statementsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder setStatements(
        int index, com.google.spanner.v1.ExecuteBatchDmlRequest.Statement value) {
      if (statementsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatementsIsMutable();
        statements_.set(index, value);
        onChanged();
      } else {
        statementsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder setStatements(
        int index, com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder builderForValue) {
      if (statementsBuilder_ == null) {
        ensureStatementsIsMutable();
        statements_.set(index, builderForValue.build());
        onChanged();
      } else {
        statementsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder addStatements(com.google.spanner.v1.ExecuteBatchDmlRequest.Statement value) {
      if (statementsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatementsIsMutable();
        statements_.add(value);
        onChanged();
      } else {
        statementsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder addStatements(
        int index, com.google.spanner.v1.ExecuteBatchDmlRequest.Statement value) {
      if (statementsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureStatementsIsMutable();
        statements_.add(index, value);
        onChanged();
      } else {
        statementsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder addStatements(
        com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder builderForValue) {
      if (statementsBuilder_ == null) {
        ensureStatementsIsMutable();
        statements_.add(builderForValue.build());
        onChanged();
      } else {
        statementsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder addStatements(
        int index, com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder builderForValue) {
      if (statementsBuilder_ == null) {
        ensureStatementsIsMutable();
        statements_.add(index, builderForValue.build());
        onChanged();
      } else {
        statementsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder addAllStatements(
        java.lang.Iterable<? extends com.google.spanner.v1.ExecuteBatchDmlRequest.Statement>
            values) {
      if (statementsBuilder_ == null) {
        ensureStatementsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, statements_);
        onChanged();
      } else {
        statementsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder clearStatements() {
      if (statementsBuilder_ == null) {
        statements_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        statementsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public Builder removeStatements(int index) {
      if (statementsBuilder_ == null) {
        ensureStatementsIsMutable();
        statements_.remove(index);
        onChanged();
      } else {
        statementsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder getStatementsBuilder(
        int index) {
      return getStatementsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder getStatementsOrBuilder(
        int index) {
      if (statementsBuilder_ == null) {
        return statements_.get(index);
      } else {
        return statementsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public java.util.List<? extends com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder>
        getStatementsOrBuilderList() {
      if (statementsBuilder_ != null) {
        return statementsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(statements_);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder addStatementsBuilder() {
      return getStatementsFieldBuilder()
          .addBuilder(com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder addStatementsBuilder(
        int index) {
      return getStatementsFieldBuilder()
          .addBuilder(
              index, com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of statements to execute in this batch. Statements are executed
     * serially, such that the effects of statement i are visible to statement
     * i+1. Each statement must be a DML statement. Execution will stop at the
     * first failed statement; the remaining statements will not run.
     * REQUIRES: statements_size() &gt; 0.
     * </pre>
     *
     * <code>repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3;</code>
     */
    public java.util.List<com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder>
        getStatementsBuilderList() {
      return getStatementsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.spanner.v1.ExecuteBatchDmlRequest.Statement,
            com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder,
            com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder>
        getStatementsFieldBuilder() {
      if (statementsBuilder_ == null) {
        statementsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.spanner.v1.ExecuteBatchDmlRequest.Statement,
                com.google.spanner.v1.ExecuteBatchDmlRequest.Statement.Builder,
                com.google.spanner.v1.ExecuteBatchDmlRequest.StatementOrBuilder>(
                statements_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
        statements_ = null;
      }
      return statementsBuilder_;
    }

    private long seqno_;
    /**
     *
     *
     * <pre>
     * A per-transaction sequence number used to identify this request. This is
     * used in the same space as the seqno in
     * [ExecuteSqlRequest][Spanner.ExecuteSqlRequest]. See more details
     * in [ExecuteSqlRequest][Spanner.ExecuteSqlRequest].
     * </pre>
     *
     * <code>int64 seqno = 4;</code>
     */
    public long getSeqno() {
      return seqno_;
    }
    /**
     *
     *
     * <pre>
     * A per-transaction sequence number used to identify this request. This is
     * used in the same space as the seqno in
     * [ExecuteSqlRequest][Spanner.ExecuteSqlRequest]. See more details
     * in [ExecuteSqlRequest][Spanner.ExecuteSqlRequest].
     * </pre>
     *
     * <code>int64 seqno = 4;</code>
     */
    public Builder setSeqno(long value) {

      seqno_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A per-transaction sequence number used to identify this request. This is
     * used in the same space as the seqno in
     * [ExecuteSqlRequest][Spanner.ExecuteSqlRequest]. See more details
     * in [ExecuteSqlRequest][Spanner.ExecuteSqlRequest].
     * </pre>
     *
     * <code>int64 seqno = 4;</code>
     */
    public Builder clearSeqno() {

      seqno_ = 0L;
      onChanged();
      return this;
    }

    @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.ExecuteBatchDmlRequest)
  }

  // @@protoc_insertion_point(class_scope:google.spanner.v1.ExecuteBatchDmlRequest)
  private static final com.google.spanner.v1.ExecuteBatchDmlRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.spanner.v1.ExecuteBatchDmlRequest();
  }

  public static com.google.spanner.v1.ExecuteBatchDmlRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ExecuteBatchDmlRequest> PARSER =
      new com.google.protobuf.AbstractParser<ExecuteBatchDmlRequest>() {
        @java.lang.Override
        public ExecuteBatchDmlRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ExecuteBatchDmlRequest(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<ExecuteBatchDmlRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ExecuteBatchDmlRequest> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.spanner.v1.ExecuteBatchDmlRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
