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