Use ListRecipes with an AWS SDK or command line tool - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ListRecipes with an AWS SDK or command line tool

The following code example shows how to use ListRecipes.

Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

public static void listAllRecipes(PersonalizeClient personalizeClient) { try { ListRecipesRequest recipesRequest = ListRecipesRequest.builder() .maxResults(15) .build(); ListRecipesResponse response = personalizeClient.listRecipes(recipesRequest); List<RecipeSummary> recipes = response.recipes(); for (RecipeSummary recipe : recipes) { System.out.println("The recipe ARN is: " + recipe.recipeArn()); System.out.println("The recipe name is: " + recipe.name()); } } catch (PersonalizeException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } }
  • For API details, see ListRecipes in AWS SDK for Java 2.x API Reference.