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