Map<String, dynamic> imageRefToJson(ImageRef input) { return { 'image': input.uniqueId != null ? input.toJson() : {'buffer': input.buffer}, }; }