use of com.amazonaws.services.personalize.model.ListRecipesResult in project knime-cloud by knime.
the class AmazonPersonalizeUtils method listAllRecipes.
/**
* @param personalize the amazon personalize client
* @return all recipes
*/
public static List<RecipeSummary> listAllRecipes(final AmazonPersonalize personalize) {
final ListRecipesRequest request = new ListRecipesRequest().withMaxResults(100);
ListRecipesResult result = personalize.listRecipes(request);
List<RecipeSummary> list = result.getRecipes();
String nextToken;
while ((nextToken = result.getNextToken()) != null) {
result = personalize.listRecipes(request.withNextToken(nextToken));
list.addAll(result.getRecipes());
}
return list;
}
Aggregations