@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.AcknowledgeRequest)) { return super.equals(obj); } com.google.pubsub.v1.AcknowledgeRequest other = (com.google.pubsub.v1.AcknowledgeRequest) obj; boolean result = true; result = result && getSubscription().equals(other.getSubscription()); result = result && getAckIdsList().equals(other.getAckIdsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getSubscription().hashCode(); if (getAckIdsCount() > 0) { hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; hash = (53 * hash) + getAckIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The subscription whose message is being acknowledged. * Format is `projects/{project}/subscriptions/{sub}`. * </pre> * * <code>string subscription = 1;</code> */ public Builder clearSubscription() { subscription_ = getDefaultInstance().getSubscription(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.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(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void acknowledgeTest() { Empty expectedResponse = Empty.newBuilder().build(); mockSubscriber.addResponse(expectedResponse); ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); List<String> ackIds = new ArrayList<>(); client.acknowledge(subscription, ackIds); List<GeneratedMessageV3> actualRequests = mockSubscriber.getRequests(); Assert.assertEquals(1, actualRequests.size()); AcknowledgeRequest actualRequest = (AcknowledgeRequest) actualRequests.get(0); Assert.assertEquals( subscription, ProjectSubscriptionName.parse(actualRequest.getSubscription())); Assert.assertEquals(ackIds, actualRequest.getAckIdsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.AcknowledgeRequest)) { return super.equals(obj); } com.google.pubsub.v1.AcknowledgeRequest other = (com.google.pubsub.v1.AcknowledgeRequest) obj; boolean result = true; result = result && getSubscription().equals(other.getSubscription()); result = result && getAckIdsList().equals(other.getAckIdsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.AcknowledgeRequest)) { return super.equals(obj); } com.google.pubsub.v1.AcknowledgeRequest other = (com.google.pubsub.v1.AcknowledgeRequest) obj; boolean result = true; result = result && getSubscription() .equals(other.getSubscription()); result = result && getAckIdsList() .equals(other.getAckIdsList()); return result; }
/** * <code>optional string subscription = 1;</code> * * <pre> * The subscription whose message is being acknowledged. * </pre> */ public Builder clearSubscription() { subscription_ = getDefaultInstance().getSubscription(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().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(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The subscription whose message is being acknowledged. * </pre> * * <code>optional string subscription = 1;</code> */ public Builder clearSubscription() { subscription_ = getDefaultInstance().getSubscription(); onChanged(); return this; } /**
@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(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The subscription whose message is being acknowledged. * Format is `projects/{project}/subscriptions/{sub}`. * </pre> * * <code>string subscription = 1;</code> */ public Builder clearSubscription() { subscription_ = getDefaultInstance().getSubscription(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.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(); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.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(); } onChanged(); return this; }
public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { if (other == com.google.pubsub.v1.AcknowledgeRequest.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(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }