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

package com.google.firestore.v1;

/**
 *
 *
 * <pre>
 * The result of applying a write.
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1.WriteResult}
 */
public final class WriteResult extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1.WriteResult)
    WriteResultOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use WriteResult.newBuilder() to construct.
  private WriteResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private WriteResult() {
    transformResults_ = java.util.Collections.emptyList();
  }

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

  private WriteResult(
      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:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (updateTime_ != null) {
                subBuilder = updateTime_.toBuilder();
              }
              updateTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(updateTime_);
                updateTime_ = subBuilder.buildPartial();
              }

              break;
            }
          case 18:
            {
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                transformResults_ = new java.util.ArrayList<com.google.firestore.v1.Value>();
                mutable_bitField0_ |= 0x00000002;
              }
              transformResults_.add(
                  input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        transformResults_ = java.util.Collections.unmodifiableList(transformResults_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.firestore.v1.WriteProto
        .internal_static_google_firestore_v1_WriteResult_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.firestore.v1.WriteProto
        .internal_static_google_firestore_v1_WriteResult_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.firestore.v1.WriteResult.class,
            com.google.firestore.v1.WriteResult.Builder.class);
  }

  private int bitField0_;
  public static final int UPDATE_TIME_FIELD_NUMBER = 1;
  private com.google.protobuf.Timestamp updateTime_;
  /**
   *
   *
   * <pre>
   * The last update time of the document after applying the write. Not set
   * after a `delete`.
   * If the write did not actually change the document, this will be the
   * previous update_time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 1;</code>
   */
  public boolean hasUpdateTime() {
    return updateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * The last update time of the document after applying the write. Not set
   * after a `delete`.
   * If the write did not actually change the document, this will be the
   * previous update_time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 1;</code>
   */
  public com.google.protobuf.Timestamp getUpdateTime() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }
  /**
   *
   *
   * <pre>
   * The last update time of the document after applying the write. Not set
   * after a `delete`.
   * If the write did not actually change the document, this will be the
   * previous update_time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 1;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
    return getUpdateTime();
  }

  public static final int TRANSFORM_RESULTS_FIELD_NUMBER = 2;
  private java.util.List<com.google.firestore.v1.Value> transformResults_;
  /**
   *
   *
   * <pre>
   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
   * same order.
   * </pre>
   *
   * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
   */
  public java.util.List<com.google.firestore.v1.Value> getTransformResultsList() {
    return transformResults_;
  }
  /**
   *
   *
   * <pre>
   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
   * same order.
   * </pre>
   *
   * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
   */
  public java.util.List<? extends com.google.firestore.v1.ValueOrBuilder>
      getTransformResultsOrBuilderList() {
    return transformResults_;
  }
  /**
   *
   *
   * <pre>
   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
   * same order.
   * </pre>
   *
   * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
   */
  public int getTransformResultsCount() {
    return transformResults_.size();
  }
  /**
   *
   *
   * <pre>
   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
   * same order.
   * </pre>
   *
   * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
   */
  public com.google.firestore.v1.Value getTransformResults(int index) {
    return transformResults_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
   * same order.
   * </pre>
   *
   * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
   */
  public com.google.firestore.v1.ValueOrBuilder getTransformResultsOrBuilder(int index) {
    return transformResults_.get(index);
  }

  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 (updateTime_ != null) {
      output.writeMessage(1, getUpdateTime());
    }
    for (int i = 0; i < transformResults_.size(); i++) {
      output.writeMessage(2, transformResults_.get(i));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (updateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateTime());
    }
    for (int i = 0; i < transformResults_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, transformResults_.get(i));
    }
    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.v1.WriteResult)) {
      return super.equals(obj);
    }
    com.google.firestore.v1.WriteResult other = (com.google.firestore.v1.WriteResult) obj;

    if (hasUpdateTime() != other.hasUpdateTime()) return false;
    if (hasUpdateTime()) {
      if (!getUpdateTime().equals(other.getUpdateTime())) return false;
    }
    if (!getTransformResultsList().equals(other.getTransformResultsList())) 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();
    if (hasUpdateTime()) {
      hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateTime().hashCode();
    }
    if (getTransformResultsCount() > 0) {
      hash = (37 * hash) + TRANSFORM_RESULTS_FIELD_NUMBER;
      hash = (53 * hash) + getTransformResultsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.firestore.v1.WriteResult 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.v1.WriteResult prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

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

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The result of applying a write.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1.WriteResult}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.firestore.v1.WriteResult)
      com.google.firestore.v1.WriteResultOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.firestore.v1.WriteProto
          .internal_static_google_firestore_v1_WriteResult_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1.WriteProto
          .internal_static_google_firestore_v1_WriteResult_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1.WriteResult.class,
              com.google.firestore.v1.WriteResult.Builder.class);
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (updateTimeBuilder_ == null) {
        updateTime_ = null;
      } else {
        updateTime_ = null;
        updateTimeBuilder_ = null;
      }
      if (transformResultsBuilder_ == null) {
        transformResults_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        transformResultsBuilder_.clear();
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.firestore.v1.WriteResult buildPartial() {
      com.google.firestore.v1.WriteResult result = new com.google.firestore.v1.WriteResult(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (updateTimeBuilder_ == null) {
        result.updateTime_ = updateTime_;
      } else {
        result.updateTime_ = updateTimeBuilder_.build();
      }
      if (transformResultsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          transformResults_ = java.util.Collections.unmodifiableList(transformResults_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.transformResults_ = transformResults_;
      } else {
        result.transformResults_ = transformResultsBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

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

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

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

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

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

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

    public Builder mergeFrom(com.google.firestore.v1.WriteResult other) {
      if (other == com.google.firestore.v1.WriteResult.getDefaultInstance()) return this;
      if (other.hasUpdateTime()) {
        mergeUpdateTime(other.getUpdateTime());
      }
      if (transformResultsBuilder_ == null) {
        if (!other.transformResults_.isEmpty()) {
          if (transformResults_.isEmpty()) {
            transformResults_ = other.transformResults_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureTransformResultsIsMutable();
            transformResults_.addAll(other.transformResults_);
          }
          onChanged();
        }
      } else {
        if (!other.transformResults_.isEmpty()) {
          if (transformResultsBuilder_.isEmpty()) {
            transformResultsBuilder_.dispose();
            transformResultsBuilder_ = null;
            transformResults_ = other.transformResults_;
            bitField0_ = (bitField0_ & ~0x00000002);
            transformResultsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getTransformResultsFieldBuilder()
                    : null;
          } else {
            transformResultsBuilder_.addAllMessages(other.transformResults_);
          }
        }
      }
      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.v1.WriteResult parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.firestore.v1.WriteResult) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.Timestamp updateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        updateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public boolean hasUpdateTime() {
      return updateTimeBuilder_ != null || updateTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public com.google.protobuf.Timestamp getUpdateTime() {
      if (updateTimeBuilder_ == null) {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      } else {
        return updateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateTime_ = value;
        onChanged();
      } else {
        updateTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (updateTimeBuilder_ == null) {
        updateTime_ = builderForValue.build();
        onChanged();
      } else {
        updateTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (updateTime_ != null) {
          updateTime_ =
              com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial();
        } else {
          updateTime_ = value;
        }
        onChanged();
      } else {
        updateTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public Builder clearUpdateTime() {
      if (updateTimeBuilder_ == null) {
        updateTime_ = null;
        onChanged();
      } else {
        updateTime_ = null;
        updateTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {

      onChanged();
      return getUpdateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
      if (updateTimeBuilder_ != null) {
        return updateTimeBuilder_.getMessageOrBuilder();
      } else {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * The last update time of the document after applying the write. Not set
     * after a `delete`.
     * If the write did not actually change the document, this will be the
     * previous update_time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getUpdateTimeFieldBuilder() {
      if (updateTimeBuilder_ == null) {
        updateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getUpdateTime(), getParentForChildren(), isClean());
        updateTime_ = null;
      }
      return updateTimeBuilder_;
    }

    private java.util.List<com.google.firestore.v1.Value> transformResults_ =
        java.util.Collections.emptyList();

    private void ensureTransformResultsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        transformResults_ =
            new java.util.ArrayList<com.google.firestore.v1.Value>(transformResults_);
        bitField0_ |= 0x00000002;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.firestore.v1.Value,
            com.google.firestore.v1.Value.Builder,
            com.google.firestore.v1.ValueOrBuilder>
        transformResultsBuilder_;

    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public java.util.List<com.google.firestore.v1.Value> getTransformResultsList() {
      if (transformResultsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(transformResults_);
      } else {
        return transformResultsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public int getTransformResultsCount() {
      if (transformResultsBuilder_ == null) {
        return transformResults_.size();
      } else {
        return transformResultsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public com.google.firestore.v1.Value getTransformResults(int index) {
      if (transformResultsBuilder_ == null) {
        return transformResults_.get(index);
      } else {
        return transformResultsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder setTransformResults(int index, com.google.firestore.v1.Value value) {
      if (transformResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTransformResultsIsMutable();
        transformResults_.set(index, value);
        onChanged();
      } else {
        transformResultsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder setTransformResults(
        int index, com.google.firestore.v1.Value.Builder builderForValue) {
      if (transformResultsBuilder_ == null) {
        ensureTransformResultsIsMutable();
        transformResults_.set(index, builderForValue.build());
        onChanged();
      } else {
        transformResultsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder addTransformResults(com.google.firestore.v1.Value value) {
      if (transformResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTransformResultsIsMutable();
        transformResults_.add(value);
        onChanged();
      } else {
        transformResultsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder addTransformResults(int index, com.google.firestore.v1.Value value) {
      if (transformResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTransformResultsIsMutable();
        transformResults_.add(index, value);
        onChanged();
      } else {
        transformResultsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder addTransformResults(com.google.firestore.v1.Value.Builder builderForValue) {
      if (transformResultsBuilder_ == null) {
        ensureTransformResultsIsMutable();
        transformResults_.add(builderForValue.build());
        onChanged();
      } else {
        transformResultsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder addTransformResults(
        int index, com.google.firestore.v1.Value.Builder builderForValue) {
      if (transformResultsBuilder_ == null) {
        ensureTransformResultsIsMutable();
        transformResults_.add(index, builderForValue.build());
        onChanged();
      } else {
        transformResultsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder addAllTransformResults(
        java.lang.Iterable<? extends com.google.firestore.v1.Value> values) {
      if (transformResultsBuilder_ == null) {
        ensureTransformResultsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transformResults_);
        onChanged();
      } else {
        transformResultsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder clearTransformResults() {
      if (transformResultsBuilder_ == null) {
        transformResults_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        transformResultsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public Builder removeTransformResults(int index) {
      if (transformResultsBuilder_ == null) {
        ensureTransformResultsIsMutable();
        transformResults_.remove(index);
        onChanged();
      } else {
        transformResultsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public com.google.firestore.v1.Value.Builder getTransformResultsBuilder(int index) {
      return getTransformResultsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public com.google.firestore.v1.ValueOrBuilder getTransformResultsOrBuilder(int index) {
      if (transformResultsBuilder_ == null) {
        return transformResults_.get(index);
      } else {
        return transformResultsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public java.util.List<? extends com.google.firestore.v1.ValueOrBuilder>
        getTransformResultsOrBuilderList() {
      if (transformResultsBuilder_ != null) {
        return transformResultsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(transformResults_);
      }
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public com.google.firestore.v1.Value.Builder addTransformResultsBuilder() {
      return getTransformResultsFieldBuilder()
          .addBuilder(com.google.firestore.v1.Value.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public com.google.firestore.v1.Value.Builder addTransformResultsBuilder(int index) {
      return getTransformResultsFieldBuilder()
          .addBuilder(index, com.google.firestore.v1.Value.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the
     * same order.
     * </pre>
     *
     * <code>repeated .google.firestore.v1.Value transform_results = 2;</code>
     */
    public java.util.List<com.google.firestore.v1.Value.Builder> getTransformResultsBuilderList() {
      return getTransformResultsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.firestore.v1.Value,
            com.google.firestore.v1.Value.Builder,
            com.google.firestore.v1.ValueOrBuilder>
        getTransformResultsFieldBuilder() {
      if (transformResultsBuilder_ == null) {
        transformResultsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.firestore.v1.Value,
                com.google.firestore.v1.Value.Builder,
                com.google.firestore.v1.ValueOrBuilder>(
                transformResults_,
                ((bitField0_ & 0x00000002) != 0),
                getParentForChildren(),
                isClean());
        transformResults_ = null;
      }
      return transformResultsBuilder_;
    }

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

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

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

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

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

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

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

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