notifyList method

  1. @override
Future<String> notifyList({
  1. String? fromDate,
  2. String? toDate,
  3. String? regex,
  4. bool isDedicated = false,
})
override

Returns the list of received notifications of an atsign, Optionally, notifications can be filtered on from date, to date and regular expression

e.g alice is the current atsign
 Get all the notifications
 notify:list
   notifyList();

 Get notification starting from 2021-01-28 to 2021-01-29
 notify:list:2021-01-28:2021-01-29
    notifyList(fromDate: 2021-01-28, toDate: 2021-01-29);

 Get notifications list which matches with the regex 'phone'
 notify:list:phone
    notifyList(regex: phone);

 Get notification starting from 2021-01-28 to 2021-01-29 and
        matches with the regex 'phone'
 notify:list:2021-01-28:2021-01-29:phone
    notifyList(fromDate: 2021-01-28, toDate: 2021-01-29, regex: phone);

Implementation

@override
Future<String> notifyList(
    {String? fromDate,
    String? toDate,
    String? regex,
    bool isDedicated = false}) async {
  try {
    var builder = NotifyListVerbBuilder()
      ..fromDate = fromDate
      ..toDate = toDate
      ..regex = regex;
    var notifyList = await getRemoteSecondary()!.executeVerb(builder);
    return notifyList;
  } on AtLookUpException catch (e) {
    throw AtClientException(e.errorCode, e.errorMessage);
  }
}