from typing import Annotated from fastapi import Depends, HTTPException from ..apirouters import auth from ..entities.agent import Agent from ..entities.ship import Ship async def get_ship(ship_symbol: str, agent: Annotated[Agent, Depends(auth.auth_agent)]) -> Ship: for ship in agent.ships.values(): if ship.symbol == ship_symbol: return ship raise HTTPException(status_code=400, detail="Unknown ship symbol.")