Search in sources :

Example 1 with GetCelebrityInfoResponse

use of software.amazon.awssdk.services.rekognition.model.GetCelebrityInfoResponse 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);
    }
}
Also used : GetCelebrityInfoRequest(software.amazon.awssdk.services.rekognition.model.GetCelebrityInfoRequest) GetCelebrityInfoResponse(software.amazon.awssdk.services.rekognition.model.GetCelebrityInfoResponse) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException)

Aggregations

GetCelebrityInfoRequest (software.amazon.awssdk.services.rekognition.model.GetCelebrityInfoRequest)1 GetCelebrityInfoResponse (software.amazon.awssdk.services.rekognition.model.GetCelebrityInfoResponse)1 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1