Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

34 rader
618 B

  1. from typing import Optional
  2. from pydantic import BaseModel
  3. class CreateVehicle(BaseModel):
  4. Model: str
  5. Year: int
  6. LicensePlate: str
  7. Mileage: int
  8. Capacity: int
  9. class OutputVehicle(BaseModel):
  10. Id: int
  11. Model: str
  12. Year: int
  13. LicensePlate: str
  14. Mileage: int
  15. CurrentLocation: Optional[list[str]] = None
  16. Fuel: Optional[int] = 0
  17. Type: str
  18. DriverHistory: Optional[list[int]] = None
  19. AssignedDriver: Optional[int] = None
  20. Capacity: int
  21. Status: str
  22. class UpdateVehicle(OutputVehicle):
  23. pass
  24. class VehicleLocation(BaseModel):
  25. CurrentLocation: list[str]