Map<String, dynamic> toJson() => withoutNulls({'type': type?.toJson(), 'settings': settings?.toJson()});