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

package com.google.pubsub.v1;

/**
 *
 *
 * <pre>
 * Request for the `StreamingPull` streaming RPC method. This request is used to
 * establish the initial stream as well as to stream acknowledgements and ack
 * deadline modifications from the client to the server.
 * </pre>
 *
 * Protobuf type {@code google.pubsub.v1.StreamingPullRequest}
 */
public final class StreamingPullRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullRequest)
    StreamingPullRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use StreamingPullRequest.newBuilder() to construct.
  private StreamingPullRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private StreamingPullRequest() {
    subscription_ = "";
    ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    modifyDeadlineSeconds_ = emptyIntList();
    modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

  private StreamingPullRequest(
      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:
            {
              java.lang.String s = input.readStringRequireUtf8();

              subscription_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                ackIds_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000002;
              }
              ackIds_.add(s);
              break;
            }
          case 24:
            {
              if (!((mutable_bitField0_ & 0x00000004) != 0)) {
                modifyDeadlineSeconds_ = newIntList();
                mutable_bitField0_ |= 0x00000004;
              }
              modifyDeadlineSeconds_.addInt(input.readInt32());
              break;
            }
          case 26:
            {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) {
                modifyDeadlineSeconds_ = newIntList();
                mutable_bitField0_ |= 0x00000004;
              }
              while (input.getBytesUntilLimit() > 0) {
                modifyDeadlineSeconds_.addInt(input.readInt32());
              }
              input.popLimit(limit);
              break;
            }
          case 34:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
                modifyDeadlineAckIds_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000008;
              }
              modifyDeadlineAckIds_.add(s);
              break;
            }
          case 40:
            {
              streamAckDeadlineSeconds_ = input.readInt32();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        ackIds_ = ackIds_.getUnmodifiableView();
      }
      if (((mutable_bitField0_ & 0x00000004) != 0)) {
        modifyDeadlineSeconds_.makeImmutable(); // C
      }
      if (((mutable_bitField0_ & 0x00000008) != 0)) {
        modifyDeadlineAckIds_ = modifyDeadlineAckIds_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.pubsub.v1.PubsubProto
        .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.pubsub.v1.PubsubProto
        .internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.pubsub.v1.StreamingPullRequest.class,
            com.google.pubsub.v1.StreamingPullRequest.Builder.class);
  }

  private int bitField0_;
  public static final int SUBSCRIPTION_FIELD_NUMBER = 1;
  private volatile java.lang.Object subscription_;
  /**
   *
   *
   * <pre>
   * The subscription for which to initialize the new stream. This must be
   * provided in the first request on the stream, and must not be set in
   * subsequent requests from client to server.
   * Format is `projects/{project}/subscriptions/{sub}`.
   * </pre>
   *
   * <code>string subscription = 1;</code>
   */
  public java.lang.String getSubscription() {
    java.lang.Object ref = subscription_;
    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();
      subscription_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The subscription for which to initialize the new stream. This must be
   * provided in the first request on the stream, and must not be set in
   * subsequent requests from client to server.
   * Format is `projects/{project}/subscriptions/{sub}`.
   * </pre>
   *
   * <code>string subscription = 1;</code>
   */
  public com.google.protobuf.ByteString getSubscriptionBytes() {
    java.lang.Object ref = subscription_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      subscription_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ACK_IDS_FIELD_NUMBER = 2;
  private com.google.protobuf.LazyStringList ackIds_;
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs for acknowledging previously received messages
   * (received on this stream or a different stream). If an ack ID has expired,
   * the corresponding message may be redelivered later. Acknowledging a message
   * more than once will not result in an error. If the acknowledgement ID is
   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2;</code>
   */
  public com.google.protobuf.ProtocolStringList getAckIdsList() {
    return ackIds_;
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs for acknowledging previously received messages
   * (received on this stream or a different stream). If an ack ID has expired,
   * the corresponding message may be redelivered later. Acknowledging a message
   * more than once will not result in an error. If the acknowledgement ID is
   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2;</code>
   */
  public int getAckIdsCount() {
    return ackIds_.size();
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs for acknowledging previously received messages
   * (received on this stream or a different stream). If an ack ID has expired,
   * the corresponding message may be redelivered later. Acknowledging a message
   * more than once will not result in an error. If the acknowledgement ID is
   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2;</code>
   */
  public java.lang.String getAckIds(int index) {
    return ackIds_.get(index);
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs for acknowledging previously received messages
   * (received on this stream or a different stream). If an ack ID has expired,
   * the corresponding message may be redelivered later. Acknowledging a message
   * more than once will not result in an error. If the acknowledgement ID is
   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2;</code>
   */
  public com.google.protobuf.ByteString getAckIdsBytes(int index) {
    return ackIds_.getByteString(index);
  }

  public static final int MODIFY_DEADLINE_SECONDS_FIELD_NUMBER = 3;
  private com.google.protobuf.Internal.IntList modifyDeadlineSeconds_;
  /**
   *
   *
   * <pre>
   * The list of new ack deadlines for the IDs listed in
   * `modify_deadline_ack_ids`. The size of this list must be the same as the
   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
   * element in the same position in `modify_deadline_ack_ids`. The new ack
   * deadline is with respect to the time this request was sent to the Pub/Sub
   * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
   * will expire 10 seconds after this request is received. If the value is 0,
   * the message is immediately made available for another streaming or
   * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
   * be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated int32 modify_deadline_seconds = 3;</code>
   */
  public java.util.List<java.lang.Integer> getModifyDeadlineSecondsList() {
    return modifyDeadlineSeconds_;
  }
  /**
   *
   *
   * <pre>
   * The list of new ack deadlines for the IDs listed in
   * `modify_deadline_ack_ids`. The size of this list must be the same as the
   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
   * element in the same position in `modify_deadline_ack_ids`. The new ack
   * deadline is with respect to the time this request was sent to the Pub/Sub
   * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
   * will expire 10 seconds after this request is received. If the value is 0,
   * the message is immediately made available for another streaming or
   * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
   * be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated int32 modify_deadline_seconds = 3;</code>
   */
  public int getModifyDeadlineSecondsCount() {
    return modifyDeadlineSeconds_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of new ack deadlines for the IDs listed in
   * `modify_deadline_ack_ids`. The size of this list must be the same as the
   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
   * element in the same position in `modify_deadline_ack_ids`. The new ack
   * deadline is with respect to the time this request was sent to the Pub/Sub
   * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
   * will expire 10 seconds after this request is received. If the value is 0,
   * the message is immediately made available for another streaming or
   * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
   * be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated int32 modify_deadline_seconds = 3;</code>
   */
  public int getModifyDeadlineSeconds(int index) {
    return modifyDeadlineSeconds_.getInt(index);
  }

  private int modifyDeadlineSecondsMemoizedSerializedSize = -1;

  public static final int MODIFY_DEADLINE_ACK_IDS_FIELD_NUMBER = 4;
  private com.google.protobuf.LazyStringList modifyDeadlineAckIds_;
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs whose deadline will be modified based on the
   * corresponding element in `modify_deadline_seconds`. This field can be used
   * to indicate that more time is needed to process a message by the
   * subscriber, or to make the message available for redelivery if the
   * processing was interrupted.
   * </pre>
   *
   * <code>repeated string modify_deadline_ack_ids = 4;</code>
   */
  public com.google.protobuf.ProtocolStringList getModifyDeadlineAckIdsList() {
    return modifyDeadlineAckIds_;
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs whose deadline will be modified based on the
   * corresponding element in `modify_deadline_seconds`. This field can be used
   * to indicate that more time is needed to process a message by the
   * subscriber, or to make the message available for redelivery if the
   * processing was interrupted.
   * </pre>
   *
   * <code>repeated string modify_deadline_ack_ids = 4;</code>
   */
  public int getModifyDeadlineAckIdsCount() {
    return modifyDeadlineAckIds_.size();
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs whose deadline will be modified based on the
   * corresponding element in `modify_deadline_seconds`. This field can be used
   * to indicate that more time is needed to process a message by the
   * subscriber, or to make the message available for redelivery if the
   * processing was interrupted.
   * </pre>
   *
   * <code>repeated string modify_deadline_ack_ids = 4;</code>
   */
  public java.lang.String getModifyDeadlineAckIds(int index) {
    return modifyDeadlineAckIds_.get(index);
  }
  /**
   *
   *
   * <pre>
   * List of acknowledgement IDs whose deadline will be modified based on the
   * corresponding element in `modify_deadline_seconds`. This field can be used
   * to indicate that more time is needed to process a message by the
   * subscriber, or to make the message available for redelivery if the
   * processing was interrupted.
   * </pre>
   *
   * <code>repeated string modify_deadline_ack_ids = 4;</code>
   */
  public com.google.protobuf.ByteString getModifyDeadlineAckIdsBytes(int index) {
    return modifyDeadlineAckIds_.getByteString(index);
  }

  public static final int STREAM_ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5;
  private int streamAckDeadlineSeconds_;
  /**
   *
   *
   * <pre>
   * The ack deadline to use for the stream. This must be provided in the
   * first request on the stream, but it can also be updated on subsequent
   * requests from client to server. The minimum deadline you can specify is 10
   * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
   * </pre>
   *
   * <code>int32 stream_ack_deadline_seconds = 5;</code>
   */
  public int getStreamAckDeadlineSeconds() {
    return streamAckDeadlineSeconds_;
  }

  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 {
    getSerializedSize();
    if (!getSubscriptionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
    }
    for (int i = 0; i < ackIds_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ackIds_.getRaw(i));
    }
    if (getModifyDeadlineSecondsList().size() > 0) {
      output.writeUInt32NoTag(26);
      output.writeUInt32NoTag(modifyDeadlineSecondsMemoizedSerializedSize);
    }
    for (int i = 0; i < modifyDeadlineSeconds_.size(); i++) {
      output.writeInt32NoTag(modifyDeadlineSeconds_.getInt(i));
    }
    for (int i = 0; i < modifyDeadlineAckIds_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(
          output, 4, modifyDeadlineAckIds_.getRaw(i));
    }
    if (streamAckDeadlineSeconds_ != 0) {
      output.writeInt32(5, streamAckDeadlineSeconds_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getSubscriptionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < ackIds_.size(); i++) {
        dataSize += computeStringSizeNoTag(ackIds_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getAckIdsList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < modifyDeadlineSeconds_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(
                modifyDeadlineSeconds_.getInt(i));
      }
      size += dataSize;
      if (!getModifyDeadlineSecondsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      modifyDeadlineSecondsMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < modifyDeadlineAckIds_.size(); i++) {
        dataSize += computeStringSizeNoTag(modifyDeadlineAckIds_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getModifyDeadlineAckIdsList().size();
    }
    if (streamAckDeadlineSeconds_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, streamAckDeadlineSeconds_);
    }
    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.pubsub.v1.StreamingPullRequest)) {
      return super.equals(obj);
    }
    com.google.pubsub.v1.StreamingPullRequest other =
        (com.google.pubsub.v1.StreamingPullRequest) obj;

    if (!getSubscription().equals(other.getSubscription())) return false;
    if (!getAckIdsList().equals(other.getAckIdsList())) return false;
    if (!getModifyDeadlineSecondsList().equals(other.getModifyDeadlineSecondsList())) return false;
    if (!getModifyDeadlineAckIdsList().equals(other.getModifyDeadlineAckIdsList())) return false;
    if (getStreamAckDeadlineSeconds() != other.getStreamAckDeadlineSeconds()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER;
    hash = (53 * hash) + getSubscription().hashCode();
    if (getAckIdsCount() > 0) {
      hash = (37 * hash) + ACK_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getAckIdsList().hashCode();
    }
    if (getModifyDeadlineSecondsCount() > 0) {
      hash = (37 * hash) + MODIFY_DEADLINE_SECONDS_FIELD_NUMBER;
      hash = (53 * hash) + getModifyDeadlineSecondsList().hashCode();
    }
    if (getModifyDeadlineAckIdsCount() > 0) {
      hash = (37 * hash) + MODIFY_DEADLINE_ACK_IDS_FIELD_NUMBER;
      hash = (53 * hash) + getModifyDeadlineAckIdsList().hashCode();
    }
    hash = (37 * hash) + STREAM_ACK_DEADLINE_SECONDS_FIELD_NUMBER;
    hash = (53 * hash) + getStreamAckDeadlineSeconds();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public static com.google.pubsub.v1.StreamingPullRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.pubsub.v1.StreamingPullRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

  public static com.google.pubsub.v1.StreamingPullRequest 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.pubsub.v1.StreamingPullRequest 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>
   * Request for the `StreamingPull` streaming RPC method. This request is used to
   * establish the initial stream as well as to stream acknowledgements and ack
   * deadline modifications from the client to the server.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.StreamingPullRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullRequest)
      com.google.pubsub.v1.StreamingPullRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.StreamingPullRequest.class,
              com.google.pubsub.v1.StreamingPullRequest.Builder.class);
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      subscription_ = "";

      ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      modifyDeadlineSeconds_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000004);
      modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000008);
      streamAckDeadlineSeconds_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.StreamingPullRequest buildPartial() {
      com.google.pubsub.v1.StreamingPullRequest result =
          new com.google.pubsub.v1.StreamingPullRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.subscription_ = subscription_;
      if (((bitField0_ & 0x00000002) != 0)) {
        ackIds_ = ackIds_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.ackIds_ = ackIds_;
      if (((bitField0_ & 0x00000004) != 0)) {
        modifyDeadlineSeconds_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.modifyDeadlineSeconds_ = modifyDeadlineSeconds_;
      if (((bitField0_ & 0x00000008) != 0)) {
        modifyDeadlineAckIds_ = modifyDeadlineAckIds_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000008);
      }
      result.modifyDeadlineAckIds_ = modifyDeadlineAckIds_;
      result.streamAckDeadlineSeconds_ = streamAckDeadlineSeconds_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

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

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

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

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

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

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

    public Builder mergeFrom(com.google.pubsub.v1.StreamingPullRequest other) {
      if (other == com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance()) return this;
      if (!other.getSubscription().isEmpty()) {
        subscription_ = other.subscription_;
        onChanged();
      }
      if (!other.ackIds_.isEmpty()) {
        if (ackIds_.isEmpty()) {
          ackIds_ = other.ackIds_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureAckIdsIsMutable();
          ackIds_.addAll(other.ackIds_);
        }
        onChanged();
      }
      if (!other.modifyDeadlineSeconds_.isEmpty()) {
        if (modifyDeadlineSeconds_.isEmpty()) {
          modifyDeadlineSeconds_ = other.modifyDeadlineSeconds_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureModifyDeadlineSecondsIsMutable();
          modifyDeadlineSeconds_.addAll(other.modifyDeadlineSeconds_);
        }
        onChanged();
      }
      if (!other.modifyDeadlineAckIds_.isEmpty()) {
        if (modifyDeadlineAckIds_.isEmpty()) {
          modifyDeadlineAckIds_ = other.modifyDeadlineAckIds_;
          bitField0_ = (bitField0_ & ~0x00000008);
        } else {
          ensureModifyDeadlineAckIdsIsMutable();
          modifyDeadlineAckIds_.addAll(other.modifyDeadlineAckIds_);
        }
        onChanged();
      }
      if (other.getStreamAckDeadlineSeconds() != 0) {
        setStreamAckDeadlineSeconds(other.getStreamAckDeadlineSeconds());
      }
      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.pubsub.v1.StreamingPullRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.pubsub.v1.StreamingPullRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object subscription_ = "";
    /**
     *
     *
     * <pre>
     * The subscription for which to initialize the new stream. This must be
     * provided in the first request on the stream, and must not be set in
     * subsequent requests from client to server.
     * Format is `projects/{project}/subscriptions/{sub}`.
     * </pre>
     *
     * <code>string subscription = 1;</code>
     */
    public java.lang.String getSubscription() {
      java.lang.Object ref = subscription_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        subscription_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The subscription for which to initialize the new stream. This must be
     * provided in the first request on the stream, and must not be set in
     * subsequent requests from client to server.
     * Format is `projects/{project}/subscriptions/{sub}`.
     * </pre>
     *
     * <code>string subscription = 1;</code>
     */
    public com.google.protobuf.ByteString getSubscriptionBytes() {
      java.lang.Object ref = subscription_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        subscription_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The subscription for which to initialize the new stream. This must be
     * provided in the first request on the stream, and must not be set in
     * subsequent requests from client to server.
     * Format is `projects/{project}/subscriptions/{sub}`.
     * </pre>
     *
     * <code>string subscription = 1;</code>
     */
    public Builder setSubscription(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      subscription_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The subscription for which to initialize the new stream. This must be
     * provided in the first request on the stream, and must not be set in
     * subsequent requests from client to server.
     * Format is `projects/{project}/subscriptions/{sub}`.
     * </pre>
     *
     * <code>string subscription = 1;</code>
     */
    public Builder clearSubscription() {

      subscription_ = getDefaultInstance().getSubscription();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The subscription for which to initialize the new stream. This must be
     * provided in the first request on the stream, and must not be set in
     * subsequent requests from client to server.
     * Format is `projects/{project}/subscriptions/{sub}`.
     * </pre>
     *
     * <code>string subscription = 1;</code>
     */
    public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      subscription_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList ackIds_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureAckIdsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public com.google.protobuf.ProtocolStringList getAckIdsList() {
      return ackIds_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public int getAckIdsCount() {
      return ackIds_.size();
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public java.lang.String getAckIds(int index) {
      return ackIds_.get(index);
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public com.google.protobuf.ByteString getAckIdsBytes(int index) {
      return ackIds_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public Builder setAckIds(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAckIdsIsMutable();
      ackIds_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public Builder addAckIds(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAckIdsIsMutable();
      ackIds_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public Builder addAllAckIds(java.lang.Iterable<java.lang.String> values) {
      ensureAckIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public Builder clearAckIds() {
      ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs for acknowledging previously received messages
     * (received on this stream or a different stream). If an ack ID has expired,
     * the corresponding message may be redelivered later. Acknowledging a message
     * more than once will not result in an error. If the acknowledgement ID is
     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated string ack_ids = 2;</code>
     */
    public Builder addAckIdsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureAckIdsIsMutable();
      ackIds_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.Internal.IntList modifyDeadlineSeconds_ = emptyIntList();

    private void ensureModifyDeadlineSecondsIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        modifyDeadlineSeconds_ = mutableCopy(modifyDeadlineSeconds_);
        bitField0_ |= 0x00000004;
      }
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public java.util.List<java.lang.Integer> getModifyDeadlineSecondsList() {
      return ((bitField0_ & 0x00000004) != 0)
          ? java.util.Collections.unmodifiableList(modifyDeadlineSeconds_)
          : modifyDeadlineSeconds_;
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public int getModifyDeadlineSecondsCount() {
      return modifyDeadlineSeconds_.size();
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public int getModifyDeadlineSeconds(int index) {
      return modifyDeadlineSeconds_.getInt(index);
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public Builder setModifyDeadlineSeconds(int index, int value) {
      ensureModifyDeadlineSecondsIsMutable();
      modifyDeadlineSeconds_.setInt(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public Builder addModifyDeadlineSeconds(int value) {
      ensureModifyDeadlineSecondsIsMutable();
      modifyDeadlineSeconds_.addInt(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public Builder addAllModifyDeadlineSeconds(
        java.lang.Iterable<? extends java.lang.Integer> values) {
      ensureModifyDeadlineSecondsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modifyDeadlineSeconds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of new ack deadlines for the IDs listed in
     * `modify_deadline_ack_ids`. The size of this list must be the same as the
     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
     * element in the same position in `modify_deadline_ack_ids`. The new ack
     * deadline is with respect to the time this request was sent to the Pub/Sub
     * system. Must be &gt;= 0. For example, if the value is 10, the new ack deadline
     * will expire 10 seconds after this request is received. If the value is 0,
     * the message is immediately made available for another streaming or
     * non-streaming pull request. If the value is &lt; 0 (an error), the stream will
     * be aborted with status `INVALID_ARGUMENT`.
     * </pre>
     *
     * <code>repeated int32 modify_deadline_seconds = 3;</code>
     */
    public Builder clearModifyDeadlineSeconds() {
      modifyDeadlineSeconds_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList modifyDeadlineAckIds_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureModifyDeadlineAckIdsIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        modifyDeadlineAckIds_ = new com.google.protobuf.LazyStringArrayList(modifyDeadlineAckIds_);
        bitField0_ |= 0x00000008;
      }
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public com.google.protobuf.ProtocolStringList getModifyDeadlineAckIdsList() {
      return modifyDeadlineAckIds_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public int getModifyDeadlineAckIdsCount() {
      return modifyDeadlineAckIds_.size();
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public java.lang.String getModifyDeadlineAckIds(int index) {
      return modifyDeadlineAckIds_.get(index);
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public com.google.protobuf.ByteString getModifyDeadlineAckIdsBytes(int index) {
      return modifyDeadlineAckIds_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public Builder setModifyDeadlineAckIds(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureModifyDeadlineAckIdsIsMutable();
      modifyDeadlineAckIds_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public Builder addModifyDeadlineAckIds(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureModifyDeadlineAckIdsIsMutable();
      modifyDeadlineAckIds_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public Builder addAllModifyDeadlineAckIds(java.lang.Iterable<java.lang.String> values) {
      ensureModifyDeadlineAckIdsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modifyDeadlineAckIds_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public Builder clearModifyDeadlineAckIds() {
      modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of acknowledgement IDs whose deadline will be modified based on the
     * corresponding element in `modify_deadline_seconds`. This field can be used
     * to indicate that more time is needed to process a message by the
     * subscriber, or to make the message available for redelivery if the
     * processing was interrupted.
     * </pre>
     *
     * <code>repeated string modify_deadline_ack_ids = 4;</code>
     */
    public Builder addModifyDeadlineAckIdsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureModifyDeadlineAckIdsIsMutable();
      modifyDeadlineAckIds_.add(value);
      onChanged();
      return this;
    }

    private int streamAckDeadlineSeconds_;
    /**
     *
     *
     * <pre>
     * The ack deadline to use for the stream. This must be provided in the
     * first request on the stream, but it can also be updated on subsequent
     * requests from client to server. The minimum deadline you can specify is 10
     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
     * </pre>
     *
     * <code>int32 stream_ack_deadline_seconds = 5;</code>
     */
    public int getStreamAckDeadlineSeconds() {
      return streamAckDeadlineSeconds_;
    }
    /**
     *
     *
     * <pre>
     * The ack deadline to use for the stream. This must be provided in the
     * first request on the stream, but it can also be updated on subsequent
     * requests from client to server. The minimum deadline you can specify is 10
     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
     * </pre>
     *
     * <code>int32 stream_ack_deadline_seconds = 5;</code>
     */
    public Builder setStreamAckDeadlineSeconds(int value) {

      streamAckDeadlineSeconds_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The ack deadline to use for the stream. This must be provided in the
     * first request on the stream, but it can also be updated on subsequent
     * requests from client to server. The minimum deadline you can specify is 10
     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
     * </pre>
     *
     * <code>int32 stream_ack_deadline_seconds = 5;</code>
     */
    public Builder clearStreamAckDeadlineSeconds() {

      streamAckDeadlineSeconds_ = 0;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.pubsub.v1.StreamingPullRequest)
  }

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

  static {
    DEFAULT_INSTANCE = new com.google.pubsub.v1.StreamingPullRequest();
  }

  public static com.google.pubsub.v1.StreamingPullRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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