core.Map<core.String, core.dynamic> toJson() => { if (aggregations != null) 'aggregations': aggregations!, if (nestedQuery != null) 'nestedQuery': nestedQuery!, };