Search in sources :

Example 1 with CreateCollectionRequest

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

the class CreateCollection method createMyCollection.

// snippet-start:[rekognition.java2.create_collection.main]
public static void createMyCollection(RekognitionClient rekClient, String collectionId) {
    try {
        CreateCollectionRequest collectionRequest = CreateCollectionRequest.builder().collectionId(collectionId).build();
        CreateCollectionResponse collectionResponse = rekClient.createCollection(collectionRequest);
        System.out.println("CollectionArn : " + collectionResponse.collectionArn());
        System.out.println("Status code : " + collectionResponse.statusCode().toString());
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : CreateCollectionRequest(software.amazon.awssdk.services.rekognition.model.CreateCollectionRequest) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) CreateCollectionResponse(software.amazon.awssdk.services.rekognition.model.CreateCollectionResponse)

Aggregations

CreateCollectionRequest (software.amazon.awssdk.services.rekognition.model.CreateCollectionRequest)1 CreateCollectionResponse (software.amazon.awssdk.services.rekognition.model.CreateCollectionResponse)1 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1