Implementation
Map<String, dynamic> toJson() {
final ret = <String, dynamic>{
'file': uploadFile,
'thumbnails': thumbnailSizes,
'scheduled_at': scheduledAt,
'send_push': sendPush,
'is_silent': isSilent,
'mark_as_read': markAsRead,
'dedup_id': dedupId,
'apns_bundle_id': apnsBundleId,
'sound': appleCriticalAlertOptions?.sound,
'volume': appleCriticalAlertOptions?.volume,
'req_id': reqId,
'data': data,
'custom_type': customType,
'push_option': pushOption.toString().split('.').last,
'mention_type': mentionType.toString().split('.').last,
'mentionedUserIds': mentionedUserIds,
'sorted_metaarray': metaArrays,
'url': uploadFile.url,
'file_name': uploadFile.name,
'file_size': uploadFile.fileSize,
'file_type': uploadFile.mimeType,
'require_auth': requiredAuth,
};
ret.removeWhere((key, value) => value == null);
return ret;
}