Use AWS SDK
If you need functionality in the AWS services used by the Amplify Predictions category that isn't available, we provide an escape hatch so you can get a reference to that service. For example, to get a reference to AmazonRekognitionClient
:
// Obtain reference to the pluginAWSPredictionsPlugin predictionsPlugin = (AWSPredictionsPlugin) Amplify.Predictions.getPlugin("awsPredictionsPlugin");AWSPredictionsEscapeHatch escapeHatch = predictionsPlugin.getEscapeHatch();
// Send a new request to the Rekognition endpoint directly using the clientAmazonRekognitionClient client = escapeHatch.getRekognitionClient();CreateCollectionRequest request = new CreateCollectionRequest() .withCollectionId("<new-collection-id-here>");client.createCollection(request);
// Obtain reference to the pluginval plugin = Amplify.Predictions.getPlugin("awsPredictionsPlugin")val escapeHatch = (plugin as AWSPredictionsPlugin).escapeHatch
// Send a new request to the Rekognition endpoint directly using the clientval client = escapeHatch.rekognitionClientval request = CreateCollectionRequest().withCollectionId("<new-collection-id-here>")
client.createCollection(request)
API Documentation Resources