getPromotions method
Future<void>
getPromotions(
- PromotionsApiQuery promotionsApiQuery, {
- required void onSuccess(),
- required void onError(
- SyneriseError error
This method retrieves promotions that match the parameters defined in an API query.
Args: promotionsApiQuery (PromotionsApiQuery): It is an object of type PromotionsApiQuery which contains the query parameters for the promotions API.
Implementation
Future<void> getPromotions(PromotionsApiQuery promotionsApiQuery,
{required void Function(PromotionResponse) onSuccess,
required void Function(SyneriseError error) onError}) async {
SyneriseResult<PromotionResponse> result =
await _methods.getPromotions(promotionsApiQuery);
result.onSuccess((result) {
onSuccess(result);
}).onError((error) {
onError(error);
});
}