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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamIn {
    #[prost(oneof = "stream_in::Message", tags = "1, 2, 3")]
    pub message: ::core::option::Option<stream_in::Message>,
}
/// Nested message and enum types in `StreamIn`.
pub mod stream_in {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        /// Consumer side establishes a replication stream from the producer service
        /// by sending the `InitReq` with the offset and `FilterCriteria` to start from.
        #[prost(message, tag = "1")]
        Init(super::InitReq),
        /// Consumer defined event filters can be changed in runtime by sending `FilterReq`.
        #[prost(message, tag = "2")]
        Filter(super::FilterReq),
        /// If the consumer detects a missing sequence number it can request a replay of
        /// events for a specific entity.
        #[prost(message, tag = "3")]
        Replay(super::ReplayReq),
    }
}
/// The first message must always be this InitReq to setup the stream.
/// It can only be used as the first message.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitReq {
    /// the logical stream identifier, mapped to a specific internal entity type by
    /// the producer settings
    #[prost(string, tag = "1")]
    pub stream_id: ::prost::alloc::string::String,
    /// entities are partitioned by a deterministic slice (0-1023),
    /// a consumer would handle a slice range from slice_min to slice_max
    #[prost(int32, tag = "2")]
    pub slice_min: i32,
    #[prost(int32, tag = "3")]
    pub slice_max: i32,
    /// start from this offset
    #[prost(message, optional, tag = "4")]
    pub offset: ::core::option::Option<Offset>,
    /// consumer defined event filters
    #[prost(message, repeated, tag = "5")]
    pub filter: ::prost::alloc::vec::Vec<FilterCriteria>,
    #[prost(message, optional, tag = "6")]
    pub replica_info: ::core::option::Option<ReplicaInfo>,
}
/// Add filter criteria to exclude and include events for matching entities.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterReq {
    #[prost(message, repeated, tag = "1")]
    pub criteria: ::prost::alloc::vec::Vec<FilterCriteria>,
}
/// Replay events for given entities.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplayReq {
    #[prost(message, repeated, tag = "1")]
    pub persistence_id_offset: ::prost::alloc::vec::Vec<PersistenceIdSeqNr>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterCriteria {
    /// Exclude criteria are evaluated first.
    /// If no matching exclude criteria the event is emitted.
    /// If an exclude criteria is matching the include criteria are evaluated.
    ///    If no matching include criteria the event is discarded.
    ///    If matching include criteria the event is emitted.
    #[prost(
        oneof = "filter_criteria::Message",
        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14"
    )]
    pub message: ::core::option::Option<filter_criteria::Message>,
}
/// Nested message and enum types in `FilterCriteria`.
pub mod filter_criteria {
    /// Exclude criteria are evaluated first.
    /// If no matching exclude criteria the event is emitted.
    /// If an exclude criteria is matching the include criteria are evaluated.
    ///    If no matching include criteria the event is discarded.
    ///    If matching include criteria the event is emitted.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(message, tag = "1")]
        ExcludeTags(super::ExcludeTags),
        #[prost(message, tag = "2")]
        RemoveExcludeTags(super::RemoveExcludeTags),
        #[prost(message, tag = "3")]
        IncludeTags(super::IncludeTags),
        #[prost(message, tag = "4")]
        RemoveIncludeTags(super::RemoveIncludeTags),
        #[prost(message, tag = "5")]
        ExcludeMatchingEntityIds(super::ExcludeRegexEntityIds),
        #[prost(message, tag = "6")]
        RemoveExcludeMatchingEntityIds(super::RemoveExcludeRegexEntityIds),
        #[prost(message, tag = "7")]
        IncludeMatchingEntityIds(super::IncludeRegexEntityIds),
        #[prost(message, tag = "8")]
        RemoveIncludeMatchingEntityIds(super::RemoveIncludeRegexEntityIds),
        #[prost(message, tag = "9")]
        ExcludeEntityIds(super::ExcludeEntityIds),
        #[prost(message, tag = "10")]
        RemoveExcludeEntityIds(super::RemoveExcludeEntityIds),
        #[prost(message, tag = "11")]
        IncludeEntityIds(super::IncludeEntityIds),
        #[prost(message, tag = "12")]
        RemoveIncludeEntityIds(super::RemoveIncludeEntityIds),
        #[prost(message, tag = "13")]
        IncludeTopics(super::IncludeTopics),
        #[prost(message, tag = "14")]
        RemoveIncludeTopics(super::RemoveIncludeTopics),
    }
}
/// Exclude events with any of the given tags, unless there is a
/// matching include filter that overrides the exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExcludeTags {
    #[prost(string, repeated, tag = "1")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `ExcludeTags`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveExcludeTags {
    #[prost(string, repeated, tag = "1")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Include events with any of the given tags. A matching include overrides
