/*
 * Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: google/firestore/admin/v1/firestore_admin.proto
// Protobuf Java Version: 4.33.2

package com.google.firestore.admin.v1;

/**
 *
 *
 * <pre>
 * The request message for
 * [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
 * </pre>
 *
 * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseRequest}
 */
@com.google.protobuf.Generated
public final class RestoreDatabaseRequest extends com.google.protobuf.GeneratedMessage
    implements
    // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.RestoreDatabaseRequest)
    RestoreDatabaseRequestOrBuilder {
  private static final long serialVersionUID = 0L;

  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 33,
        /* patch= */ 2,
        /* suffix= */ "",
        "RestoreDatabaseRequest");
  }

  // Use RestoreDatabaseRequest.newBuilder() to construct.
  private RestoreDatabaseRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }

  private RestoreDatabaseRequest() {
    parent_ = "";
    databaseId_ = "";
    backup_ = "";
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.firestore.admin.v1.FirestoreAdminProto
        .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
      int number) {
    switch (number) {
      case 10:
        return internalGetTags();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.firestore.admin.v1.FirestoreAdminProto
        .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.firestore.admin.v1.RestoreDatabaseRequest.class,
            com.google.firestore.admin.v1.RestoreDatabaseRequest.Builder.class);
  }

  private int bitField0_;
  public static final int PARENT_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object parent_ = "";

  /**
   *
   *
   * <pre>
   * Required. The project to restore the database in. Format is
   * `projects/{project_id}`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. The project to restore the database in. Format is
   * `projects/{project_id}`.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DATABASE_ID_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object databaseId_ = "";

  /**
   *
   *
   * <pre>
   * Required. The ID to use for the database, which will become the final
   * component of the database's resource name. This database ID must not be
   * associated with an existing database.
   *
   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
   * with first character a letter and the last a letter or a number. Must not
   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
   *
   * "(default)" database ID is also valid if the database is Standard edition.
   * </pre>
   *
   * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The databaseId.
   */
  @java.lang.Override
  public java.lang.String getDatabaseId() {
    java.lang.Object ref = databaseId_;
    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();
      databaseId_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. The ID to use for the database, which will become the final
   * component of the database's resource name. This database ID must not be
   * associated with an existing database.
   *
   * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
   * with first character a letter and the last a letter or a number. Must not
   * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
   *
   * "(default)" database ID is also valid if the database is Standard edition.
   * </pre>
   *
   * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for databaseId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDatabaseIdBytes() {
    java.lang.Object ref = databaseId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      databaseId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BACKUP_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object backup_ = "";

  /**
   *
   *
   * <pre>
   * Required. Backup to restore from. Must be from the same project as the
   * parent.
   *
   * The restored database will be created in the same location as the source
   * backup.
   *
   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
   * </pre>
   *
   * <code>
   * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The backup.
   */
  @java.lang.Override
  public java.lang.String getBackup() {
    java.lang.Object ref = backup_;
    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();
      backup_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. Backup to restore from. Must be from the same project as the
   * parent.
   *
   * The restored database will be created in the same location as the source
   * backup.
   *
   * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
   * </pre>
   *
   * <code>
   * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for backup.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBackupBytes() {
    java.lang.Object ref = backup_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      backup_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 9;
  private com.google.firestore.admin.v1.Database.EncryptionConfig encryptionConfig_;

  /**
   *
   *
   * <pre>
   * Optional. Encryption configuration for the restored database.
   *
   * If this field is not specified, the restored database will use
   * the same encryption configuration as the backup, namely
   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
   * </pre>
   *
   * <code>
   * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the encryptionConfig field is set.
   */
  @java.lang.Override
  public boolean hasEncryptionConfig() {
    return ((bitField0_ & 0x00000001) != 0);
  }

  /**
   *
   *
   * <pre>
   * Optional. Encryption configuration for the restored database.
   *
   * If this field is not specified, the restored database will use
   * the same encryption configuration as the backup, namely
   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
   * </pre>
   *
   * <code>
   * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The encryptionConfig.
   */
  @java.lang.Override
  public com.google.firestore.admin.v1.Database.EncryptionConfig getEncryptionConfig() {
    return encryptionConfig_ == null
        ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()
        : encryptionConfig_;
  }

  /**
   *
   *
   * <pre>
   * Optional. Encryption configuration for the restored database.
   *
   * If this field is not specified, the restored database will use
   * the same encryption configuration as the backup, namely
   * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
   * </pre>
   *
   * <code>
   * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder
      getEncryptionConfigOrBuilder() {
    return encryptionConfig_ == null
        ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()
        : encryptionConfig_;
  }

  public static final int TAGS_FIELD_NUMBER = 10;

  private static final class TagsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.firestore.admin.v1.FirestoreAdminProto
                .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_TagsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> tags_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetTags() {
    if (tags_ == null) {
      return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry);
    }
    return tags_;
  }

  public int getTagsCount() {
    return internalGetTags().getMap().size();
  }

  /**
   *
   *
   * <pre>
   * Optional. Immutable. Tags to be bound to the restored database.
   *
   * The tags should be provided in the format of
   * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
   * </pre>
   *
   * <code>
   * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public boolean containsTags(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetTags().getMap().containsKey(key);
  }

  /** Use {@link #getTagsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getTags() {
    return getTagsMap();
  }

  /**
   *
   *
   * <pre>
   * Optional. Immutable. Tags to be bound to the restored database.
   *
   * The tags should be provided in the format of
   * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
   * </pre>
   *
   * <code>
   * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getTagsMap() {
    return internalGetTags().getMap();
  }

  /**
   *
   *
   * <pre>
   * Optional. Immutable. Tags to be bound to the restored database.
   *
   * The tags should be provided in the format of
   * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
   * </pre>
   *
   * <code>
   * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getTagsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }

  /**
   *
   *
   * <pre>
   * Optional. Immutable. Tags to be bound to the restored database.
   *
   * The tags should be provided in the format of
   * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
   * </pre>
   *
   * <code>
   * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public java.lang.String getTagsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseId_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 2, databaseId_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 3, backup_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(9, getEncryptionConfig());
    }
    com.google.protobuf.GeneratedMessage.serializeStringMapTo(
        output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 10);
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(databaseId_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, databaseId_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, backup_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEncryptionConfig());
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetTags().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> tags__ =
          TagsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, tags__);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.firestore.admin.v1.RestoreDatabaseRequest)) {
      return super.equals(obj);
    }
    com.google.firestore.admin.v1.RestoreDatabaseRequest other =
        (com.google.firestore.admin.v1.RestoreDatabaseRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getDatabaseId().equals(other.getDatabaseId())) return false;
    if (!getBackup().equals(other.getBackup())) return false;
    if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false;
    if (hasEncryptionConfig()) {
      if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false;
    }
    if (!internalGetTags().equals(other.internalGetTags())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    hash = (37 * hash) + DATABASE_ID_FIELD_NUMBER;
    hash = (53 * hash) + getDatabaseId().hashCode();
    hash = (37 * hash) + BACKUP_FIELD_NUMBER;
    hash = (53 * hash) + getBackup().hashCode();
    if (hasEncryptionConfig()) {
      hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getEncryptionConfig().hashCode();
    }
    if (!internalGetTags().getMap().isEmpty()) {
      hash = (37 * hash) + TAGS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetTags().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.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.firestore.admin.v1.RestoreDatabaseRequest 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.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }

  /**
   *
   *
   * <pre>
   * The request message for
   * [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
   * </pre>
   *
   * Protobuf type {@code google.firestore.admin.v1.RestoreDatabaseRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.RestoreDatabaseRequest)
      com.google.firestore.admin.v1.RestoreDatabaseRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.firestore.admin.v1.FirestoreAdminProto
          .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
        int number) {
      switch (number) {
        case 10:
          return internalGetTags();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
        int number) {
      switch (number) {
        case 10:
          return internalGetMutableTags();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.admin.v1.FirestoreAdminProto
          .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.admin.v1.RestoreDatabaseRequest.class,
              com.google.firestore.admin.v1.RestoreDatabaseRequest.Builder.class);
    }

    // Construct using com.google.firestore.admin.v1.RestoreDatabaseRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        internalGetEncryptionConfigFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      parent_ = "";
      databaseId_ = "";
      backup_ = "";
      encryptionConfig_ = null;
      if (encryptionConfigBuilder_ != null) {
        encryptionConfigBuilder_.dispose();
        encryptionConfigBuilder_ = null;
      }
      internalGetMutableTags().clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.firestore.admin.v1.FirestoreAdminProto
          .internal_static_google_firestore_admin_v1_RestoreDatabaseRequest_descriptor;
    }

    @java.lang.Override
    public com.google.firestore.admin.v1.RestoreDatabaseRequest getDefaultInstanceForType() {
      return com.google.firestore.admin.v1.RestoreDatabaseRequest.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.firestore.admin.v1.RestoreDatabaseRequest buildPartial() {
      com.google.firestore.admin.v1.RestoreDatabaseRequest result =
          new com.google.firestore.admin.v1.RestoreDatabaseRequest(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.firestore.admin.v1.RestoreDatabaseRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.parent_ = parent_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.databaseId_ = databaseId_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.backup_ = backup_;
      }
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.encryptionConfig_ =
            encryptionConfigBuilder_ == null ? encryptionConfig_ : encryptionConfigBuilder_.build();
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.tags_ = internalGetTags();
        result.tags_.makeImmutable();
      }
      result.bitField0_ |= to_bitField0_;
    }

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

    public Builder mergeFrom(com.google.firestore.admin.v1.RestoreDatabaseRequest other) {
      if (other == com.google.firestore.admin.v1.RestoreDatabaseRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getDatabaseId().isEmpty()) {
        databaseId_ = other.databaseId_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getBackup().isEmpty()) {
        backup_ = other.backup_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.hasEncryptionConfig()) {
        mergeEncryptionConfig(other.getEncryptionConfig());
      }
      internalGetMutableTags().mergeFrom(other.internalGetTags());
      bitField0_ |= 0x00000010;
      this.mergeUnknownFields(other.getUnknownFields());
      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 {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                parent_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                databaseId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                backup_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 74:
              {
                input.readMessage(
                    internalGetEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 74
            case 82:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> tags__ =
                    input.readMessage(
                        TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
                internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue());
                bitField0_ |= 0x00000010;
                break;
              } // case 82
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";

    /**
     *
     *
     * <pre>
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {
      parent_ = getDefaultInstance().getParent();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object databaseId_ = "";

    /**
     *
     *
     * <pre>
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     *
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *
     * "(default)" database ID is also valid if the database is Standard edition.
     * </pre>
     *
     * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The databaseId.
     */
    public java.lang.String getDatabaseId() {
      java.lang.Object ref = databaseId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        databaseId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     *
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *
     * "(default)" database ID is also valid if the database is Standard edition.
     * </pre>
     *
     * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for databaseId.
     */
    public com.google.protobuf.ByteString getDatabaseIdBytes() {
      java.lang.Object ref = databaseId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        databaseId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     *
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *
     * "(default)" database ID is also valid if the database is Standard edition.
     * </pre>
     *
     * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The databaseId to set.
     * @return This builder for chaining.
     */
    public Builder setDatabaseId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      databaseId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     *
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *
     * "(default)" database ID is also valid if the database is Standard edition.
     * </pre>
     *
     * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDatabaseId() {
      databaseId_ = getDefaultInstance().getDatabaseId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     *
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *
     * "(default)" database ID is also valid if the database is Standard edition.
     * </pre>
     *
     * <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for databaseId to set.
     * @return This builder for chaining.
     */
    public Builder setDatabaseIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      databaseId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object backup_ = "";

    /**
     *
     *
     * <pre>
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     *
     * The restored database will be created in the same location as the source
     * backup.
     *
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     * </pre>
     *
     * <code>
     * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The backup.
     */
    public java.lang.String getBackup() {
      java.lang.Object ref = backup_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        backup_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     *
     * The restored database will be created in the same location as the source
     * backup.
     *
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     * </pre>
     *
     * <code>
     * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for backup.
     */
    public com.google.protobuf.ByteString getBackupBytes() {
      java.lang.Object ref = backup_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        backup_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     *
     * The restored database will be created in the same location as the source
     * backup.
     *
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     * </pre>
     *
     * <code>
     * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The backup to set.
     * @return This builder for chaining.
     */
    public Builder setBackup(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      backup_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     *
     * The restored database will be created in the same location as the source
     * backup.
     *
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     * </pre>
     *
     * <code>
     * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBackup() {
      backup_ = getDefaultInstance().getBackup();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     *
     * The restored database will be created in the same location as the source
     * backup.
     *
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     * </pre>
     *
     * <code>
     * string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for backup to set.
     * @return This builder for chaining.
     */
    public Builder setBackupBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      backup_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private com.google.firestore.admin.v1.Database.EncryptionConfig encryptionConfig_;
    private com.google.protobuf.SingleFieldBuilder<
            com.google.firestore.admin.v1.Database.EncryptionConfig,
            com.google.firestore.admin.v1.Database.EncryptionConfig.Builder,
            com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder>
        encryptionConfigBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the encryptionConfig field is set.
     */
    public boolean hasEncryptionConfig() {
      return ((bitField0_ & 0x00000008) != 0);
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The encryptionConfig.
     */
    public com.google.firestore.admin.v1.Database.EncryptionConfig getEncryptionConfig() {
      if (encryptionConfigBuilder_ == null) {
        return encryptionConfig_ == null
            ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()
            : encryptionConfig_;
      } else {
        return encryptionConfigBuilder_.getMessage();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setEncryptionConfig(
        com.google.firestore.admin.v1.Database.EncryptionConfig value) {
      if (encryptionConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        encryptionConfig_ = value;
      } else {
        encryptionConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setEncryptionConfig(
        com.google.firestore.admin.v1.Database.EncryptionConfig.Builder builderForValue) {
      if (encryptionConfigBuilder_ == null) {
        encryptionConfig_ = builderForValue.build();
      } else {
        encryptionConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeEncryptionConfig(
        com.google.firestore.admin.v1.Database.EncryptionConfig value) {
      if (encryptionConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && encryptionConfig_ != null
            && encryptionConfig_
                != com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()) {
          getEncryptionConfigBuilder().mergeFrom(value);
        } else {
          encryptionConfig_ = value;
        }
      } else {
        encryptionConfigBuilder_.mergeFrom(value);
      }
      if (encryptionConfig_ != null) {
        bitField0_ |= 0x00000008;
        onChanged();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearEncryptionConfig() {
      bitField0_ = (bitField0_ & ~0x00000008);
      encryptionConfig_ = null;
      if (encryptionConfigBuilder_ != null) {
        encryptionConfigBuilder_.dispose();
        encryptionConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.firestore.admin.v1.Database.EncryptionConfig.Builder
        getEncryptionConfigBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return internalGetEncryptionConfigFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder
        getEncryptionConfigOrBuilder() {
      if (encryptionConfigBuilder_ != null) {
        return encryptionConfigBuilder_.getMessageOrBuilder();
      } else {
        return encryptionConfig_ == null
            ? com.google.firestore.admin.v1.Database.EncryptionConfig.getDefaultInstance()
            : encryptionConfig_;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Encryption configuration for the restored database.
     *
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     * </pre>
     *
     * <code>
     * .google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.google.firestore.admin.v1.Database.EncryptionConfig,
            com.google.firestore.admin.v1.Database.EncryptionConfig.Builder,
            com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder>
        internalGetEncryptionConfigFieldBuilder() {
      if (encryptionConfigBuilder_ == null) {
        encryptionConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.google.firestore.admin.v1.Database.EncryptionConfig,
                com.google.firestore.admin.v1.Database.EncryptionConfig.Builder,
                com.google.firestore.admin.v1.Database.EncryptionConfigOrBuilder>(
                getEncryptionConfig(), getParentForChildren(), isClean());
        encryptionConfig_ = null;
      }
      return encryptionConfigBuilder_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> tags_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetTags() {
      if (tags_ == null) {
        return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry);
      }
      return tags_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableTags() {
      if (tags_ == null) {
        tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry);
      }
      if (!tags_.isMutable()) {
        tags_ = tags_.copy();
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return tags_;
    }

    public int getTagsCount() {
      return internalGetTags().getMap().size();
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public boolean containsTags(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetTags().getMap().containsKey(key);
    }

    /** Use {@link #getTagsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getTags() {
      return getTagsMap();
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getTagsMap() {
      return internalGetTags().getMap();
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getTagsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public java.lang.String getTagsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetTags().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearTags() {
      bitField0_ = (bitField0_ & ~0x00000010);
      internalGetMutableTags().getMutableMap().clear();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder removeTags(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableTags().getMutableMap().remove(key);
      return this;
    }

    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableTags() {
      bitField0_ |= 0x00000010;
      return internalGetMutableTags().getMutableMap();
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putTags(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableTags().getMutableMap().put(key, value);
      bitField0_ |= 0x00000010;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Immutable. Tags to be bound to the restored database.
     *
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -&gt; tagValues/{tag_value_id}`.
     * </pre>
     *
     * <code>
     * map&lt;string, string&gt; tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putAllTags(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableTags().getMutableMap().putAll(values);
      bitField0_ |= 0x00000010;
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.RestoreDatabaseRequest)
  }

  // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.RestoreDatabaseRequest)
  private static final com.google.firestore.admin.v1.RestoreDatabaseRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.firestore.admin.v1.RestoreDatabaseRequest();
  }

  public static com.google.firestore.admin.v1.RestoreDatabaseRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RestoreDatabaseRequest> PARSER =
      new com.google.protobuf.AbstractParser<RestoreDatabaseRequest>() {
        @java.lang.Override
        public RestoreDatabaseRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.firestore.admin.v1.RestoreDatabaseRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
