Skip to content

Commit

Permalink
added ceremonies
Browse files Browse the repository at this point in the history
  • Loading branch information
MinshuG committed Jan 22, 2022
1 parent 9e18b4e commit dee02f0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
9 changes: 7 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def synctest():
equippables = api.get_gamemode_equippables()
equippable = api.search_gamemode_equippables_by_uuid("3de32920-4a8f-0499-7740-648a5bf95470")
maps = api.get_maps()
Map = api.search_maps_by_uuid("7eaecc1b-4337-bbf6-6ab9-04b8f06b3319")
map = api.search_maps_by_uuid("7eaecc1b-4337-bbf6-6ab9-04b8f06b3319")
playercards = api.get_playercards()
playercard = api.search_playercards_by_uuid("33c1f011-4eca-068c-9751-f68c788b2eee")
playertitles = api.get_playertitles()
Expand Down Expand Up @@ -60,6 +60,9 @@ def synctest():
buddy_level = api.search_buddy_levels_by_uuid(buddy_levels[0].uuid)
spray_levels = api.get_spray_levels()
spray_level = api.search_spray_levels_by_uuid(spray_levels[0].uuid)
ceremonies = api.get_ceremonies()
ceremony = api.search_ceremonies_by_uuid(ceremonies[0].uuid)


async def Asynctest():
api = AsyncValorantApi(language=language)
Expand All @@ -78,7 +81,7 @@ async def Asynctest():
equippables = await api.get_gamemode_equippables()
equippable = await api.search_gamemode_equippables_by_uuid("3de32920-4a8f-0499-7740-648a5bf95470")
maps = await api.get_maps()
Map = await api.search_maps_by_uuid("7eaecc1b-4337-bbf6-6ab9-04b8f06b3319")
map = await api.search_maps_by_uuid("7eaecc1b-4337-bbf6-6ab9-04b8f06b3319")
playercards = await api.get_playercards()
playercard = await api.search_playercards_by_uuid("33c1f011-4eca-068c-9751-f68c788b2eee")
playertitles = await api.get_playertitles()
Expand Down Expand Up @@ -112,6 +115,8 @@ async def Asynctest():
buddy_level = await api.search_buddy_levels_by_uuid(buddy_levels[0].uuid)
spray_levels = await api.get_spray_levels()
spray_level = await api.search_spray_levels_by_uuid(spray_levels[0].uuid)
ceremonies = await api.get_ceremonies()
ceremony = await api.search_ceremonies_by_uuid(ceremonies[0].uuid)

async def generate(generator, agent: Agent):
image = await generator.generate(agent)
Expand Down
2 changes: 1 addition & 1 deletion valorant_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.1.0"
__version__ = "0.1.1"

from .api import SyncValorantApi, AsyncValorantApi
23 changes: 20 additions & 3 deletions valorant_api/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from valorant_api.gear import Gear
from valorant_api.events import Event
from valorant_api.contracts import Contract
from .ceremonies import Ceremony
from .gear import Gear
from .events import Event
from .contracts import Contract
from .competitive import Competitive
from .competitivetiers import CompetitiveTier
from .sprays import Spray
Expand Down Expand Up @@ -80,6 +81,14 @@ def search_currencies_by_uuid(self, uuid: str, *args, **kwargs) -> ContentTier:
data = self.client.get(f"{Endpoints.Currencies}/{uuid}", *args, **kwargs)
return ContentTier(data)

def get_ceremonies(self, *args, **kwargs) -> BaseList[Ceremony]:
data = self.client.get(Endpoints.Ceremonies, *args, **kwargs)
return BaseList([Ceremony(x) for x in data])

def search_ceremonies_by_uuid(self, uuid: str, *args, **kwargs) -> Ceremony:
data = self.client.get(f"{Endpoints.Ceremonies}/{uuid}", *args, **kwargs)
return Ceremony(data)

def get_gamemodes(self, *args, **kwargs) -> BaseList[GameMode]:
data = self.client.get(Endpoints.GameMode, *args, **kwargs)
return BaseList([GameMode(x) for x in data])
Expand Down Expand Up @@ -293,6 +302,14 @@ async def search_currencies_by_uuid(self, uuid: str, *args, **kwargs) -> Content
data = await self.client.get(f"{Endpoints.Currencies}/{uuid}", *args, **kwargs)
return ContentTier(data)

async def get_ceremonies(self, *args, **kwargs) -> BaseList[Ceremony]:
data = await self.client.get(Endpoints.Ceremonies, *args, **kwargs)
return BaseList([Ceremony(x) for x in data])

async def search_ceremonies_by_uuid(self, uuid: str, *args, **kwargs) -> Ceremony:
data = await self.client.get(f"{Endpoints.Ceremonies}/{uuid}", *args, **kwargs)
return Ceremony(data)

async def get_gamemodes(self, *args, **kwargs) -> BaseList[GameMode]:
data = await self.client.get(Endpoints.GameMode, *args, **kwargs)
return BaseList([GameMode(x) for x in data])
Expand Down
13 changes: 13 additions & 0 deletions valorant_api/ceremonies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from dataclasses import dataclass


@dataclass
class Ceremony:
uuid: str
display_name: str
asset_path: str

def __init__(self, data: dict) -> None:
self.uuid = data.get('uuid')
self.display_name = data.get('displayName')
self.asset_path = data.get('assetPath')
1 change: 1 addition & 0 deletions valorant_api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Endpoints:
Buddies = BASE + "buddies"
BuddyLevels = Buddies + "/levels"
Bundles = BASE + "bundles"
Ceremonies = BASE + "ceremonies"
ContentTiers = BASE + "contenttiers"
Currencies = BASE + "currencies"
GameMode = BASE + "gamemodes"
Expand Down

0 comments on commit dee02f0

Please sign in to comment.