-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgtfs-realtime.pb.swift
4734 lines (4235 loc) · 221 KB
/
gtfs-realtime.pb.swift
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// DO NOT EDIT.
// swift-format-ignore-file
// swiftlint:disable all
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: gtfs-realtime.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
// Copyright 2015 The GTFS Specifications Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Protocol definition file for GTFS Realtime.
//
// GTFS Realtime lets transit agencies provide consumers with realtime
// information about disruptions to their service (stations closed, lines not
// operating, important delays etc), location of their vehicles and expected
// arrival times.
//
// This protocol is published at:
// https://github.com/google/transit/tree/master/gtfs-realtime
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
/// The contents of a feed message.
/// A feed is a continuous stream of feed messages. Each message in the stream is
/// obtained as a response to an appropriate HTTP GET request.
/// A realtime feed is always defined with relation to an existing GTFS feed.
/// All the entity ids are resolved with respect to the GTFS feed.
/// Note that "required" and "optional" as stated in this file refer to Protocol
/// Buffer cardinality, not semantic cardinality. See reference.md at
/// https://github.com/google/transit/tree/master/gtfs-realtime for field
/// semantic cardinality.
struct TransitRealtime_FeedMessage: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Metadata about this feed and feed message.
var header: TransitRealtime_FeedHeader {
get {return _header ?? TransitRealtime_FeedHeader()}
set {_header = newValue}
}
/// Returns true if `header` has been explicitly set.
var hasHeader: Bool {return self._header != nil}
/// Clears the value of `header`. Subsequent reads from it will return its default value.
mutating func clearHeader() {self._header = nil}
/// Contents of the feed.
var entity: [TransitRealtime_FeedEntity] = []
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _header: TransitRealtime_FeedHeader? = nil
}
/// Metadata about a feed, included in feed messages.
struct TransitRealtime_FeedHeader: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Version of the feed specification.
/// The current version is 2.0. Valid versions are "2.0", "1.0".
var gtfsRealtimeVersion: String {
get {return _gtfsRealtimeVersion ?? String()}
set {_gtfsRealtimeVersion = newValue}
}
/// Returns true if `gtfsRealtimeVersion` has been explicitly set.
var hasGtfsRealtimeVersion: Bool {return self._gtfsRealtimeVersion != nil}
/// Clears the value of `gtfsRealtimeVersion`. Subsequent reads from it will return its default value.
mutating func clearGtfsRealtimeVersion() {self._gtfsRealtimeVersion = nil}
var incrementality: TransitRealtime_FeedHeader.Incrementality {
get {return _incrementality ?? .fullDataset}
set {_incrementality = newValue}
}
/// Returns true if `incrementality` has been explicitly set.
var hasIncrementality: Bool {return self._incrementality != nil}
/// Clears the value of `incrementality`. Subsequent reads from it will return its default value.
mutating func clearIncrementality() {self._incrementality = nil}
/// This timestamp identifies the moment when the content of this feed has been
/// created (in server time). In POSIX time (i.e., number of seconds since
/// January 1st 1970 00:00:00 UTC).
var timestamp: UInt64 {
get {return _timestamp ?? 0}
set {_timestamp = newValue}
}
/// Returns true if `timestamp` has been explicitly set.
var hasTimestamp: Bool {return self._timestamp != nil}
/// Clears the value of `timestamp`. Subsequent reads from it will return its default value.
mutating func clearTimestamp() {self._timestamp = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
/// Determines whether the current fetch is incremental. Currently,
/// DIFFERENTIAL mode is unsupported and behavior is unspecified for feeds
/// that use this mode. There are discussions on the GTFS Realtime mailing
/// list around fully specifying the behavior of DIFFERENTIAL mode and the
/// documentation will be updated when those discussions are finalized.
enum Incrementality: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int
case fullDataset // = 0
case differential // = 1
init() {
self = .fullDataset
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .fullDataset
case 1: self = .differential
default: return nil
}
}
var rawValue: Int {
switch self {
case .fullDataset: return 0
case .differential: return 1
}
}
}
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _gtfsRealtimeVersion: String? = nil
fileprivate var _incrementality: TransitRealtime_FeedHeader.Incrementality? = nil
fileprivate var _timestamp: UInt64? = nil
}
/// A definition (or update) of an entity in the transit feed.
struct TransitRealtime_FeedEntity: SwiftProtobuf.ExtensibleMessage, @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The ids are used only to provide incrementality support. The id should be
/// unique within a FeedMessage. Consequent FeedMessages may contain
/// FeedEntities with the same id. In case of a DIFFERENTIAL update the new
/// FeedEntity with some id will replace the old FeedEntity with the same id
/// (or delete it - see is_deleted below).
/// The actual GTFS entities (e.g. stations, routes, trips) referenced by the
/// feed must be specified by explicit selectors (see EntitySelector below for
/// more info).
var id: String {
get {return _storage._id ?? String()}
set {_uniqueStorage()._id = newValue}
}
/// Returns true if `id` has been explicitly set.
var hasID: Bool {return _storage._id != nil}
/// Clears the value of `id`. Subsequent reads from it will return its default value.
mutating func clearID() {_uniqueStorage()._id = nil}
/// Whether this entity is to be deleted. Relevant only for incremental
/// fetches.
var isDeleted: Bool {
get {return _storage._isDeleted ?? false}
set {_uniqueStorage()._isDeleted = newValue}
}
/// Returns true if `isDeleted` has been explicitly set.
var hasIsDeleted: Bool {return _storage._isDeleted != nil}
/// Clears the value of `isDeleted`. Subsequent reads from it will return its default value.
mutating func clearIsDeleted() {_uniqueStorage()._isDeleted = nil}
/// Data about the entity itself. Exactly one of the following fields must be
/// present (unless the entity is being deleted).
var tripUpdate: TransitRealtime_TripUpdate {
get {return _storage._tripUpdate ?? TransitRealtime_TripUpdate()}
set {_uniqueStorage()._tripUpdate = newValue}
}
/// Returns true if `tripUpdate` has been explicitly set.
var hasTripUpdate: Bool {return _storage._tripUpdate != nil}
/// Clears the value of `tripUpdate`. Subsequent reads from it will return its default value.
mutating func clearTripUpdate() {_uniqueStorage()._tripUpdate = nil}
var vehicle: TransitRealtime_VehiclePosition {
get {return _storage._vehicle ?? TransitRealtime_VehiclePosition()}
set {_uniqueStorage()._vehicle = newValue}
}
/// Returns true if `vehicle` has been explicitly set.
var hasVehicle: Bool {return _storage._vehicle != nil}
/// Clears the value of `vehicle`. Subsequent reads from it will return its default value.
mutating func clearVehicle() {_uniqueStorage()._vehicle = nil}
var alert: TransitRealtime_Alert {
get {return _storage._alert ?? TransitRealtime_Alert()}
set {_uniqueStorage()._alert = newValue}
}
/// Returns true if `alert` has been explicitly set.
var hasAlert: Bool {return _storage._alert != nil}
/// Clears the value of `alert`. Subsequent reads from it will return its default value.
mutating func clearAlert() {_uniqueStorage()._alert = nil}
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var shape: TransitRealtime_Shape {
get {return _storage._shape ?? TransitRealtime_Shape()}
set {_uniqueStorage()._shape = newValue}
}
/// Returns true if `shape` has been explicitly set.
var hasShape: Bool {return _storage._shape != nil}
/// Clears the value of `shape`. Subsequent reads from it will return its default value.
mutating func clearShape() {_uniqueStorage()._shape = nil}
var stop: TransitRealtime_Stop {
get {return _storage._stop ?? TransitRealtime_Stop()}
set {_uniqueStorage()._stop = newValue}
}
/// Returns true if `stop` has been explicitly set.
var hasStop: Bool {return _storage._stop != nil}
/// Clears the value of `stop`. Subsequent reads from it will return its default value.
mutating func clearStop() {_uniqueStorage()._stop = nil}
var tripModifications: TransitRealtime_TripModifications {
get {return _storage._tripModifications ?? TransitRealtime_TripModifications()}
set {_uniqueStorage()._tripModifications = newValue}
}
/// Returns true if `tripModifications` has been explicitly set.
var hasTripModifications: Bool {return _storage._tripModifications != nil}
/// Clears the value of `tripModifications`. Subsequent reads from it will return its default value.
mutating func clearTripModifications() {_uniqueStorage()._tripModifications = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _storage = _StorageClass.defaultInstance
}
/// Realtime update of the progress of a vehicle along a trip.
/// Depending on the value of ScheduleRelationship, a TripUpdate can specify:
/// - A trip that proceeds along the schedule.
/// - A trip that proceeds along a route but has no fixed schedule.
/// - A trip that have been added or removed with regard to schedule.
///
/// The updates can be for future, predicted arrival/departure events, or for
/// past events that already occurred.
/// Normally, updates should get more precise and more certain (see
/// uncertainty below) as the events gets closer to current time.
/// Even if that is not possible, the information for past events should be
/// precise and certain. In particular, if an update points to time in the past
/// but its update's uncertainty is not 0, the client should conclude that the
/// update is a (wrong) prediction and that the trip has not completed yet.
///
/// Note that the update can describe a trip that is already completed.
/// To this end, it is enough to provide an update for the last stop of the trip.
/// If the time of that is in the past, the client will conclude from that that
/// the whole trip is in the past (it is possible, although inconsequential, to
/// also provide updates for preceding stops).
/// This option is most relevant for a trip that has completed ahead of schedule,
/// but according to the schedule, the trip is still proceeding at the current
/// time. Removing the updates for this trip could make the client assume
/// that the trip is still proceeding.
/// Note that the feed provider is allowed, but not required, to purge past
/// updates - this is one case where this would be practically useful.
struct TransitRealtime_TripUpdate: SwiftProtobuf.ExtensibleMessage, @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The Trip that this message applies to. There can be at most one
/// TripUpdate entity for each actual trip instance.
/// If there is none, that means there is no prediction information available.
/// It does *not* mean that the trip is progressing according to schedule.
var trip: TransitRealtime_TripDescriptor {
get {return _storage._trip ?? TransitRealtime_TripDescriptor()}
set {_uniqueStorage()._trip = newValue}
}
/// Returns true if `trip` has been explicitly set.
var hasTrip: Bool {return _storage._trip != nil}
/// Clears the value of `trip`. Subsequent reads from it will return its default value.
mutating func clearTrip() {_uniqueStorage()._trip = nil}
/// Additional information on the vehicle that is serving this trip.
var vehicle: TransitRealtime_VehicleDescriptor {
get {return _storage._vehicle ?? TransitRealtime_VehicleDescriptor()}
set {_uniqueStorage()._vehicle = newValue}
}
/// Returns true if `vehicle` has been explicitly set.
var hasVehicle: Bool {return _storage._vehicle != nil}
/// Clears the value of `vehicle`. Subsequent reads from it will return its default value.
mutating func clearVehicle() {_uniqueStorage()._vehicle = nil}
/// Updates to StopTimes for the trip (both future, i.e., predictions, and in
/// some cases, past ones, i.e., those that already happened).
/// The updates must be sorted by stop_sequence, and apply for all the
/// following stops of the trip up to the next specified one.
///
/// Example 1:
/// For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
/// delay of 0 for stop_sequence of the current stop means that the trip is
/// exactly on time.
///
/// Example 2:
/// For the same trip instance, 3 StopTimeUpdates are provided:
/// - delay of 5 min for stop_sequence 3
/// - delay of 1 min for stop_sequence 8
/// - delay of unspecified duration for stop_sequence 10
/// This will be interpreted as:
/// - stop_sequences 3,4,5,6,7 have delay of 5 min.
/// - stop_sequences 8,9 have delay of 1 min.
/// - stop_sequences 10,... have unknown delay.
var stopTimeUpdate: [TransitRealtime_TripUpdate.StopTimeUpdate] {
get {return _storage._stopTimeUpdate}
set {_uniqueStorage()._stopTimeUpdate = newValue}
}
/// The most recent moment at which the vehicle's real-time progress was measured
/// to estimate StopTimes in the future. When StopTimes in the past are provided,
/// arrival/departure times may be earlier than this value. In POSIX
/// time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
var timestamp: UInt64 {
get {return _storage._timestamp ?? 0}
set {_uniqueStorage()._timestamp = newValue}
}
/// Returns true if `timestamp` has been explicitly set.
var hasTimestamp: Bool {return _storage._timestamp != nil}
/// Clears the value of `timestamp`. Subsequent reads from it will return its default value.
mutating func clearTimestamp() {_uniqueStorage()._timestamp = nil}
/// The current schedule deviation for the trip. Delay should only be
/// specified when the prediction is given relative to some existing schedule
/// in GTFS.
///
/// Delay (in seconds) can be positive (meaning that the vehicle is late) or
/// negative (meaning that the vehicle is ahead of schedule). Delay of 0
/// means that the vehicle is exactly on time.
///
/// Delay information in StopTimeUpdates take precedent of trip-level delay
/// information, such that trip-level delay is only propagated until the next
/// stop along the trip with a StopTimeUpdate delay value specified.
///
/// Feed providers are strongly encouraged to provide a TripUpdate.timestamp
/// value indicating when the delay value was last updated, in order to
/// evaluate the freshness of the data.
///
/// NOTE: This field is still experimental, and subject to change. It may be
/// formally adopted in the future.
var delay: Int32 {
get {return _storage._delay ?? 0}
set {_uniqueStorage()._delay = newValue}
}
/// Returns true if `delay` has been explicitly set.
var hasDelay: Bool {return _storage._delay != nil}
/// Clears the value of `delay`. Subsequent reads from it will return its default value.
mutating func clearDelay() {_uniqueStorage()._delay = nil}
var tripProperties: TransitRealtime_TripUpdate.TripProperties {
get {return _storage._tripProperties ?? TransitRealtime_TripUpdate.TripProperties()}
set {_uniqueStorage()._tripProperties = newValue}
}
/// Returns true if `tripProperties` has been explicitly set.
var hasTripProperties: Bool {return _storage._tripProperties != nil}
/// Clears the value of `tripProperties`. Subsequent reads from it will return its default value.
mutating func clearTripProperties() {_uniqueStorage()._tripProperties = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
/// Timing information for a single predicted event (either arrival or
/// departure).
/// Timing consists of delay and/or estimated time, and uncertainty.
/// - delay should be used when the prediction is given relative to some
/// existing schedule in GTFS.
/// - time should be given whether there is a predicted schedule or not. If
/// both time and delay are specified, time will take precedence
/// (although normally, time, if given for a scheduled trip, should be
/// equal to scheduled time in GTFS + delay).
///
/// Uncertainty applies equally to both time and delay.
/// The uncertainty roughly specifies the expected error in true delay (but
/// note, we don't yet define its precise statistical meaning). It's possible
/// for the uncertainty to be 0, for example for trains that are driven under
/// computer timing control.
struct StopTimeEvent: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Delay (in seconds) can be positive (meaning that the vehicle is late) or
/// negative (meaning that the vehicle is ahead of schedule). Delay of 0
/// means that the vehicle is exactly on time.
var delay: Int32 {
get {return _delay ?? 0}
set {_delay = newValue}
}
/// Returns true if `delay` has been explicitly set.
var hasDelay: Bool {return self._delay != nil}
/// Clears the value of `delay`. Subsequent reads from it will return its default value.
mutating func clearDelay() {self._delay = nil}
/// Event as absolute time.
/// In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
/// UTC).
var time: Int64 {
get {return _time ?? 0}
set {_time = newValue}
}
/// Returns true if `time` has been explicitly set.
var hasTime: Bool {return self._time != nil}
/// Clears the value of `time`. Subsequent reads from it will return its default value.
mutating func clearTime() {self._time = nil}
/// If uncertainty is omitted, it is interpreted as unknown.
/// If the prediction is unknown or too uncertain, the delay (or time) field
/// should be empty. In such case, the uncertainty field is ignored.
/// To specify a completely certain prediction, set its uncertainty to 0.
var uncertainty: Int32 {
get {return _uncertainty ?? 0}
set {_uncertainty = newValue}
}
/// Returns true if `uncertainty` has been explicitly set.
var hasUncertainty: Bool {return self._uncertainty != nil}
/// Clears the value of `uncertainty`. Subsequent reads from it will return its default value.
mutating func clearUncertainty() {self._uncertainty = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _delay: Int32? = nil
fileprivate var _time: Int64? = nil
fileprivate var _uncertainty: Int32? = nil
}
/// Realtime update for arrival and/or departure events for a given stop on a
/// trip. Updates can be supplied for both past and future events.
/// The producer is allowed, although not required, to drop past events.
struct StopTimeUpdate: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Must be the same as in stop_times.txt in the corresponding GTFS feed.
var stopSequence: UInt32 {
get {return _stopSequence ?? 0}
set {_stopSequence = newValue}
}
/// Returns true if `stopSequence` has been explicitly set.
var hasStopSequence: Bool {return self._stopSequence != nil}
/// Clears the value of `stopSequence`. Subsequent reads from it will return its default value.
mutating func clearStopSequence() {self._stopSequence = nil}
/// Must be the same as in stops.txt in the corresponding GTFS feed.
var stopID: String {
get {return _stopID ?? String()}
set {_stopID = newValue}
}
/// Returns true if `stopID` has been explicitly set.
var hasStopID: Bool {return self._stopID != nil}
/// Clears the value of `stopID`. Subsequent reads from it will return its default value.
mutating func clearStopID() {self._stopID = nil}
var arrival: TransitRealtime_TripUpdate.StopTimeEvent {
get {return _arrival ?? TransitRealtime_TripUpdate.StopTimeEvent()}
set {_arrival = newValue}
}
/// Returns true if `arrival` has been explicitly set.
var hasArrival: Bool {return self._arrival != nil}
/// Clears the value of `arrival`. Subsequent reads from it will return its default value.
mutating func clearArrival() {self._arrival = nil}
var departure: TransitRealtime_TripUpdate.StopTimeEvent {
get {return _departure ?? TransitRealtime_TripUpdate.StopTimeEvent()}
set {_departure = newValue}
}
/// Returns true if `departure` has been explicitly set.
var hasDeparture: Bool {return self._departure != nil}
/// Clears the value of `departure`. Subsequent reads from it will return its default value.
mutating func clearDeparture() {self._departure = nil}
/// Expected occupancy after departure from the given stop.
/// Should be provided only for future stops.
/// In order to provide departure_occupancy_status without either arrival or
/// departure StopTimeEvents, ScheduleRelationship should be set to NO_DATA.
var departureOccupancyStatus: TransitRealtime_VehiclePosition.OccupancyStatus {
get {return _departureOccupancyStatus ?? .empty}
set {_departureOccupancyStatus = newValue}
}
/// Returns true if `departureOccupancyStatus` has been explicitly set.
var hasDepartureOccupancyStatus: Bool {return self._departureOccupancyStatus != nil}
/// Clears the value of `departureOccupancyStatus`. Subsequent reads from it will return its default value.
mutating func clearDepartureOccupancyStatus() {self._departureOccupancyStatus = nil}
var scheduleRelationship: TransitRealtime_TripUpdate.StopTimeUpdate.ScheduleRelationship {
get {return _scheduleRelationship ?? .scheduled}
set {_scheduleRelationship = newValue}
}
/// Returns true if `scheduleRelationship` has been explicitly set.
var hasScheduleRelationship: Bool {return self._scheduleRelationship != nil}
/// Clears the value of `scheduleRelationship`. Subsequent reads from it will return its default value.
mutating func clearScheduleRelationship() {self._scheduleRelationship = nil}
/// Realtime updates for certain properties defined within GTFS stop_times.txt
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var stopTimeProperties: TransitRealtime_TripUpdate.StopTimeUpdate.StopTimeProperties {
get {return _stopTimeProperties ?? TransitRealtime_TripUpdate.StopTimeUpdate.StopTimeProperties()}
set {_stopTimeProperties = newValue}
}
/// Returns true if `stopTimeProperties` has been explicitly set.
var hasStopTimeProperties: Bool {return self._stopTimeProperties != nil}
/// Clears the value of `stopTimeProperties`. Subsequent reads from it will return its default value.
mutating func clearStopTimeProperties() {self._stopTimeProperties = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
/// The relation between the StopTimeEvents and the static schedule.
enum ScheduleRelationship: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int
/// The vehicle is proceeding in accordance with its static schedule of
/// stops, although not necessarily according to the times of the schedule.
/// At least one of arrival and departure must be provided. If the schedule
/// for this stop contains both arrival and departure times then so must
/// this update. Frequency-based trips (GTFS frequencies.txt with exact_times = 0)
/// should not have a SCHEDULED value and should use UNSCHEDULED instead.
case scheduled // = 0
/// The stop is skipped, i.e., the vehicle will not stop at this stop.
/// Arrival and departure are optional.
case skipped // = 1
/// No StopTimeEvents are given for this stop.
/// The main intention for this value is to give time predictions only for
/// part of a trip, i.e., if the last update for a trip has a NO_DATA
/// specifier, then StopTimeEvents for the rest of the stops in the trip
/// are considered to be unspecified as well.
/// Neither arrival nor departure should be supplied.
case noData // = 2
/// The vehicle is operating a trip defined in GTFS frequencies.txt with exact_times = 0.
/// This value should not be used for trips that are not defined in GTFS frequencies.txt,
/// or trips in GTFS frequencies.txt with exact_times = 1. Trips containing StopTimeUpdates
/// with ScheduleRelationship=UNSCHEDULED must also set TripDescriptor.ScheduleRelationship=UNSCHEDULED.
/// NOTE: This field is still experimental, and subject to change. It may be
/// formally adopted in the future.
case unscheduled // = 3
init() {
self = .scheduled
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .scheduled
case 1: self = .skipped
case 2: self = .noData
case 3: self = .unscheduled
default: return nil
}
}
var rawValue: Int {
switch self {
case .scheduled: return 0
case .skipped: return 1
case .noData: return 2
case .unscheduled: return 3
}
}
}
/// Provides the updated values for the stop time.
/// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
struct StopTimeProperties: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Supports real-time stop assignments. Refers to a stop_id defined in the GTFS stops.txt.
/// The new assigned_stop_id should not result in a significantly different trip experience for the end user than
/// the stop_id defined in GTFS stop_times.txt. In other words, the end user should not view this new stop_id as an
/// "unusual change" if the new stop was presented within an app without any additional context.
/// For example, this field is intended to be used for platform assignments by using a stop_id that belongs to the
/// same station as the stop originally defined in GTFS stop_times.txt.
/// To assign a stop without providing any real-time arrival or departure predictions, populate this field and set
/// StopTimeUpdate.schedule_relationship = NO_DATA.
/// If this field is populated, it is preferred to omit `StopTimeUpdate.stop_id` and use only `StopTimeUpdate.stop_sequence`. If
/// `StopTimeProperties.assigned_stop_id` and `StopTimeUpdate.stop_id` are populated, `StopTimeUpdate.stop_id` must match `assigned_stop_id`.
/// Platform assignments should be reflected in other GTFS-realtime fields as well
/// (e.g., `VehiclePosition.stop_id`).
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var assignedStopID: String {
get {return _assignedStopID ?? String()}
set {_assignedStopID = newValue}
}
/// Returns true if `assignedStopID` has been explicitly set.
var hasAssignedStopID: Bool {return self._assignedStopID != nil}
/// Clears the value of `assignedStopID`. Subsequent reads from it will return its default value.
mutating func clearAssignedStopID() {self._assignedStopID = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _assignedStopID: String? = nil
}
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _stopSequence: UInt32? = nil
fileprivate var _stopID: String? = nil
fileprivate var _arrival: TransitRealtime_TripUpdate.StopTimeEvent? = nil
fileprivate var _departure: TransitRealtime_TripUpdate.StopTimeEvent? = nil
fileprivate var _departureOccupancyStatus: TransitRealtime_VehiclePosition.OccupancyStatus? = nil
fileprivate var _scheduleRelationship: TransitRealtime_TripUpdate.StopTimeUpdate.ScheduleRelationship? = nil
fileprivate var _stopTimeProperties: TransitRealtime_TripUpdate.StopTimeUpdate.StopTimeProperties? = nil
}
/// Defines updated properties of the trip, such as a new shape_id when there is a detour. Or defines the
/// trip_id, start_date, and start_time of a DUPLICATED trip.
/// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
struct TripProperties: SwiftProtobuf.ExtensibleMessage, Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Defines the identifier of a new trip that is a duplicate of an existing trip defined in (CSV) GTFS trips.txt
/// but will start at a different service date and/or time (defined using the TripProperties.start_date and
/// TripProperties.start_time fields). See definition of trips.trip_id in (CSV) GTFS. Its value must be different
/// than the ones used in the (CSV) GTFS. Required if schedule_relationship=DUPLICATED, otherwise this field must not
/// be populated and will be ignored by consumers.
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var tripID: String {
get {return _tripID ?? String()}
set {_tripID = newValue}
}
/// Returns true if `tripID` has been explicitly set.
var hasTripID: Bool {return self._tripID != nil}
/// Clears the value of `tripID`. Subsequent reads from it will return its default value.
mutating func clearTripID() {self._tripID = nil}
/// Service date on which the DUPLICATED trip will be run, in YYYYMMDD format. Required if
/// schedule_relationship=DUPLICATED, otherwise this field must not be populated and will be ignored by consumers.
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var startDate: String {
get {return _startDate ?? String()}
set {_startDate = newValue}
}
/// Returns true if `startDate` has been explicitly set.
var hasStartDate: Bool {return self._startDate != nil}
/// Clears the value of `startDate`. Subsequent reads from it will return its default value.
mutating func clearStartDate() {self._startDate = nil}
/// Defines the departure start time of the trip when it’s duplicated. See definition of stop_times.departure_time
/// in (CSV) GTFS. Scheduled arrival and departure times for the duplicated trip are calculated based on the offset
/// between the original trip departure_time and this field. For example, if a GTFS trip has stop A with a
/// departure_time of 10:00:00 and stop B with departure_time of 10:01:00, and this field is populated with the value
/// of 10:30:00, stop B on the duplicated trip will have a scheduled departure_time of 10:31:00. Real-time prediction
/// delay values are applied to this calculated schedule time to determine the predicted time. For example, if a
/// departure delay of 30 is provided for stop B, then the predicted departure time is 10:31:30. Real-time
/// prediction time values do not have any offset applied to them and indicate the predicted time as provided.
/// For example, if a departure time representing 10:31:30 is provided for stop B, then the predicted departure time
/// is 10:31:30. This field is required if schedule_relationship is DUPLICATED, otherwise this field must not be
/// populated and will be ignored by consumers.
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var startTime: String {
get {return _startTime ?? String()}
set {_startTime = newValue}
}
/// Returns true if `startTime` has been explicitly set.
var hasStartTime: Bool {return self._startTime != nil}
/// Clears the value of `startTime`. Subsequent reads from it will return its default value.
mutating func clearStartTime() {self._startTime = nil}
/// Specifies the shape of the vehicle travel path when the trip shape differs from the shape specified in
/// (CSV) GTFS or to specify it in real-time when it's not provided by (CSV) GTFS, such as a vehicle that takes differing
/// paths based on rider demand. See definition of trips.shape_id in (CSV) GTFS. If a shape is neither defined in (CSV) GTFS
/// nor in real-time, the shape is considered unknown. This field can refer to a shape defined in the (CSV) GTFS in shapes.txt
/// or a Shape in the (protobuf) real-time feed. The order of stops (stop sequences) for this trip must remain the same as
/// (CSV) GTFS. Stops that are a part of the original trip but will no longer be made, such as when a detour occurs, should
/// be marked as schedule_relationship=SKIPPED.
/// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
var shapeID: String {
get {return _shapeID ?? String()}
set {_shapeID = newValue}
}
/// Returns true if `shapeID` has been explicitly set.
var hasShapeID: Bool {return self._shapeID != nil}
/// Clears the value of `shapeID`. Subsequent reads from it will return its default value.
mutating func clearShapeID() {self._shapeID = nil}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _tripID: String? = nil
fileprivate var _startDate: String? = nil
fileprivate var _startTime: String? = nil
fileprivate var _shapeID: String? = nil
}
init() {}
var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet()
fileprivate var _storage = _StorageClass.defaultInstance
}
/// Realtime positioning information for a given vehicle.
struct TransitRealtime_VehiclePosition: SwiftProtobuf.ExtensibleMessage, @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The Trip that this vehicle is serving.
/// Can be empty or partial if the vehicle can not be identified with a given
/// trip instance.
var trip: TransitRealtime_TripDescriptor {
get {return _storage._trip ?? TransitRealtime_TripDescriptor()}
set {_uniqueStorage()._trip = newValue}
}
/// Returns true if `trip` has been explicitly set.
var hasTrip: Bool {return _storage._trip != nil}
/// Clears the value of `trip`. Subsequent reads from it will return its default value.
mutating func clearTrip() {_uniqueStorage()._trip = nil}
/// Additional information on the vehicle that is serving this trip.
var vehicle: TransitRealtime_VehicleDescriptor {
get {return _storage._vehicle ?? TransitRealtime_VehicleDescriptor()}
set {_uniqueStorage()._vehicle = newValue}
}
/// Returns true if `vehicle` has been explicitly set.
var hasVehicle: Bool {return _storage._vehicle != nil}
/// Clears the value of `vehicle`. Subsequent reads from it will return its default value.
mutating func clearVehicle() {_uniqueStorage()._vehicle = nil}
/// Current position of this vehicle.
var position: TransitRealtime_Position {
get {return _storage._position ?? TransitRealtime_Position()}
set {_uniqueStorage()._position = newValue}
}
/// Returns true if `position` has been explicitly set.
var hasPosition: Bool {return _storage._position != nil}
/// Clears the value of `position`. Subsequent reads from it will return its default value.
mutating func clearPosition() {_uniqueStorage()._position = nil}
/// The stop sequence index of the current stop. The meaning of
/// current_stop_sequence (i.e., the stop that it refers to) is determined by
/// current_status.
/// If current_status is missing IN_TRANSIT_TO is assumed.
var currentStopSequence: UInt32 {
get {return _storage._currentStopSequence ?? 0}
set {_uniqueStorage()._currentStopSequence = newValue}
}
/// Returns true if `currentStopSequence` has been explicitly set.
var hasCurrentStopSequence: Bool {return _storage._currentStopSequence != nil}
/// Clears the value of `currentStopSequence`. Subsequent reads from it will return its default value.
mutating func clearCurrentStopSequence() {_uniqueStorage()._currentStopSequence = nil}
/// Identifies the current stop. The value must be the same as in stops.txt in
/// the corresponding GTFS feed.
var stopID: String {
get {return _storage._stopID ?? String()}
set {_uniqueStorage()._stopID = newValue}
}
/// Returns true if `stopID` has been explicitly set.
var hasStopID: Bool {return _storage._stopID != nil}
/// Clears the value of `stopID`. Subsequent reads from it will return its default value.
mutating func clearStopID() {_uniqueStorage()._stopID = nil}
/// The exact status of the vehicle with respect to the current stop.
/// Ignored if current_stop_sequence is missing.
var currentStatus: TransitRealtime_VehiclePosition.VehicleStopStatus {
get {return _storage._currentStatus ?? .inTransitTo}
set {_uniqueStorage()._currentStatus = newValue}
}
/// Returns true if `currentStatus` has been explicitly set.
var hasCurrentStatus: Bool {return _storage._currentStatus != nil}
/// Clears the value of `currentStatus`. Subsequent reads from it will return its default value.
mutating func clearCurrentStatus() {_uniqueStorage()._currentStatus = nil}
/// Moment at which the vehicle's position was measured. In POSIX time
/// (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
var timestamp: UInt64 {
get {return _storage._timestamp ?? 0}
set {_uniqueStorage()._timestamp = newValue}
}
/// Returns true if `timestamp` has been explicitly set.
var hasTimestamp: Bool {return _storage._timestamp != nil}
/// Clears the value of `timestamp`. Subsequent reads from it will return its default value.
mutating func clearTimestamp() {_uniqueStorage()._timestamp = nil}
var congestionLevel: TransitRealtime_VehiclePosition.CongestionLevel {
get {return _storage._congestionLevel ?? .unknownCongestionLevel}
set {_uniqueStorage()._congestionLevel = newValue}
}
/// Returns true if `congestionLevel` has been explicitly set.
var hasCongestionLevel: Bool {return _storage._congestionLevel != nil}
/// Clears the value of `congestionLevel`. Subsequent reads from it will return its default value.
mutating func clearCongestionLevel() {_uniqueStorage()._congestionLevel = nil}
/// If multi_carriage_status is populated with per-carriage OccupancyStatus,
/// then this field should describe the entire vehicle with all carriages accepting passengers considered.
var occupancyStatus: TransitRealtime_VehiclePosition.OccupancyStatus {
get {return _storage._occupancyStatus ?? .empty}
set {_uniqueStorage()._occupancyStatus = newValue}
}
/// Returns true if `occupancyStatus` has been explicitly set.
var hasOccupancyStatus: Bool {return _storage._occupancyStatus != nil}
/// Clears the value of `occupancyStatus`. Subsequent reads from it will return its default value.
mutating func clearOccupancyStatus() {_uniqueStorage()._occupancyStatus = nil}
/// A percentage value indicating the degree of passenger occupancy in the vehicle.
/// The values are represented as an integer without decimals. 0 means 0% and 100 means 100%.
/// The value 100 should represent the total maximum occupancy the vehicle was designed for,
/// including both seated and standing capacity, and current operating regulations allow.
/// The value may exceed 100 if there are more passengers than the maximum designed capacity.
/// The precision of occupancy_percentage should be low enough that individual passengers cannot be tracked boarding or alighting the vehicle.
/// If multi_carriage_status is populated with per-carriage occupancy_percentage,
/// then this field should describe the entire vehicle with all carriages accepting passengers considered.
/// This field is still experimental, and subject to change. It may be formally adopted in the future.
var occupancyPercentage: UInt32 {
get {return _storage._occupancyPercentage ?? 0}
set {_uniqueStorage()._occupancyPercentage = newValue}
}
/// Returns true if `occupancyPercentage` has been explicitly set.
var hasOccupancyPercentage: Bool {return _storage._occupancyPercentage != nil}
/// Clears the value of `occupancyPercentage`. Subsequent reads from it will return its default value.
mutating func clearOccupancyPercentage() {_uniqueStorage()._occupancyPercentage = nil}
/// Details of the multiple carriages of this given vehicle.
/// The first occurrence represents the first carriage of the vehicle,
/// given the current direction of travel.
/// The number of occurrences of the multi_carriage_details
/// field represents the number of carriages of the vehicle.
/// It also includes non boardable carriages,
/// like engines, maintenance carriages, etc… as they provide valuable
/// information to passengers about where to stand on a platform.
/// This message/field is still experimental, and subject to change. It may be formally adopted in the future.
var multiCarriageDetails: [TransitRealtime_VehiclePosition.CarriageDetails] {
get {return _storage._multiCarriageDetails}
set {_uniqueStorage()._multiCarriageDetails = newValue}
}
var unknownFields = SwiftProtobuf.UnknownStorage()
enum VehicleStopStatus: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int
/// The vehicle is just about to arrive at the stop (on a stop
/// display, the vehicle symbol typically flashes).
case incomingAt // = 0
/// The vehicle is standing at the stop.
case stoppedAt // = 1
/// The vehicle has departed and is in transit to the next stop.
case inTransitTo // = 2
init() {
self = .incomingAt
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .incomingAt
case 1: self = .stoppedAt
case 2: self = .inTransitTo
default: return nil
}
}
var rawValue: Int {
switch self {
case .incomingAt: return 0
case .stoppedAt: return 1
case .inTransitTo: return 2
}
}
}
/// Congestion level that is affecting this vehicle.
enum CongestionLevel: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int
case unknownCongestionLevel // = 0
case runningSmoothly // = 1
case stopAndGo // = 2
case congestion // = 3
/// People leaving their cars.
case severeCongestion // = 4
init() {
self = .unknownCongestionLevel
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .unknownCongestionLevel
case 1: self = .runningSmoothly
case 2: self = .stopAndGo
case 3: self = .congestion
case 4: self = .severeCongestion
default: return nil
}
}
var rawValue: Int {
switch self {
case .unknownCongestionLevel: return 0
case .runningSmoothly: return 1
case .stopAndGo: return 2
case .congestion: return 3
case .severeCongestion: return 4
}
}
}
/// The state of passenger occupancy for the vehicle or carriage.
/// Individual producers may not publish all OccupancyStatus values. Therefore, consumers
/// must not assume that the OccupancyStatus values follow a linear scale.
/// Consumers should represent OccupancyStatus values as the state indicated
/// and intended by the producer. Likewise, producers must use OccupancyStatus values that
/// correspond to actual vehicle occupancy states.
/// For describing passenger occupancy levels on a linear scale, see `occupancy_percentage`.
/// This field is still experimental, and subject to change. It may be formally adopted in the future.
enum OccupancyStatus: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int
/// The vehicle or carriage is considered empty by most measures, and has few or no
/// passengers onboard, but is still accepting passengers.
case empty // = 0
/// The vehicle or carriage has a large number of seats available.
/// The amount of free seats out of the total seats available to be
/// considered large enough to fall into this category is determined at the
/// discretion of the producer.
case manySeatsAvailable // = 1
/// The vehicle or carriage has a relatively small number of seats available.
/// The amount of free seats out of the total seats available to be
/// considered small enough to fall into this category is determined at the
/// discretion of the feed producer.
case fewSeatsAvailable // = 2
/// The vehicle or carriage can currently accommodate only standing passengers.
case standingRoomOnly // = 3
/// The vehicle or carriage can currently accommodate only standing passengers
/// and has limited space for them.
case crushedStandingRoomOnly // = 4
/// The vehicle or carriage is considered full by most measures, but may still be
/// allowing passengers to board.
case full // = 5
/// The vehicle or carriage is not accepting passengers, but usually accepts passengers for boarding.
case notAcceptingPassengers // = 6
/// The vehicle or carriage doesn't have any occupancy data available at that time.
case noDataAvailable // = 7
/// The vehicle or carriage is not boardable and never accepts passengers.
/// Useful for special vehicles or carriages (engine, maintenance carriage, etc…).
case notBoardable // = 8
init() {
self = .empty
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .empty
case 1: self = .manySeatsAvailable