/// a matching exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IncludeTags {
    #[prost(string, repeated, tag = "1")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `IncludeTags`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveIncludeTags {
    #[prost(string, repeated, tag = "1")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Include events for entities with the given entity ids. A matching include overrides
/// a matching exclude.
///
/// For the given entity ids a `seq_nr` can be defined to replay all events for the entity
/// from the sequence number (inclusive). If `seq_nr` is 0 events will not be replayed.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IncludeEntityIds {
    #[prost(message, repeated, tag = "1")]
    pub entity_id_offset: ::prost::alloc::vec::Vec<EntityIdOffset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityIdOffset {
    #[prost(string, tag = "1")]
    pub entity_id: ::prost::alloc::string::String,
    /// If this is defined (> 0) events are replayed from the given
    /// sequence number (inclusive).
    #[prost(int64, tag = "2")]
    pub seq_nr: i64,
}
/// Remove a previously added `IncludeEntityIds`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveIncludeEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub entity_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Exclude events for entities with the given entity ids,
/// unless there is a matching include filter that overrides the exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExcludeEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub entity_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `ExcludeEntityIds`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveExcludeEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub entity_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Exclude events for entities with entity ids matching the given regular expressions,
/// unless there is a matching include filter that overrides the exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExcludeRegexEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub matching: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `ExcludeRegexEntityIds`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveExcludeRegexEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub matching: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Include events for entities with entity ids matching the given regular expressions.
/// A matching include overrides a matching exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IncludeRegexEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub matching: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `IncludeRegexEntityIds`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveIncludeRegexEntityIds {
    #[prost(string, repeated, tag = "1")]
    pub matching: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Include events with any of the given matching topics. A matching include overrides
/// a matching exclude.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IncludeTopics {
    /// topic match expression according to MQTT specification, including wildcards
    #[prost(string, repeated, tag = "1")]
    pub expression: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Remove a previously added `IncludeTopics`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveIncludeTopics {
    #[prost(string, repeated, tag = "1")]
    pub expression: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Offset {
    #[prost(message, optional, tag = "1")]
    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
    /// Events with these sequence numbers for this timestamp have already been
    /// processed and doesn't have to be emitted again.
    /// If empty it is assumed to be the persistence_id -> seq_nr of enclosing Event
    /// or FilteredEvent.
    #[prost(message, repeated, tag = "2")]
    pub seen: ::prost::alloc::vec::Vec<PersistenceIdSeqNr>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersistenceIdSeqNr {
    #[prost(string, tag = "1")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub seq_nr: i64,
}
/// Used for Replicated Event Sourcing to filter events based on origin.
/// For edge topologies, like star topologies, an edge replica is not connected
/// to all other replicas, but should be able to receive events indirectly via
/// the replica that it is consuming from.
///
/// Events originating from other replicas that the consumer is connected to are excluded
/// and emitted as FilteredEvent from the producer side, because the consumer will receive
/// them directly from the other replica.
/// Events originating from the consumer replica itself are excluded (break the cycle).
/// Events originating from the producer replica are always included.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplicaInfo {
    /// The replica id of the consumer
    #[prost(string, tag = "1")]
    pub replica_id: ::prost::alloc::string::String,
    /// Other replicas that the consumer is connected to.
    #[prost(string, repeated, tag = "2")]
    pub other_replica_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamOut {
    #[prost(oneof = "stream_out::Message", tags = "1, 2")]
    pub message: ::core::option::Option<stream_out::Message>,
}
/// Nested message and enum types in `StreamOut`.
pub mod stream_out {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(message, tag = "1")]
        Event(super::Event),
        #[prost(message, tag = "2")]
        FilteredEvent(super::FilteredEvent),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
    #[prost(string, tag = "1")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub seq_nr: i64,
    #[prost(int32, tag = "3")]
    pub slice: i32,
    #[prost(message, optional, tag = "4")]
    pub offset: ::core::option::Option<Offset>,
    /// The event payload may be serialized as Protobuf message when the type_url
    /// prefix is `type.googleapis.com/` or with Akka serialization when the type_url
    /// prefix `ser.akka.io/`. For Akka serialization, the serializer id and manifest
    /// are encoded into a custom type_url schema.
    /// Note that the payload is empty for backtracking events, see `source`.
    #[prost(message, optional, tag = "5")]
    pub payload: ::core::option::Option<::prost_types::Any>,
    /// "" for ordinary events.
    /// "BT" for backtracking events.
    /// "PS" for PubSub events.
    #[prost(string, tag = "6")]
    pub source: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "7")]
    pub metadata: ::core::option::Option<::prost_types::Any>,
    #[prost(string, repeated, tag = "8")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Events that are filtered out are represented by this
/// placeholder to be able to track sequence numbers without holes.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilteredEvent {
    #[prost(string, tag = "1")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub seq_nr: i64,
    #[prost(int32, tag = "3")]
    pub slice: i32,
    #[prost(message, optional, tag = "4")]
    pub offset: ::core::option::Option<Offset>,
    #[prost(string, tag = "5")]
    pub source: ::prost::alloc::string::String,
}
/// Retrieve the timestamp of a specific event.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventTimestampRequest {
    #[prost(string, tag = "1")]
    pub stream_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "3")]
    pub seq_nr: i64,
}
/// Response to `EventTimestampRequest`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventTimestampResponse {
    #[prost(message, optional, tag = "1")]
    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
}
/// Lazy loading of a specific event. Used when payload for a backtracking event
/// is needed.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoadEventRequest {
    /// the logical stream identifier, mapped to a specific internal entity type by
    /// the producer settings
    #[prost(string, tag = "1")]
    pub stream_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "3")]
    pub seq_nr: i64,
    #[prost(message, optional, tag = "4")]
    pub replica_info: ::core::option::Option<ReplicaInfo>,
}
/// Response to `LoadEventRequest`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoadEventResponse {
    #[prost(oneof = "load_event_response::Message", tags = "1, 2")]
    pub message: ::core::option::Option<load_event_response::Message>,
}
/// Nested message and enum types in `LoadEventResponse`.
pub mod load_event_response {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(message, tag = "1")]
        Event(super::Event),
        #[prost(message, tag = "2")]
        FilteredEvent(super::FilteredEvent),
    }
}
/// Generated client implementations.
pub mod event_producer_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// EventProducerService runs on the producer side and implements the
    /// producer side of the EventsBySlices query, which can be used with
    /// Akka Projection over gRPC.
    ///
    /// 1. Events are stored in the event journal on the producer side.
    /// 2. Consumer side starts an Akka Projection which locally reads its offset
    ///    from the Projection offset store.
    /// 3. Consumer side establishes a replication stream from the producer service
    ///    by sending the `InitReq` with the offset to start from.
    /// 4. Events are read from the journal on the producer side and emitted to the
    ///    replication stream.
    /// 5. Consumer side processes the events in a Projection handler.
    /// 6. Offset is stored on the consumer side by the Projection offset store.
    /// 7. Producer continues to read new events from the journal and emit to the stream.
    ///
    /// The consumer can define event filters with the `FilterCriteria`, which can be included
    /// in the `InitReq` and also changed in runtime by sending `FilterReq`.
    #[derive(Debug, Clone)]
    pub struct EventProducerServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl EventProducerServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> EventProducerServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> EventProducerServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            EventProducerServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn events_by_slices(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::StreamIn>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::StreamOut>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/akka.projection.grpc.EventProducerService/EventsBySlices",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "akka.projection.grpc.EventProducerService",
                        "EventsBySlices",
                    ),
                );
            self.inner.streaming(req, path, codec).await
        }
        /// Used in some edge cases by the offset store to retrieve the timestamp for
        /// a certain event.
        pub async fn event_timestamp(
            &mut self,
            request: impl tonic::IntoRequest<super::EventTimestampRequest>,
        ) -> std::result::Result<
            tonic::Response<super::EventTimestampResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/akka.projection.grpc.EventProducerService/EventTimestamp",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "akka.projection.grpc.EventProducerService",
                        "EventTimestamp",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lazy loading of a specific event.
        pub async fn load_event(
            &mut self,
            request: impl tonic::IntoRequest<super::LoadEventRequest>,
        ) -> std::result::Result<
            tonic::Response<super::LoadEventResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/akka.projection.grpc.EventProducerService/LoadEvent",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "akka.projection.grpc.EventProducerService",
                        "LoadEvent",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod event_producer_service_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with EventProducerServiceServer.
    #[async_trait]
    pub trait EventProducerService: Send + Sync + 'static {
        /// Server streaming response type for the EventsBySlices method.
        type EventsBySlicesStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::StreamOut, tonic::Status>,
            >
            + Send
            + 'static;
        async fn events_by_slices(
            &self,
            request: tonic::Request<tonic::Streaming<super::StreamIn>>,
        ) -> std::result::Result<
            tonic::Response<Self::EventsBySlicesStream>,
            tonic::Status,
        >;
        /// Used in some edge cases by the offset store to retrieve the timestamp for
        /// a certain event.
        async fn event_timestamp(
            &self,
            request: tonic::Request<super::EventTimestampRequest>,
        ) -> std::result::Result<
            tonic::Response<super::EventTimestampResponse>,
            tonic::Status,
        >;
        /// Lazy loading of a specific event.
        async fn load_event(
            &self,
            request: tonic::Request<super::LoadEventRequest>,
        ) -> std::result::Result<
            tonic::Response<super::LoadEventResponse>,
            tonic::Status,
        >;
    }
    /// EventProducerService runs on the producer side and implements the
    /// producer side of the EventsBySlices query, which can be used with
    /// Akka Projection over gRPC.
    ///
    /// 1. Events are stored in the event journal on the producer side.
    /// 2. Consumer side starts an Akka Projection which locally reads its offset
    ///    from the Projection offset store.
    /// 3. Consumer side establishes a replication stream from the producer service
    ///    by sending the `InitReq` with the offset to start from.
    /// 4. Events are read from the journal on the producer side and emitted to the
    ///    replication stream.
    /// 5. Consumer side processes the events in a Projection handler.
    /// 6. Offset is stored on the consumer side by the Projection offset store.
    /// 7. Producer continues to read new events from the journal and emit to the stream.
    ///
    /// The consumer can define event filters with the `FilterCriteria`, which can be included
    /// in the `InitReq` and also changed in runtime by sending `FilterReq`.
    #[derive(Debug)]
    pub struct EventProducerServiceServer<T: EventProducerService> {
        inner: _Inner<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    struct _Inner<T>(Arc<T>);
    impl<T: EventProducerService> EventProducerServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for EventProducerServiceServer<T>
    where
        T: EventProducerService,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/akka.projection.grpc.EventProducerService/EventsBySlices" => {
                    #[allow(non_camel_case_types)]
                    struct EventsBySlicesSvc<T: EventProducerService>(pub Arc<T>);
                    impl<
                        T: EventProducerService,
                    > tonic::server::StreamingService<super::StreamIn>
                    for EventsBySlicesSvc<T> {
                        type Response = super::StreamOut;
                        type ResponseStream = T::EventsBySlicesStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<tonic::Streaming<super::StreamIn>>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as EventProducerService>::events_by_slices(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = EventsBySlicesSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/akka.projection.grpc.EventProducerService/EventTimestamp" => {
                    #[allow(non_camel_case_types)]
                    struct EventTimestampSvc<T: EventProducerService>(pub Arc<T>);
                    impl<
                        T: EventProducerService,
                    > tonic::server::UnaryService<super::EventTimestampRequest>
                    for EventTimestampSvc<T> {
                        type Response = super::EventTimestampResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::EventTimestampRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as EventProducerService>::event_timestamp(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = EventTimestampSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/akka.projection.grpc.EventProducerService/LoadEvent" => {
                    #[allow(non_camel_case_types)]
                    struct LoadEventSvc<T: EventProducerService>(pub Arc<T>);
                    impl<
                        T: EventProducerService,
                    > tonic::server::UnaryService<super::LoadEventRequest>
                    for LoadEventSvc<T> {
                        type Response = super::LoadEventResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::LoadEventRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as EventProducerService>::load_event(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = LoadEventSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: EventProducerService> Clone for EventProducerServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    impl<T: EventProducerService> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(Arc::clone(&self.0))
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: EventProducerService> tonic::server::NamedService
    for EventProducerServiceServer<T> {
        const NAME: &'static str = "akka.projection.grpc.EventProducerService";
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumeEventOut {
    #[prost(oneof = "consume_event_out::Message", tags = "1, 2")]
    pub message: ::core::option::Option<consume_event_out::Message>,
}
/// Nested message and enum types in `ConsumeEventOut`.
pub mod consume_event_out {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(message, tag = "1")]
        Start(super::ConsumerEventStart),
        #[prost(message, tag = "2")]
        Ack(super::ConsumerEventAck),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumerEventAck {
    #[prost(string, tag = "1")]
    pub persistence_id: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub seq_nr: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumeEventIn {
    #[prost(oneof = "consume_event_in::Message", tags = "1, 2, 3, 4")]
    pub message: ::core::option::Option<consume_event_in::Message>,
}
/// Nested message and enum types in `ConsumeEventIn`.
pub mod consume_event_in {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        /// always sent first
        #[prost(message, tag = "1")]
        Init(super::ConsumerEventInit),
        #[prost(message, tag = "2")]
        Event(super::Event),
        #[prost(message, tag = "3")]
        FilteredEvent(super::FilteredEvent),
        #[prost(message, tag = "4")]
        KeepAlive(super::KeepAlive),
    }
}
/// must be the first event from the connecting producer,
/// the producer must then not start emitting events until
/// it sees a ConsumerEventStart
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumerEventInit {
    /// unique producer identifier showing where the events came from/was produced
    #[prost(string, tag = "1")]
    pub origin_id: ::prost::alloc::string::String,
    /// the stream id of the type of entity the producer wants to push
    #[prost(string, tag = "2")]
    pub stream_id: ::prost::alloc::string::String,
    /// if gaps in sequence numbers may exist and should be filled in
    #[prost(bool, tag = "3")]
    pub fill_sequence_number_gaps: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumerEventStart {
    #[prost(message, repeated, tag = "1")]
    pub filter: ::prost::alloc::vec::Vec<FilterCriteria>,
    #[prost(message, optional, tag = "2")]
    pub replica_info: ::core::option::Option<ReplicaInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeepAlive {}
/// Generated client implementations.
pub mod event_consumer_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// EventConsumerService runs on the consumer side and allows a producer
    /// to initiate/push events to the consumer.
    ///
    /// 1. Events are stored in the event journal on the producer side.
    /// 2. Producer side starts an Akka Projection which locally tracks its offset
    ///    and as projection handler pushes events to a consuming EventConsumerService
    /// 3. Consumer stores events directly into a journal
    /// 4. Consumer side projections can run against the local journal
    #[derive(Debug, Clone)]
    pub struct EventConsumerServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl EventConsumerServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> EventConsumerServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> EventConsumerServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            EventConsumerServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn consume_event(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::ConsumeEventIn>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::ConsumeEventOut>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/akka.projection.grpc.EventConsumerService/ConsumeEvent",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "akka.projection.grpc.EventConsumerService",
                        "ConsumeEvent",
                    ),
                );
            self.inner.streaming(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod event_consumer_service_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with EventConsumerServiceServer.
    #[async_trait]
    pub trait EventConsumerService: Send + Sync + 'static {
        /// Server streaming response type for the ConsumeEvent method.
        type ConsumeEventStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::ConsumeEventOut, tonic::Status>,
            >
            + Send
            + 'static;
        async fn consume_event(
            &self,
            request: tonic::Request<tonic::Streaming<super::ConsumeEventIn>>,
        ) -> std::result::Result<
            tonic::Response<Self::ConsumeEventStream>,
            tonic::Status,
        >;
    }
    /// EventConsumerService runs on the consumer side and allows a producer
    /// to initiate/push events to the consumer.
    ///
    /// 1. Events are stored in the event journal on the producer side.
    /// 2. Producer side starts an Akka Projection which locally tracks its offset
    ///    and as projection handler pushes events to a consuming EventConsumerService
    /// 3. Consumer stores events directly into a journal
    /// 4. Consumer side projections can run against the local journal
    #[derive(Debug)]
    pub struct EventConsumerServiceServer<T: EventConsumerService> {
        inner: _Inner<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    struct _Inner<T>(Arc<T>);
    impl<T: EventConsumerService> EventConsumerServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>>
    for EventConsumerServiceServer<T>
    where
        T: EventConsumerService,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/akka.projection.grpc.EventConsumerService/ConsumeEvent" => {
                    #[allow(non_camel_case_types)]
                    struct ConsumeEventSvc<T: EventConsumerService>(pub Arc<T>);
                    impl<
                        T: EventConsumerService,
                    > tonic::server::StreamingService<super::ConsumeEventIn>
                    for ConsumeEventSvc<T> {
                        type Response = super::ConsumeEventOut;
                        type ResponseStream = T::ConsumeEventStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::ConsumeEventIn>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as EventConsumerService>::consume_event(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = ConsumeEventSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: EventConsumerService> Clone for EventConsumerServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    impl<T: EventConsumerService> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(Arc::clone(&self.0))
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: EventConsumerService> tonic::server::NamedService
    for EventConsumerServiceServer<T> {
        const NAME: &'static str = "akka.projection.grpc.EventConsumerService";
    }
}