Coverage for fio_wrapper/models/building_models.py: 100%
39 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-16 11:50 +0100
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-16 11:50 +0100
1from typing import List, Optional
2from pydantic import BaseModel, RootModel, Field, NaiveDatetime
5class BuildingRecipeIO(BaseModel):
6 CommodityName: str
7 CommodityTicker: str = Field(max_length=3)
8 Weight: float
9 Volume: float
10 Amount: int
13class BuildingRecipe(BaseModel):
14 Inputs: List[BuildingRecipeIO]
15 Outputs: List[BuildingRecipeIO]
17 BuildingRecipeId: str
18 RecipeName: str
19 StandardRecipeName: str
21 DurationMs: int
24class BuildingCost(BaseModel):
25 CommodityName: str
26 CommodityTicker: str = Field(max_length=3)
27 Weight: float
28 Volume: float
29 Amount: int
32class BuildingTicker(BaseModel):
33 Recipes: Optional[List[BuildingRecipe]]
34 BuildingId: str = Field(min_length=32)
35 Name: str
36 Ticker: str = Field(max_length=3)
37 Expertise: Optional[str]
38 Pioneers: int
39 Settlers: int
40 Technicians: int
41 Engineers: int
42 Scientists: int
43 AreaCost: int
44 UserNameSubmitted: str
45 Timestamp: NaiveDatetime
48class BuildingTickerList(RootModel):
49 root: List[BuildingTicker]
51 def __iter__(self):
52 return iter(self.root)