-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtransportation.py
54 lines (36 loc) · 1.45 KB
/
transportation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from typing import Optional
from typing_extensions import Literal
from pydantic.main import BaseModel
class MaxChanges(BaseModel):
enabled: bool
limit: int
class Driving(BaseModel):
type: Literal["driving"] = "driving"
disable_border_crossing: Optional[bool] = None
class Walking(BaseModel):
type: Literal["walking"] = "walking"
class Cycling(BaseModel):
type: Literal["cycling"] = "cycling"
class Ferry(BaseModel):
type: Literal["ferry", "cycling+ferry", "driving+ferry"] = "ferry"
boarding_time: Optional[int] = None
class DrivingTrain(BaseModel):
type: Literal["driving+train"] = "driving+train"
pt_change_delay: Optional[int] = None
driving_time_to_station: Optional[int] = None
parking_time: Optional[int] = None
walking_time: Optional[int] = None
max_changes: Optional[MaxChanges] = None
class PublicTransport(BaseModel):
type: Literal["public_transport", "train", "bus", "coach"] = "public_transport"
pt_change_delay: Optional[int] = None
walking_time: Optional[int] = None
max_changes: Optional[MaxChanges] = None
class CyclingPublicTransport(BaseModel):
type: Literal["cycling+public_transport"] = "cycling+public_transport"
walking_time: Optional[int] = None
pt_change_delay: Optional[int] = None
cycling_time_to_station: Optional[int] = None
parking_time: Optional[int] = None
boarding_time: Optional[int] = None
max_changes: Optional[MaxChanges] = None