Source code for wow._async.resources.title

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