Coverage for fio_wrapper/models/planet_models.py: 100%
107 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
3from datetime import datetime
6class PlanetResource(BaseModel):
7 MaterialId: str = Field(min_length=32)
8 ResourceType: str
9 Factor: float
12class BuildingRequirement(BaseModel):
13 MaterialName: str
14 MaterialId: str = Field(min_length=32)
15 MaterialTicker: str = Field(max_length=3)
16 MaterialCategory: str = Field(min_length=32)
17 MaterialAmount: int
18 MaterialWeight: float
19 MaterialVolume: float
22class ProductionFee(BaseModel):
23 Category: str
24 WorkforceLevel: str
25 FeeAmount: int
26 FeeCurrency: Optional[str]
29class COGCProgram(BaseModel):
30 ProgramType: Optional[str]
31 StartEpochMs: datetime
32 EndEpochMs: datetime
35class COGCVote(BaseModel):
36 CompanyName: str
37 CompanyCode: str
38 Influence: float
39 VoteType: str
40 VoteTimeEpochMs: datetime
43class Planet(BaseModel):
44 PlanetNaturalId: str
45 PlanetName: str
48class PlanetList(RootModel):
49 root: List[Planet]
51 def __iter__(self):
52 return iter(self.root)
55class PlanetFull(Planet):
56 Resources: List[PlanetResource]
57 BuildRequirements: List[BuildingRequirement]
58 ProductionFees: List[ProductionFee]
59 COGCPrograms: List[COGCProgram]
60 COGCVotes: List[COGCVote]
62 PlanetId: str = Field(min_length=32)
63 Namer: Optional[str]
64 NamingDataEpochMs: int
65 Nameable: bool
66 SystemId: str = Field(min_length=32)
67 Gravity: float
68 MagneticField: float
69 Mass: float
70 MassEarth: float
71 OrbitSemiMajorAxis: int
72 OrbitEccentricity: float
73 OrbitInclination: float
74 OrbitRightAscension: int
75 OrbitPeriapsis: int
76 OrbitIndex: int
77 Pressure: float
78 Radiation: float
79 Radius: float
80 Sunlight: float
81 Surface: bool
82 Temperature: float
83 Fertility: float
84 HasLocalMarket: bool
85 HasChamberOfCommerce: bool
86 HasWarehouse: bool
87 HasAdministrationCenter: bool
88 HasShipyard: bool
89 FactionCode: Optional[str]
90 FactionName: Optional[str]
91 GovernorId: Optional[str] = Field(min_length=32)
92 GovernorUserName: Optional[str]
93 GovernorCorporationId: Optional[str] = Field(min_length=32)
94 GovernorCorporationName: Optional[str]
95 GovernorCorporationCode: Optional[str]
96 CurrencyName: Optional[str]
97 CurrencyCode: Optional[str]
98 CollectorId: Optional[str] = Field(min_length=32)
99 CollectorName: Optional[str]
100 CollectorCode: Optional[str]
101 BaseLocalMarketFee: int
102 LocalMarketFeeFactor: int
103 WarehouseFee: int
104 PopulationId: Optional[str] = Field(min_length=32)
105 COGCProgramStatus: Optional[str]
106 PlanetTier: int
107 UserNameSubmitted: str
108 Timestamp: NaiveDatetime
109 DistanceResults: Optional[List[int]]
112class PlanetFullList(RootModel):
113 root: List[PlanetFull]
115 def __iter__(self):
116 return iter(self.root)
119class PlanetSite(BaseModel):
120 PlanetId: str = Field(min_length=32)
121 OwnerId: str = Field(min_length=32)
122 OwnerName: str
123 OwnerCode: Optional[str]
124 PlotNumber: int
125 PlotId: str = Field(min_length=32)
126 SiteId: str
129class PlanetSiteList(RootModel):
130 root: List[PlanetSite]
132 def __iter__(self):
133 return iter(self.root)