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