walletsGetAll method
List wallets
Lists all of the partner's wallets. Returns the whole list as an array, without paging. Each wallet has its id, label, balance, whether it isSelected (the wallet that pays for orders) and its currency.
Implementation
Future<List<WalletSummary>?> walletsGetAll({ Future<void>? abortTrigger, }) async {
final response = await walletsGetAllWithHttpInfo(abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<WalletSummary>') as List)
.cast<WalletSummary>()
.toList(growable: false);
}
return null;
}