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

package com.google.spanner.admin.database.v1;

/**
 * <pre>
 * Enqueues the given DDL statements to be applied, in order but not
 * necessarily all at once, to the database schema at some point (or
 * points) in the future. The server checks that the statements
 * are executable (syntactically valid, name tables that exist, etc.)
 * before enqueueing them, but they may still fail upon
 * later execution (e.g., if a statement from another batch of
 * statements is applied first and it conflicts in some way, or if
 * there is some data-related problem like a `NULL` value in a column to
 * which `NOT NULL` would be added). If a statement fails, all
 * subsequent statements in the batch are automatically cancelled.
 * Each batch of statements is assigned a name which can be used with
 * the [Operations][google.longrunning.Operations] API to monitor
 * progress. See the
 * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more
 * details.
 * </pre>
 *
 * Protobuf type {@code google.spanner.admin.database.v1.UpdateDatabaseDdlRequest}
 */
public  final class UpdateDatabaseDdlRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.spanner.admin.database.v1.UpdateDatabaseDdlRequest)
    UpdateDatabaseDdlRequestOrBuilder {
private static final long serialVersionUID = 0L;
  // Use UpdateDatabaseDdlRequest.newBuilder() to construct.
  private UpdateDatabaseDdlRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private UpdateDatabaseDdlRequest() {
    database_ = "";
    statements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    operationId_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private UpdateDatabaseDdlRequest(
      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;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            database_ = s;
            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
              statements_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00000002;
            }
            statements_.add(s);
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            operationId_ = s;
            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_ & 0x00000002) == 0x00000002)) {
        statements_ = statements_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.class, com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.Builder.class);
  }

  private int bitField0_;
  public static final int DATABASE_FIELD_NUMBER = 1;
  private volatile java.lang.Object database_;
  /**
   * <pre>
   * Required. The database to update.
   * </pre>
   *
   * <code>string database = 1;</code>
   */
  public java.lang.String getDatabase() {
    java.lang.Object ref = database_;
    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();
      database_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Required. The database to update.
   * </pre>
   *
   * <code>string database = 1;</code>
   */
  public com.google.protobuf.ByteString
      getDatabaseBytes() {
    java.lang.Object ref = database_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      database_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int STATEMENTS_FIELD_NUMBER = 2;
  private com.google.protobuf.LazyStringList statements_;
  /**
   * <pre>
   * DDL statements to be applied to the database.
   * </pre>
   *
   * <code>repeated string statements = 2;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getStatementsList() {
    return statements_;
  }
  /**
   * <pre>
   * DDL statements to be applied to the database.
   * </pre>
   *
   * <code>repeated string statements = 2;</code>
   */
  public int getStatementsCount() {
    return statements_.size();
  }
  /**
   * <pre>
   * DDL statements to be applied to the database.
   * </pre>
   *
   * <code>repeated string statements = 2;</code>
   */
  public java.lang.String getStatements(int index) {
    return statements_.get(index);
  }
  /**
   * <pre>
   * DDL statements to be applied to the database.
   * </pre>
   *
   * <code>repeated string statements = 2;</code>
   */
  public com.google.protobuf.ByteString
      getStatementsBytes(int index) {
    return statements_.getByteString(index);
  }

  public static final int OPERATION_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object operationId_;
  /**
   * <pre>
   * If empty, the new update request is assigned an
   * automatically-generated operation ID. Otherwise, `operation_id`
   * is used to construct the name of the resulting
   * [Operation][google.longrunning.Operation].
   * Specifying an explicit operation ID simplifies determining
   * whether the statements were executed in the event that the
   * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
   * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
   * `operation_id` fields can be combined to form the
   * [name][google.longrunning.Operation.name] of the resulting
   * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
   * `operation_id` should be unique within the database, and must be
   * a valid identifier: `[a-z][a-z0-9_]*`. Note that
   * automatically-generated operation IDs always begin with an
   * underscore. If the named operation already exists,
   * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
   * `ALREADY_EXISTS`.
   * </pre>
   *
   * <code>string operation_id = 3;</code>
   */
  public java.lang.String getOperationId() {
    java.lang.Object ref = operationId_;
    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();
      operationId_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * If empty, the new update request is assigned an
   * automatically-generated operation ID. Otherwise, `operation_id`
   * is used to construct the name of the resulting
   * [Operation][google.longrunning.Operation].
   * Specifying an explicit operation ID simplifies determining
   * whether the statements were executed in the event that the
   * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
   * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
   * `operation_id` fields can be combined to form the
   * [name][google.longrunning.Operation.name] of the resulting
   * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
   * `operation_id` should be unique within the database, and must be
   * a valid identifier: `[a-z][a-z0-9_]*`. Note that
   * automatically-generated operation IDs always begin with an
   * underscore. If the named operation already exists,
   * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
   * `ALREADY_EXISTS`.
   * </pre>
   *
   * <code>string operation_id = 3;</code>
   */
  public com.google.protobuf.ByteString
      getOperationIdBytes() {
    java.lang.Object ref = operationId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      operationId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getDatabaseBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, database_);
    }
    for (int i = 0; i < statements_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, statements_.getRaw(i));
    }
    if (!getOperationIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, operationId_);
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getDatabaseBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, database_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < statements_.size(); i++) {
        dataSize += computeStringSizeNoTag(statements_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getStatementsList().size();
    }
    if (!getOperationIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, operationId_);
    }
    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.admin.database.v1.UpdateDatabaseDdlRequest)) {
      return super.equals(obj);
    }
    com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest other = (com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) obj;

    boolean result = true;
    result = result && getDatabase()
        .equals(other.getDatabase());
    result = result && getStatementsList()
        .equals(other.getStatementsList());
    result = result && getOperationId()
        .equals(other.getOperationId());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + DATABASE_FIELD_NUMBER;
    hash = (53 * hash) + getDatabase().hashCode();
    if (getStatementsCount() > 0) {
      hash = (37 * hash) + STATEMENTS_FIELD_NUMBER;
      hash = (53 * hash) + getStatementsList().hashCode();
    }
    hash = (37 * hash) + OPERATION_ID_FIELD_NUMBER;
    hash = (53 * hash) + getOperationId().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest 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.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest 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.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest 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.admin.database.v1.UpdateDatabaseDdlRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest 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.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  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>
   * Enqueues the given DDL statements to be applied, in order but not
   * necessarily all at once, to the database schema at some point (or
   * points) in the future. The server checks that the statements
   * are executable (syntactically valid, name tables that exist, etc.)
   * before enqueueing them, but they may still fail upon
   * later execution (e.g., if a statement from another batch of
   * statements is applied first and it conflicts in some way, or if
   * there is some data-related problem like a `NULL` value in a column to
   * which `NOT NULL` would be added). If a statement fails, all
   * subsequent statements in the batch are automatically cancelled.
   * Each batch of statements is assigned a name which can be used with
   * the [Operations][google.longrunning.Operations] API to monitor
   * progress. See the
   * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more
   * details.
   * </pre>
   *
   * Protobuf type {@code google.spanner.admin.database.v1.UpdateDatabaseDdlRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.spanner.admin.database.v1.UpdateDatabaseDdlRequest)
      com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.class, com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      database_ = "";

      statements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      operationId_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.spanner.admin.database.v1.SpannerDatabaseAdminProto.internal_static_google_spanner_admin_database_v1_UpdateDatabaseDdlRequest_descriptor;
    }

    public com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest getDefaultInstanceForType() {
      return com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.getDefaultInstance();
    }

    public com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest build() {
      com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest buildPartial() {
      com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest result = new com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.database_ = database_;
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        statements_ = statements_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.statements_ = statements_;
      result.operationId_ = operationId_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) {
        return mergeFrom((com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest other) {
      if (other == com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.getDefaultInstance()) return this;
      if (!other.getDatabase().isEmpty()) {
        database_ = other.database_;
        onChanged();
      }
      if (!other.statements_.isEmpty()) {
        if (statements_.isEmpty()) {
          statements_ = other.statements_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureStatementsIsMutable();
          statements_.addAll(other.statements_);
        }
        onChanged();
      }
      if (!other.getOperationId().isEmpty()) {
        operationId_ = other.operationId_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object database_ = "";
    /**
     * <pre>
     * Required. The database to update.
     * </pre>
     *
     * <code>string database = 1;</code>
     */
    public java.lang.String getDatabase() {
      java.lang.Object ref = database_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        database_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Required. The database to update.
     * </pre>
     *
     * <code>string database = 1;</code>
     */
    public com.google.protobuf.ByteString
        getDatabaseBytes() {
      java.lang.Object ref = database_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        database_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Required. The database to update.
     * </pre>
     *
     * <code>string database = 1;</code>
     */
    public Builder setDatabase(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      database_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The database to update.
     * </pre>
     *
     * <code>string database = 1;</code>
     */
    public Builder clearDatabase() {
      
      database_ = getDefaultInstance().getDatabase();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The database to update.
     * </pre>
     *
     * <code>string database = 1;</code>
     */
    public Builder setDatabaseBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      database_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList statements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureStatementsIsMutable() {
      if (!((bitField0_ & 0x00000002) == 0x00000002)) {
        statements_ = new com.google.protobuf.LazyStringArrayList(statements_);
        bitField0_ |= 0x00000002;
       }
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getStatementsList() {
      return statements_.getUnmodifiableView();
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public int getStatementsCount() {
      return statements_.size();
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public java.lang.String getStatements(int index) {
      return statements_.get(index);
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public com.google.protobuf.ByteString
        getStatementsBytes(int index) {
      return statements_.getByteString(index);
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public Builder setStatements(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureStatementsIsMutable();
      statements_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public Builder addStatements(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureStatementsIsMutable();
      statements_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public Builder addAllStatements(
        java.lang.Iterable<java.lang.String> values) {
      ensureStatementsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, statements_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public Builder clearStatements() {
      statements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * DDL statements to be applied to the database.
     * </pre>
     *
     * <code>repeated string statements = 2;</code>
     */
    public Builder addStatementsBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      ensureStatementsIsMutable();
      statements_.add(value);
      onChanged();
      return this;
    }

    private java.lang.Object operationId_ = "";
    /**
     * <pre>
     * If empty, the new update request is assigned an
     * automatically-generated operation ID. Otherwise, `operation_id`
     * is used to construct the name of the resulting
     * [Operation][google.longrunning.Operation].
     * Specifying an explicit operation ID simplifies determining
     * whether the statements were executed in the event that the
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
     * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
     * `operation_id` fields can be combined to form the
     * [name][google.longrunning.Operation.name] of the resulting
     * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
     * `operation_id` should be unique within the database, and must be
     * a valid identifier: `[a-z][a-z0-9_]*`. Note that
     * automatically-generated operation IDs always begin with an
     * underscore. If the named operation already exists,
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
     * `ALREADY_EXISTS`.
     * </pre>
     *
     * <code>string operation_id = 3;</code>
     */
    public java.lang.String getOperationId() {
      java.lang.Object ref = operationId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        operationId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * If empty, the new update request is assigned an
     * automatically-generated operation ID. Otherwise, `operation_id`
     * is used to construct the name of the resulting
     * [Operation][google.longrunning.Operation].
     * Specifying an explicit operation ID simplifies determining
     * whether the statements were executed in the event that the
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
     * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
     * `operation_id` fields can be combined to form the
     * [name][google.longrunning.Operation.name] of the resulting
     * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
     * `operation_id` should be unique within the database, and must be
     * a valid identifier: `[a-z][a-z0-9_]*`. Note that
     * automatically-generated operation IDs always begin with an
     * underscore. If the named operation already exists,
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
     * `ALREADY_EXISTS`.
     * </pre>
     *
     * <code>string operation_id = 3;</code>
     */
    public com.google.protobuf.ByteString
        getOperationIdBytes() {
      java.lang.Object ref = operationId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        operationId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * If empty, the new update request is assigned an
     * automatically-generated operation ID. Otherwise, `operation_id`
     * is used to construct the name of the resulting
     * [Operation][google.longrunning.Operation].
     * Specifying an explicit operation ID simplifies determining
     * whether the statements were executed in the event that the
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
     * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
     * `operation_id` fields can be combined to form the
     * [name][google.longrunning.Operation.name] of the resulting
     * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
     * `operation_id` should be unique within the database, and must be
     * a valid identifier: `[a-z][a-z0-9_]*`. Note that
     * automatically-generated operation IDs always begin with an
     * underscore. If the named operation already exists,
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
     * `ALREADY_EXISTS`.
     * </pre>
     *
     * <code>string operation_id = 3;</code>
     */
    public Builder setOperationId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      operationId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If empty, the new update request is assigned an
     * automatically-generated operation ID. Otherwise, `operation_id`
     * is used to construct the name of the resulting
     * [Operation][google.longrunning.Operation].
     * Specifying an explicit operation ID simplifies determining
     * whether the statements were executed in the event that the
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
     * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
     * `operation_id` fields can be combined to form the
     * [name][google.longrunning.Operation.name] of the resulting
     * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
     * `operation_id` should be unique within the database, and must be
     * a valid identifier: `[a-z][a-z0-9_]*`. Note that
     * automatically-generated operation IDs always begin with an
     * underscore. If the named operation already exists,
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
     * `ALREADY_EXISTS`.
     * </pre>
     *
     * <code>string operation_id = 3;</code>
     */
    public Builder clearOperationId() {
      
      operationId_ = getDefaultInstance().getOperationId();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If empty, the new update request is assigned an
     * automatically-generated operation ID. Otherwise, `operation_id`
     * is used to construct the name of the resulting
     * [Operation][google.longrunning.Operation].
     * Specifying an explicit operation ID simplifies determining
     * whether the statements were executed in the event that the
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
     * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
     * `operation_id` fields can be combined to form the
     * [name][google.longrunning.Operation.name] of the resulting
     * [longrunning.Operation][google.longrunning.Operation]: `&lt;database&gt;/operations/&lt;operation_id&gt;`.
     * `operation_id` should be unique within the database, and must be
     * a valid identifier: `[a-z][a-z0-9_]*`. Note that
     * automatically-generated operation IDs always begin with an
     * underscore. If the named operation already exists,
     * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
     * `ALREADY_EXISTS`.
     * </pre>
     *
     * <code>string operation_id = 3;</code>
     */
    public Builder setOperationIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      operationId_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:google.spanner.admin.database.v1.UpdateDatabaseDdlRequest)
  }

  // @@protoc_insertion_point(class_scope:google.spanner.admin.database.v1.UpdateDatabaseDdlRequest)
  private static final com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest();
  }

  public static com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

