Поместить объекты в список Retrofit 2

Как добавить имена объекта в список для дальнейшего отображения через свой адаптер. Вот сам API который я получаю с помощью Retrofit 2 Список запроса

Далее я делаю запрос следующего вида:

TestHero.kt

data class TestHero (@SerializedName("global") val global: PlayerInf,
                     @SerializedName("legends")val legends: AllLegends)

data class  PlayerInf (val name: String, val uid: Long, val avatar: String, val platform: String,
val  level: Int, val toNextLevelPercent: Int, val internalUpdateCount: Int, val bans: BanInf, val rank: RankInf)

data class BanInf (val isActive: Boolean, val remainingSeconds: Int)

data class RankInf (val rankScore: Int, val rankName: String, val rankDiv: Int, val rankImg: String)

data class AllLegends (val all: Revenant)

data class Revenant (val ImgAssets: String)
data class Horizon (val data : ArrayList<Rang>, val ImgAssets: String)

data class Rang (val t0 : String)

Тоесть мне нужно создать каждый объект Revenant, Horizon, Crypto и т.д. Но я не понимаю как эти имена отобразить в адаптере в textView

HeroesAdapter.kt

class HeroesAdapter(context: Context, heroes: List<TestHero>): BaseAdapter() {
    private val context = context
    private val heroes = heroes

    override fun getCount(): Int {
        return heroes.count()
    }

    override fun getItem(position: Int): Any {
        return heroes[position]
    }

    override fun getItemId(position: Int): Long {
        return 0
    }

    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {

           // categoryView = LayoutInflater.from(context).inflate(R.layout.activity_heroes, null)
        val listheroView = LayoutInflater.from(context).inflate(R.layout.list_hero_view, parent, false)
           // val categoryImage: ImageView = categoryView.findViewById(R.id.heroesImageView)
            val heroText: TextView = listheroView.findViewById(R.id.textHeroView)
            val category = heroes[position]

            heroText.text = category.legends.all.toString()
            return listheroView

    }
}

В отображении получаю следующее: Ответ в ListView

Пример того что я хочу получить: List

Где я после нажатия буду получать уже данные из data

JSON-API

"legends": {
        "selected": {
            "LegendName": "Octane",
            "data": [
                {
                    "name": "Special event kills",
                    "value": 815,
                    "key": "specialEvent_kills"
                },
                {
                    "name": "Special event wins",
                    "value": 37,
                    "key": "specialEvent_wins"
                },
                {
                    "name": "Special event damage",
                    "value": 321873,
                    "key": "specialEvent_damage"
                }
            ],
            "gameInfo": {
                "skin": "Arachnoid Rush",
                "skinRarity": "Legendary",
                "frame": "Shark Teeth",
                "frameRarity": "Legendary",
                "pose": "All. Day.",
                "poseRarity": "Rare",
                "intro": "Death catches up to everyone",
                "introRarity": "Rare",
                "badges": [
                    {
                        "name": "Venomous",
                        "value": 0,
                        "category": "Octane"
                    },
                    {
                        "name": "Wild Frontier Level: Season 1",
                        "value": 112,
                        "category": "Account Badges"
                    },
                    {
                        "name": "Fortune's Favor Level: Season 5",
                        "value": 113,
                        "category": "Account Badges"
                    }
                ]
            },
            "ImgAssets": {
                "icon": "https:\/\/api.mozambiquehe.re\/assets\/icons\/octane.png",
                "banner": "https:\/\/api.mozambiquehe.re\/assets\/banners\/octane.jpg"
            }
        },
        "all": {
            "Revenant": {
                "ImgAssets": {
                    "icon": "https:\/\/api.mozambiquehe.re\/assets\/icons\/revenant.png",
                    "banner": "https:\/\/api.mozambiquehe.re\/assets\/banners\/revenant.jpg"
                }
            },
            "Crypto": {
                "ImgAssets": {
                    "icon": "https:\/\/api.mozambiquehe.re\/assets\/icons\/crypto.png",
                    "banner": "https:\/\/api.mozambiquehe.re\/assets\/banners\/crypto.jpg"
                }
            },
            "Horizon": {
                "data": [
                    {
                        "name": "Season 7 wins",
                        "value": 1,
                        "key": "wins_season_7",
                        "rank": {
                            "rankPos": 59006,
                            "topPercent": 69.87
                        },
                        "rankPlatformSpecific": {
                            "rankPos": 53782,
                            "topPercent": 69.14
                        }
                    },
                    {
                        "name": "Special event kills",
                        "value": 101,
                        "key": "specialEvent_kills",
                        "rank": {
                            "rankPos": 77442,
                            "topPercent": 64.21
                        },
                        "rankPlatformSpecific": {
                            "rankPos": 52573,
                            "topPercent": 60.51
                        }
                    },
                    {
                        "name": "Special event damage",
                        "value": 47004,
                        "key": "specialEvent_damage",
                        "rank": {
                            "rankPos": 74182,
                            "topPercent": 57.92
                        },
                        "rankPlatformSpecific": {
                            "rankPos": 51199,
                            "topPercent": 54.54
                        }
                    }
                ],
                "ImgAssets": {
                    "icon": "https:\/\/api.mozambiquehe.re\/assets\/icons\/horizon.png",
                    "banner": "https:\/\/api.mozambiquehe.re\/assets\/banners\/horizon.jpg"
                }
            },

Ответы (1 шт):

Автор решения: Ethernets

Для реализации моего решения, спасибо @woesss за подсказку, спарсил данные в Map

data class AllLegends (@SerializedName("all") val all: Map<String, LegendWrapper> = emptyMap())


data class LegendWrapper(
    val data: List<PlayerPerformance>? = emptyList()

)
data class PlayerPerformance(val name: String, val value: Int, val key: String)

data class TestList (val name: ArrayList<String>) 

далее отобразил это всё в RecyclerView, посмотреть реализацию можно тут

→ Ссылка