getPromotionByUUID method

Future<void> getPromotionByUUID(
  1. String uuid, {
  2. required void onSuccess(
    1. Promotion
    ),
  3. required void onError(
    1. SyneriseError error
    ),
})

This function retrieves a Promotion object by its UUID.

Args: uuid (String): The "uuid" parameter is a string that represents a unique identifier for a promotion.

Implementation

Future<void> getPromotionByUUID(String uuid,
    {required void Function(Promotion) onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<Promotion> result = await _methods.getPromotionByUUID(uuid);

  result.onSuccess((result) {
    onSuccess(result);
  }).onError((error) {
    onError(error);
  });
}