Source code for wow._sync.resources.pet

 1# Generated by scripts/unasync.py from src/wow/_async/resources/pet.py. Do not edit.
 2"""Routes of the Pet API."""
 3
 4from wow._sync._resource import Resource
 5from wow.models._common import Media
 6from wow.models.pet import Pet, PetIndex
 7
 8__all__ = ["Pets"]
 9
10
[docs] 11class Pets(Resource): 12 """``client.pets``: battle pet species.""" 13 14 __slots__ = () 15
[docs] 16 def index(self) -> PetIndex: 17 """List every battle pet species.""" 18 return self._get("static", "/data/wow/pet/index", PetIndex)
19
[docs] 20 def get(self, pet_id: int) -> Pet: 21 """Get one battle pet species by id.""" 22 return self._get("static", f"/data/wow/pet/{pet_id}", Pet)
23
[docs] 24 def media(self, pet_id: int) -> Media: 25 """Get a battle pet species' icon.""" 26 return self._get("static", f"/data/wow/media/pet/{pet_id}", Media)