Map<String, Object?> toJson() => { if (granularity != null) 'granularity': granularity, if (singleThread != null) 'singleThread': singleThread, 'threadId': threadId, };