gamesheet_sdk.admin.games.scheduled module¶
Scheduled game CRUD operations.
- gamesheet_sdk.admin.games.scheduled.list_scheduled(session, season_id)[source]¶
Return every scheduled game in the specified season.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401. :param session: An authenticatedSession. :type session: Session :param season_id: The season identifier whose scheduled games to list. :type season_id: str :returns: A list ofGame, in the order the server returned them. The list may be empty if theseason has no scheduled games.
- gamesheet_sdk.admin.games.scheduled.create_scheduled_game(session, season_id, scheduled_start_time, scheduled_end_time, home_team_id, home_division_id, visitor_team_id, visitor_division_id, location, scorekeeper_name, scorekeeper_phone, game_type, time_zone_name, time_zone_offset, number, broadcaster='', home_label='', visitor_label='')[source]¶
Create a new scheduled game.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
session (Session) – An authenticated
Session.season_id (str) – The parent season identifier.
scheduled_start_time (str) – Scheduled start time (ISO 8601 format).
scheduled_end_time (str) – Scheduled end time (ISO 8601 format).
home_team_id (str) – Home team identifier.
home_division_id (str) – Home team division identifier.
visitor_team_id (str) – Visitor team identifier.
visitor_division_id (str) – Visitor team division identifier.
location (str) – Game location/venue (default: empty string). Must match format ‘<location_name> <surface_name>’ from the API (case-insensitive match, but stored with correct casing).
scorekeeper_name (str) – Scorekeeper’s full name.
scorekeeper_phone (str) – Scorekeeper’s phone number.
game_type (str) – Game type. Must be one of: playoff, exhibition, tournament, regular_season.
time_zone_name (str) – IANA time zone name.
time_zone_offset (int) – Time zone offset in minutes.
number (str) – Game number.
broadcaster (str) – Broadcast provider name (default: empty string). Must match a valid broadcaster key from the API (case-insensitive match, but stored with correct casing).
home_label (str) – Home team label override (default: empty string).
visitor_label (str) – Visitor team label override (default: empty string).
- Returns:
The created
ScheduledGame.- Return type:
- Raises:
AuthenticationError – If the server returns 401.
GameSheetError – If the game_type, location, or broadcaster is invalid, or for any other non-2xx response.
- gamesheet_sdk.admin.games.scheduled.get_scheduled_game(session, season_id, game_id)[source]¶
Get a single scheduled game by ID (JSON:API format).
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
The
ScheduledGamewith the specified ID.- Return type:
- Raises:
AuthenticationError – If the server returns 401.
GameSheetError – For any other non-2xx response, including 404 if the game is not found.
- gamesheet_sdk.admin.games.scheduled.update_scheduled_game(session, season_id, game_id, scheduled_start_time, scheduled_end_time, home_team_id, home_division_id, visitor_team_id, visitor_division_id, location, scorekeeper_name, scorekeeper_phone, game_type, time_zone_name, time_zone_offset, number, status, broadcaster='', home_label='', visitor_label='')[source]¶
Update a scheduled game.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
session (Session) – An authenticated
Session.season_id (str) – The parent season identifier.
game_id (str) – The game identifier to update.
scheduled_start_time (str) – Scheduled start time (ISO 8601 format).
scheduled_end_time (str) – Scheduled end time (ISO 8601 format).
home_team_id (str) – Home team identifier.
home_division_id (str) – Home team division identifier.
visitor_team_id (str) – Visitor team identifier.
visitor_division_id (str) – Visitor team division identifier.
location (str) – Game location/venue. Must match format ‘<location_name> <surface_name>’ from the API (case-insensitive match, but stored with correct casing).
scorekeeper_name (str) – Scorekeeper’s full name.
scorekeeper_phone (str) – Scorekeeper’s phone number.
game_type (str) – Game type. Must be one of: playoff, exhibition, tournament, regular_season.
time_zone_name (str) – IANA time zone name.
time_zone_offset (int) – Time zone offset in minutes.
number (str) – Game number.
status (str) – Game status.
broadcaster (str) – Broadcast provider name (default: empty string). Must match a valid broadcaster key from the API (case-insensitive match, but stored with correct casing).
home_label (str) – Home team label override (default: empty string).
visitor_label (str) – Visitor team label override (default: empty string).
- Returns:
The updated
ScheduledGame.- Return type:
- Raises:
AuthenticationError – If the server returns 401.
GameSheetError – If the game_type, location, or broadcaster is invalid, or for any other non-2xx response, including 404 if the game is not found.
- gamesheet_sdk.admin.games.scheduled.delete_scheduled_game(session, season_id, game_id)[source]¶
Delete a scheduled game.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Raises:
AuthenticationError – If the server returns 401.
GameSheetError – For any other non-2xx response, including 404 if the game is not found.