Map<String, dynamic> toJson() { return { if (nextBatch != null) 'next_batch': nextBatch, if (events != null) 'events': events, }; }