public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsRequest other) { if (other == com.google.bigtable.admin.v2.ListSnapshotsRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; 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 Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.bigtable.admin.v2.ListSnapshotsRequest buildPartial() { com.google.bigtable.admin.v2.ListSnapshotsRequest result = new com.google.bigtable.admin.v2.ListSnapshotsRequest(this); result.parent_ = parent_; 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.bigtable.admin.v2.ListSnapshotsRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.ListSnapshotsRequest other = (com.google.bigtable.admin.v2.ListSnapshotsRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); 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) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().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 value of `next_page_token` returned by a previous call. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
/** * * * <pre> * The unique name of the cluster for which snapshots should be listed. * Values are of the form * `projects/<project>/instances/<instance>/clusters/<cluster>`. * Use `<cluster> = '-'` to list snapshots for all clusters in an instance, * e.g., `projects/<project>/instances/<instance>/clusters/-`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@Override public Map<String, String> extract(ListSnapshotsRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
@java.lang.Override public com.google.bigtable.admin.v2.ListSnapshotsRequest getDefaultInstanceForType() { return com.google.bigtable.admin.v2.ListSnapshotsRequest.getDefaultInstance(); }
@Override public Integer extractPageSize(ListSnapshotsRequest payload) { return payload.getPageSize(); }
@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_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 boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.ListSnapshotsRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.ListSnapshotsRequest other = (com.google.bigtable.admin.v2.ListSnapshotsRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && (getPageSize() == other.getPageSize()); result = result && getPageToken().equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The unique name of the cluster for which snapshots should be listed. * Values are of the form * `projects/<project>/instances/<instance>/clusters/<cluster>`. * Use `<cluster> = '-'` to list snapshots for all clusters in an instance, * e.g., `projects/<project>/instances/<instance>/clusters/-`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@Test @SuppressWarnings("all") public void listSnapshotsTest() { String nextPageToken = ""; Snapshot snapshotsElement = Snapshot.newBuilder().build(); List<Snapshot> snapshots = Arrays.asList(snapshotsElement); ListSnapshotsResponse expectedResponse = ListSnapshotsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllSnapshots(snapshots) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); List<Snapshot> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListSnapshotsRequest actualRequest = (ListSnapshotsRequest) actualRequests.get(0); Assert.assertEquals(parent, ClusterName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * The value of `next_page_token` returned by a previous call. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
io.grpc.protobuf.ProtoUtils.marshaller( com.google.bigtable.admin.v2.ListSnapshotsRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
@Override public Integer extractPageSize(ListSnapshotsRequest payload) { return payload.getPageSize(); }
@Override public ListSnapshotsRequest injectPageSize(ListSnapshotsRequest payload, int pageSize) { return ListSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); }
public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsRequest other) { if (other == com.google.bigtable.admin.v2.ListSnapshotsRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.getPageSize() != 0) { setPageSize(other.getPageSize()); } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override public Map<String, String> extract(ListSnapshotsRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })