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

package com.google.firestore.v1beta1;

/**
 * <pre>
 * Targets being watched have changed.
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1beta1.TargetChange}
 */
public  final class TargetChange extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.TargetChange)
    TargetChangeOrBuilder {
private static final long serialVersionUID = 0L;
  // Use TargetChange.newBuilder() to construct.
  private TargetChange(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private TargetChange() {
    targetChangeType_ = 0;
    targetIds_ = java.util.Collections.emptyList();
    resumeToken_ = com.google.protobuf.ByteString.EMPTY;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private TargetChange(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 8: {
            int rawValue = input.readEnum();

            targetChangeType_ = rawValue;
            break;
          }
          case 16: {
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
              targetIds_ = new java.util.ArrayList<java.lang.Integer>();
              mutable_bitField0_ |= 0x00000002;
            }
            targetIds_.add(input.readInt32());
            break;
          }
          case 18: {
            int length = input.readRawVarint32();
            int limit = input.pushLimit(length);
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
              targetIds_ = new java.util.ArrayList<java.lang.Integer>();
              mutable_bitField0_ |= 0x00000002;
            }
            while (input.getBytesUntilLimit() > 0) {
              targetIds_.add(input.readInt32());
            }
            input.popLimit(limit);
            break;
          }
          case 26: {
            com.google.rpc.Status.Builder subBuilder = null;
            if (cause_ != null) {
              subBuilder = cause_.toBuilder();
            }
            cause_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(cause_);
              cause_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {

            resumeToken_ = input.readBytes();
            break;
          }
          case 50: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (readTime_ != null) {
              subBuilder = readTime_.toBuilder();
            }
            readTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(readTime_);
              readTime_ = subBuilder.buildPartial();
            }

            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
        targetIds_ = java.util.Collections.unmodifiableList(targetIds_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_TargetChange_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_TargetChange_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.firestore.v1beta1.TargetChange.class, com.google.firestore.v1beta1.TargetChange.Builder.class);
  }

  /**
   * <pre>
   * The type of change.
   * </pre>
   *
   * Protobuf enum {@code google.firestore.v1beta1.TargetChange.TargetChangeType}
   */
  public enum TargetChangeType
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * No change has occurred. Used only to send an updated `resume_token`.
     * </pre>
     *
     * <code>NO_CHANGE = 0;</code>
     */
    NO_CHANGE(0),
    /**
     * <pre>
     * The targets have been added.
     * </pre>
     *
     * <code>ADD = 1;</code>
     */
    ADD(1),
    /**
     * <pre>
     * The targets have been removed.
     * </pre>
     *
     * <code>REMOVE = 2;</code>
     */
    REMOVE(2),
    /**
     * <pre>
     * The targets reflect all changes committed before the targets were added
     * to the stream.
     * This will be sent after or with a `read_time` that is greater than or
     * equal to the time at which the targets were added.
     * Listeners can wait for this change if read-after-write semantics
     * are desired.
     * </pre>
     *
     * <code>CURRENT = 3;</code>
     */
    CURRENT(3),
    /**
     * <pre>
     * The targets have been reset, and a new initial state for the targets
     * will be returned in subsequent changes.
     * After the initial state is complete, `CURRENT` will be returned even
     * if the target was previously indicated to be `CURRENT`.
     * </pre>
     *
     * <code>RESET = 4;</code>
     */
    RESET(4),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * No change has occurred. Used only to send an updated `resume_token`.
     * </pre>
     *
     * <code>NO_CHANGE = 0;</code>
     */
    public static final int NO_CHANGE_VALUE = 0;
    /**
     * <pre>
     * The targets have been added.
     * </pre>
     *
     * <code>ADD = 1;</code>
     */
    public static final int ADD_VALUE = 1;
    /**
     * <pre>
     * The targets have been removed.
     * </pre>
     *
     * <code>REMOVE = 2;</code>
     */
    public static final int REMOVE_VALUE = 2;
    /**
     * <pre>
     * The targets reflect all changes committed before the targets were added
     * to the stream.
     * This will be sent after or with a `read_time` that is greater than or
     * equal to the time at which the targets were added.
     * Listeners can wait for this change if read-after-write semantics
     * are desired.
     * </pre>
     *
     * <code>CURRENT = 3;</code>
     */
    public static final int CURRENT_VALUE = 3;
    /**
     * <pre>
     * The targets have been reset, and a new initial state for the targets
     * will be returned in subsequent changes.
     * After the initial state is complete, `CURRENT` will be returned even
     * if the target was previously indicated to be `CURRENT`.
     * </pre>
     *
     * <code>RESET = 4;</code>
     */
    public static final int RESET_VALUE = 4;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

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

    public static TargetChangeType forNumber(int value) {
      switch (value) {
        case 0: return NO_CHANGE;
        case 1: return ADD;
        case 2: return REMOVE;
        case 3: return CURRENT;
        case 4: return RESET;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<TargetChangeType>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        TargetChangeType> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<TargetChangeType>() {
            public TargetChangeType findValueByNumber(int number) {
              return TargetChangeType.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.google.firestore.v1beta1.TargetChange.getDescriptor().getEnumTypes().get(0);
    }

    private static final TargetChangeType[] VALUES = values();

    public static TargetChangeType valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private TargetChangeType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.firestore.v1beta1.TargetChange.TargetChangeType)
  }

  private int bitField0_;
  public static final int TARGET_CHANGE_TYPE_FIELD_NUMBER = 1;
  private int targetChangeType_;
  /**
   * <pre>
   * The type of change that occurred.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
   */
  public int getTargetChangeTypeValue() {
    return targetChangeType_;
  }
  /**
   * <pre>
   * The type of change that occurred.
   * </pre>
   *
   * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
   */
  public com.google.firestore.v1beta1.TargetChange.TargetChangeType getTargetChangeType() {
    com.google.firestore.v1beta1.TargetChange.TargetChangeType result = com.google.firestore.v1beta1.TargetChange.TargetChangeType.valueOf(targetChangeType_);
    return result == null ? com.google.firestore.v1beta1.TargetChange.TargetChangeType.UNRECOGNIZED : result;
  }

  public static final int TARGET_IDS_FIELD_NUMBER = 2;
  private java.util.List<java.lang.Integer> targetIds_;
  /**
   * <pre>
   * The target IDs of targets that have changed.
   * If empty, the change applies to all targets.
   * For `target_change_type=ADD`, the order of the target IDs matches the order
   * of the requests to add the targets. This allows clients to unambiguously
   * associate server-assigned target IDs with added targets.
   * For other states, the order of the target IDs is not defined.
   * </pre>
   *
   * <code>repeated int32 target_ids = 2;</code>
   */
  public java.util.List<java.lang.Integer>
      getTargetIdsList() {
    return targetIds_;
  }
  /**
   * <pre>
   * The target IDs of targets that have changed.
   * If empty, the change applies to all targets.
   * For `target_change_type=ADD`, the order of the target IDs matches the order
   * of the requests to add the targets. This allows clients to unambiguously
   * associate server-assigned target IDs with added targets.
   * For other states, the order of the target IDs is not defined.
   * </pre>
   *
   * <code>repeated int32 target_ids = 2;</code>
   */
  public int getTargetIdsCount() {
    return targetIds_.size();
  }
  /**
   * <pre>
   * The target IDs of targets that have changed.
   * If empty, the change applies to all targets.
   * For `target_change_type=ADD`, the order of the target IDs matches the order
   * of the requests to add the targets. This allows clients to unambiguously
   * associate server-assigned target IDs with added targets.
   * For other states, the order of the target IDs is not defined.
   * </pre>
   *
   * <code>repeated int32 target_ids = 2;</code>
   */
  public int getTargetIds(int index) {
    return targetIds_.get(index);
  }
  private int targetIdsMemoizedSerializedSize = -1;

  public static final int CAUSE_FIELD_NUMBER = 3;
  private com.google.rpc.Status cause_;
  /**
   * <pre>
   * The error that resulted in this change, if applicable.
   * </pre>
   *
   * <code>.google.rpc.Status cause = 3;</code>
   */
  public boolean hasCause() {
    return cause_ != null;
  }
  /**
   * <pre>
   * The error that resulted in this change, if applicable.
   * </pre>
   *
   * <code>.google.rpc.Status cause = 3;</code>
   */
  public com.google.rpc.Status getCause() {
    return cause_ == null ? com.google.rpc.Status.getDefaultInstance() : cause_;
  }
  /**
   * <pre>
   * The error that resulted in this change, if applicable.
   * </pre>
   *
   * <code>.google.rpc.Status cause = 3;</code>
   */
  public com.google.rpc.StatusOrBuilder getCauseOrBuilder() {
    return getCause();
  }

  public static final int RESUME_TOKEN_FIELD_NUMBER = 4;
  private com.google.protobuf.ByteString resumeToken_;
  /**
   * <pre>
   * A token that can be used to resume the stream for the given `target_ids`,
   * or all targets if `target_ids` is empty.
   * Not set on every target change.
   * </pre>
   *
   * <code>bytes resume_token = 4;</code>
   */
  public com.google.protobuf.ByteString getResumeToken() {
    return resumeToken_;
  }

  public static final int READ_TIME_FIELD_NUMBER = 6;
  private com.google.protobuf.Timestamp readTime_;
  /**
   * <pre>
   * The consistent `read_time` for the given `target_ids` (omitted when the
   * target_ids are not at a consistent snapshot).
   * The stream is guaranteed to send a `read_time` with `target_ids` empty
   * whenever the entire stream reaches a new consistent snapshot. ADD,
   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
   * For a given stream, `read_time` is guaranteed to be monotonically
   * increasing.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 6;</code>
   */
  public boolean hasReadTime() {
    return readTime_ != null;
  }
  /**
   * <pre>
   * The consistent `read_time` for the given `target_ids` (omitted when the
   * target_ids are not at a consistent snapshot).
   * The stream is guaranteed to send a `read_time` with `target_ids` empty
   * whenever the entire stream reaches a new consistent snapshot. ADD,
   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
   * For a given stream, `read_time` is guaranteed to be monotonically
   * increasing.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 6;</code>
   */
  public com.google.protobuf.Timestamp getReadTime() {
    return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
  }
  /**
   * <pre>
   * The consistent `read_time` for the given `target_ids` (omitted when the
   * target_ids are not at a consistent snapshot).
   * The stream is guaranteed to send a `read_time` with `target_ids` empty
   * whenever the entire stream reaches a new consistent snapshot. ADD,
   * CURRENT, and RESET messages are guaranteed to (eventually) result in a
   * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
   * For a given stream, `read_time` is guaranteed to be monotonically
   * increasing.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 6;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
    return getReadTime();
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (targetChangeType_ != com.google.firestore.v1beta1.TargetChange.TargetChangeType.NO_CHANGE.getNumber()) {
      output.writeEnum(1, targetChangeType_);
    }
    if (getTargetIdsList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(targetIdsMemoizedSerializedSize);
    }
    for (int i = 0; i < targetIds_.size(); i++) {
      output.writeInt32NoTag(targetIds_.get(i));
    }
    if (cause_ != null) {
      output.writeMessage(3, getCause());
    }
    if (!resumeToken_.isEmpty()) {
      output.writeBytes(4, resumeToken_);
    }
    if (readTime_ != null) {
      output.writeMessage(6, getReadTime());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (targetChangeType_ != com.google.firestore.v1beta1.TargetChange.TargetChangeType.NO_CHANGE.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(1, targetChangeType_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < targetIds_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream
          .computeInt32SizeNoTag(targetIds_.get(i));
      }
      size += dataSize;
      if (!getTargetIdsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(dataSize);
      }
      targetIdsMemoizedSerializedSize = dataSize;
    }
    if (cause_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getCause());
    }
    if (!resumeToken_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(4, resumeToken_);
    }
    if (readTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, getReadTime());
    }
    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.TargetChange)) {
      return super.equals(obj);
    }
    com.google.firestore.v1beta1.TargetChange other = (com.google.firestore.v1beta1.TargetChange) obj;

    boolean result = true;
    result = result && targetChangeType_ == other.targetChangeType_;
    result = result && getTargetIdsList()
        .equals(other.getTargetIdsList());
    result = result && (hasCause() == other.hasCause());
    if (hasCause()) {
      result = result && getCause()
          .equals(other.getCause());
    }
    result = result && getResumeToken()
        .equals(other.getResumeToken());
    result = result && (hasReadTime() == other.hasReadTime());
    if (hasReadTime()) {
      result = result && getReadTime()
          .equals(other.getReadTime());
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + TARGET_CHANGE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + targetChangeType_;
    if (getTargetIdsCount() > 0) {
      hash = (37 * hash) + TARGET_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getTargetIdsList().hashCode();
    }
    if (hasCause()) {
      hash = (37 * hash) + CAUSE_FIELD_NUMBER;
      hash = (53 * hash) + getCause().hashCode();
    }
    hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getResumeToken().hashCode();
    if (hasReadTime()) {
      hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getReadTime().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.firestore.v1beta1.TargetChange prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Targets being watched have changed.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.TargetChange}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.TargetChange)
      com.google.firestore.v1beta1.TargetChangeOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_TargetChange_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_TargetChange_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.TargetChange.class, com.google.firestore.v1beta1.TargetChange.Builder.class);
    }

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

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

      targetIds_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000002);
      if (causeBuilder_ == null) {
        cause_ = null;
      } else {
        cause_ = null;
        causeBuilder_ = null;
      }
      resumeToken_ = com.google.protobuf.ByteString.EMPTY;

      if (readTimeBuilder_ == null) {
        readTime_ = null;
      } else {
        readTime_ = null;
        readTimeBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_TargetChange_descriptor;
    }

    public com.google.firestore.v1beta1.TargetChange getDefaultInstanceForType() {
      return com.google.firestore.v1beta1.TargetChange.getDefaultInstance();
    }

    public com.google.firestore.v1beta1.TargetChange build() {
      com.google.firestore.v1beta1.TargetChange result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.firestore.v1beta1.TargetChange buildPartial() {
      com.google.firestore.v1beta1.TargetChange result = new com.google.firestore.v1beta1.TargetChange(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.targetChangeType_ = targetChangeType_;
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        targetIds_ = java.util.Collections.unmodifiableList(targetIds_);
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.targetIds_ = targetIds_;
      if (causeBuilder_ == null) {
        result.cause_ = cause_;
      } else {
        result.cause_ = causeBuilder_.build();
      }
      result.resumeToken_ = resumeToken_;
      if (readTimeBuilder_ == null) {
        result.readTime_ = readTime_;
      } else {
        result.readTime_ = readTimeBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.firestore.v1beta1.TargetChange other) {
      if (other == com.google.firestore.v1beta1.TargetChange.getDefaultInstance()) return this;
      if (other.targetChangeType_ != 0) {
        setTargetChangeTypeValue(other.getTargetChangeTypeValue());
      }
      if (!other.targetIds_.isEmpty()) {
        if (targetIds_.isEmpty()) {
          targetIds_ = other.targetIds_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureTargetIdsIsMutable();
          targetIds_.addAll(other.targetIds_);
        }
        onChanged();
      }
      if (other.hasCause()) {
        mergeCause(other.getCause());
      }
      if (other.getResumeToken() != com.google.protobuf.ByteString.EMPTY) {
        setResumeToken(other.getResumeToken());
      }
      if (other.hasReadTime()) {
        mergeReadTime(other.getReadTime());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private int targetChangeType_ = 0;
    /**
     * <pre>
     * The type of change that occurred.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
     */
    public int getTargetChangeTypeValue() {
      return targetChangeType_;
    }
    /**
     * <pre>
     * The type of change that occurred.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
     */
    public Builder setTargetChangeTypeValue(int value) {
      targetChangeType_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The type of change that occurred.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
     */
    public com.google.firestore.v1beta1.TargetChange.TargetChangeType getTargetChangeType() {
      com.google.firestore.v1beta1.TargetChange.TargetChangeType result = com.google.firestore.v1beta1.TargetChange.TargetChangeType.valueOf(targetChangeType_);
      return result == null ? com.google.firestore.v1beta1.TargetChange.TargetChangeType.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * The type of change that occurred.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
     */
    public Builder setTargetChangeType(com.google.firestore.v1beta1.TargetChange.TargetChangeType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      targetChangeType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The type of change that occurred.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.TargetChange.TargetChangeType target_change_type = 1;</code>
     */
    public Builder clearTargetChangeType() {
      
      targetChangeType_ = 0;
      onChanged();
      return this;
    }

    private java.util.List<java.lang.Integer> targetIds_ = java.util.Collections.emptyList();
    private void ensureTargetIdsIsMutable() {
      if (!((bitField0_ & 0x00000002) == 0x00000002)) {
        targetIds_ = new java.util.ArrayList<java.lang.Integer>(targetIds_);
        bitField0_ |= 0x00000002;
       }
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public java.util.List<java.lang.Integer>
        getTargetIdsList() {
      return java.util.Collections.unmodifiableList(targetIds_);
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public int getTargetIdsCount() {
      return targetIds_.size();
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public int getTargetIds(int index) {
      return targetIds_.get(index);
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public Builder setTargetIds(
        int index, int value) {
      ensureTargetIdsIsMutable();
      targetIds_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public Builder addTargetIds(int value) {
      ensureTargetIdsIsMutable();
      targetIds_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public Builder addAllTargetIds(
        java.lang.Iterable<? extends java.lang.Integer> values) {
      ensureTargetIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, targetIds_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The target IDs of targets that have changed.
     * If empty, the change applies to all targets.
     * For `target_change_type=ADD`, the order of the target IDs matches the order
     * of the requests to add the targets. This allows clients to unambiguously
     * associate server-assigned target IDs with added targets.
     * For other states, the order of the target IDs is not defined.
     * </pre>
     *
     * <code>repeated int32 target_ids = 2;</code>
     */
    public Builder clearTargetIds() {
      targetIds_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    private com.google.rpc.Status cause_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> causeBuilder_;
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public boolean hasCause() {
      return causeBuilder_ != null || cause_ != null;
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public com.google.rpc.Status getCause() {
      if (causeBuilder_ == null) {
        return cause_ == null ? com.google.rpc.Status.getDefaultInstance() : cause_;
      } else {
        return causeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public Builder setCause(com.google.rpc.Status value) {
      if (causeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cause_ = value;
        onChanged();
      } else {
        causeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public Builder setCause(
        com.google.rpc.Status.Builder builderForValue) {
      if (causeBuilder_ == null) {
        cause_ = builderForValue.build();
        onChanged();
      } else {
        causeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public Builder mergeCause(com.google.rpc.Status value) {
      if (causeBuilder_ == null) {
        if (cause_ != null) {
          cause_ =
            com.google.rpc.Status.newBuilder(cause_).mergeFrom(value).buildPartial();
        } else {
          cause_ = value;
        }
        onChanged();
      } else {
        causeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public Builder clearCause() {
      if (causeBuilder_ == null) {
        cause_ = null;
        onChanged();
      } else {
        cause_ = null;
        causeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public com.google.rpc.Status.Builder getCauseBuilder() {
      
      onChanged();
      return getCauseFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    public com.google.rpc.StatusOrBuilder getCauseOrBuilder() {
      if (causeBuilder_ != null) {
        return causeBuilder_.getMessageOrBuilder();
      } else {
        return cause_ == null ?
            com.google.rpc.Status.getDefaultInstance() : cause_;
      }
    }
    /**
     * <pre>
     * The error that resulted in this change, if applicable.
     * </pre>
     *
     * <code>.google.rpc.Status cause = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> 
        getCauseFieldBuilder() {
      if (causeBuilder_ == null) {
        causeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(
                getCause(),
                getParentForChildren(),
                isClean());
        cause_ = null;
      }
      return causeBuilder_;
    }

    private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY;
    /**
     * <pre>
     * A token that can be used to resume the stream for the given `target_ids`,
     * or all targets if `target_ids` is empty.
     * Not set on every target change.
     * </pre>
     *
     * <code>bytes resume_token = 4;</code>
     */
    public com.google.protobuf.ByteString getResumeToken() {
      return resumeToken_;
    }
    /**
     * <pre>
     * A token that can be used to resume the stream for the given `target_ids`,
     * or all targets if `target_ids` is empty.
     * Not set on every target change.
     * </pre>
     *
     * <code>bytes resume_token = 4;</code>
     */
    public Builder setResumeToken(com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      resumeToken_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * A token that can be used to resume the stream for the given `target_ids`,
     * or all targets if `target_ids` is empty.
     * Not set on every target change.
     * </pre>
     *
     * <code>bytes resume_token = 4;</code>
     */
    public Builder clearResumeToken() {
      
      resumeToken_ = getDefaultInstance().getResumeToken();
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp readTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> readTimeBuilder_;
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public boolean hasReadTime() {
      return readTimeBuilder_ != null || readTime_ != null;
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public com.google.protobuf.Timestamp getReadTime() {
      if (readTimeBuilder_ == null) {
        return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
      } else {
        return readTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public Builder setReadTime(com.google.protobuf.Timestamp value) {
      if (readTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        readTime_ = value;
        onChanged();
      } else {
        readTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public Builder setReadTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (readTimeBuilder_ == null) {
        readTime_ = builderForValue.build();
        onChanged();
      } else {
        readTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
      if (readTimeBuilder_ == null) {
        if (readTime_ != null) {
          readTime_ =
            com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial();
        } else {
          readTime_ = value;
        }
        onChanged();
      } else {
        readTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public Builder clearReadTime() {
      if (readTimeBuilder_ == null) {
        readTime_ = null;
        onChanged();
      } else {
        readTime_ = null;
        readTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
      
      onChanged();
      return getReadTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
      if (readTimeBuilder_ != null) {
        return readTimeBuilder_.getMessageOrBuilder();
      } else {
        return readTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
      }
    }
    /**
     * <pre>
     * The consistent `read_time` for the given `target_ids` (omitted when the
     * target_ids are not at a consistent snapshot).
     * The stream is guaranteed to send a `read_time` with `target_ids` empty
     * whenever the entire stream reaches a new consistent snapshot. ADD,
     * CURRENT, and RESET messages are guaranteed to (eventually) result in a
     * new consistent snapshot (while NO_CHANGE and REMOVE messages are not).
     * For a given stream, `read_time` is guaranteed to be monotonically
     * increasing.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getReadTimeFieldBuilder() {
      if (readTimeBuilder_ == null) {
        readTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getReadTime(),
                getParentForChildren(),
                isClean());
        readTime_ = null;
      }
      return readTimeBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


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

  // @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TargetChange)
  private static final com.google.firestore.v1beta1.TargetChange DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.firestore.v1beta1.TargetChange();
  }

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

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

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

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

  public com.google.firestore.v1beta1.TargetChange getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

