diff --git a/tests.py b/tests.py index 01f140c..104539b 100644 --- a/tests.py +++ b/tests.py @@ -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() @@ -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) @@ -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() @@ -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) diff --git a/valorant_api/__init__.py b/valorant_api/__init__.py index f4fb88c..9df6024 100644 --- a/valorant_api/__init__.py +++ b/valorant_api/__init__.py @@ -1,3 +1,3 @@ -__version__ = "0.1.0" +__version__ = "0.1.1" from .api import SyncValorantApi, AsyncValorantApi diff --git a/valorant_api/api.py b/valorant_api/api.py index 2d32320..b883d7e 100644 --- a/valorant_api/api.py +++ b/valorant_api/api.py @@ -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 @@ -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]) @@ -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]) diff --git a/valorant_api/ceremonies.py b/valorant_api/ceremonies.py new file mode 100644 index 0000000..fb6c49c --- /dev/null +++ b/valorant_api/ceremonies.py @@ -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') diff --git a/valorant_api/endpoints.py b/valorant_api/endpoints.py index 1cc7c62..b2c9132 100644 --- a/valorant_api/endpoints.py +++ b/valorant_api/endpoints.py @@ -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"