Skip to content

Commit 77a4f18

Browse files
committed
railway_manager: adapt models.py
1 parent af90e75 commit 77a4f18

File tree

1 file changed

+13
-13
lines changed
  • railway_manager_interface/osrd_railway_manager_interface

1 file changed

+13
-13
lines changed

railway_manager_interface/osrd_railway_manager_interface/models.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,24 @@ class Margins(BaseModel):
8080
"""
8181

8282

83-
class OperationalPointIdentifierId(BaseModel):
83+
class OperationalPointPartReference(BaseModel):
84+
operational_point: (
85+
OperationalPointReferenceId
86+
| OperationalPointReferenceTrigram
87+
| OperationalPointReferenceUic
88+
)
89+
track_reference: TrackReferenceId | TrackReferenceName | None = None
90+
91+
92+
class OperationalPointReferenceId(BaseModel):
8493
operational_point: str
8594
"""
8695
The object id of an operational point
8796
"""
8897
type: Literal["id"]
8998

9099

91-
class OperationalPointIdentifierTrigram(BaseModel):
100+
class OperationalPointReferenceTrigram(BaseModel):
92101
secondary_code: str | None = None
93102
"""
94103
An optional secondary code to identify a more specific location
@@ -100,7 +109,7 @@ class OperationalPointIdentifierTrigram(BaseModel):
100109
type: Literal["trigram"]
101110

102111

103-
class OperationalPointIdentifierUic(BaseModel):
112+
class OperationalPointReferenceUic(BaseModel):
104113
secondary_code: str | None = None
105114
"""
106115
An optional secondary code to identify a more specific location
@@ -112,15 +121,6 @@ class OperationalPointIdentifierUic(BaseModel):
112121
"""
113122

114123

115-
class OperationalPointReference(BaseModel):
116-
operational_point: (
117-
OperationalPointIdentifierId
118-
| OperationalPointIdentifierTrigram
119-
| OperationalPointIdentifierUic
120-
)
121-
track_reference: TrackReferenceId | TrackReferenceName | None = None
122-
123-
124124
class OptionsChangeGroup(BaseModel):
125125
value: TrainScheduleOptions
126126

@@ -183,7 +183,7 @@ class PathItem(BaseModel):
183183
The unique identifier of the path item.
184184
This is used to reference path items in the train schedule.
185185
"""
186-
location: TrackOffset | OperationalPointReference
186+
location: TrackOffset | OperationalPointPartReference
187187
"""
188188
The location of a path waypoint
189189
"""

0 commit comments

Comments
 (0)