Source code for wow._async.resources.playable_specialization

 1"""Routes of the Playable Specialization API."""
 2
 3from wow._async._resource import AsyncResource
 4from wow.models._common import Media
 5from wow.models.playable_specialization import PlayableSpecialization, PlayableSpecializationIndex
 6
 7__all__ = ["AsyncPlayableSpecializations"]
 8
 9
[docs] 10class AsyncPlayableSpecializations(AsyncResource): 11 """``client.playable_specializations``: class specializations such as Fury or Restoration.""" 12 13 __slots__ = () 14
[docs] 15 async def index(self) -> PlayableSpecializationIndex: 16 """List every playable specialization.""" 17 return await self._get("static", "/data/wow/playable-specialization/index", PlayableSpecializationIndex)
18
[docs] 19 async def get(self, spec_id: int) -> PlayableSpecialization: 20 """Get one playable specialization by id.""" 21 return await self._get("static", f"/data/wow/playable-specialization/{spec_id}", PlayableSpecialization)
22
[docs] 23 async def media(self, spec_id: int) -> Media: 24 """Get a specialization's icon.""" 25 return await self._get("static", f"/data/wow/media/playable-specialization/{spec_id}", Media)