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

package com.google.firestore.v1beta1;

/**
 * <pre>
 * A transformation of a document.
 * </pre>
 *
 * Protobuf type {@code google.firestore.v1beta1.DocumentTransform}
 */
public  final class DocumentTransform extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.DocumentTransform)
    DocumentTransformOrBuilder {
private static final long serialVersionUID = 0L;
  // Use DocumentTransform.newBuilder() to construct.
  private DocumentTransform(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private DocumentTransform() {
    document_ = "";
    fieldTransforms_ = java.util.Collections.emptyList();
  }

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

            document_ = s;
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
              fieldTransforms_ = new java.util.ArrayList<com.google.firestore.v1beta1.DocumentTransform.FieldTransform>();
              mutable_bitField0_ |= 0x00000002;
            }
            fieldTransforms_.add(
                input.readMessage(com.google.firestore.v1beta1.DocumentTransform.FieldTransform.parser(), extensionRegistry));
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
        fieldTransforms_ = java.util.Collections.unmodifiableList(fieldTransforms_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.firestore.v1beta1.DocumentTransform.class, com.google.firestore.v1beta1.DocumentTransform.Builder.class);
  }

  public interface FieldTransformOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.firestore.v1beta1.DocumentTransform.FieldTransform)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
     * reference.
     * </pre>
     *
     * <code>string field_path = 1;</code>
     */
    java.lang.String getFieldPath();
    /**
     * <pre>
     * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
     * reference.
     * </pre>
     *
     * <code>string field_path = 1;</code>
     */
    com.google.protobuf.ByteString
        getFieldPathBytes();

    /**
     * <pre>
     * Sets the field to the given server value.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
     */
    int getSetToServerValueValue();
    /**
     * <pre>
     * Sets the field to the given server value.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
     */
    com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue();

    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.TransformTypeCase getTransformTypeCase();
  }
  /**
   * <pre>
   * A transformation of a field of the document.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.DocumentTransform.FieldTransform}
   */
  public  static final class FieldTransform extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:google.firestore.v1beta1.DocumentTransform.FieldTransform)
      FieldTransformOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use FieldTransform.newBuilder() to construct.
    private FieldTransform(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private FieldTransform() {
      fieldPath_ = "";
    }

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

              fieldPath_ = s;
              break;
            }
            case 16: {
              int rawValue = input.readEnum();
              transformTypeCase_ = 2;
              transformType_ = rawValue;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.DocumentTransform.FieldTransform.class, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder.class);
    }

    /**
     * <pre>
     * A value that is calculated by the server.
     * </pre>
     *
     * Protobuf enum {@code google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue}
     */
    public enum ServerValue
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * <pre>
       * Unspecified. This value must not be used.
       * </pre>
       *
       * <code>SERVER_VALUE_UNSPECIFIED = 0;</code>
       */
      SERVER_VALUE_UNSPECIFIED(0),
      /**
       * <pre>
       * The time at which the server processed the request, with millisecond
       * precision.
       * </pre>
       *
       * <code>REQUEST_TIME = 1;</code>
       */
      REQUEST_TIME(1),
      UNRECOGNIZED(-1),
      ;

      /**
       * <pre>
       * Unspecified. This value must not be used.
       * </pre>
       *
       * <code>SERVER_VALUE_UNSPECIFIED = 0;</code>
       */
      public static final int SERVER_VALUE_UNSPECIFIED_VALUE = 0;
      /**
       * <pre>
       * The time at which the server processed the request, with millisecond
       * precision.
       * </pre>
       *
       * <code>REQUEST_TIME = 1;</code>
       */
      public static final int REQUEST_TIME_VALUE = 1;


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

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

      public static ServerValue forNumber(int value) {
        switch (value) {
          case 0: return SERVER_VALUE_UNSPECIFIED;
          case 1: return REQUEST_TIME;
          default: return null;
        }
      }

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

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

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

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

      private final int value;

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

      // @@protoc_insertion_point(enum_scope:google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue)
    }

    private int transformTypeCase_ = 0;
    private java.lang.Object transformType_;
    public enum TransformTypeCase
        implements com.google.protobuf.Internal.EnumLite {
      SET_TO_SERVER_VALUE(2),
      TRANSFORMTYPE_NOT_SET(0);
      private final int value;
      private TransformTypeCase(int value) {
        this.value = value;
      }
      /**
       * @deprecated Use {@link #forNumber(int)} instead.
       */
      @java.lang.Deprecated
      public static TransformTypeCase valueOf(int value) {
        return forNumber(value);
      }

      public static TransformTypeCase forNumber(int value) {
        switch (value) {
          case 2: return SET_TO_SERVER_VALUE;
          case 0: return TRANSFORMTYPE_NOT_SET;
          default: return null;
        }
      }
      public int getNumber() {
        return this.value;
      }
    };

    public TransformTypeCase
    getTransformTypeCase() {
      return TransformTypeCase.forNumber(
          transformTypeCase_);
    }

    public static final int FIELD_PATH_FIELD_NUMBER = 1;
    private volatile java.lang.Object fieldPath_;
    /**
     * <pre>
     * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
     * reference.
     * </pre>
     *
     * <code>string field_path = 1;</code>
     */
    public java.lang.String getFieldPath() {
      java.lang.Object ref = fieldPath_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        fieldPath_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
     * reference.
     * </pre>
     *
     * <code>string field_path = 1;</code>
     */
    public com.google.protobuf.ByteString
        getFieldPathBytes() {
      java.lang.Object ref = fieldPath_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        fieldPath_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SET_TO_SERVER_VALUE_FIELD_NUMBER = 2;
    /**
     * <pre>
     * Sets the field to the given server value.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
     */
    public int getSetToServerValueValue() {
      if (transformTypeCase_ == 2) {
        return (java.lang.Integer) transformType_;
      }
      return 0;
    }
    /**
     * <pre>
     * Sets the field to the given server value.
     * </pre>
     *
     * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue() {
      if (transformTypeCase_ == 2) {
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue result = com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.valueOf(
            (java.lang.Integer) transformType_);
        return result == null ? com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.UNRECOGNIZED : result;
      }
      return com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.SERVER_VALUE_UNSPECIFIED;
    }

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

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getFieldPathBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_);
      }
      if (transformTypeCase_ == 2) {
        output.writeEnum(2, ((java.lang.Integer) transformType_));
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      if (!getFieldPathBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_);
      }
      if (transformTypeCase_ == 2) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(2, ((java.lang.Integer) transformType_));
      }
      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.DocumentTransform.FieldTransform)) {
        return super.equals(obj);
      }
      com.google.firestore.v1beta1.DocumentTransform.FieldTransform other = (com.google.firestore.v1beta1.DocumentTransform.FieldTransform) obj;

      boolean result = true;
      result = result && getFieldPath()
          .equals(other.getFieldPath());
      result = result && getTransformTypeCase().equals(
          other.getTransformTypeCase());
      if (!result) return false;
      switch (transformTypeCase_) {
        case 2:
          result = result && getSetToServerValueValue()
              == other.getSetToServerValueValue();
          break;
        case 0:
        default:
      }
      result = result && unknownFields.equals(other.unknownFields);
      return result;
    }

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

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

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

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * A transformation of a field of the document.
     * </pre>
     *
     * Protobuf type {@code google.firestore.v1beta1.DocumentTransform.FieldTransform}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.DocumentTransform.FieldTransform)
        com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.firestore.v1beta1.DocumentTransform.FieldTransform.class, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder.class);
      }

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

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

        transformTypeCase_ = 0;
        transformType_ = null;
        return this;
      }

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

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

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

      public com.google.firestore.v1beta1.DocumentTransform.FieldTransform buildPartial() {
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform result = new com.google.firestore.v1beta1.DocumentTransform.FieldTransform(this);
        result.fieldPath_ = fieldPath_;
        if (transformTypeCase_ == 2) {
          result.transformType_ = transformType_;
        }
        result.transformTypeCase_ = transformTypeCase_;
        onBuilt();
        return result;
      }

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

      public Builder mergeFrom(com.google.firestore.v1beta1.DocumentTransform.FieldTransform other) {
        if (other == com.google.firestore.v1beta1.DocumentTransform.FieldTransform.getDefaultInstance()) return this;
        if (!other.getFieldPath().isEmpty()) {
          fieldPath_ = other.fieldPath_;
          onChanged();
        }
        switch (other.getTransformTypeCase()) {
          case SET_TO_SERVER_VALUE: {
            setSetToServerValueValue(other.getSetToServerValueValue());
            break;
          }
          case TRANSFORMTYPE_NOT_SET: {
            break;
          }
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.google.firestore.v1beta1.DocumentTransform.FieldTransform) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int transformTypeCase_ = 0;
      private java.lang.Object transformType_;
      public TransformTypeCase
          getTransformTypeCase() {
        return TransformTypeCase.forNumber(
            transformTypeCase_);
      }

      public Builder clearTransformType() {
        transformTypeCase_ = 0;
        transformType_ = null;
        onChanged();
        return this;
      }


      private java.lang.Object fieldPath_ = "";
      /**
       * <pre>
       * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
       * reference.
       * </pre>
       *
       * <code>string field_path = 1;</code>
       */
      public java.lang.String getFieldPath() {
        java.lang.Object ref = fieldPath_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          fieldPath_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
       * reference.
       * </pre>
       *
       * <code>string field_path = 1;</code>
       */
      public com.google.protobuf.ByteString
          getFieldPathBytes() {
        java.lang.Object ref = fieldPath_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          fieldPath_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
       * reference.
       * </pre>
       *
       * <code>string field_path = 1;</code>
       */
      public Builder setFieldPath(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        fieldPath_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
       * reference.
       * </pre>
       *
       * <code>string field_path = 1;</code>
       */
      public Builder clearFieldPath() {
        
        fieldPath_ = getDefaultInstance().getFieldPath();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax
       * reference.
       * </pre>
       *
       * <code>string field_path = 1;</code>
       */
      public Builder setFieldPathBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        fieldPath_ = value;
        onChanged();
        return this;
      }

      /**
       * <pre>
       * Sets the field to the given server value.
       * </pre>
       *
       * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
       */
      public int getSetToServerValueValue() {
        if (transformTypeCase_ == 2) {
          return ((java.lang.Integer) transformType_).intValue();
        }
        return 0;
      }
      /**
       * <pre>
       * Sets the field to the given server value.
       * </pre>
       *
       * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
       */
      public Builder setSetToServerValueValue(int value) {
        transformTypeCase_ = 2;
        transformType_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Sets the field to the given server value.
       * </pre>
       *
       * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
       */
      public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue() {
        if (transformTypeCase_ == 2) {
          com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue result = com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.valueOf(
              (java.lang.Integer) transformType_);
          return result == null ? com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.UNRECOGNIZED : result;
        }
        return com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.SERVER_VALUE_UNSPECIFIED;
      }
      /**
       * <pre>
       * Sets the field to the given server value.
       * </pre>
       *
       * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
       */
      public Builder setSetToServerValue(com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue value) {
        if (value == null) {
          throw new NullPointerException();
        }
        transformTypeCase_ = 2;
        transformType_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Sets the field to the given server value.
       * </pre>
       *
       * <code>.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2;</code>
       */
      public Builder clearSetToServerValue() {
        if (transformTypeCase_ == 2) {
          transformTypeCase_ = 0;
          transformType_ = null;
          onChanged();
        }
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

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


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

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

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

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

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

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

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

  }

  private int bitField0_;
  public static final int DOCUMENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object document_;
  /**
   * <pre>
   * The name of the document to transform.
   * </pre>
   *
   * <code>string document = 1;</code>
   */
  public java.lang.String getDocument() {
    java.lang.Object ref = document_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      document_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The name of the document to transform.
   * </pre>
   *
   * <code>string document = 1;</code>
   */
  public com.google.protobuf.ByteString
      getDocumentBytes() {
    java.lang.Object ref = document_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      document_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FIELD_TRANSFORMS_FIELD_NUMBER = 2;
  private java.util.List<com.google.firestore.v1beta1.DocumentTransform.FieldTransform> fieldTransforms_;
  /**
   * <pre>
   * The list of transformations to apply to the fields of the document, in
   * order.
   * This must not be empty.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
   */
  public java.util.List<com.google.firestore.v1beta1.DocumentTransform.FieldTransform> getFieldTransformsList() {
    return fieldTransforms_;
  }
  /**
   * <pre>
   * The list of transformations to apply to the fields of the document, in
   * order.
   * This must not be empty.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
   */
  public java.util.List<? extends com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder> 
      getFieldTransformsOrBuilderList() {
    return fieldTransforms_;
  }
  /**
   * <pre>
   * The list of transformations to apply to the fields of the document, in
   * order.
   * This must not be empty.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
   */
  public int getFieldTransformsCount() {
    return fieldTransforms_.size();
  }
  /**
   * <pre>
   * The list of transformations to apply to the fields of the document, in
   * order.
   * This must not be empty.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
   */
  public com.google.firestore.v1beta1.DocumentTransform.FieldTransform getFieldTransforms(int index) {
    return fieldTransforms_.get(index);
  }
  /**
   * <pre>
   * The list of transformations to apply to the fields of the document, in
   * order.
   * This must not be empty.
   * </pre>
   *
   * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
   */
  public com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder getFieldTransformsOrBuilder(
      int index) {
    return fieldTransforms_.get(index);
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getDocumentBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, document_);
    }
    for (int i = 0; i < fieldTransforms_.size(); i++) {
      output.writeMessage(2, fieldTransforms_.get(i));
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getDocumentBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, document_);
    }
    for (int i = 0; i < fieldTransforms_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, fieldTransforms_.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.v1beta1.DocumentTransform)) {
      return super.equals(obj);
    }
    com.google.firestore.v1beta1.DocumentTransform other = (com.google.firestore.v1beta1.DocumentTransform) obj;

    boolean result = true;
    result = result && getDocument()
        .equals(other.getDocument());
    result = result && getFieldTransformsList()
        .equals(other.getFieldTransformsList());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + DOCUMENT_FIELD_NUMBER;
    hash = (53 * hash) + getDocument().hashCode();
    if (getFieldTransformsCount() > 0) {
      hash = (37 * hash) + FIELD_TRANSFORMS_FIELD_NUMBER;
      hash = (53 * hash) + getFieldTransformsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * A transformation of a document.
   * </pre>
   *
   * Protobuf type {@code google.firestore.v1beta1.DocumentTransform}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.firestore.v1beta1.DocumentTransform)
      com.google.firestore.v1beta1.DocumentTransformOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.firestore.v1beta1.WriteProto.internal_static_google_firestore_v1beta1_DocumentTransform_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.firestore.v1beta1.DocumentTransform.class, com.google.firestore.v1beta1.DocumentTransform.Builder.class);
    }

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

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

      if (fieldTransformsBuilder_ == null) {
        fieldTransforms_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        fieldTransformsBuilder_.clear();
      }
      return this;
    }

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

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

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

    public com.google.firestore.v1beta1.DocumentTransform buildPartial() {
      com.google.firestore.v1beta1.DocumentTransform result = new com.google.firestore.v1beta1.DocumentTransform(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.document_ = document_;
      if (fieldTransformsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          fieldTransforms_ = java.util.Collections.unmodifiableList(fieldTransforms_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.fieldTransforms_ = fieldTransforms_;
      } else {
        result.fieldTransforms_ = fieldTransformsBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.firestore.v1beta1.DocumentTransform other) {
      if (other == com.google.firestore.v1beta1.DocumentTransform.getDefaultInstance()) return this;
      if (!other.getDocument().isEmpty()) {
        document_ = other.document_;
        onChanged();
      }
      if (fieldTransformsBuilder_ == null) {
        if (!other.fieldTransforms_.isEmpty()) {
          if (fieldTransforms_.isEmpty()) {
            fieldTransforms_ = other.fieldTransforms_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureFieldTransformsIsMutable();
            fieldTransforms_.addAll(other.fieldTransforms_);
          }
          onChanged();
        }
      } else {
        if (!other.fieldTransforms_.isEmpty()) {
          if (fieldTransformsBuilder_.isEmpty()) {
            fieldTransformsBuilder_.dispose();
            fieldTransformsBuilder_ = null;
            fieldTransforms_ = other.fieldTransforms_;
            bitField0_ = (bitField0_ & ~0x00000002);
            fieldTransformsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getFieldTransformsFieldBuilder() : null;
          } else {
            fieldTransformsBuilder_.addAllMessages(other.fieldTransforms_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object document_ = "";
    /**
     * <pre>
     * The name of the document to transform.
     * </pre>
     *
     * <code>string document = 1;</code>
     */
    public java.lang.String getDocument() {
      java.lang.Object ref = document_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        document_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The name of the document to transform.
     * </pre>
     *
     * <code>string document = 1;</code>
     */
    public com.google.protobuf.ByteString
        getDocumentBytes() {
      java.lang.Object ref = document_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        document_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The name of the document to transform.
     * </pre>
     *
     * <code>string document = 1;</code>
     */
    public Builder setDocument(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      document_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the document to transform.
     * </pre>
     *
     * <code>string document = 1;</code>
     */
    public Builder clearDocument() {
      
      document_ = getDefaultInstance().getDocument();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the document to transform.
     * </pre>
     *
     * <code>string document = 1;</code>
     */
    public Builder setDocumentBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      document_ = value;
      onChanged();
      return this;
    }

    private java.util.List<com.google.firestore.v1beta1.DocumentTransform.FieldTransform> fieldTransforms_ =
      java.util.Collections.emptyList();
    private void ensureFieldTransformsIsMutable() {
      if (!((bitField0_ & 0x00000002) == 0x00000002)) {
        fieldTransforms_ = new java.util.ArrayList<com.google.firestore.v1beta1.DocumentTransform.FieldTransform>(fieldTransforms_);
        bitField0_ |= 0x00000002;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder, com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder> fieldTransformsBuilder_;

    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public java.util.List<com.google.firestore.v1beta1.DocumentTransform.FieldTransform> getFieldTransformsList() {
      if (fieldTransformsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(fieldTransforms_);
      } else {
        return fieldTransformsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public int getFieldTransformsCount() {
      if (fieldTransformsBuilder_ == null) {
        return fieldTransforms_.size();
      } else {
        return fieldTransformsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform getFieldTransforms(int index) {
      if (fieldTransformsBuilder_ == null) {
        return fieldTransforms_.get(index);
      } else {
        return fieldTransformsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder setFieldTransforms(
        int index, com.google.firestore.v1beta1.DocumentTransform.FieldTransform value) {
      if (fieldTransformsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFieldTransformsIsMutable();
        fieldTransforms_.set(index, value);
        onChanged();
      } else {
        fieldTransformsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder setFieldTransforms(
        int index, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder builderForValue) {
      if (fieldTransformsBuilder_ == null) {
        ensureFieldTransformsIsMutable();
        fieldTransforms_.set(index, builderForValue.build());
        onChanged();
      } else {
        fieldTransformsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder addFieldTransforms(com.google.firestore.v1beta1.DocumentTransform.FieldTransform value) {
      if (fieldTransformsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFieldTransformsIsMutable();
        fieldTransforms_.add(value);
        onChanged();
      } else {
        fieldTransformsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder addFieldTransforms(
        int index, com.google.firestore.v1beta1.DocumentTransform.FieldTransform value) {
      if (fieldTransformsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFieldTransformsIsMutable();
        fieldTransforms_.add(index, value);
        onChanged();
      } else {
        fieldTransformsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder addFieldTransforms(
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder builderForValue) {
      if (fieldTransformsBuilder_ == null) {
        ensureFieldTransformsIsMutable();
        fieldTransforms_.add(builderForValue.build());
        onChanged();
      } else {
        fieldTransformsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder addFieldTransforms(
        int index, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder builderForValue) {
      if (fieldTransformsBuilder_ == null) {
        ensureFieldTransformsIsMutable();
        fieldTransforms_.add(index, builderForValue.build());
        onChanged();
      } else {
        fieldTransformsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder addAllFieldTransforms(
        java.lang.Iterable<? extends com.google.firestore.v1beta1.DocumentTransform.FieldTransform> values) {
      if (fieldTransformsBuilder_ == null) {
        ensureFieldTransformsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, fieldTransforms_);
        onChanged();
      } else {
        fieldTransformsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder clearFieldTransforms() {
      if (fieldTransformsBuilder_ == null) {
        fieldTransforms_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        fieldTransformsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public Builder removeFieldTransforms(int index) {
      if (fieldTransformsBuilder_ == null) {
        ensureFieldTransformsIsMutable();
        fieldTransforms_.remove(index);
        onChanged();
      } else {
        fieldTransformsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder getFieldTransformsBuilder(
        int index) {
      return getFieldTransformsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder getFieldTransformsOrBuilder(
        int index) {
      if (fieldTransformsBuilder_ == null) {
        return fieldTransforms_.get(index);  } else {
        return fieldTransformsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public java.util.List<? extends com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder> 
         getFieldTransformsOrBuilderList() {
      if (fieldTransformsBuilder_ != null) {
        return fieldTransformsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(fieldTransforms_);
      }
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder addFieldTransformsBuilder() {
      return getFieldTransformsFieldBuilder().addBuilder(
          com.google.firestore.v1beta1.DocumentTransform.FieldTransform.getDefaultInstance());
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder addFieldTransformsBuilder(
        int index) {
      return getFieldTransformsFieldBuilder().addBuilder(
          index, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.getDefaultInstance());
    }
    /**
     * <pre>
     * The list of transformations to apply to the fields of the document, in
     * order.
     * This must not be empty.
     * </pre>
     *
     * <code>repeated .google.firestore.v1beta1.DocumentTransform.FieldTransform field_transforms = 2;</code>
     */
    public java.util.List<com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder> 
         getFieldTransformsBuilderList() {
      return getFieldTransformsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.firestore.v1beta1.DocumentTransform.FieldTransform, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder, com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder> 
        getFieldTransformsFieldBuilder() {
      if (fieldTransformsBuilder_ == null) {
        fieldTransformsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.firestore.v1beta1.DocumentTransform.FieldTransform, com.google.firestore.v1beta1.DocumentTransform.FieldTransform.Builder, com.google.firestore.v1beta1.DocumentTransform.FieldTransformOrBuilder>(
                fieldTransforms_,
                ((bitField0_ & 0x00000002) == 0x00000002),
                getParentForChildren(),
                isClean());
        fieldTransforms_ = null;
      }
      return fieldTransformsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


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

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

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

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

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

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

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

}

