gamesheet_sdk.teams.schedule.query module¶
Schedule and calendar query and retrieval functions.
- gamesheet_sdk.teams.schedule.query.fetch_availability_raw(session, team_id, event_id, event_type, *, timeout=15.0)[source]¶
Fetch batch availability data for a team event.
- Parameters:
- Returns:
dict[str, Any] – Parsed JSON response from the availability API.
- Raises:
AuthenticationError – If the user is not authenticated (401).
GameSheetError – If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.schedule.query.fetch_calendar_raw(session, team_id, *, month='all', timeout=15.0)[source]¶
Fetch raw calendar data from the teams API for a specified team.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
team_id (str) – Team identifier.
month (str) – Month filter for calendar events (default: ‘all’).
timeout (float) – Request timeout in seconds.
- Returns:
dict[str, Any] – Parsed JSON response from the calendar API.
- Raises:
AuthenticationError – If the user is not authenticated (401).
GameSheetError – If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.schedule.query.fetch_event_occurrence_raw(session, event_id, *, timeout=15.0)[source]¶
Fetch raw calendar event occurrence data from the teams API.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
timeout (float) – Request timeout in seconds.
- Returns:
dict[str, Any] – Parsed JSON response from the calendar occurrences API.
- Raises:
AuthenticationError – If the user is not authenticated (401).
GameSheetError – If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.schedule.query.fetch_scheduled_game_raw(session, game_id, *, timeout=15.0)[source]¶
Fetch raw game details from the teams schedule-game API.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
timeout (float) – Request timeout in seconds.
- Returns:
dict[str, Any] – Parsed JSON response from the schedule-game API.
- Raises:
AuthenticationError – If the user is not authenticated (401).
GameSheetError – If the server returns an error or malformed response.
- Return type:
- gamesheet_sdk.teams.schedule.query.get_calendar_subscription(team_id, *, timestamp_hours=None)[source]¶
Generate calendar subscription URLs for a team.
Calculates subscription URLs for Apple Calendar (webcal), Google Calendar, and generic calendar feed.
- Parameters:
- Returns:
CalendarSubscription – Pydantic model with appleCalendar, googleCalendar, and calendarUrl.
- Return type:
- gamesheet_sdk.teams.schedule.query.get_event(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]¶
Retrieve detailed metadata for a calendar event (‘event’ type).
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
include_availability (bool) – Whether to fetch and include team availability.
team_id (str | int | None) – Optional team ID for availability lookup.
timeout (float) – Request timeout in seconds.
- Returns:
ScheduleEventDetail – Event details model.
- Return type:
- gamesheet_sdk.teams.schedule.query.get_game(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]¶
Retrieve detailed metadata for a scheduled game (‘game’ type).
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
include_availability (bool) – Whether to fetch and include team availability.
team_id (str | int | None) – Optional team ID for availability lookup.
timeout (float) – Request timeout in seconds.
- Returns:
ScheduleEventDetail – Game details model.
- Return type:
- gamesheet_sdk.teams.schedule.query.get_practice(session, event_id, *, include_availability=False, team_id=None, timeout=15.0)[source]¶
Retrieve detailed metadata for a practice (‘practice’ type).
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
event_id (str | int) – Identifier of the practice occurrence.
include_availability (bool) – Whether to fetch and include team availability.
team_id (str | int | None) – Optional team ID for availability lookup.
timeout (float) – Request timeout in seconds.
- Returns:
ScheduleEventDetail – Practice details model.
- Return type:
- gamesheet_sdk.teams.schedule.query.get_schedule_event(session, event_id, *, event_type=None, include_availability=False, team_id=None, timeout=15.0)[source]¶
Retrieve detailed metadata for a calendar event occurrence or scheduled game.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
event_id (str | int) – Identifier of the event occurrence or game ID.
event_type (str | None) – Expected event type (‘event’, ‘game’, ‘practice’).
include_availability (bool) – Whether to fetch and include team availability.
team_id (str | int | None) – Optional team ID (used when fetching availability).
timeout (float) – Request timeout in seconds.
- Returns:
ScheduleEventDetail – Detailed schedule event occurrence or game model.
- Raises:
GameSheetError – If the server returns an error, event type mismatches, or team ID is missing for availability.
- Return type:
- gamesheet_sdk.teams.schedule.query.list_events(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]¶
List calendar events (‘event’ type) for a team.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
team_id (str) – Team identifier.
month (str) – Month filter for calendar events (default: ‘all’).
include_event_data (bool) – Whether to include detailed eventData in models (default: False).
timeout (float) – Request timeout in seconds.
- Returns:
list[ScheduleEvent] – List of calendar events.
- Return type:
- gamesheet_sdk.teams.schedule.query.list_games(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]¶
List scheduled games (‘game’ type) for a team.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
team_id (str) – Team identifier.
month (str) – Month filter for calendar events (default: ‘all’).
include_event_data (bool) – Whether to include detailed eventData in models (default: False).
timeout (float) – Request timeout in seconds.
- Returns:
list[ScheduleEvent] – List of scheduled games.
- Return type:
- gamesheet_sdk.teams.schedule.query.list_practices(session, team_id, *, month='all', include_event_data=False, timeout=15.0)[source]¶
List practices (‘practice’ type) for a team.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
team_id (str) – Team identifier.
month (str) – Month filter for calendar events (default: ‘all’).
include_event_data (bool) – Whether to include detailed eventData in models (default: False).
timeout (float) – Request timeout in seconds.
- Returns:
list[ScheduleEvent] – List of team practices.
- Return type:
- gamesheet_sdk.teams.schedule.query.list_schedule(session, team_id, *, event_type=None, month='all', include_event_data=False, timeout=15.0)[source]¶
List schedule events for a team, optionally filtered by event type.
- Parameters:
session (BaseAuthenticatedSession) – Authenticated session instance.
team_id (str) – Team identifier.
event_type (str | None) – Optional event type filter (‘event’, ‘game’, ‘practice’).
month (str) – Month filter for calendar events (default: ‘all’).
include_event_data (bool) – Whether to include detailed eventData in models (default: False).
timeout (float) – Request timeout in seconds.
- Returns:
list[ScheduleEvent] – List of parsed schedule event models.
- Raises:
GameSheetError – If the server returns malformed data.
- Return type: