Search in sources :

Example 1 with ListCollectionsResponse

use of software.amazon.awssdk.services.rekognition.model.ListCollectionsResponse in project aws-doc-sdk-examples by awsdocs.

the class ListCollections method listAllCollections.

// snippet-start:[rekognition.java2.list_collections.main]
public static void listAllCollections(RekognitionClient rekClient) {
    try {
        ListCollectionsRequest listCollectionsRequest = ListCollectionsRequest.builder().maxResults(10).build();
        ListCollectionsResponse response = rekClient.listCollections(listCollectionsRequest);
        List<String> collectionIds = response.collectionIds();
        for (String resultId : collectionIds) {
            System.out.println(resultId);
        }
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) ListCollectionsRequest(software.amazon.awssdk.services.rekognition.model.ListCollectionsRequest) ListCollectionsResponse(software.amazon.awssdk.services.rekognition.model.ListCollectionsResponse)

Aggregations

ListCollectionsRequest (software.amazon.awssdk.services.rekognition.model.ListCollectionsRequest)1 ListCollectionsResponse (software.amazon.awssdk.services.rekognition.model.ListCollectionsResponse)1 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1