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

package com.google.firestore.v1;

/**
 *
 *
 * <pre>
 * The result of applying a write.
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1.WriteResult}
 */
@com.google.protobuf.Generated
public final class WriteResult extends com.google.protobuf.GeneratedMessage
    implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1.WriteResult)
    WriteResultOrBuilder {
  private static final long serialVersionUID = 0L;

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

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

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

  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.GeneratedMessage.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>
   *
   * @return Whether the updateTime field is set.
   */
  @java.lang.Override
  public boolean hasUpdateTime() {
    return ((bitField0_ & 0x00000001) != 0);
  }

  /**
   *
   *
   * <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>
   *
   * @return The updateTime.
   */
  @java.lang.Override
  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>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }

  public static final int TRANSFORM_RESULTS_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  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>
   */
  @java.lang.Override
  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>
   */
  @java.lang.Override
  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>
   */
  @java.lang.Override
  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>
   */
  @java.lang.Override
  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>
   */
  @java.lang.Override
  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 (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(1, getUpdateTime());
    }
    for (int i = 0; i < transformResults_.size(); i++) {
      output.writeMessage(2, transformResults_.get(i));
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      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 += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.firestore.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 (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    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) + getUnknownFields().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.GeneratedMessage.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.GeneratedMessage.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

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

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

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

  public static Builder newBuilder(com.google.firestore.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      if (transformResultsBuilder_ == null) {
        transformResults_ = java.util.Collections.emptyList();
      } else {
        transformResults_ = null;
        transformResultsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000002);
      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);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.firestore.v1.WriteResult result) {
      if (transformResultsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          transformResults_ = java.util.Collections.unmodifiableList(transformResults_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.transformResults_ = transformResults_;
      } else {
        result.transformResults_ = transformResultsBuilder_.build();
      }
    }

    private void buildPartial0(com.google.firestore.v1.WriteResult result) {
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
        to_bitField0_ |= 0x00000001;
      }
      result.bitField0_ |= to_bitField0_;
    }

    @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.GeneratedMessage.alwaysUseFieldBuilders
                    ? internalGetTransformResultsFieldBuilder()
                    : null;
          } else {
            transformResultsBuilder_.addAllMessages(other.transformResults_);
          }
        }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                input.readMessage(
                    internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                com.google.firestore.v1.Value m =
                    input.readMessage(com.google.firestore.v1.Value.parser(), extensionRegistry);
                if (transformResultsBuilder_ == null) {
                  ensureTransformResultsIsMutable();
                  transformResults_.add(m);
                } else {
                  transformResultsBuilder_.addMessage(m);
                }
                break;
              } // case 18
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.Timestamp updateTime_;
    private com.google.protobuf.SingleFieldBuilder<
            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>
     *
     * @return Whether the updateTime field is set.
     */
    public boolean hasUpdateTime() {
      return ((bitField0_ & 0x00000001) != 0);
    }

    /**
     *
     *
     * <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>
     *
     * @return The updateTime.
     */
    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;
      } else {
        updateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      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();
      } else {
        updateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      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 (((bitField0_ & 0x00000001) != 0)
            && updateTime_ != null
            && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getUpdateTimeBuilder().mergeFrom(value);
        } else {
          updateTime_ = value;
        }
      } else {
        updateTimeBuilder_.mergeFrom(value);
      }
      if (updateTime_ != null) {
        bitField0_ |= 0x00000001;
        onChanged();
      }
      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() {
      bitField0_ = (bitField0_ & ~0x00000001);
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      onChanged();
      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() {
      bitField0_ |= 0x00000001;
      onChanged();
      return internalGetUpdateTimeFieldBuilder().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.SingleFieldBuilder<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        internalGetUpdateTimeFieldBuilder() {
      if (updateTimeBuilder_ == null) {
        updateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                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.RepeatedFieldBuilder<
            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 internalGetTransformResultsFieldBuilder().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 internalGetTransformResultsFieldBuilder()
          .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 internalGetTransformResultsFieldBuilder()
          .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 internalGetTransformResultsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilder<
            com.google.firestore.v1.Value,
            com.google.firestore.v1.Value.Builder,
            com.google.firestore.v1.ValueOrBuilder>
        internalGetTransformResultsFieldBuilder() {
      if (transformResultsBuilder_ == null) {
        transformResultsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilder<
                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_;
    }

    // @@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 {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<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;
  }
}
