@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.logging.v2.ListExclusionsRequest)) { return super.equals(obj); } com.google.logging.v2.ListExclusionsRequest other = (com.google.logging.v2.ListExclusionsRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getPageToken().equals(other.getPageToken()); result = result && (getPageSize() == other.getPageSize()); 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) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; hash = (53 * hash) + getPageSize(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * Required. The parent resource whose exclusions are to be listed. * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.logging.v2.ListExclusionsRequest other) { if (other == com.google.logging.v2.ListExclusionsRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void listExclusionsTest() { String nextPageToken = ""; LogExclusion exclusionsElement = LogExclusion.newBuilder().build(); List<LogExclusion> exclusions = Arrays.asList(exclusionsElement); ListExclusionsResponse expectedResponse = ListExclusionsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllExclusions(exclusions) .build(); mockConfigServiceV2.addResponse(expectedResponse); ParentName parent = ProjectName.of("[PROJECT]"); ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); List<LogExclusion> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockConfigServiceV2.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListExclusionsRequest actualRequest = (ListExclusionsRequest) actualRequests.get(0); Assert.assertEquals(parent, ParentNames.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }