use of com.google.pubsub.v1.ListSchemasRequest in project gapic-generator-java by googleapis.
the class AsyncListSchemasPaged method asyncListSchemasPaged.
public static void asyncListSchemasPaged() throws Exception {
// It may require modifications to work in your environment.
try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
ListSchemasRequest request = ListSchemasRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setView(SchemaView.forNumber(0)).setPageSize(883849137).setPageToken("pageToken873572522").build();
while (true) {
ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request);
for (Schema element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
Aggregations