Source code for wow._async.resources.toy

 1"""Routes of the Toy API."""
 2
 3from wow._async._resource import AsyncResource
 4from wow.models.toy import Toy, ToyIndex
 5
 6__all__ = ["AsyncToys"]
 7
 8
[docs] 9class AsyncToys(AsyncResource): 10 """``client.toys``: toy-box toys.""" 11 12 __slots__ = () 13
[docs] 14 async def index(self) -> ToyIndex: 15 """List every toy.""" 16 return await self._get("static", "/data/wow/toy/index", ToyIndex)
17
[docs] 18 async def get(self, toy_id: int) -> Toy: 19 """Get one toy by id.""" 20 return await self._get("static", f"/data/wow/toy/{toy_id}", Toy)