encode method
Implementation
@override
Future<Map<String, dynamic>> encode(dynamic content) async {
if (content is! AttachmentContent) {
throw const FormatException('Content must be AttachmentContent');
}
return {
'content': content.data,
'parameters': {
'filename': content.filename,
'mimeType': content.mimeType,
if (content.description != null) 'description': content.description!,
}
};
}