use of software.amazon.awssdk.services.rekognition.model.RekognitionException in project aws-doc-sdk-examples by awsdocs.
the class CelebrityInfo method getCelebrityInfo.
// snippet-start:[rekognition.java2.celebrityInfo.main]
public static void getCelebrityInfo(RekognitionClient rekClient, String id) {
try {
GetCelebrityInfoRequest info = GetCelebrityInfoRequest.builder().id(id).build();
GetCelebrityInfoResponse response = rekClient.getCelebrityInfo(info);
// Display celebrity information.
System.out.println("celebrity name: " + response.name());
System.out.println("Further information (if available):");
for (String url : response.urls()) {
System.out.println(url);
}
} catch (RekognitionException e) {
System.out.println(e.getMessage());
System.exit(1);
}
}
use of software.amazon.awssdk.services.rekognition.model.RekognitionException 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);
}
}
use of software.amazon.awssdk.services.rekognition.model.RekognitionException in project aws-doc-sdk-examples by awsdocs.
the class DeleteCollection method deleteMyCollection.
// snippet-start:[rekognition.java2.delete_collection.main]
public static void deleteMyCollection(RekognitionClient rekClient, String collectionId) {
try {
DeleteCollectionRequest deleteCollectionRequest = DeleteCollectionRequest.builder().collectionId(collectionId).build();
DeleteCollectionResponse deleteCollectionResponse = rekClient.deleteCollection(deleteCollectionRequest);
System.out.println(collectionId + ": " + deleteCollectionResponse.statusCode().toString());
} catch (RekognitionException e) {
System.out.println(e.getMessage());
System.exit(1);
}
}
Aggregations