-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.go
More file actions
476 lines (432 loc) · 13.5 KB
/
Copy pathmodel.go
File metadata and controls
476 lines (432 loc) · 13.5 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
// SPDX-License-Identifier: MPL-2.0
package netex
import (
"encoding/xml"
)
type PublicationDelivery struct {
XMLName xml.Name `xml:"http://www.netex.org.uk/netex PublicationDelivery"`
Version string `xml:"version,attr"`
NsXsi string `xml:"xmlns:xsi,attr"`
XsiSchemaLocation string `xml:"xsi:schemaLocation,attr"`
PublicationTimestamp string
ParticipantRef string
Description string
DataObjects []CompositeFrame `xml:"dataObjects>CompositeFrame"`
}
type CompositeFrame struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ValidBetween ValidBetween
TypeOfFrameRef TypeOfFrameRef
Codespaces struct {
Codespace struct {
Id string `xml:"id,attr"`
Xmlns string
XmlnsUrl string
Description string
}
//} `xml:"codespaces"`
} `xml:"-"`
FrameDefaults struct {
DefaultCodespaceRef Ref
} `xml:"-"`
Frames struct {
ResourceFrame []ResourceFrame
SiteFrame []SiteFrame
MobilityServiceFrame []MobilityServiceFrame
ServiceFrame []ServiceFrame
ServiceCalendarFrame []ServiceCalendarFrame
TimetableFrame []TimetableFrame
Frames []any
} `xml:"frames"`
}
type ResourceFrame struct {
XMLName xml.Name `xml:"ResourceFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TypeOfFrameRef TypeOfFrameRef
Operators Maybe[[]Operator] `xml:"organisations>Operator"`
CarModels Maybe[[]CarModelProfile] `xml:"vehicleModelProfiles>CarModelProfile"`
CycleModels Maybe[[]CycleModelProfile] `xml:"vehicleModelProfiles>CycleModelProfile"`
Vehicles Maybe[[]Vehicle] `xml:"vehicles>Vehicle"`
}
type SiteFrame struct {
XMLName xml.Name `xml:"SiteFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TypeOfFrameRef TypeOfFrameRef
Parkings Maybe[[]Parking] `xml:"parkings>Parking"`
StopPlaces Maybe[[]StopPlace] `xml:"stopPlaces>StopPlace"`
}
type Operator struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
PrivateCode string
Name string
ShortName string
LegalName string
TradingName string
ContactDetails struct {
Email string
Phone string
Url string
}
OrganisationType string
Address struct {
Id string `xml:"id,attr"`
CountryName string
Street string
Town string
PostCode string
}
Departments any
}
type Ref struct {
XMLName xml.Name
Ref string `xml:"ref,attr"`
Version string `xml:"version,attr,omitempty"`
}
type TypeOfFrameRef struct {
Ref string `xml:"ref,attr"`
VersionRef string `xml:"versionRef,attr,omitempty"`
}
// Avoid having the explicit namespace there for every Ref
func (r *Ref) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
type ReRef Ref
err := d.DecodeElement((*ReRef)(r), &start)
if err == nil {
r.XMLName.Space = ""
}
return err
}
type ValidBetween struct {
FromDate string
ToDate string
}
type MobilityServiceFrame struct {
XMLName xml.Name `xml:"MobilityServiceFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
FrameDefaults struct {
DefaultCurrency string
}
Fleets Maybe[[]Fleet] `xml:"fleets>Fleet"`
ModesOfOperation Maybe[[]VehicleSharing] `xml:"modesOfOperation>VehicleSharing"`
MobilityServices Maybe[[]VehicleSharingService] `xml:"mobilityServices>VehicleSharingService"`
MobilityServiceConstraintZones Maybe[[]MobilityServiceConstraintZone] `xml:"mobilityServiceConstraintZones>MobilityServiceConstraintZone"`
}
type Fleet struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ValidBetween ValidBetween
Members Maybe[[]Ref] `xml:"members>VehicleRef"`
OperatorRef Ref
}
type Vehicle struct {
XMLName xml.Name `xml:"Vehicle"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ValidBetween ValidBetween
Name string
ShortName string
RegistrationNumber string
OperationalNumber string
PrivateCode string
OperatorRef Ref
VehicleTypeRef Ref
}
type CycleModelProfile struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ChildSeat string
Battery bool
Lamps bool
Pump bool
Basket bool
Lock bool
}
type CarModelProfile struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ChildSeat Maybe[string]
Seats Maybe[uint8]
Doors Maybe[uint8]
Transmission Maybe[string]
CruiseControl Maybe[bool]
SatNav Maybe[bool]
AirConditioning Maybe[bool]
Convertible Maybe[bool]
UsbPowerSockets Maybe[bool]
WinterTyres Maybe[bool]
Chains Maybe[bool]
TrailerHitch Maybe[bool]
RoofRack Maybe[bool]
CycleRack Maybe[bool]
SkiRack Maybe[bool]
}
type Submode struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TransportMode string
SelfDriveSubmode string
}
type VehicleSharing struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Submodes Maybe[[]Submode] `xml:"submodes>Submode"`
}
type VehicleSharingService struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
VehicleSharingRef Ref
FloatingVehicles bool
Fleets Maybe[[]Ref] `xml:"fleets>FleetRef"`
}
type GmlPolygon struct {
XMLName xml.Name `xml:"http://www.opengis.net/gml/3.2 Polygon"`
Id string `xml:"http://www.opengis.net/gml/3.2 id,attr"`
Polygon string `xml:",innerxml"`
}
type MobilityServiceConstraintZone struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
GmlPolygon GmlPolygon
VehicleSharingRef Ref
}
type Parking struct {
XMLName xml.Name `xml:"Parking"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
ShortName string
Centroid Centroid
GmlPolygon any `xml:"http://www.opengis.net/gml/3.2 Polygon"`
OperatorRef Ref
Entrances any `xml:"entrances"`
ParkingType string
ParkingVehicleTypes string
ParkingLayout string
PrincipalCapacity int32
TotalCapacity int32
ProhibitedForHazardousMaterials Maybe[bool]
RechargingAvailable Maybe[bool]
Secure Maybe[bool]
ParkingReservation string
ParkingProperties any
}
type Centroid struct {
Location struct {
Longitude float32
Latitude float32
}
}
type StopPlace struct {
XMLName xml.Name `xml:"StopPlace"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
ShortName string
PrivateCode string
Centroid Centroid
AccessModes string
Levels Maybe[[]Level] `xml:"levels>Level"`
PublicCode string
TransportMode string
StopPlaceType string
Quays Maybe[[]Quay] `xml:"quays>Quay"`
}
type Quay struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
Centroid struct {
Location struct {
Longitude string `xml:"Longitude"`
Latitude string `xml:"Latitude"`
}
}
LevelRef Ref
QuayType string
}
type Level struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
PublicCode string
}
type ServiceCalendarFrame struct {
XMLName xml.Name `xml:"ServiceCalendarFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TypeOfFrameRef TypeOfFrameRef
ServiceCalendar []ServiceCalendar `xml:",omitempty"`
}
type ServiceCalendar struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
FromDate string
ToDate string
DayTypes Maybe[[]DayType] `xml:"dayTypes>DayType"`
OperatingPeriods Maybe[[]UicOperatingPeriod] `xml:"operatingPeriods>UicOperatingPeriod"`
DayTypeAssignments Maybe[[]DayTypeAssignment] `xml:"dayTypeAssignments>DayTypeAssignment"`
}
type DayType struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
Description string
Properties struct {
PropertyOfDay struct {
DaysOfWeek string
HolidayTypes string
}
} `xml:"properties"`
}
type UicOperatingPeriod struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
FromDate string
ToDate string
ValidDayBits string
}
type DayTypeAssignment struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Order string `xml:"order,attr"`
OperatingPeriodRef Ref
Date string
DayTypeRef Ref
}
type Route struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
}
type Line struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
ShortName string
Description string
TransportMode string
Url string
PublicCode string
PrivateCode string
OperatorRef Ref
Monitored string
}
type ScheduledStopPoint struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
Location struct {
Longitude string
Latitude string
Altitude string
Precision string
}
ShortName string
Description string
PublicCode string
PrivateCode string
}
type ServiceLink struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Distance string
LineString LineString `xml:"http://www.opengis.net/gml/3.2 LineString"`
FromPointRef Ref
ToPointRef Ref
}
type LineString struct {
Id string `xml:"http://www.opengis.net/gml/3.2 id,attr"`
PosList string `xml:"posList"`
}
type PassengerStopAssignment struct {
Order string `xml:"order,attr"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
ScheduledStopPointRef Ref
StopPlaceRef Ref
QuayRef Ref
}
type ServiceJourneyPattern struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
Distance string
RouteView struct {
LineRef Ref
}
PointsInSequence Maybe[[]StopPointInJourneyPattern] `xml:"pointsInSequence>StopPointInJourneyPattern"`
DirectionType string
}
type StopPointInJourneyPattern struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Order string `xml:"order,attr"`
ScheduledStopPointRef Ref
OnwardServiceLinkRef Ref
ForAlighting bool
ForBoarding bool
DestinationDisplayRef Ref
}
type ServiceFrame struct {
XMLName xml.Name `xml:"ServiceFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TypeOfFrameRef TypeOfFrameRef
Routes Maybe[[]Route] `xml:"routes>Route"`
Lines Maybe[[]Line] `xml:"lines>Line"`
ScheduledStopPoints Maybe[[]ScheduledStopPoint] `xml:"scheduledStopPoints>ScheduledStopPoint"`
ServiceLinks Maybe[[]ServiceLink] `xml:"serviceLinks>ServiceLink"`
StopAssignments Maybe[[]PassengerStopAssignment] `xml:"stopAssignments>PassengerStopAssignment"`
JourneyPatterns Maybe[[]ServiceJourneyPattern] `xml:"journeyPatterns>ServiceJourneyPattern"`
DestinationDisplays Maybe[[]DestinationDisplay] `xml:"destinationDisplays>DestinationDisplay"`
}
type DestinationDisplay struct {
XMLName xml.Name `xml:"DestinationDisplay"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
ShortName string
SideText string
FrontText string
PublicCode string
}
type TimetabledPassingTime struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
StopPointInJourneyPatternRef Ref
ArrivalTime string
ArrivalDayOffset string
DepartureTime string
DepartureDayOffset string
}
type ServiceJourney struct {
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
Name string
Distance string
TransportMode string
DepartureTime string
DepartureDayOffset string
JourneyDuration string
DayTypes Maybe[[]Ref] `xml:"dayTypes>DayTypeRef"`
ServiceJourneyPatternRef Ref
OperatorRef Ref
PassingTimes []TimetabledPassingTime `xml:"passingTimes>TimetabledPassingTime"`
LineRef Ref
TrainNumbers Maybe[[]Ref] `xml:"trainNumbers>TrainNumberRef"`
}
type TimetableFrame struct {
XMLName xml.Name `xml:"TimetableFrame"`
Id string `xml:"id,attr"`
Version string `xml:"version,attr"`
TypeOfFrameRef TypeOfFrameRef
VehicleJourneys Maybe[[]ServiceJourney] `xml:"vehicleJourneys>ServiceJourney"`
}
// Wrapper for optional values
type Maybe[T any] *T