Map<String, Object?> toJson() { var levels = this.levels; final json = <String, Object?>{}; json[r'levels'] = levels.map((i) => i.value).toList(); return json; }