Skip to content

Commit

Permalink
Add support for the wsc/game-story API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
willdeberry committed Nov 25, 2024
1 parent a600b0c commit b27ad27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions nhlpy/api/wsc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from nhlpy.http_client import HttpClient

class Wsc:
def __init__(self, http_client: HttpClient):
self.client = http_client

def game_story(self, game_id: str) -> dict:
"""
Get game story information for the game id. GameIds can be retrieved from the schedule endpoint.
:param game_id: The game_id for the game you want the game story for.
:return: dict
"""
return self.client.get(resource=f"wsc/game-story/{game_id}").json()
3 changes: 2 additions & 1 deletion nhlpy/nhl_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nhlpy.api import teams, standings, schedule, game_center, stats, misc, playoffs
from nhlpy.api import teams, standings, schedule, game_center, stats, misc, playoffs, wsc
from nhlpy.http_client import HttpClient
from nhlpy.config import ClientConfig

Expand Down Expand Up @@ -36,3 +36,4 @@ def __init__(
self.stats = stats.Stats(http_client=self._http_client)
self.misc = misc.Misc(http_client=self._http_client)
self.playoffs = playoffs.Playoffs(http_client=self._http_client)
self.wsc = wsc.Wsc(http_client=self._http_client)

0 comments on commit b27ad27

Please sign in to comment.