-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathchaos.proto
266 lines (245 loc) · 8.54 KB
/
chaos.proto
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
syntax = "proto2";
package chaos;
import "gtfs-realtime.proto";
message Disruption{
// must match with the id in the FeedEntity for deletion
required string id = 1;
// indicator if disruption is planned or not
optional string type = 2;
// it's a reference label as shown in the backoffice
optional string reference = 3;
// the publication period specify when an information can be displayed to
// the customer, if a request is made before or after this period the
// disruption must not be shown
optional transit_realtime.TimeRange publication_period = 4;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 6;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 7;
optional Cause cause = 8;
repeated Impact impacts = 9;
repeated Tag tags = 11;
optional string note = 12;
// general info about area where the disruption happens
repeated PtObject localization = 13;
// Provider of the disruption
optional string contributor = 14;
// properties attached to the disruption
repeated DisruptionProperty properties = 15;
// author of the disruption
optional string author = 16;
// version of the disruption
optional string version = 17;
}
message Wording {
required string key = 1;
required string value = 2;
}
message Category {
required string id = 1;
required string name = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 3;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 4;
}
message Cause{
required string id = 1;
optional string wording = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 3;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 4;
repeated Wording wordings = 5;
optional Category category = 6;
}
message Impact{
required string id = 1;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 3;
// the application period defines when the impact happens
repeated transit_realtime.TimeRange application_periods = 4;
optional Severity severity = 5;
repeated PtObject informed_entities = 6;
repeated Message messages = 7;
// send certain type of message(s) to optional brokers ! deprecated in favor of Message values
optional bool send_notifications = 8;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC) ! deprecated in favor of Message values
optional uint64 notification_date = 9;
// Application pattern used while creating impact if any
repeated Pattern application_patterns = 10;
// version of the impact
optional string version = 11;
}
message WeekPattern {
required bool monday = 1;
required bool tuesday = 2;
required bool wednesday = 3;
required bool thursday = 4;
required bool friday = 5;
required bool saturday = 6;
required bool sunday = 7;
}
message TimeSlot{
// Times in local for a timeslot
required uint32 begin = 1;
required uint32 end = 2;
}
message Pattern {
// Dates in local
required uint32 start_date = 1;
required uint32 end_date = 2;
required WeekPattern week_pattern = 3;
repeated TimeSlot time_slots = 4;
optional string timezone = 5;
}
message LineSection{
required PtObject line = 1;
required PtObject start_point = 2;
required PtObject end_point = 3;
repeated PtObject routes = 5;
}
message OrderedPtObject{
required string uri = 1;
required uint32 order = 2;
}
message RailSection {
required PtObject start_point = 1;
required PtObject end_point = 2;
repeated OrderedPtObject blocked_stop_areas = 3;
repeated PtObject routes = 4;
optional PtObject line = 5;
}
message AccessPoint {
optional PtObject stop_point = 1;
}
message PtObject{
enum Type {
option allow_alias = true;
network = 1;
stop_area = 2;
line = 3;
line_section = 4;
route = 5;
unkown_type = 6;
unknown_type = 6;
stop_point = 7;
trip = 8;
rail_section = 9;
poi = 10;
access_point = 11;
vehicle_journey = 12;
}
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 1;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 2;
required Type pt_object_type = 3;
required string uri = 4;
optional LineSection pt_line_section = 5;
optional RailSection pt_rail_section = 6;
optional AccessPoint pt_access_point = 7;
optional string name = 8;
}
message Severity{
required string id = 1;
optional string wording = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 3;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 4;
optional string color = 5;
optional int32 priority = 6;
optional transit_realtime.Alert.Effect effect = 7;
}
message Tag{
required string id = 1;
required string name = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 3;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 4;
}
// Need to "extend" TranslatedString with gtfs-realtime, but not possible.
message Translation {
// A UTF-8 string containing the message.
required string text = 1;
// BCP-47 language code. Can be omitted if the language is unknown or if
// no i18n is done at all for the feed. At most one translation is
// allowed to have an unspecified language tag.
optional string language = 2;
// A UTF-8 string containing the vocalized text audio file
optional string url_audio = 3;
}
message Message{
required string text = 1;
// Channel where the message is active, it can be something like twitter, SMS, web, etc...
required Channel channel = 2;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 3;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 4;
repeated Meta meta = 5;
// send this message
optional bool send_notification = 6;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 notification_date = 7;
repeated Translation translations = 8;
// A UTF-8 string containing the vocalized text audio file
optional string url_audio = 9;
}
// It represents a channel of diffusion like SMS, Push notifications, twitter, etc...
message Channel{
// Represent a type of diffusion for a channel like web, mobile, notification, sms, email..
enum Type {
option allow_alias = true;
web = 1;
sms = 2;
email = 3;
mobile = 4;
notification = 5;
twitter = 6;
facebook = 7;
unkown_type = 8;
unknown_type = 8;
title = 9;
beacon = 10;
pids = 11;
}
required string id = 1;
//for example: "twitter" or "short text"
optional string name = 2;
//for example: "text/plain" or "text/html"
optional string content_type = 3;
// maximum number of character for this channel, mostly for information
// since diffusion system don't need to bother with that
// If missing, there is no limit!
optional uint32 max_size = 4;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 created_at = 5;
// in POSIX time (number of seconds since January 1st 1970 00:00:00 UTC)
optional uint64 updated_at = 6;
//Channel types
repeated Type types = 7;
}
// Property attached to a disruption
message DisruptionProperty {
// identification key of the property
required string key = 1;
// type of the property, example: "datasource"
required string type = 2;
// value of the property
required string value = 3;
}
// Meta use for Message
message Meta {
// identification key of the meta
required string key = 1;
// value of the meta
required string value = 2;
}
extend transit_realtime.FeedEntity{
optional Disruption disruption = 1000;
}