toJson method
Implementation
Map<String, dynamic> toJson() {
final ret = <String, dynamic>{
'data': data,
'custom_type': customType,
'mention_type': mentionType?.asString(),
if (mentionType == MentionType.users)
'mentioned_user_ids': mentionedUserIds,
};
ret.removeWhere((key, value) => value == null);
return ret;
}