// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/firestore/v1beta1/common.proto

package com.google.firestore.v1beta1;

/**
 *
 *
 * <pre>
 * Options for creating a new transaction.
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1beta1.TransactionOptions}
 */
public final class TransactionOptions extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.TransactionOptions)
    TransactionOptionsOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TransactionOptions.newBuilder() to construct.
  private TransactionOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private TransactionOptions() {}

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

  private TransactionOptions(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 18:
            {
              com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder subBuilder = null;
              if (modeCase_ == 2) {
                subBuilder =
                    ((com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_).toBuilder();
              }
              mode_ =
                  input.readMessage(
                      com.google.firestore.v1beta1.TransactionOptions.ReadOnly.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(
                    (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_);
                mode_ = subBuilder.buildPartial();
              }
              modeCase_ = 2;
              break;
            }
          case 26:
            {
              com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder subBuilder = null;
              if (modeCase_ == 3) {
                subBuilder =
                    ((com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_).toBuilder();
              }
              mode_ =
                  input.readMessage(
                      com.google.firestore.v1beta1.TransactionOptions.ReadWrite.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(
                    (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_);
                mode_ = subBuilder.buildPartial();
              }
              modeCase_ = 3;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.firestore.v1beta1.CommonProto
        .internal_static_google_firestore_v1beta1_TransactionOptions_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.firestore.v1beta1.CommonProto
        .internal_static_google_firestore_v1beta1_TransactionOptions_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.firestore.v1beta1.TransactionOptions.class,
            com.google.firestore.v1beta1.TransactionOptions.Builder.class);
  }

  public interface ReadWriteOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.firestore.v1beta1.TransactionOptions.ReadWrite)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * An optional transaction to retry.
     * </pre>
     *
     * <code>bytes retry_transaction = 1;</code>
     */
    com.google.protobuf.ByteString getRetryTransaction();
  }
  /**
   *
   *
   * <pre>
   * Options for a transaction that can be used to read and write documents.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.TransactionOptions.ReadWrite}
   */
  public static final class ReadWrite extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.TransactionOptions.ReadWrite)
      ReadWriteOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ReadWrite.newBuilder() to construct.
    private ReadWrite(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ReadWrite() {
      retryTransaction_ = com.google.protobuf.ByteString.EMPTY;
    }

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

    private ReadWrite(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                retryTransaction_ = input.readBytes();
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_ReadWrite_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_ReadWrite_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.TransactionOptions.ReadWrite.class,
              com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder.class);
    }

    public static final int RETRY_TRANSACTION_FIELD_NUMBER = 1;
    private com.google.protobuf.ByteString retryTransaction_;
    /**
     *
     *
     * <pre>
     * An optional transaction to retry.
     * </pre>
     *
     * <code>bytes retry_transaction = 1;</code>
     */
    public com.google.protobuf.ByteString getRetryTransaction() {
      return retryTransaction_;
    }

    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 (!retryTransaction_.isEmpty()) {
        output.writeBytes(1, retryTransaction_);
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      if (!retryTransaction_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, retryTransaction_);
      }
      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.firestore.v1beta1.TransactionOptions.ReadWrite)) {
        return super.equals(obj);
      }
      com.google.firestore.v1beta1.TransactionOptions.ReadWrite other =
          (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) obj;

      if (!getRetryTransaction().equals(other.getRetryTransaction())) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + RETRY_TRANSACTION_FIELD_NUMBER;
      hash = (53 * hash) + getRetryTransaction().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadWrite parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadWrite 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.v1beta1.TransactionOptions.ReadWrite parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

    public static com.google.firestore.v1beta1.TransactionOptions.ReadWrite parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

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

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

    public static com.google.firestore.v1beta1.TransactionOptions.ReadWrite parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.firestore.v1beta1.TransactionOptions.ReadWrite prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Options for a transaction that can be used to read and write documents.
     * </pre>
     *
     * Protobuf type {@code google.firestore.v1beta1.TransactionOptions.ReadWrite}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.TransactionOptions.ReadWrite)
        com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadWrite_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadWrite_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.firestore.v1beta1.TransactionOptions.ReadWrite.class,
                com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder.class);
      }

      // Construct using com.google.firestore.v1beta1.TransactionOptions.ReadWrite.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

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

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        retryTransaction_ = com.google.protobuf.ByteString.EMPTY;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadWrite_descriptor;
      }

      @java.lang.Override
      public com.google.firestore.v1beta1.TransactionOptions.ReadWrite getDefaultInstanceForType() {
        return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
      }

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

      @java.lang.Override
      public com.google.firestore.v1beta1.TransactionOptions.ReadWrite buildPartial() {
        com.google.firestore.v1beta1.TransactionOptions.ReadWrite result =
            new com.google.firestore.v1beta1.TransactionOptions.ReadWrite(this);
        result.retryTransaction_ = retryTransaction_;
        onBuilt();
        return result;
      }

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

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

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

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

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

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

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

      public Builder mergeFrom(com.google.firestore.v1beta1.TransactionOptions.ReadWrite other) {
        if (other == com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance())
          return this;
        if (other.getRetryTransaction() != com.google.protobuf.ByteString.EMPTY) {
          setRetryTransaction(other.getRetryTransaction());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

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

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

      private com.google.protobuf.ByteString retryTransaction_ =
          com.google.protobuf.ByteString.EMPTY;
      /**
       *
       *
       * <pre>
       * An optional transaction to retry.
       * </pre>
       *
       * <code>bytes retry_transaction = 1;</code>
       */
      public com.google.protobuf.ByteString getRetryTransaction() {
        return retryTransaction_;
      }
      /**
       *
       *
       * <pre>
       * An optional transaction to retry.
       * </pre>
       *
       * <code>bytes retry_transaction = 1;</code>
       */
      public Builder setRetryTransaction(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }

        retryTransaction_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * An optional transaction to retry.
       * </pre>
       *
       * <code>bytes retry_transaction = 1;</code>
       */
      public Builder clearRetryTransaction() {

        retryTransaction_ = getDefaultInstance().getRetryTransaction();
        onChanged();
        return this;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

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

      // @@protoc_insertion_point(builder_scope:google.firestore.v1beta1.TransactionOptions.ReadWrite)
    }

    // @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions.ReadWrite)
    private static final com.google.firestore.v1beta1.TransactionOptions.ReadWrite DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.firestore.v1beta1.TransactionOptions.ReadWrite();
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadWrite getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.firestore.v1beta1.TransactionOptions.ReadWrite getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface ReadOnlyOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.firestore.v1beta1.TransactionOptions.ReadOnly)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    boolean hasReadTime();
    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    com.google.protobuf.Timestamp getReadTime();
    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder();

    public com.google.firestore.v1beta1.TransactionOptions.ReadOnly.ConsistencySelectorCase
        getConsistencySelectorCase();
  }
  /**
   *
   *
   * <pre>
   * Options for a transaction that can only be used to read documents.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.TransactionOptions.ReadOnly}
   */
  public static final class ReadOnly extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.TransactionOptions.ReadOnly)
      ReadOnlyOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ReadOnly.newBuilder() to construct.
    private ReadOnly(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ReadOnly() {}

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

    private ReadOnly(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 18:
              {
                com.google.protobuf.Timestamp.Builder subBuilder = null;
                if (consistencySelectorCase_ == 2) {
                  subBuilder = ((com.google.protobuf.Timestamp) consistencySelector_).toBuilder();
                }
                consistencySelector_ =
                    input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom((com.google.protobuf.Timestamp) consistencySelector_);
                  consistencySelector_ = subBuilder.buildPartial();
                }
                consistencySelectorCase_ = 2;
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_ReadOnly_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_ReadOnly_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.TransactionOptions.ReadOnly.class,
              com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder.class);
    }

    private int consistencySelectorCase_ = 0;
    private java.lang.Object consistencySelector_;

    public enum ConsistencySelectorCase implements com.google.protobuf.Internal.EnumLite {
      READ_TIME(2),
      CONSISTENCYSELECTOR_NOT_SET(0);
      private final int value;

      private ConsistencySelectorCase(int value) {
        this.value = value;
      }
      /** @deprecated Use {@link #forNumber(int)} instead. */
      @java.lang.Deprecated
      public static ConsistencySelectorCase valueOf(int value) {
        return forNumber(value);
      }

      public static ConsistencySelectorCase forNumber(int value) {
        switch (value) {
          case 2:
            return READ_TIME;
          case 0:
            return CONSISTENCYSELECTOR_NOT_SET;
          default:
            return null;
        }
      }

      public int getNumber() {
        return this.value;
      }
    };

    public ConsistencySelectorCase getConsistencySelectorCase() {
      return ConsistencySelectorCase.forNumber(consistencySelectorCase_);
    }

    public static final int READ_TIME_FIELD_NUMBER = 2;
    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    public boolean hasReadTime() {
      return consistencySelectorCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    public com.google.protobuf.Timestamp getReadTime() {
      if (consistencySelectorCase_ == 2) {
        return (com.google.protobuf.Timestamp) consistencySelector_;
      }
      return com.google.protobuf.Timestamp.getDefaultInstance();
    }
    /**
     *
     *
     * <pre>
     * Reads documents at the given time.
     * This may not be older than 60 seconds.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 2;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
      if (consistencySelectorCase_ == 2) {
        return (com.google.protobuf.Timestamp) consistencySelector_;
      }
      return com.google.protobuf.Timestamp.getDefaultInstance();
    }

    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 (consistencySelectorCase_ == 2) {
        output.writeMessage(2, (com.google.protobuf.Timestamp) consistencySelector_);
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      if (consistencySelectorCase_ == 2) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                2, (com.google.protobuf.Timestamp) consistencySelector_);
      }
      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.firestore.v1beta1.TransactionOptions.ReadOnly)) {
        return super.equals(obj);
      }
      com.google.firestore.v1beta1.TransactionOptions.ReadOnly other =
          (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) obj;

      if (!getConsistencySelectorCase().equals(other.getConsistencySelectorCase())) return false;
      switch (consistencySelectorCase_) {
        case 2:
          if (!getReadTime().equals(other.getReadTime())) return false;
          break;
        case 0:
        default:
      }
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      switch (consistencySelectorCase_) {
        case 2:
          hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
          hash = (53 * hash) + getReadTime().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadOnly parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadOnly 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.v1beta1.TransactionOptions.ReadOnly parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

    public static com.google.firestore.v1beta1.TransactionOptions.ReadOnly parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

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

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

    public static com.google.firestore.v1beta1.TransactionOptions.ReadOnly parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.firestore.v1beta1.TransactionOptions.ReadOnly prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Options for a transaction that can only be used to read documents.
     * </pre>
     *
     * Protobuf type {@code google.firestore.v1beta1.TransactionOptions.ReadOnly}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.TransactionOptions.ReadOnly)
        com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadOnly_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadOnly_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.firestore.v1beta1.TransactionOptions.ReadOnly.class,
                com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder.class);
      }

      // Construct using com.google.firestore.v1beta1.TransactionOptions.ReadOnly.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

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

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        consistencySelectorCase_ = 0;
        consistencySelector_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.firestore.v1beta1.CommonProto
            .internal_static_google_firestore_v1beta1_TransactionOptions_ReadOnly_descriptor;
      }

      @java.lang.Override
      public com.google.firestore.v1beta1.TransactionOptions.ReadOnly getDefaultInstanceForType() {
        return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
      }

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

      @java.lang.Override
      public com.google.firestore.v1beta1.TransactionOptions.ReadOnly buildPartial() {
        com.google.firestore.v1beta1.TransactionOptions.ReadOnly result =
            new com.google.firestore.v1beta1.TransactionOptions.ReadOnly(this);
        if (consistencySelectorCase_ == 2) {
          if (readTimeBuilder_ == null) {
            result.consistencySelector_ = consistencySelector_;
          } else {
            result.consistencySelector_ = readTimeBuilder_.build();
          }
        }
        result.consistencySelectorCase_ = consistencySelectorCase_;
        onBuilt();
        return result;
      }

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

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

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

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

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

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

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

      public Builder mergeFrom(com.google.firestore.v1beta1.TransactionOptions.ReadOnly other) {
        if (other == com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance())
          return this;
        switch (other.getConsistencySelectorCase()) {
          case READ_TIME:
            {
              mergeReadTime(other.getReadTime());
              break;
            }
          case CONSISTENCYSELECTOR_NOT_SET:
            {
              break;
            }
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

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

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

      private int consistencySelectorCase_ = 0;
      private java.lang.Object consistencySelector_;

      public ConsistencySelectorCase getConsistencySelectorCase() {
        return ConsistencySelectorCase.forNumber(consistencySelectorCase_);
      }

      public Builder clearConsistencySelector() {
        consistencySelectorCase_ = 0;
        consistencySelector_ = null;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          readTimeBuilder_;
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public boolean hasReadTime() {
        return consistencySelectorCase_ == 2;
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public com.google.protobuf.Timestamp getReadTime() {
        if (readTimeBuilder_ == null) {
          if (consistencySelectorCase_ == 2) {
            return (com.google.protobuf.Timestamp) consistencySelector_;
          }
          return com.google.protobuf.Timestamp.getDefaultInstance();
        } else {
          if (consistencySelectorCase_ == 2) {
            return readTimeBuilder_.getMessage();
          }
          return com.google.protobuf.Timestamp.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public Builder setReadTime(com.google.protobuf.Timestamp value) {
        if (readTimeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          consistencySelector_ = value;
          onChanged();
        } else {
          readTimeBuilder_.setMessage(value);
        }
        consistencySelectorCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) {
        if (readTimeBuilder_ == null) {
          consistencySelector_ = builderForValue.build();
          onChanged();
        } else {
          readTimeBuilder_.setMessage(builderForValue.build());
        }
        consistencySelectorCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
        if (readTimeBuilder_ == null) {
          if (consistencySelectorCase_ == 2
              && consistencySelector_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
            consistencySelector_ =
                com.google.protobuf.Timestamp.newBuilder(
                        (com.google.protobuf.Timestamp) consistencySelector_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            consistencySelector_ = value;
          }
          onChanged();
        } else {
          if (consistencySelectorCase_ == 2) {
            readTimeBuilder_.mergeFrom(value);
          }
          readTimeBuilder_.setMessage(value);
        }
        consistencySelectorCase_ = 2;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public Builder clearReadTime() {
        if (readTimeBuilder_ == null) {
          if (consistencySelectorCase_ == 2) {
            consistencySelectorCase_ = 0;
            consistencySelector_ = null;
            onChanged();
          }
        } else {
          if (consistencySelectorCase_ == 2) {
            consistencySelectorCase_ = 0;
            consistencySelector_ = null;
          }
          readTimeBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
        return getReadTimeFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
        if ((consistencySelectorCase_ == 2) && (readTimeBuilder_ != null)) {
          return readTimeBuilder_.getMessageOrBuilder();
        } else {
          if (consistencySelectorCase_ == 2) {
            return (com.google.protobuf.Timestamp) consistencySelector_;
          }
          return com.google.protobuf.Timestamp.getDefaultInstance();
        }
      }
      /**
       *
       *
       * <pre>
       * Reads documents at the given time.
       * This may not be older than 60 seconds.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp read_time = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          getReadTimeFieldBuilder() {
        if (readTimeBuilder_ == null) {
          if (!(consistencySelectorCase_ == 2)) {
            consistencySelector_ = com.google.protobuf.Timestamp.getDefaultInstance();
          }
          readTimeBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.protobuf.Timestamp,
                  com.google.protobuf.Timestamp.Builder,
                  com.google.protobuf.TimestampOrBuilder>(
                  (com.google.protobuf.Timestamp) consistencySelector_,
                  getParentForChildren(),
                  isClean());
          consistencySelector_ = null;
        }
        consistencySelectorCase_ = 2;
        onChanged();
        ;
        return readTimeBuilder_;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

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

      // @@protoc_insertion_point(builder_scope:google.firestore.v1beta1.TransactionOptions.ReadOnly)
    }

    // @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions.ReadOnly)
    private static final com.google.firestore.v1beta1.TransactionOptions.ReadOnly DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.firestore.v1beta1.TransactionOptions.ReadOnly();
    }

    public static com.google.firestore.v1beta1.TransactionOptions.ReadOnly getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    @java.lang.Override
    public com.google.firestore.v1beta1.TransactionOptions.ReadOnly getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int modeCase_ = 0;
  private java.lang.Object mode_;

  public enum ModeCase implements com.google.protobuf.Internal.EnumLite {
    READ_ONLY(2),
    READ_WRITE(3),
    MODE_NOT_SET(0);
    private final int value;

    private ModeCase(int value) {
      this.value = value;
    }
    /** @deprecated Use {@link #forNumber(int)} instead. */
    @java.lang.Deprecated
    public static ModeCase valueOf(int value) {
      return forNumber(value);
    }

    public static ModeCase forNumber(int value) {
      switch (value) {
        case 2:
          return READ_ONLY;
        case 3:
          return READ_WRITE;
        case 0:
          return MODE_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public ModeCase getModeCase() {
    return ModeCase.forNumber(modeCase_);
  }

  public static final int READ_ONLY_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * The transaction can only be used for read operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
   */
  public boolean hasReadOnly() {
    return modeCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * The transaction can only be used for read operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
   */
  public com.google.firestore.v1beta1.TransactionOptions.ReadOnly getReadOnly() {
    if (modeCase_ == 2) {
      return (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_;
    }
    return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The transaction can only be used for read operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
   */
  public com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder() {
    if (modeCase_ == 2) {
      return (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_;
    }
    return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
  }

  public static final int READ_WRITE_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * The transaction can be used for both read and write operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
   */
  public boolean hasReadWrite() {
    return modeCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * The transaction can be used for both read and write operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
   */
  public com.google.firestore.v1beta1.TransactionOptions.ReadWrite getReadWrite() {
    if (modeCase_ == 3) {
      return (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_;
    }
    return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * The transaction can be used for both read and write operations.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
   */
  public com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder
      getReadWriteOrBuilder() {
    if (modeCase_ == 3) {
      return (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_;
    }
    return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
  }

  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 (modeCase_ == 2) {
      output.writeMessage(2, (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_);
    }
    if (modeCase_ == 3) {
      output.writeMessage(3, (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (modeCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2, (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_);
    }
    if (modeCase_ == 3) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_);
    }
    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.firestore.v1beta1.TransactionOptions)) {
      return super.equals(obj);
    }
    com.google.firestore.v1beta1.TransactionOptions other =
        (com.google.firestore.v1beta1.TransactionOptions) obj;

    if (!getModeCase().equals(other.getModeCase())) return false;
    switch (modeCase_) {
      case 2:
        if (!getReadOnly().equals(other.getReadOnly())) return false;
        break;
      case 3:
        if (!getReadWrite().equals(other.getReadWrite())) return false;
        break;
      case 0:
      default:
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (modeCase_) {
      case 2:
        hash = (37 * hash) + READ_ONLY_FIELD_NUMBER;
        hash = (53 * hash) + getReadOnly().hashCode();
        break;
      case 3:
        hash = (37 * hash) + READ_WRITE_FIELD_NUMBER;
        hash = (53 * hash) + getReadWrite().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

  public static com.google.firestore.v1beta1.TransactionOptions parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.firestore.v1beta1.TransactionOptions parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.firestore.v1beta1.TransactionOptions prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Options for creating a new transaction.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.TransactionOptions}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.TransactionOptions)
      com.google.firestore.v1beta1.TransactionOptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.TransactionOptions.class,
              com.google.firestore.v1beta1.TransactionOptions.Builder.class);
    }

    // Construct using com.google.firestore.v1beta1.TransactionOptions.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      modeCase_ = 0;
      mode_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.firestore.v1beta1.CommonProto
          .internal_static_google_firestore_v1beta1_TransactionOptions_descriptor;
    }

    @java.lang.Override
    public com.google.firestore.v1beta1.TransactionOptions getDefaultInstanceForType() {
      return com.google.firestore.v1beta1.TransactionOptions.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.firestore.v1beta1.TransactionOptions buildPartial() {
      com.google.firestore.v1beta1.TransactionOptions result =
          new com.google.firestore.v1beta1.TransactionOptions(this);
      if (modeCase_ == 2) {
        if (readOnlyBuilder_ == null) {
          result.mode_ = mode_;
        } else {
          result.mode_ = readOnlyBuilder_.build();
        }
      }
      if (modeCase_ == 3) {
        if (readWriteBuilder_ == null) {
          result.mode_ = mode_;
        } else {
          result.mode_ = readWriteBuilder_.build();
        }
      }
      result.modeCase_ = modeCase_;
      onBuilt();
      return result;
    }

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

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

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

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

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

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

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

    public Builder mergeFrom(com.google.firestore.v1beta1.TransactionOptions other) {
      if (other == com.google.firestore.v1beta1.TransactionOptions.getDefaultInstance())
        return this;
      switch (other.getModeCase()) {
        case READ_ONLY:
          {
            mergeReadOnly(other.getReadOnly());
            break;
          }
        case READ_WRITE:
          {
            mergeReadWrite(other.getReadWrite());
            break;
          }
        case MODE_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

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

    private int modeCase_ = 0;
    private java.lang.Object mode_;

    public ModeCase getModeCase() {
      return ModeCase.forNumber(modeCase_);
    }

    public Builder clearMode() {
      modeCase_ = 0;
      mode_ = null;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.firestore.v1beta1.TransactionOptions.ReadOnly,
            com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder,
            com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder>
        readOnlyBuilder_;
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public boolean hasReadOnly() {
      return modeCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadOnly getReadOnly() {
      if (readOnlyBuilder_ == null) {
        if (modeCase_ == 2) {
          return (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_;
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
      } else {
        if (modeCase_ == 2) {
          return readOnlyBuilder_.getMessage();
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public Builder setReadOnly(com.google.firestore.v1beta1.TransactionOptions.ReadOnly value) {
      if (readOnlyBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        mode_ = value;
        onChanged();
      } else {
        readOnlyBuilder_.setMessage(value);
      }
      modeCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public Builder setReadOnly(
        com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder builderForValue) {
      if (readOnlyBuilder_ == null) {
        mode_ = builderForValue.build();
        onChanged();
      } else {
        readOnlyBuilder_.setMessage(builderForValue.build());
      }
      modeCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public Builder mergeReadOnly(com.google.firestore.v1beta1.TransactionOptions.ReadOnly value) {
      if (readOnlyBuilder_ == null) {
        if (modeCase_ == 2
            && mode_
                != com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance()) {
          mode_ =
              com.google.firestore.v1beta1.TransactionOptions.ReadOnly.newBuilder(
                      (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          mode_ = value;
        }
        onChanged();
      } else {
        if (modeCase_ == 2) {
          readOnlyBuilder_.mergeFrom(value);
        }
        readOnlyBuilder_.setMessage(value);
      }
      modeCase_ = 2;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public Builder clearReadOnly() {
      if (readOnlyBuilder_ == null) {
        if (modeCase_ == 2) {
          modeCase_ = 0;
          mode_ = null;
          onChanged();
        }
      } else {
        if (modeCase_ == 2) {
          modeCase_ = 0;
          mode_ = null;
        }
        readOnlyBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder getReadOnlyBuilder() {
      return getReadOnlyFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder
        getReadOnlyOrBuilder() {
      if ((modeCase_ == 2) && (readOnlyBuilder_ != null)) {
        return readOnlyBuilder_.getMessageOrBuilder();
      } else {
        if (modeCase_ == 2) {
          return (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_;
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction can only be used for read operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadOnly read_only = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.firestore.v1beta1.TransactionOptions.ReadOnly,
            com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder,
            com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder>
        getReadOnlyFieldBuilder() {
      if (readOnlyBuilder_ == null) {
        if (!(modeCase_ == 2)) {
          mode_ = com.google.firestore.v1beta1.TransactionOptions.ReadOnly.getDefaultInstance();
        }
        readOnlyBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.firestore.v1beta1.TransactionOptions.ReadOnly,
                com.google.firestore.v1beta1.TransactionOptions.ReadOnly.Builder,
                com.google.firestore.v1beta1.TransactionOptions.ReadOnlyOrBuilder>(
                (com.google.firestore.v1beta1.TransactionOptions.ReadOnly) mode_,
                getParentForChildren(),
                isClean());
        mode_ = null;
      }
      modeCase_ = 2;
      onChanged();
      ;
      return readOnlyBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.firestore.v1beta1.TransactionOptions.ReadWrite,
            com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder,
            com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder>
        readWriteBuilder_;
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public boolean hasReadWrite() {
      return modeCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadWrite getReadWrite() {
      if (readWriteBuilder_ == null) {
        if (modeCase_ == 3) {
          return (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_;
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
      } else {
        if (modeCase_ == 3) {
          return readWriteBuilder_.getMessage();
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public Builder setReadWrite(com.google.firestore.v1beta1.TransactionOptions.ReadWrite value) {
      if (readWriteBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        mode_ = value;
        onChanged();
      } else {
        readWriteBuilder_.setMessage(value);
      }
      modeCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public Builder setReadWrite(
        com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder builderForValue) {
      if (readWriteBuilder_ == null) {
        mode_ = builderForValue.build();
        onChanged();
      } else {
        readWriteBuilder_.setMessage(builderForValue.build());
      }
      modeCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public Builder mergeReadWrite(com.google.firestore.v1beta1.TransactionOptions.ReadWrite value) {
      if (readWriteBuilder_ == null) {
        if (modeCase_ == 3
            && mode_
                != com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance()) {
          mode_ =
              com.google.firestore.v1beta1.TransactionOptions.ReadWrite.newBuilder(
                      (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          mode_ = value;
        }
        onChanged();
      } else {
        if (modeCase_ == 3) {
          readWriteBuilder_.mergeFrom(value);
        }
        readWriteBuilder_.setMessage(value);
      }
      modeCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public Builder clearReadWrite() {
      if (readWriteBuilder_ == null) {
        if (modeCase_ == 3) {
          modeCase_ = 0;
          mode_ = null;
          onChanged();
        }
      } else {
        if (modeCase_ == 3) {
          modeCase_ = 0;
          mode_ = null;
        }
        readWriteBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder getReadWriteBuilder() {
      return getReadWriteFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    public com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder
        getReadWriteOrBuilder() {
      if ((modeCase_ == 3) && (readWriteBuilder_ != null)) {
        return readWriteBuilder_.getMessageOrBuilder();
      } else {
        if (modeCase_ == 3) {
          return (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_;
        }
        return com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * The transaction can be used for both read and write operations.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TransactionOptions.ReadWrite read_write = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.firestore.v1beta1.TransactionOptions.ReadWrite,
            com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder,
            com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder>
        getReadWriteFieldBuilder() {
      if (readWriteBuilder_ == null) {
        if (!(modeCase_ == 3)) {
          mode_ = com.google.firestore.v1beta1.TransactionOptions.ReadWrite.getDefaultInstance();
        }
        readWriteBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.firestore.v1beta1.TransactionOptions.ReadWrite,
                com.google.firestore.v1beta1.TransactionOptions.ReadWrite.Builder,
                com.google.firestore.v1beta1.TransactionOptions.ReadWriteOrBuilder>(
                (com.google.firestore.v1beta1.TransactionOptions.ReadWrite) mode_,
                getParentForChildren(),
                isClean());
        mode_ = null;
      }
      modeCase_ = 3;
      onChanged();
      ;
      return readWriteBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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

    // @@protoc_insertion_point(builder_scope:google.firestore.v1beta1.TransactionOptions)
  }

  // @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions)
  private static final com.google.firestore.v1beta1.TransactionOptions DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.firestore.v1beta1.TransactionOptions();
  }

  public static com.google.firestore.v1beta1.TransactionOptions getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.firestore.v1beta1.TransactionOptions getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
