toJson method
Implementation
@override
Map<String, dynamic> toJson() => {
'type': type,
if (id != null) 'id': id,
'role': role,
'content': content.map((c) => c.toJson()).toList(),
if (status != null) 'status': status,
};