Map<String, dynamic> toJson() => { "messages": List<dynamic>.from(messages.map((x) => x.toJson())), };