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

package com.google.firestore.v1beta1;

/**
 * <pre>
 * The response for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit].
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1beta1.CommitResponse}
 */
public  final class CommitResponse extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.CommitResponse)
    CommitResponseOrBuilder {
private static final long serialVersionUID = 0L;
  // Use CommitResponse.newBuilder() to construct.
  private CommitResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private CommitResponse() {
    writeResults_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private CommitResponse(
      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: {
            if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
              writeResults_ = new java.util.ArrayList<com.google.firestore.v1beta1.WriteResult>();
              mutable_bitField0_ |= 0x00000001;
            }
            writeResults_.add(
                input.readMessage(com.google.firestore.v1beta1.WriteResult.parser(), extensionRegistry));
            break;
          }
          case 18: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (commitTime_ != null) {
              subBuilder = commitTime_.toBuilder();
            }
            commitTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(commitTime_);
              commitTime_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                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_ & 0x00000001) == 0x00000001)) {
        writeResults_ = java.util.Collections.unmodifiableList(writeResults_);
      }
      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_CommitResponse_descriptor;
  }

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

  private int bitField0_;
  public static final int WRITE_RESULTS_FIELD_NUMBER = 1;
  private java.util.List<com.google.firestore.v1beta1.WriteResult> writeResults_;
  /**
   * <pre>
   * The result of applying the writes.
   * This i-th write result corresponds to the i-th write in the
   * request.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
   */
  public java.util.List<com.google.firestore.v1beta1.WriteResult> getWriteResultsList() {
    return writeResults_;
  }
  /**
   * <pre>
   * The result of applying the writes.
   * This i-th write result corresponds to the i-th write in the
   * request.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
   */
  public java.util.List<? extends com.google.firestore.v1beta1.WriteResultOrBuilder> 
      getWriteResultsOrBuilderList() {
    return writeResults_;
  }
  /**
   * <pre>
   * The result of applying the writes.
   * This i-th write result corresponds to the i-th write in the
   * request.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
   */
  public int getWriteResultsCount() {
    return writeResults_.size();
  }
  /**
   * <pre>
   * The result of applying the writes.
   * This i-th write result corresponds to the i-th write in the
   * request.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
   */
  public com.google.firestore.v1beta1.WriteResult getWriteResults(int index) {
    return writeResults_.get(index);
  }
  /**
   * <pre>
   * The result of applying the writes.
   * This i-th write result corresponds to the i-th write in the
   * request.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
   */
  public com.google.firestore.v1beta1.WriteResultOrBuilder getWriteResultsOrBuilder(
      int index) {
    return writeResults_.get(index);
  }

  public static final int COMMIT_TIME_FIELD_NUMBER = 2;
  private com.google.protobuf.Timestamp commitTime_;
  /**
   * <pre>
   * The time at which the commit occurred.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp commit_time = 2;</code>
   */
  public boolean hasCommitTime() {
    return commitTime_ != null;
  }
  /**
   * <pre>
   * The time at which the commit occurred.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp commit_time = 2;</code>
   */
  public com.google.protobuf.Timestamp getCommitTime() {
    return commitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : commitTime_;
  }
  /**
   * <pre>
   * The time at which the commit occurred.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp commit_time = 2;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() {
    return getCommitTime();
  }

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

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

    size = 0;
    for (int i = 0; i < writeResults_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, writeResults_.get(i));
    }
    if (commitTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getCommitTime());
    }
    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.CommitResponse)) {
      return super.equals(obj);
    }
    com.google.firestore.v1beta1.CommitResponse other = (com.google.firestore.v1beta1.CommitResponse) obj;

    boolean result = true;
    result = result && getWriteResultsList()
        .equals(other.getWriteResultsList());
    result = result && (hasCommitTime() == other.hasCommitTime());
    if (hasCommitTime()) {
      result = result && getCommitTime()
          .equals(other.getCommitTime());
    }
    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();
    if (getWriteResultsCount() > 0) {
      hash = (37 * hash) + WRITE_RESULTS_FIELD_NUMBER;
      hash = (53 * hash) + getWriteResultsList().hashCode();
    }
    if (hasCommitTime()) {
      hash = (37 * hash) + COMMIT_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCommitTime().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.firestore.v1beta1.CommitResponse 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 response for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit].
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.CommitResponse}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.CommitResponse)
      com.google.firestore.v1beta1.CommitResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.firestore.v1beta1.FirestoreProto.internal_static_google_firestore_v1beta1_CommitResponse_descriptor;
    }

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

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getWriteResultsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (writeResultsBuilder_ == null) {
        writeResults_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        writeResultsBuilder_.clear();
      }
      if (commitTimeBuilder_ == null) {
        commitTime_ = null;
      } else {
        commitTime_ = null;
        commitTimeBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.firestore.v1beta1.CommitResponse buildPartial() {
      com.google.firestore.v1beta1.CommitResponse result = new com.google.firestore.v1beta1.CommitResponse(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (writeResultsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          writeResults_ = java.util.Collections.unmodifiableList(writeResults_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.writeResults_ = writeResults_;
      } else {
        result.writeResults_ = writeResultsBuilder_.build();
      }
      if (commitTimeBuilder_ == null) {
        result.commitTime_ = commitTime_;
      } else {
        result.commitTime_ = commitTimeBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.firestore.v1beta1.CommitResponse other) {
      if (other == com.google.firestore.v1beta1.CommitResponse.getDefaultInstance()) return this;
      if (writeResultsBuilder_ == null) {
        if (!other.writeResults_.isEmpty()) {
          if (writeResults_.isEmpty()) {
            writeResults_ = other.writeResults_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureWriteResultsIsMutable();
            writeResults_.addAll(other.writeResults_);
          }
          onChanged();
        }
      } else {
        if (!other.writeResults_.isEmpty()) {
          if (writeResultsBuilder_.isEmpty()) {
            writeResultsBuilder_.dispose();
            writeResultsBuilder_ = null;
            writeResults_ = other.writeResults_;
            bitField0_ = (bitField0_ & ~0x00000001);
            writeResultsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getWriteResultsFieldBuilder() : null;
          } else {
            writeResultsBuilder_.addAllMessages(other.writeResults_);
          }
        }
      }
      if (other.hasCommitTime()) {
        mergeCommitTime(other.getCommitTime());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

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

    private java.util.List<com.google.firestore.v1beta1.WriteResult> writeResults_ =
      java.util.Collections.emptyList();
    private void ensureWriteResultsIsMutable() {
      if (!((bitField0_ & 0x00000001) == 0x00000001)) {
        writeResults_ = new java.util.ArrayList<com.google.firestore.v1beta1.WriteResult>(writeResults_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.firestore.v1beta1.WriteResult, com.google.firestore.v1beta1.WriteResult.Builder, com.google.firestore.v1beta1.WriteResultOrBuilder> writeResultsBuilder_;

    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public java.util.List<com.google.firestore.v1beta1.WriteResult> getWriteResultsList() {
      if (writeResultsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(writeResults_);
      } else {
        return writeResultsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public int getWriteResultsCount() {
      if (writeResultsBuilder_ == null) {
        return writeResults_.size();
      } else {
        return writeResultsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public com.google.firestore.v1beta1.WriteResult getWriteResults(int index) {
      if (writeResultsBuilder_ == null) {
        return writeResults_.get(index);
      } else {
        return writeResultsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder setWriteResults(
        int index, com.google.firestore.v1beta1.WriteResult value) {
      if (writeResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureWriteResultsIsMutable();
        writeResults_.set(index, value);
        onChanged();
      } else {
        writeResultsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder setWriteResults(
        int index, com.google.firestore.v1beta1.WriteResult.Builder builderForValue) {
      if (writeResultsBuilder_ == null) {
        ensureWriteResultsIsMutable();
        writeResults_.set(index, builderForValue.build());
        onChanged();
      } else {
        writeResultsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder addWriteResults(com.google.firestore.v1beta1.WriteResult value) {
      if (writeResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureWriteResultsIsMutable();
        writeResults_.add(value);
        onChanged();
      } else {
        writeResultsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder addWriteResults(
        int index, com.google.firestore.v1beta1.WriteResult value) {
      if (writeResultsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureWriteResultsIsMutable();
        writeResults_.add(index, value);
        onChanged();
      } else {
        writeResultsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder addWriteResults(
        com.google.firestore.v1beta1.WriteResult.Builder builderForValue) {
      if (writeResultsBuilder_ == null) {
        ensureWriteResultsIsMutable();
        writeResults_.add(builderForValue.build());
        onChanged();
      } else {
        writeResultsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder addWriteResults(
        int index, com.google.firestore.v1beta1.WriteResult.Builder builderForValue) {
      if (writeResultsBuilder_ == null) {
        ensureWriteResultsIsMutable();
        writeResults_.add(index, builderForValue.build());
        onChanged();
      } else {
        writeResultsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder addAllWriteResults(
        java.lang.Iterable<? extends com.google.firestore.v1beta1.WriteResult> values) {
      if (writeResultsBuilder_ == null) {
        ensureWriteResultsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, writeResults_);
        onChanged();
      } else {
        writeResultsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder clearWriteResults() {
      if (writeResultsBuilder_ == null) {
        writeResults_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        writeResultsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public Builder removeWriteResults(int index) {
      if (writeResultsBuilder_ == null) {
        ensureWriteResultsIsMutable();
        writeResults_.remove(index);
        onChanged();
      } else {
        writeResultsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public com.google.firestore.v1beta1.WriteResult.Builder getWriteResultsBuilder(
        int index) {
      return getWriteResultsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public com.google.firestore.v1beta1.WriteResultOrBuilder getWriteResultsOrBuilder(
        int index) {
      if (writeResultsBuilder_ == null) {
        return writeResults_.get(index);  } else {
        return writeResultsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public java.util.List<? extends com.google.firestore.v1beta1.WriteResultOrBuilder> 
         getWriteResultsOrBuilderList() {
      if (writeResultsBuilder_ != null) {
        return writeResultsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(writeResults_);
      }
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public com.google.firestore.v1beta1.WriteResult.Builder addWriteResultsBuilder() {
      return getWriteResultsFieldBuilder().addBuilder(
          com.google.firestore.v1beta1.WriteResult.getDefaultInstance());
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public com.google.firestore.v1beta1.WriteResult.Builder addWriteResultsBuilder(
        int index) {
      return getWriteResultsFieldBuilder().addBuilder(
          index, com.google.firestore.v1beta1.WriteResult.getDefaultInstance());
    }
    /**
     * <pre>
     * The result of applying the writes.
     * This i-th write result corresponds to the i-th write in the
     * request.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.WriteResult write_results = 1;</code>
     */
    public java.util.List<com.google.firestore.v1beta1.WriteResult.Builder> 
         getWriteResultsBuilderList() {
      return getWriteResultsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.firestore.v1beta1.WriteResult, com.google.firestore.v1beta1.WriteResult.Builder, com.google.firestore.v1beta1.WriteResultOrBuilder> 
        getWriteResultsFieldBuilder() {
      if (writeResultsBuilder_ == null) {
        writeResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.firestore.v1beta1.WriteResult, com.google.firestore.v1beta1.WriteResult.Builder, com.google.firestore.v1beta1.WriteResultOrBuilder>(
                writeResults_,
                ((bitField0_ & 0x00000001) == 0x00000001),
                getParentForChildren(),
                isClean());
        writeResults_ = null;
      }
      return writeResultsBuilder_;
    }

    private com.google.protobuf.Timestamp commitTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> commitTimeBuilder_;
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public boolean hasCommitTime() {
      return commitTimeBuilder_ != null || commitTime_ != null;
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public com.google.protobuf.Timestamp getCommitTime() {
      if (commitTimeBuilder_ == null) {
        return commitTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : commitTime_;
      } else {
        return commitTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public Builder setCommitTime(com.google.protobuf.Timestamp value) {
      if (commitTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        commitTime_ = value;
        onChanged();
      } else {
        commitTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public Builder setCommitTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (commitTimeBuilder_ == null) {
        commitTime_ = builderForValue.build();
        onChanged();
      } else {
        commitTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public Builder mergeCommitTime(com.google.protobuf.Timestamp value) {
      if (commitTimeBuilder_ == null) {
        if (commitTime_ != null) {
          commitTime_ =
            com.google.protobuf.Timestamp.newBuilder(commitTime_).mergeFrom(value).buildPartial();
        } else {
          commitTime_ = value;
        }
        onChanged();
      } else {
        commitTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public Builder clearCommitTime() {
      if (commitTimeBuilder_ == null) {
        commitTime_ = null;
        onChanged();
      } else {
        commitTime_ = null;
        commitTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public com.google.protobuf.Timestamp.Builder getCommitTimeBuilder() {
      
      onChanged();
      return getCommitTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getCommitTimeOrBuilder() {
      if (commitTimeBuilder_ != null) {
        return commitTimeBuilder_.getMessageOrBuilder();
      } else {
        return commitTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : commitTime_;
      }
    }
    /**
     * <pre>
     * The time at which the commit occurred.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp commit_time = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getCommitTimeFieldBuilder() {
      if (commitTimeBuilder_ == null) {
        commitTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getCommitTime(),
                getParentForChildren(),
                isClean());
        commitTime_ = null;
      }
      return commitTimeBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


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

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

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

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

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

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

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

}

