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