1"""Routes of the Profession API."""
2
3from wow._async._resource import AsyncResource
4from wow.models._common import Media
5from wow.models.profession import Profession, ProfessionIndex, ProfessionSkillTier
6
7__all__ = ["AsyncProfessions"]
8
9
[docs]
10class AsyncProfessions(AsyncResource):
11 """``client.professions``: professions such as Tailoring and Cooking."""
12
13 __slots__ = ()
14
[docs]
15 async def index(self) -> ProfessionIndex:
16 """List every profession."""
17 return await self._get("static", "/data/wow/profession/index", ProfessionIndex)
18
[docs]
19 async def get(self, profession_id: int) -> Profession:
20 """Get one profession by id."""
21 return await self._get("static", f"/data/wow/profession/{profession_id}", Profession)
22
26
[docs]
27 async def skill_tier(self, profession_id: int, skill_tier_id: int) -> ProfessionSkillTier:
28 """Get one skill tier of a profession, with every recipe in it. A profession lists its tiers' ids."""
29 return await self._get(
30 "static", f"/data/wow/profession/{profession_id}/skill-tier/{skill_tier_id}", ProfessionSkillTier
31 )