listMailboxes method

Future<List<MailboxInfo>> listMailboxes()

List all mailboxes owned by this client

Implementation

Future<List<MailboxInfo>> listMailboxes() async {
  _logger.fine('Listing mailboxes for ${host.id.toBase58()}');

  final request = ListMailboxesRequest(ownerId: host.id);

  final response = await _sendRequest(request);
  if (!response.success) {
    throw MailboxManagementError(
      response.errorMessage ?? 'Failed to list mailboxes',
    );
  }

  if (response.data == null) {
    return [];
  }

  return AdminFrame.decodeMailboxInfoList(response.data as List<dynamic>);
}