Source code for wow._sync.resources.talent

 1# Generated by scripts/unasync.py from src/wow/_async/resources/talent.py. Do not edit.
 2"""Routes of the Talent and Talent Tree APIs."""
 3
 4from wow._sync._resource import Resource
 5from wow.models.talent import Talent, TalentIndex, TalentTree, TalentTreeIndex
 6
 7__all__ = ["TalentTrees", "Talents"]
 8
 9
[docs] 10class Talents(Resource): 11 """``client.talents``: individual talents across every class and specialization.""" 12 13 __slots__ = () 14
[docs] 15 def index(self) -> TalentIndex: 16 """List every talent.""" 17 return self._get("static", "/data/wow/talent/index", TalentIndex)
18
[docs] 19 def get(self, talent_id: int) -> Talent: 20 """Get one talent by id.""" 21 return self._get("static", f"/data/wow/talent/{talent_id}", Talent)
22 23
[docs] 24class TalentTrees(Resource): 25 """``client.talent_trees``: class and specialization talent trees.""" 26 27 __slots__ = () 28
[docs] 29 def index(self) -> TalentTreeIndex: 30 """List every class and specialization talent tree.""" 31 return self._get("static", "/data/wow/talent-tree/index", TalentTreeIndex)
32
[docs] 33 def get(self, tree_id: int, specialization_id: int) -> TalentTree: 34 """Get one specialization's talent tree by its class tree id and specialization id.""" 35 return self._get( 36 "static", 37 f"/data/wow/talent-tree/{tree_id}/playable-specialization/{specialization_id}", 38 TalentTree, 39 )