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

// Protobuf Java Version: 3.25.8
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 acknowledgments 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.emptyList();
    modifyDeadlineSeconds_ = emptyIntList();
    modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList();
    clientId_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new StreamingPullRequest();
  }

  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);
  }

  public static final int SUBSCRIPTION_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object subscription_ = "";

  /**
   *
   *
   * <pre>
   * Required. 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The subscription.
   */
  @java.lang.Override
  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>
   * Required. 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for subscription.
   */
  @java.lang.Override
  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;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringArrayList ackIds_ =
      com.google.protobuf.LazyStringArrayList.emptyList();

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 acknowledgment
   * ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return A list containing the ackIds.
   */
  public com.google.protobuf.ProtocolStringList getAckIdsList() {
    return ackIds_;
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 acknowledgment
   * ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The count of ackIds.
   */
  public int getAckIdsCount() {
    return ackIds_.size();
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 acknowledgment
   * ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @param index The index of the element to return.
   * @return The ackIds at the given index.
   */
  public java.lang.String getAckIds(int index) {
    return ackIds_.get(index);
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 acknowledgment
   * ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>repeated string ack_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the ackIds at the given index.
   */
  public com.google.protobuf.ByteString getAckIdsBytes(int index) {
    return ackIds_.getByteString(index);
  }

  public static final int MODIFY_DEADLINE_SECONDS_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private com.google.protobuf.Internal.IntList modifyDeadlineSeconds_ = emptyIntList();

  /**
   *
   *
   * <pre>
   * Optional. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return A list containing the modifyDeadlineSeconds.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer> getModifyDeadlineSecondsList() {
    return modifyDeadlineSeconds_;
  }

  /**
   *
   *
   * <pre>
   * Optional. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The count of modifyDeadlineSeconds.
   */
  public int getModifyDeadlineSecondsCount() {
    return modifyDeadlineSeconds_.size();
  }

  /**
   *
   *
   * <pre>
   * Optional. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The modifyDeadlineSeconds at the given index.
   */
  public int getModifyDeadlineSeconds(int index) {
    return modifyDeadlineSeconds_.getInt(index);
  }

  private int modifyDeadlineSecondsMemoizedSerializedSize = -1;

  public static final int MODIFY_DEADLINE_ACK_IDS_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringArrayList modifyDeadlineAckIds_ =
      com.google.protobuf.LazyStringArrayList.emptyList();

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return A list containing the modifyDeadlineAckIds.
   */
  public com.google.protobuf.ProtocolStringList getModifyDeadlineAckIdsList() {
    return modifyDeadlineAckIds_;
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The count of modifyDeadlineAckIds.
   */
  public int getModifyDeadlineAckIdsCount() {
    return modifyDeadlineAckIds_.size();
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The modifyDeadlineAckIds at the given index.
   */
  public java.lang.String getModifyDeadlineAckIds(int index) {
    return modifyDeadlineAckIds_.get(index);
  }

  /**
   *
   *
   * <pre>
   * Optional. List of acknowledgment 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the modifyDeadlineAckIds at the given index.
   */
  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_ = 0;

  /**
   *
   *
   * <pre>
   * Required. 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 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The streamAckDeadlineSeconds.
   */
  @java.lang.Override
  public int getStreamAckDeadlineSeconds() {
    return streamAckDeadlineSeconds_;
  }

  public static final int CLIENT_ID_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object clientId_ = "";

  /**
   *
   *
   * <pre>
   * Optional. A unique identifier that is used to distinguish client instances
   * from each other. Only needs to be provided on the initial request. When a
   * stream disconnects and reconnects for the same stream, the client_id should
   * be set to the same value so that state associated with the old stream can
   * be transferred to the new stream. The same client_id should not be used for
   * different client instances.
   * </pre>
   *
   * <code>string client_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The clientId.
   */
  @java.lang.Override
  public java.lang.String getClientId() {
    java.lang.Object ref = clientId_;
    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();
      clientId_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Optional. A unique identifier that is used to distinguish client instances
   * from each other. Only needs to be provided on the initial request. When a
   * stream disconnects and reconnects for the same stream, the client_id should
   * be set to the same value so that state associated with the old stream can
   * be transferred to the new stream. The same client_id should not be used for
   * different client instances.
   * </pre>
   *
   * <code>string client_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for clientId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getClientIdBytes() {
    java.lang.Object ref = clientId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      clientId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MAX_OUTSTANDING_MESSAGES_FIELD_NUMBER = 7;
  private long maxOutstandingMessages_ = 0L;

  /**
   *
   *
   * <pre>
   * Optional. Flow control settings for the maximum number of outstanding
   * messages. When there are `max_outstanding_messages` currently sent to the
   * streaming pull client that have not yet been acked or nacked, the server
   * stops sending more messages. The sending of messages resumes once the
   * number of outstanding messages is less than this value. If the value is
   * &lt;= 0, there is no limit to the number of outstanding messages. This
   * property can only be set on the initial StreamingPullRequest. If it is set
   * on a subsequent request, the stream will be aborted with status
   * `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>int64 max_outstanding_messages = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The maxOutstandingMessages.
   */
  @java.lang.Override
  public long getMaxOutstandingMessages() {
    return maxOutstandingMessages_;
  }

  public static final int MAX_OUTSTANDING_BYTES_FIELD_NUMBER = 8;
  private long maxOutstandingBytes_ = 0L;

  /**
   *
   *
   * <pre>
   * Optional. Flow control settings for the maximum number of outstanding
   * bytes. When there are `max_outstanding_bytes` or more worth of messages
   * currently sent to the streaming pull client that have not yet been acked or
   * nacked, the server will stop sending more messages. The sending of messages
   * resumes once the number of outstanding bytes is less than this value. If
   * the value is &lt;= 0, there is no limit to the number of outstanding bytes.
   * This property can only be set on the initial StreamingPullRequest. If it is
   * set on a subsequent request, the stream will be aborted with status
   * `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>int64 max_outstanding_bytes = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The maxOutstandingBytes.
   */
  @java.lang.Override
  public long getMaxOutstandingBytes() {
    return maxOutstandingBytes_;
  }

  public static final int PROTOCOL_VERSION_FIELD_NUMBER = 10;
  private long protocolVersion_ = 0L;

  /**
   *
   *
   * <pre>
   * Optional. The protocol version used by the client. This property can only
   * be set on the initial StreamingPullRequest. If it is set on a subsequent
   * request, the stream will be aborted with status `INVALID_ARGUMENT`.
   * </pre>
   *
   * <code>int64 protocol_version = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The protocolVersion.
   */
  @java.lang.Override
  public long getProtocolVersion() {
    return protocolVersion_;
  }

  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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
      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_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientId_);
    }
    if (maxOutstandingMessages_ != 0L) {
      output.writeInt64(7, maxOutstandingMessages_);
    }
    if (maxOutstandingBytes_ != 0L) {
      output.writeInt64(8, maxOutstandingBytes_);
    }
    if (protocolVersion_ != 0L) {
      output.writeInt64(10, protocolVersion_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
      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_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientId_);
    }
    if (maxOutstandingMessages_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, maxOutstandingMessages_);
    }
    if (maxOutstandingBytes_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, maxOutstandingBytes_);
    }
    if (protocolVersion_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, protocolVersion_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    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 = (37 * hash) + CLIENT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getClientId().hashCode();
    hash = (37 * hash) + MAX_OUTSTANDING_MESSAGES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxOutstandingMessages());
    hash = (37 * hash) + MAX_OUTSTANDING_BYTES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxOutstandingBytes());
    hash = (37 * hash) + PROTOCOL_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getProtocolVersion());
    hash = (29 * hash) + getUnknownFields().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 acknowledgments 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() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      subscription_ = "";
      ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList();
      modifyDeadlineSeconds_ = emptyIntList();
      modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList();
      streamAckDeadlineSeconds_ = 0;
      clientId_ = "";
      maxOutstandingMessages_ = 0L;
      maxOutstandingBytes_ = 0L;
      protocolVersion_ = 0L;
      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;
    }

