class MarlonAPIClient(BaseClient):
"""Marlon API Client.
| Resources | Support |
| -------------------- | -------------------------- |
| League of Legends | ❎ |
| Legends of Runeterra | ❎ |
| Teamfight Tactics | ❎ |
| Valorant | ✅ |
Does not support versioning by patch.
Example:
```python
async with MarlonAPIClient() as client:
agents = await client.get_val_v1_agents()
assert agents[0]["uuid"]
```
"""
class ResponseData[T](TypedDict):
status: int
data: T
def __init__(
self,
*,
base_url: str = "https://valorant-api.com",
default_params: dict[str, Any] = {},
default_headers: dict[str, str] = {},
default_queries: dict[str, str] = {},
middlewares: list[Middleware] = [
json_response_middleware(),
http_error_middleware(),
],
) -> None:
super().__init__(
base_url=base_url,
default_params=default_params,
default_headers=default_headers,
default_queries=default_queries,
middlewares=middlewares
)
async def get_val_v1_agents(self, *, queries: dict = {"isPlayableCharacter": "true"}) -> ResponseData[list[MarlonAPISchema.ValV1Agent]]:
return await self.invoke("GET", "/v1/agents")
async def get_val_v1_agent(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Agent]:
return await self.invoke("GET", "/v1/agents/{uuid}")
async def get_val_v1_buddies(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Buddy]]:
return await self.invoke("GET", "/v1/buddies")
async def get_val_v1_buddy(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Buddy]:
return await self.invoke("GET", "/v1/buddies/{uuid}")
async def get_val_v1_bundles(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Bundle]]:
return await self.invoke("GET", "/v1/bundles")
async def get_val_v1_bundle(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Bundle]:
return await self.invoke("GET", "/v1/bundles/{uuid}")
async def get_val_v1_ceremonies(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Ceremony]]:
return await self.invoke("GET", "/v1/ceremonies")
async def get_val_v1_ceremony(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Ceremony]:
return await self.invoke("GET", "/v1/ceremonies/{uuid}")
async def get_val_v1_competitive_tiers(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1CompetitiveTier]]:
return await self.invoke("GET", "/v1/competitivetiers")
async def get_val_v1_competitive_tier(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1CompetitiveTier]:
return await self.invoke("GET", "/v1/competitivetiers/{uuid}")
async def get_val_v1_content_tiers(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1ContentTier]]:
return await self.invoke("GET", "/v1/contenttiers")
async def get_val_v1_content_tier(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1ContentTier]:
return await self.invoke("GET", "/v1/contenttiers/{uuid}")
async def get_val_v1_contracts(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Contract]]:
return await self.invoke("GET", "/v1/contracts")
async def get_val_v1_contract(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Contract]:
return await self.invoke("GET", "/v1/contracts/{uuid}")
async def get_val_v1_currencies(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Contract]]:
return await self.invoke("GET", "/v1/currencies")
async def get_val_v1_currency(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Contract]:
return await self.invoke("GET", "/v1/currencies/{uuid}")
async def get_val_v1_events(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Event]]:
return await self.invoke("GET", "/v1/events")
async def get_val_v1_event(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Event]:
return await self.invoke("GET", "/v1/events/{uuid}")
async def get_val_v1_gamemodes(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1GameMode]]:
return await self.invoke("GET", "/v1/gamemodes")
async def get_val_v1_gamemode(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1GameMode]:
return await self.invoke("GET", "/v1/gamemodes/{uuid}")
async def get_val_v1_gears(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Gear]]:
return await self.invoke("GET", "/v1/gear")
async def get_val_v1_gear(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Gear]:
return await self.invoke("GET", "/v1/gear/{uuid}")
async def get_val_v1_maps(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Map]]:
return await self.invoke("GET", "/v1/maps")
async def get_val_v1_map(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Map]:
return await self.invoke("GET", "/v1/maps/{uuid}")
async def get_val_v1_playercards(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1PlayerCard]]:
return await self.invoke("GET", "/v1/playercards")
async def get_val_v1_playercard(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1PlayerCard]:
return await self.invoke("GET", "/v1/playercards/{uuid}")
async def get_val_v1_playertitles(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1PlayerTitle]]:
return await self.invoke("GET", "/v1/playertitles")
async def get_val_v1_playertitle(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1PlayerTitle]:
return await self.invoke("GET", "/v1/playertitles/{uuid}")
async def get_val_v1_seasons(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Season]]:
return await self.invoke("GET", "/v1/seasons")
async def get_val_v1_season(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Season]:
return await self.invoke("GET", "/v1/seasons/{uuid}")
async def get_val_v1_sprays(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Spray]]:
return await self.invoke("GET", "/v1/sprays")
async def get_val_v1_spray(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Spray]:
return await self.invoke("GET", "/v1/sprays/{uuid}")
async def get_val_v1_themes(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Theme]]:
return await self.invoke("GET", "/v1/themes")
async def get_val_v1_theme(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Theme]:
return await self.invoke("GET", "/v1/themes/{uuid}")
async def get_val_v1_weapons(self, *, queries: dict = {}) -> ResponseData[list[MarlonAPISchema.ValV1Weapon]]:
return await self.invoke("GET", "/v1/weapons")
async def get_val_v1_weapon(self, *, uuid: str = ..., queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Weapon]:
return await self.invoke("GET", "/v1/weapons/{uuid}")
async def get_val_v1_version(self, *, queries: dict = {}) -> ResponseData[MarlonAPISchema.ValV1Version]:
return await self.invoke("GET", "/v1/version")