gamesheet_sdk.admin.roster.coaches module¶
Coach roster operations.
- gamesheet_sdk.admin.roster.coaches.get_coach(session, season_id, coach_id)[source]¶
Get a single coach by ID.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- gamesheet_sdk.admin.roster.coaches.list_coaches(session, season_id)[source]¶
Return every coach 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.
- gamesheet_sdk.admin.roster.coaches.create_coach(session, season_id, first_name, last_name, *, external_id=None, position=None, team_id=None)[source]¶
Create a new coach 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.- Parameters:
session (Session) – An authenticated
Session.season_id (str) – The season identifier to create the coach in.
first_name (str) – Coach’s first name.
last_name (str) – Coach’s last name.
external_id (str | None) – Optional external identifier for the coach.
position (str | None) – Optional position (Head Coach, Assistant Coach, etc.).
team_id (str | None) – Optional team identifier to associate the coach with.
- Returns:
Coach – Return value.
- Return type:
- gamesheet_sdk.admin.roster.coaches.update_coach(session, season_id, coach_id, *, first_name=None, last_name=None, external_id=None, position=None)[source]¶
Update an existing coach 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. At least one field must be provided for update.- Parameters:
session (Session) – An authenticated
Session.season_id (str) – The season identifier containing the coach.
coach_id (str) – The coach identifier to update.
first_name (str | None) – Optional updated first name.
last_name (str | None) – Optional updated last name.
external_id (str | None) – Optional updated external identifier.
position (str | None) – Optional updated position.
- Returns:
Coach – The updated
Coach.- Raises:
ValueError – If no fields are provided for update.
- Return type:
- gamesheet_sdk.admin.roster.coaches.list_team_coaches(session, season_id, team_id)[source]¶
Return every coach for the specified team.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
list[Coach] –
- A list of
Coach, in the order the server returned them. The list may be empty if the team has no coaches.
- A list of
- Return type:
- gamesheet_sdk.admin.roster.coaches.get_team_coach(session, season_id, team_id, coach_id)[source]¶
Get a single coach from a team’s roster.
This function retrieves team roster metadata (position, status, signature) that is only available in the team context, unlike
get_coach()which fetches from the season-level coaches endpoint without roster metadata. The suppliedSessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
Coach – The
Coachwith team roster metadata populated.- Raises:
GameSheetError – If the coach is not found on the team’s roster.
- Return type:
- gamesheet_sdk.admin.roster.coaches.create_team_coach(session, season_id, team_id, first_name, last_name, *, external_id=None, position=None)[source]¶
Create a new coach and add to the specified team’s roster.
This function performs two operations: (1) creates the coach at the season level, (2) updates the team’s roster to include the new coach with position and other metadata. 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 season identifier.
team_id (str) – The team identifier to add the coach to.
first_name (str) – Coach’s first name.
last_name (str) – Coach’s last name.
external_id (str | None) – Optional external identifier for the coach.
position (str | None) – Optional position (Head Coach, Assistant Coach, etc.).
- Returns:
Coach – Return value.
- Return type:
- gamesheet_sdk.admin.roster.coaches.update_team_coach(session, season_id, team_id, coach_id, *, first_name=None, last_name=None, external_id=None, position=None)[source]¶
Update a coach and update the team’s roster in one operation.
This function performs two operations: (1) updates the coach at the season level, (2) updates the team’s roster with any position changes. 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 season identifier.
team_id (str) – The team identifier.
coach_id (str) – The coach identifier to update.
first_name (str | None) – Optional updated first name.
last_name (str | None) – Optional updated last name.
external_id (str | None) – Optional updated external identifier.
position (str | None) – Optional updated position.
- Returns:
Coach – The updated
Coach.- Raises:
ValueError – If no fields are provided for update.
- Return type:
- gamesheet_sdk.admin.roster.coaches.delete_coach(session, season_id, coach_id)[source]¶
Delete a coach from 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.
- gamesheet_sdk.admin.roster.coaches.unassign_coach(session, season_id, coach_id, team_id)[source]¶
Unassign a coach from a team’s roster.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Raises:
GameSheetError – If the coach is not assigned to the team.
- gamesheet_sdk.admin.roster.coaches.delete_team_coach(session, season_id, team_id, coach_id)[source]¶
Delete a coach from a team’s roster and the season.
This function performs two operations: (1) removes the coach from the team’s roster, (2) deletes the coach at the season level. The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- gamesheet_sdk.admin.roster.coaches.assign_coach(session, season_id, coach_id, team_id, *, position=None)[source]¶
Assign an existing coach to a team’s roster.
The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
Coach – The
Coachwith roster metadata populated.- Raises:
GameSheetError – If the coach is already assigned to the team.
- Return type:
- gamesheet_sdk.admin.roster.coaches.assign_team_coach(session, season_id, team_id, coach_id, *, position=None)[source]¶
Assign an existing coach to a team’s roster (team-scoped alias).
This is an alias for
assign_coach()provided for consistency with the team-scoped command structure. The suppliedSessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
Coach – Return value.
- Return type:
- gamesheet_sdk.admin.roster.coaches.unassign_team_coach(session, season_id, team_id, coach_id)[source]¶
Unassign a coach from a team’s roster (team-scoped alias).
This is an alias for
unassign_coach()provided for consistency with the team-scoped command structure. The suppliedSessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.
- gamesheet_sdk.admin.roster.coaches.get_coach_penalty_report(session, season_id, coach_id)[source]¶
Fetch penalty report for a coach.
First retrieves the coach to get their external_id, then fetches the penalty report from the BFF API. The supplied
Sessionmust already carry a bearer token (e.g. viaSession.set_bearer_token()); the call is otherwise unauthenticated and will 401.- Parameters:
- Returns:
dict[str, Any] –
- Penalty report data including coach_games, coach_penalties, rostered_coaches, and
season_coaches.
- Raises:
GameSheetError – If the penalty report API returns a non-success status.
- Return type: