-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevent.proto
1199 lines (992 loc) · 42.7 KB
/
event.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
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
syntax = "proto3";
package hiber.event;
import "google/protobuf/struct.proto";
import "assignment.proto";
import "asset.proto";
import "base.proto";
import "export.proto";
import "file.proto";
import "health.proto";
import "integration_mqtt.proto";
import "modem.proto";
import "modem_alarm.proto";
import "modem_message_body_parser.proto";
import "organization.proto";
import "publisher.proto";
import "tag.proto";
import "token.proto";
import "transfer.proto";
import "webhook.proto";
option java_multiple_files = false;
option java_package = "global.hiber.api.grpc.event";
option java_outer_classname = "EventApi";
option go_package = ".;hiber";
/* Events are used in a number of ways in the api. With this service you can
* search, list and stream them for your own purposes.
*
* Events are filtered by permission, i.e. if you cannot access the users, you would not see user-related events.
* Requesting user-related events explicitly if you cannot access the users will return an error.
*/
service EventService {
rpc List (ListEventsRequest) returns (ListEventsRequest.Response);
rpc Stream (EventStreamRequest) returns (stream Event);
rpc History (EventHistory.Request) returns (EventHistory.Response);
rpc ModemHealth (ModemHealthEvents.Request) returns (ModemHealthEvents.Response);
rpc Resolve (ResolveEvent.Request) returns (ResolveEvent.Response);
rpc MarkResolved (MarkEventsResolved.Request) returns (MarkEventsResolved.Response);
rpc GetEventConfiguration (EventConfiguration.Request) returns (EventConfiguration);
rpc UpdateEventConfiguration (EventConfiguration) returns (EventConfiguration);
rpc UpdateEventHealthConfiguration (UpdateEventHealthConfiguration.Request) returns (UpdateEventHealthConfiguration.Response);
}
/* Generic Event object, used in streams where events are mixed. Protobuf provides helper methods to extract
* the contained object.
*/
message Event {
/* The device data for this event, if it is related to a single device. */
message Device {
string number = 1;
string name = 2;
string identifier = 3;
}
/* Time of the event. */
EventType type = 98;
/* Time of the event. */
Timestamp time = 99;
/* Whether this event causes the 'Error' health level.
* If your organization does not use the default health levels, this field will be omitted.
* Use health_level instead.
*/
bool is_error = 1 [deprecated = true];
/* Whether this event causes the 'Warning' health level.
* If your organization does not use the default health levels, this field will be omitted.
* Use health_level instead.
*/
bool is_warning = 100 [deprecated = true];
/* The health level caused by this event.
* This health generally applies to either a device, a token or a publisher,
* and is also applied to the organization health.
* Not every event affects health, so this field might be empty.
*/
health.HealthLevel health_level = 101;
oneof resolved_status {
/* Whether this event was resolved. */
bool resolved = 106;
/* The identifier to use when resolving this event.
* Only present when not resolved, and only available for some event types.
*/
string resolve_identifier = 107;
}
/* Short text describing the event. */
string title = 102;
/* Longer text describing the event in more detail. */
string description = 103;
/* The device data for this event, if it is related to a single device. */
Device device = 104;
/* The tags for this event, if any. */
repeated tag.Tag tags = 105;
oneof event {
AssetEvent.AssetCreatedEvent asset_created = 70;
AssetEvent.AssetUpdatedEvent asset_updated = 71;
AssetEvent.AssetDeletedEvent asset_deleted = 72;
DeviceEvent.DeviceCreatedEvent device_created = 55;
DeviceEvent.DeviceUpdatedEvent device_updated = 39;
DeviceEvent.DeviceLocationUpdatedEvent device_location_updated = 2;
DeviceEvent.DeviceInstalledEvent device_installed = 36;
MessageEvent.MessageReceivedEvent message_received = 4;
MessageEvent.MessageBodyReceivedEvent message_body_received = 44;
MessageEvent.MessageBodyParsedEvent message_body_parsed = 45;
MessageEvent.MessageCannotBeParsedEvent message_cannot_be_parsed = 7;
MessageBodyParserEvent.CreatedEvent message_body_parser_created = 46;
MessageBodyParserEvent.UpdatedEvent message_body_parser_updated = 47;
MessageBodyParserEvent.DeletedEvent message_body_parser_deleted = 48;
AlarmEvent.AlarmTriggeredEvent alarm_triggered = 56;
AlarmEvent.CreatedEvent alarm_created = 57;
AlarmEvent.UpdatedEvent alarm_updated = 58;
AlarmEvent.DeletedEvent alarm_deleted = 59;
AssignmentEvent.AssignedEvent assigned = 68;
AssignmentEvent.UnassignedEvent unassigned = 69;
UserEvent.UserAddedEvent user_added = 8;
UserEvent.UserRemovedEvent user_removed = 9;
UserEvent.UserInvitedEvent user_invited = 41;
UserEvent.UserAccessRequestEvent user_access_request = 10;
UserEvent.UserValidationUpdatedEvent user_validation_updated = 54;
TransferEvent transfer = 17;
TokenEvent.TokenExpiryWarningEvent token_expiry_warning = 23;
TokenEvent.TokenExpiredEvent token_expired = 24;
TokenEvent.TokenCreatedEvent token_created = 30;
TokenEvent.TokenDeletedEvent token_deleted = 35;
OrganizationEvent.OrganizationCreatedEvent organization_created = 37;
OrganizationEvent.OrganizationUpdatedEvent organization_updated = 25;
OrganizationEvent.OrganizationDeletedEvent organization_deleted = 38;
OrganizationEvent.MessageSummaryEvent message_summary = 42;
OrganizationEvent.EventConfigurationUpdated organization_event_configuration_updated = 43;
PublisherEvent.CreatedEvent publisher_created = 31;
PublisherEvent.UpdatedEvent publisher_updated = 32;
PublisherEvent.DeletedEvent publisher_deleted = 33;
PublisherEvent.AutoDisabledEvent publisher_auto_disabled = 40;
PublisherEvent.FailedEvent publisher_failed = 34;
ExportEvent.ExportCreatedEvent export_created = 65;
ExportEvent.ExportReadyEvent export_ready = 66;
ExportEvent.ExportFailedEvent export_failed = 67;
}
reserved 3, 6, 11 to 16, 18 to 22, 26 to 29, 49 to 53, 60 to 64;
message AssetEvent {
message AssetCreatedEvent {
string organization = 1;
string asset_identifier = 2;
asset.Asset asset = 3;
Timestamp time = 4;
repeated tag.Tag tags = 5;
string title = 6;
string description = 7;
}
message AssetUpdatedEvent {
message Update {
optional string name = 1;
optional string description = 2;
optional string notes = 3;
optional string time_zone = 4;
optional uint32 expected_transmission_rate = 5;
optional asset.Asset.Type type = 6;
optional google.protobuf.Struct metadata = 7;
optional Location location = 8;
repeated file.File files = 9;
}
string organization = 1;
Update updated = 2;
string asset_identifier = 3;
Timestamp time = 4;
repeated tag.Tag tags = 5;
string title = 6;
string description = 7;
}
message AssetDeletedEvent {
string organization = 1;
string deleted = 2;
Timestamp time = 3;
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
}
}
message DeviceEvent {
message DeviceCreatedEvent {
string organization = 1;
string number = 2;
/* External device id for this device (e.g. a MAC address). */
string external_device_id = 20;
Timestamp time = 4;
repeated tag.Tag tags = 5;
string title = 6;
string description = 7;
}
message DeviceUpdatedEvent {
string organization = 1;
string number = 2;
/* External device id for this device (e.g. a MAC address). */
string external_device_id = 20;
UpdateClearableString display_name = 10 [deprecated = true];
optional string updated_display_name = 22;
map<string, string> peripherals = 15;
UpdateClearableString notes = 16 [deprecated = true];
optional string updated_notes = 23;
optional string device_type = 21;
bool secure_notes_updated = 17;
reserved 18;
Duration health_warning_period = 19;
Timestamp time = 4;
repeated tag.Tag tags = 5;
string title = 6;
string description = 7;
reserved 11, 12, 13, 14;
}
/* When a message comes in, the device's location is updated automatically. This event is generated whenever the
* device's location is updated
*/
message DeviceLocationUpdatedEvent {
string organization = 1;
string number = 2;
/* External device id for this device (e.g. a MAC address). */
string external_device_id = 8;
/* The updated location for this device. */
Location location = 3;
/* The device time of the first message with the new location. */
Timestamp updated_at = 9;
/* The time this event was generated on the server, after the message was received. */
Timestamp time = 4;
repeated tag.Tag tags = 5;
string title = 6;
string description = 7;
}
/* When the device is marked as installed. */
message DeviceInstalledEvent {
string organization = 1;
string number = 2;
/* External device id for this device (e.g. a MAC address). */
string external_device_id = 11;
/* The time this device was installed. */
Timestamp time = 4;
repeated tag.Tag tags = 7;
string title = 8;
string description = 9;
}
}
message MessageEvent {
/* This event is generated whenever a message comes in, after is has been decrypted
* and parsed (if any body parsers are configured for the device).
*
* It contains the relevant data in the message object, including location and the
* user-defined body.
*
* If any body parser(s) are configured for the device, the device message object also contains
* a ParsedBody for each of them.
*/
message MessageReceivedEvent {
string organization = 1;
string modem_number = 2 [deprecated = true];
string device_number = 9;
/* External device id for this device (e.g. a MAC address). */
string device_external_device_id = 8;
/* The received message, including parsed body. */
modem.ModemMessage message = 3;
/* The device's tags. */
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
Timestamp time = 7;
}
/* This lightweight event is generated whenever a message comes in, after is has been decrypted. */
message MessageBodyReceivedEvent {
string organization = 1;
string device_number = 2;
/* External device id for this device (e.g. a MAC address). */
string device_external_device_id = 3;
/* Id of the message that was parsed. */
uint64 message_id = 4;
/* Time the message was sent from the device. */
Timestamp sent_at = 5;
/* Message body convenience object. */
BytesOrHex body = 6;
/* The device's tags. */
repeated tag.Tag tags = 7;
string title = 8;
string description = 9;
Timestamp time = 10;
}
/* This event is generated whenever a message is parsed successfully by an assigned body parser.
* If multiple body parsers are assigned to a device, multiple DeviceMessageBodyParsedEvent events will
* be produced by an incoming message.
* For the total result of all assigned parsers, see the DeviceMessageReceivedEvent, which is produced
* after all body parsers have been applied.
*/
message MessageBodyParsedEvent {
string organization = 1;
string device_number = 2;
/* External device id for this device (e.g. a MAC address). */
string device_external_device_id = 3;
/* Id of the message that was parsed. */
uint64 message_id = 4;
/* Time the message was sent from the device. */
Timestamp sent_at = 5;
/* The identifier of the parser that parsed the body. */
string parser_identifier = 6;
/* The name of the parser that parsed the body. */
string parser_name = 7;
/* The resulting json from parsing the message body. */
google.protobuf.Struct parsed_message = 8;
/* The device's tags. */
repeated tag.Tag tags = 9;
string title = 10;
string description = 11;
Timestamp time = 12;
}
/* Triggered when a message cannot be parsed. This can have multiple reasons, for example, an invalid
* message version.
*/
message MessageCannotBeParsedEvent {
string organization = 1;
string device_number = 2;
/* External device id for this device (e.g. a MAC address). */
string device_external_device_id = 9;
/* The message that cannot be parsed.
* This message may or may not be available in the system, depending one the reason it could not
* be parsed.
*/
uint64 message_id = 3;
/* The moment this event was triggered. */
Timestamp time = 4;
/* The reason this message could not be parsed.
* This could be, for example:
* - invalid message envelope, but with enough information to determine the device
* - all body parsers failed to parse the body of the message
*/
string reason = 5;
repeated tag.Tag tags = 6;
string title = 7;
string description = 8;
/* The health level caused for the device (and organization) by this event. */
health.HealthLevel health_level = 10;
oneof resolved_status {
/* Whether this event was resolved. */
bool resolved = 11;
/* The identifier to use when resolving this event. Only present when not resolved */
string resolve_identifier = 12;
}
}
}
/* Events related to MessageBodyParsers. */
message MessageBodyParserEvent {
message CreatedEvent {
string organization = 1;
modem.message.bodyparser.ModemMessageBodyParser created = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message UpdatedEvent {
string organization = 1;
UpdateClearableString updated_name = 2 [deprecated = true];
optional string name = 9;
UpdateClearableString updated_content_ksy = 3 [deprecated = true];
optional string content_ksy = 10;
modem.message.bodyparser.SimpleModemMessageBodyParser updated_simple_parser = 4;
Filter.ChildOrganizations.Update updated_available_to_child_organizations = 5 [deprecated = true];
optional Filter.ChildOrganizations available_to_child_organizations = 11;
string title = 6;
string description = 7;
Timestamp time = 8;
}
message DeletedEvent {
string organization = 1;
string deleted = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
}
message AlarmEvent {
message AlarmTriggeredEvent {
string organization = 1;
string device_number = 2;
string device_external_device_id = 3;
/* The id of the device that triggered the alarm, if any. */
uint64 message_id = 4;
/* The identifier of the alarm. */
string alarm_identifier = 5;
/* The description of the alarm. */
string alarm_description = 6;
/* The filled in error message(s) for the failing checks in the alarm. */
map<string, string> error_messages = 7;
/* The highest health level caused by the failing checks in this alarm,
* for the device (and organization).
*/
health.HealthLevel health_level = 12;
repeated hiber.tag.Tag tags = 8;
string title = 9;
string description = 10;
Timestamp time = 11;
/* When this alarm event was resolved. */
oneof resolved_status {
/* Whether this event was resolved. */
Timestamp resolved_at = 13;
/* The identifier to use when resolving this event. Only present when not resolved */
string resolve_identifier = 16;
}
/* Optional health that this alarm event causes after it has been resolved. */
health.HealthLevel health_level_after_resolved = 14;
/* How long the optional health that this alarm event causes after it has been resolved lasts. */
Timestamp health_level_after_resolved_until = 15;
}
message CreatedEvent {
string organization = 1;
modem.alarm.ModemAlarm created = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message UpdatedEvent {
message Update {
UpdateClearableString deprecated_description = 1 [deprecated = true];
optional string description = 7;
string trigger_condition = 2;
google.protobuf.Struct checks = 4;
UpdateClearableString update_default_health_level = 5 [deprecated = true];
optional string updated_default_health_level = 8;
modem.alarm.ModemAlarm.HealthLevelAfterResolved update_health_level_after_resolved = 6;
reserved 3;
}
string organization = 1;
Update updated = 2;
string alarm_identifier = 3;
string title = 4;
string description = 5;
Timestamp time = 6;
}
message DeletedEvent {
string organization = 1;
string deleted = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
}
message TransferEvent {
string organization = 2;
Timestamp time = 3;
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
transfer.Transfer transfer = 7;
}
message AssignmentEvent {
message AssignedEvent {
string organization = 1;
assign.Assignment created = 2;
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
Timestamp time = 7;
}
message UnassignedEvent {
string organization = 1;
assign.Assignment removed = 2;
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
Timestamp time = 7;
}
}
message UserEvent {
message UserAddedEvent {
string organization = 1;
string user = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message UserRemovedEvent {
string organization = 1;
string user = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message UserInvitedEvent {
string organization = 1;
string email = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message UserAccessRequestEvent {
string organization = 1;
string user = 2;
Timestamp time = 3;
string title = 4;
string description = 5;
}
message UserValidationUpdatedEvent {
string organization = 1;
string email_validation_regex = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
}
message PublisherEvent {
message CreatedEvent {
string organization = 1;
publisher.Publisher created = 2;
repeated tag.Tag tags = 3;
string title = 4;
string description = 5;
Timestamp time = 6;
}
message UpdatedEvent {
message WebhookUpdate {
optional string url = 1;
UpdateClearableString deprecated_secret = 2 [deprecated = true];
optional string secret = 4;
optional webhook.Webhook.ContentType content_type = 3;
UpdateOptionalId deprecated_certificate_id = 9 [deprecated = true];
optional int64 certificate_id = 5;
}
message MQTTUpdate {
string url = 1;
integration.mqtt.MQTTPublisher.ContentType content_type = 2;
string topic = 3;
integration.mqtt.MQTTPublisher.Data.QoS qos = 4;
UpdateClearableString deprecated_identifier = 5 [deprecated = true];
optional string identifier = 9;
UpdateClearableString deprecated_username = 6 [deprecated = true];
optional string username = 10;
UpdateClearableString deprecated_password = 7 [deprecated = true];
optional string password = 11;
UpdateOptionalId deprecated_certificate_id = 8 [deprecated = true];
optional int64 certificate_id = 12;
}
message EmailUpdate {
}
message SlackUpdate {
}
message ShellSsipUpdate {
}
string organization = 1;
UpdateClearableString deprecated_updated_description = 2 [deprecated = true];
optional string updated_description = 24;
/* Deprecated in favor of the new updated_data field */
publisher.Publisher.Data partial_update_data = 3 [deprecated = true];
oneof updated_data {
WebhookUpdate webhook = 15;
MQTTUpdate mqtt = 16;
EmailUpdate email = 18;
SlackUpdate slack = 22;
ShellSsipUpdate shell_ssip = 23;
}
Filter.Events.Update deprecated_updated_event_filter = 4 [deprecated = true];
optional Filter.Events updated_event_filter = 25;
Filter.Modems.Update deprecated_updated_modem_filter = 5 [deprecated = true];
optional Filter.Modems updated_modem_filter = 26;
Filter.Tags.Update deprecated_updated_tag_filter = 6 [deprecated = true];
optional Filter.Tags updated_tag_filter = 27;
UpdateBoolean deprecated_updated_active_state = 7 [deprecated = true];
optional bool updated_active_state = 28;
reserved 20;
Duration health_warning_period = 21;
repeated tag.Tag tags = 8;
string title = 9;
string description = 10;
Timestamp time = 11;
reserved 17;
}
message DeletedEvent {
string organization = 1;
publisher.Publisher deleted = 2;
repeated tag.Tag tags = 3;
string title = 4;
string description = 5;
Timestamp time = 6;
}
message AutoDisabledEvent {
string organization = 1;
int64 id = 2;
repeated tag.Tag tags = 3;
string title = 4;
string description = 5;
Timestamp time = 6;
/* The health level caused for the publisher (and organization) by this event. */
health.HealthLevel health_level = 7;
}
message FailedEvent {
string organization = 1;
string reason = 2;
publisher.Publisher failed = 3;
repeated tag.Tag tags = 4;
string title = 5;
string description = 6;
Timestamp time = 7;
/* The health level caused for the publisher (and organization) by this event. */
health.HealthLevel health_level = 8;
}
}
message TokenEvent {
message TokenCreatedEvent {
string organization = 1;
token.Token token = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message TokenExpiryWarningEvent {
string organization = 1;
token.Token token = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
/* The health level caused for the organization by this event. */
health.HealthLevel health_level = 6;
}
message TokenExpiredEvent {
string organization = 1;
token.Token token = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message TokenDeletedEvent {
string organization = 1;
token.Token token = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
}
message OrganizationEvent {
message OrganizationCreatedEvent {
string parent_organization = 1;
organization.Organization created = 2;
string title = 9;
string description = 10;
Timestamp time = 11;
}
message OrganizationUpdatedEvent {
string organization = 1;
optional string display_name_updated = 2;
optional string vat_number_updated = 3;
optional organization.Organization.Address address_updated = 4;
UpdateBoolean is_business_updated = 5 [deprecated = true];
optional bool business_updated = 14;
optional string billing_name_updated = 6;
optional organization.Organization.Address billing_address_updated = 7;
optional organization.Organization.Contact contact_updated = 8;
string title = 9;
string description = 10;
Timestamp time = 11;
repeated organization.Organization.Feature features_added = 12;
repeated organization.Organization.Feature features_removed = 13;
}
message OrganizationDeletedEvent {
string parent_organization = 1;
string deleted_organization = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message EventConfigurationUpdated {
message MessageSummaryUpdate {
UpdateBoolean enabled = 1 [deprecated = true];
optional bool state = 4;
optional Duration period = 2;
optional Timestamp align_to_time = 3;
}
string organization = 1;
MessageSummaryUpdate message_summary_update = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
/* Message summary event that is sent when it has been configured for the organization.
* The period is configurable, using the EventConfiguration.
* This event is disabled by default.
*/
message MessageSummaryEvent {
message MessageCount {
string device = 1;
modem.ModemMessage.Source source = 2;
int32 amount = 3;
}
string organization = 1;
repeated MessageCount message_count = 2;
string title = 5;
string description = 6;
Timestamp time = 7;
TimeRange time_range = 8;
}
}
message ExportEvent {
message ExportCreatedEvent {
string organization = 1;
export.Export export = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message ExportReadyEvent {
string organization = 1;
export.Export export = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
message ExportFailedEvent {
string organization = 1;
export.Export export = 2;
string title = 3;
string description = 4;
Timestamp time = 5;
}
}
}
/* A bundle/set of events, all of the same event-type. */
message BundledEvent {
EventType type = 1;
string title = 3;
string description = 4;
/* Indicates that the amount is an exact count, and not an approximated value. */
message ExactAmount {
int32 amount = 1;
Timestamp last_event = 2;
}
/* Indicates that the amount is an approximation, and not an exact value.
* Some events will be approximated to avoid a large number of events affecting the request time.
* Because of the nature of approximation, we don't have a "last" event, so no timestamp is available.
*/
message ApproximatedAmount {
int32 amount = 1;
}
oneof amount {
ExactAmount exact_amount = 7;
ApproximatedAmount approximated_amount = 8;
}
/* Deprecated in favour of using the amount field that is either an ExactAmount or ApproximatedAmount */
int32 deprecated_amount = 2 [deprecated = true];
/* Deprecated in favour of using the amount field that is either an ExactAmount or ApproximatedAmount.
* since `last_event` is not available when using approximation (we don't know the actual last event),
* this field is only present when getting an ExactAmount.
*/
Timestamp deprecated_last_event = 5 [deprecated = true];
/* Indicates that the amount is an approximation, and not an exact value.
* Some events will be approximated to avoid a large number of events affecting the request time.
* Deprecated in favour of using the oneof_amount field that is either an ExactAmount or ApproximatedAmount
*/
bool deprecated_approximated_amount = 6 [deprecated = true];
}
/* Selection object for Event list and stream. Filter events on device, webhook, time and error state, and
* paginate the list.
* Events are returned bundled by default. this means that, instead of the details, you get a list of bundles,
* one per event type, with the count.
*/
message EventSelection {
optional Filter.Events events = 1;
optional Filter.Modems modems = 2;
optional Filter.Publishers publishers = 3;
optional Filter.Tags tags = 4;
optional TimeRange time_range = 6;
/* Filter events by actual configured health level. */
repeated string health_levels = 11;
/* By default, events that have been resolved are not listed. */
optional bool include_resolved_events = 9;
/* When not set, no unbundled events are returned.
* When set, returns unbundled events per type, paginated per type.
* Deprecated: use unbundled_events on ListEventsRequest
*/
optional bool unbundled_events = 8 [deprecated = true];
/* Return only events that cause the default Error health.
* Deprecated: use health_levels with custom health levels instead.
*/
optional bool errors_only = 7 [deprecated = true];
/* Return only events that cause the default Warning health.
* Deprecated: use health_levels with custom health levels instead.
*/
optional bool warnings_only = 10 [deprecated = true];
}
/* Lists all events matching the given criteria.
* The frequency of event can vary greatly per type, resulting in unclear pagination and some event types overshadowing
* others. For this reason, event are bundled by default, reducing them to a count per event type.
* If unbundled events for certain types are required, this can be toggled in the selection object.
* Pagination is only applied to unbundled events, and is applied per event type. This may result in a non-linear
* timeline from page to page when selecting two types with a large difference in frequency, but makes sure you
* see the most recent events of each type on the first page.
*/
message ListEventsRequest {
message Response {
message EventTypeResponse {
EventType type = 1;
repeated Event unbundled_events = 2;
Pagination.Result pagination = 3;
}
ListEventsRequest request = 2;
repeated BundledEvent events = 4;
repeated EventTypeResponse unbundled_events = 5;
reserved 1, 3;
}
enum Sort {
TIME_DESCENDING = 0;
TIME_ASCENDING = 1;
DEVICE_NUMBER_ASC = 2;
DEVICE_NUMBER_DESC = 3;
DEVICE_NUMBER_SPECIFIED = 4;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
/* Select the events to list. Optional, when omitted or empty everything is included. */
optional EventSelection selection = 2;
/* Pagination is applied per event type on unbundled events. It is not necessary for bundled events. */
optional Pagination pagination = 3;
optional Sort sort = 4;
/* When not set, bundled/grouped events are returned.
* When set, returns unbundled events per type, paginated per type.
* Overrides unbundled_events in EventSelection message.
*/
optional bool unbundled_events = 5;
}
/* Get the history of events that match the given filter, chronologically (by default, from now backwards in time).
*
* Only returns the Event with first-level fields set, event details are not included in the response
* (the oneof is not set).
*/
message EventHistory {
/* Selection for which events to include the response.