remove method

Removes 1 to 1000 payout requests still in your open list at once, each as cancel would, with its own payout_item.canceled event (an id given twice counts once). Returns a result per id, in the order given: its PayoutRemoveResult.item (removed now, or before: safe to retry), or its PayoutRemoveResult.error. A request sent from the list already is never canceled here: use cancel. An empty ids throws an ArgumentError and sends nothing.

Implementation

Future<List<PayoutRemoveResult>> remove(List<String> ids) async {
  if (ids.isEmpty) {
    throw ArgumentError(
        'payitgo: ids is empty: remove needs at least one payout request id');
  }
  return _each(
      (await _t.request('POST', '/v1/payouts/remove',
          body: {'ids': ids}))['results'],
      PayoutRemoveResult.new);
}