Converts the message to a JSON-compatible map.
Map<String, dynamic> toJson() => { 'id': id, 'from': from, 'parts': parts.map((e) => e.toJson()).toList(), 'sessionId': sessionId, };