Source code for wow._async.resources.playable_race

 1"""Routes of the Playable Race API."""
 2
 3from wow._async._resource import AsyncResource
 4from wow.models.playable_race import PlayableRace, PlayableRaceIndex
 5
 6__all__ = ["AsyncPlayableRaces"]
 7
 8
[docs] 9class AsyncPlayableRaces(AsyncResource): 10 """``client.playable_races``: races such as Human and Orc.""" 11 12 __slots__ = () 13
[docs] 14 async def index(self) -> PlayableRaceIndex: 15 """List every playable race.""" 16 return await self._get("static", "/data/wow/playable-race/index", PlayableRaceIndex)
17
[docs] 18 async def get(self, race_id: int) -> PlayableRace: 19 """Get one playable race by id.""" 20 return await self._get("static", f"/data/wow/playable-race/{race_id}", PlayableRace)