Source code for wow._sync.resources.profession

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