@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(com.google.pubsub.v1.ListSubscriptionsRequest other) { if (other == com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance()) return this; if (!other.getProject().isEmpty()) { project_ = other.project_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public com.google.pubsub.v1.ListSubscriptionsRequest buildPartial() { com.google.pubsub.v1.ListSubscriptionsRequest result = new com.google.pubsub.v1.ListSubscriptionsRequest(this); result.project_ = project_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; onBuilt(); 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.ListSubscriptionsRequest)) { return super.equals(obj); } com.google.pubsub.v1.ListSubscriptionsRequest other = (com.google.pubsub.v1.ListSubscriptionsRequest) obj; boolean result = true; result = result && getProject().equals(other.getProject()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); 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) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getProjectBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); } if (pageSize_ != 0) { output.writeInt32(2, pageSize_); } if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } unknownFields.writeTo(output); }
/** * * * <pre> * The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. * </pre> * * <code>string project = 1;</code> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
/** * * * <pre> * The value returned by the last `ListSubscriptionsResponse`; indicates that * this is a continuation of a prior `ListSubscriptions` call, and that the * system should return the next page of data. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); 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) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstanceForType() { return com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance(); }
@java.lang.Override public com.google.pubsub.v1.ListSubscriptionsRequest build() { com.google.pubsub.v1.ListSubscriptionsRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@Override public Integer extractPageSize(ListSubscriptionsRequest payload) { return payload.getPageSize(); }
e.getMessage()).setUnfinishedMessage(this)); } finally { makeExtensionsImmutable();
@Test @SuppressWarnings("all") public void listSubscriptionsTest() { String nextPageToken = ""; Subscription subscriptionsElement = Subscription.newBuilder().build(); List<Subscription> subscriptions = Arrays.asList(subscriptionsElement); ListSubscriptionsResponse expectedResponse = ListSubscriptionsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllSubscriptions(subscriptions) .build(); mockSubscriber.addResponse(expectedResponse); ProjectName project = ProjectName.of("[PROJECT]"); ListSubscriptionsPagedResponse pagedListResponse = client.listSubscriptions(project); List<Subscription> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockSubscriber.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListSubscriptionsRequest actualRequest = (ListSubscriptionsRequest) actualRequests.get(0); Assert.assertEquals(project, ProjectName.parse(actualRequest.getProject())); 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.ListSubscriptionsRequest)) { return super.equals(obj); } com.google.pubsub.v1.ListSubscriptionsRequest other = (com.google.pubsub.v1.ListSubscriptionsRequest) obj; boolean result = true; result = result && getProject().equals(other.getProject()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getProjectBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); } if (pageSize_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); } if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PROJECT_FIELD_NUMBER; hash = (53 * hash) + getProject().hashCode(); hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The name of the cloud project that subscriptions belong to. * </pre> * * <code>optional string project = 1;</code> */ public Builder clearProject() { project_ = getDefaultInstance().getProject(); onChanged(); return this; } /**
/** * <pre> * The value returned by the last `ListSubscriptionsResponse`; indicates that * this is a continuation of a prior `ListSubscriptions` call, and that the * system should return the next page of data. * </pre> * * <code>optional string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**