Map<String, Object?> encode() => { if (contextEventType != null) 'context_event_type': contextEventType!.toTfJson(), };