@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@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(); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <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; } /**
@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; }
@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; }
@java.lang.Override public com.google.pubsub.v1.AcknowledgeRequest getDefaultInstanceForType() { return com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance(); }
@java.lang.Override public com.google.pubsub.v1.AcknowledgeRequest build() { com.google.pubsub.v1.AcknowledgeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 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)); } unknownFields.writeTo(output); }
@java.lang.Override public com.google.pubsub.v1.AcknowledgeRequest buildPartial() { com.google.pubsub.v1.AcknowledgeRequest result = new com.google.pubsub.v1.AcknowledgeRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.subscription_ = subscription_; if (((bitField0_ & 0x00000002) == 0x00000002)) { ackIds_ = ackIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.ackIds_ = ackIds_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
@Override public void acknowledge( AcknowledgeRequest request, io.grpc.stub.StreamObserver<Empty> responseObserver) { addReceivedAcks(request.getAckIdsList()); responseObserver.onNext(Empty.getDefaultInstance()); responseObserver.onCompleted(); }
ackIds_ = ackIds_.getUnmodifiableView(); makeExtensionsImmutable();
@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 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; }
private static io.grpc.MethodDescriptor< com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> getAcknowledgeMethodHelper() { io.grpc.MethodDescriptor<com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> getAcknowledgeMethod; if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { SubscriberGrpc.getAcknowledgeMethod = getAcknowledgeMethod = io.grpc.MethodDescriptor .<com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( generateFullMethodName("google.pubsub.v1.Subscriber", "Acknowledge")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.protobuf.Empty.getDefaultInstance())) .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Acknowledge")) .build(); } } } return getAcknowledgeMethod; }
@java.lang.Override public com.google.pubsub.v1.AcknowledgeRequest build() { com.google.pubsub.v1.AcknowledgeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 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)); } unknownFields.writeTo(output); }
public com.google.pubsub.v1.AcknowledgeRequest buildPartial() { com.google.pubsub.v1.AcknowledgeRequest result = new com.google.pubsub.v1.AcknowledgeRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.subscription_ = subscription_; if (((bitField0_ & 0x00000002) == 0x00000002)) { ackIds_ = ackIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000002); } result.ackIds_ = ackIds_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();