recommendProducts method
Future<List<Product> >
recommendProducts({
- required Logic logic,
- List<
RecommendationFilter> ? filters, - int? limit,
- String? availabilityZone,
Implementation
Future<List<Product>> recommendProducts(
{required Logic logic,
List<RecommendationFilter>? filters,
int? limit,
String? availabilityZone}) async {
Map<String, dynamic> attributes = {"logic": _logicMapper.map(logic)};
if (filters != null) {
attributes["recommendationFilter"] =
_recommendationFilterListMapper.map(filters);
}
if (limit != null) {
attributes["limit"] = limit;
}
if (availabilityZone != null) {
attributes["availabilityZone"] = availabilityZone;
}
List<dynamic>? products =
await _channel.invokeMethod('predict.recommendProducts', attributes);
if (products == null) {
throw TypeError();
}
return _productMapper.map(products);
}