salesforce_core_pubsubapi 0.13.4

Generated Salesforce Pub/Sub API gRPC client (used by salesforce_core)
Documentation
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
// This file is @generated by prost-build.
///
/// Contains information about a topic and uniquely identifies it. TopicInfo is returned by the GetTopic RPC method.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TopicInfo {
    /// Topic name
    #[prost(string, tag = "1")]
    pub topic_name: ::prost::alloc::string::String,
    /// Tenant/org GUID
    #[prost(string, tag = "2")]
    pub tenant_guid: ::prost::alloc::string::String,
    /// Is publishing allowed?
    #[prost(bool, tag = "3")]
    pub can_publish: bool,
    /// Is subscription allowed?
    #[prost(bool, tag = "4")]
    pub can_subscribe: bool,
    /// ID of the current topic schema, which can be used for
    /// publishing of generically serialized events.
    #[prost(string, tag = "5")]
    pub schema_id: ::prost::alloc::string::String,
    /// RPC ID used to trace errors.
    #[prost(string, tag = "6")]
    pub rpc_id: ::prost::alloc::string::String,
}
///
/// A request message for GetTopic. Note that the tenant/org is not directly referenced
/// in the request, but is implicitly identified by the authentication headers.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TopicRequest {
    /// The name of the topic to retrieve.
    #[prost(string, tag = "1")]
    pub topic_name: ::prost::alloc::string::String,
}
///
/// Reserved for future use.
/// Header that contains information for distributed tracing, filtering, routing, etc.
/// For example, X-B3-* headers assigned by a publisher are stored with the event and
/// can provide a full distributed trace of the event across its entire lifecycle.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EventHeader {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub value: ::prost::alloc::vec::Vec<u8>,
}
///
/// Represents an event that an event publishing app creates.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProducerEvent {
    /// Either a user-provided ID or a system generated guid
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Schema fingerprint for this event which is hash of the schema
    #[prost(string, tag = "2")]
    pub schema_id: ::prost::alloc::string::String,
    /// The message data field
    #[prost(bytes = "vec", tag = "3")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
    /// Reserved for future use. Key-value pairs of headers.
    #[prost(message, repeated, tag = "4")]
    pub headers: ::prost::alloc::vec::Vec<EventHeader>,
}
///
/// Represents an event that is consumed in a subscriber client.
/// In addition to the fields in ProducerEvent, ConsumerEvent has the replay_id field.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumerEvent {
    /// The event with fields identical to ProducerEvent
    #[prost(message, optional, tag = "1")]
    pub event: ::core::option::Option<ProducerEvent>,
    /// The replay ID of the event.
    /// A subscriber app can store the replay ID. When the app restarts, it can resume subscription
    /// starting from events in the event bus after the event with that replay ID.
    #[prost(bytes = "vec", tag = "2")]
    pub replay_id: ::prost::alloc::vec::Vec<u8>,
}
///
/// Event publish result that the Publish RPC method returns. The result contains replay_id or a publish error.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PublishResult {
    /// Replay ID of the event
    #[prost(bytes = "vec", tag = "1")]
    pub replay_id: ::prost::alloc::vec::Vec<u8>,
    /// Publish error if any
    #[prost(message, optional, tag = "2")]
    pub error: ::core::option::Option<Error>,
    /// Correlation key of the ProducerEvent
    #[prost(string, tag = "3")]
    pub correlation_key: ::prost::alloc::string::String,
}
/// Contains error information for an error that an RPC method returns.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Error {
    /// Error code
    #[prost(enumeration = "ErrorCode", tag = "1")]
    pub code: i32,
    /// Error message
    #[prost(string, tag = "2")]
    pub msg: ::prost::alloc::string::String,
}
///
/// Request for the Subscribe streaming RPC method. This request is used to:
/// 1. Establish the initial subscribe stream.
/// 2. Request more events from the subscription stream.
/// Flow Control is handled by the subscriber via num_requested.
/// A client can specify a starting point for the subscription with replay_preset and replay_id combinations.
/// If no replay_preset is specified, the subscription starts at LATEST (tip of the stream).
/// replay_preset and replay_id values are only consumed as part of the first FetchRequest. If
/// a client needs to start at another point in the stream, it must start a new subscription.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FetchRequest {
    ///
    /// Identifies a topic for subscription in the very first FetchRequest of the stream. The topic cannot change
    /// in subsequent FetchRequests within the same subscribe stream, but can be omitted for efficiency.
    #[prost(string, tag = "1")]
    pub topic_name: ::prost::alloc::string::String,
    ///
    /// Subscription starting point. This is consumed only as part of the first FetchRequest
    /// when the subscription is set up.
    #[prost(enumeration = "ReplayPreset", tag = "2")]
    pub replay_preset: i32,
    ///
    /// If replay_preset of CUSTOM is selected, specify the subscription point to start after.
    /// This is consumed only as part of the first FetchRequest when the subscription is set up.
    #[prost(bytes = "vec", tag = "3")]
    pub replay_id: ::prost::alloc::vec::Vec<u8>,
    ///
    /// Number of events a client is ready to accept. Each subsequent FetchRequest informs the server
    /// of additional processing capacity available on the client side. There is no guarantee of equal number of
    /// FetchResponse messages to be sent back. There is not necessarily a correspondence between
    /// number of requested events in FetchRequest and the number of events returned in subsequent
    /// FetchResponses.
    #[prost(int32, tag = "4")]
    pub num_requested: i32,
    /// For internal Salesforce use only.
    #[prost(string, tag = "5")]
    pub auth_refresh: ::prost::alloc::string::String,
}
///
/// Response for the Subscribe streaming RPC method. This returns ConsumerEvent(s).
/// If there are no events to deliver, the server sends an empty batch fetch response with the latest replay ID. The
/// empty fetch response is sent within 270 seconds. An empty fetch response provides a periodic keepalive from the
/// server and the latest replay ID.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchResponse {
    /// Received events for subscription for client consumption
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<ConsumerEvent>,
    /// Latest replay ID of a subscription. Enables clients with an updated replay value so that they can keep track
    /// of their last consumed replay. Clients will not have to start a subscription at a very old replay in the case where a resubscribe is necessary.
    #[prost(bytes = "vec", tag = "2")]
    pub latest_replay_id: ::prost::alloc::vec::Vec<u8>,
    /// RPC ID used to trace errors.
    #[prost(string, tag = "3")]
    pub rpc_id: ::prost::alloc::string::String,
    /// Number of remaining events to be delivered to the client for a Subscribe RPC call.
    #[prost(int32, tag = "4")]
    pub pending_num_requested: i32,
}
///
/// Request for the GetSchema RPC method. The schema request is based on the event schema ID.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SchemaRequest {
    /// Schema fingerprint for this event, which is a hash of the schema.
    #[prost(string, tag = "1")]
    pub schema_id: ::prost::alloc::string::String,
}
///
/// Response for the GetSchema RPC method. This returns the schema ID and schema of an event.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SchemaInfo {
    /// Avro schema in JSON format
    #[prost(string, tag = "1")]
    pub schema_json: ::prost::alloc::string::String,
    /// Schema fingerprint
    #[prost(string, tag = "2")]
    pub schema_id: ::prost::alloc::string::String,
    /// RPC ID used to trace errors.
    #[prost(string, tag = "3")]
    pub rpc_id: ::prost::alloc::string::String,
}
/// Request for the Publish and PublishStream RPC method.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishRequest {
    /// Topic to publish on
    #[prost(string, tag = "1")]
    pub topic_name: ::prost::alloc::string::String,
    /// Batch of ProducerEvent(s) to send
    #[prost(message, repeated, tag = "2")]
    pub events: ::prost::alloc::vec::Vec<ProducerEvent>,
    /// For internal Salesforce use only.
    #[prost(string, tag = "3")]
    pub auth_refresh: ::prost::alloc::string::String,
}
///
/// Response for the Publish and PublishStream RPC methods. This returns
/// a list of PublishResults for each event that the client attempted to
/// publish. PublishResult indicates if publish succeeded or not
/// for each event. It also returns the schema ID that was used to create
/// the ProducerEvents in the PublishRequest.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishResponse {
    /// Publish results
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<PublishResult>,
    /// Schema fingerprint for this event, which is a hash of the schema
    #[prost(string, tag = "2")]
    pub schema_id: ::prost::alloc::string::String,
    /// RPC ID used to trace errors.
    #[prost(string, tag = "3")]
    pub rpc_id: ::prost::alloc::string::String,
}
///
/// This feature is part of an open beta release and is subject to the applicable
/// Beta Services Terms provided at Agreements and Terms
/// (<https://www.salesforce.com/company/legal/agreements/>).
///
/// Request for the ManagedSubscribe streaming RPC method. This request is used to:
/// 1. Establish the initial managed subscribe stream.
/// 2. Request more events from the subscription stream.
/// 3. Commit a Replay ID using CommitReplayRequest.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ManagedFetchRequest {
    ///
    /// Managed subscription ID or developer name. This value corresponds to the
    /// ID or developer name of the ManagedEventSubscription Tooling API record.
    /// This value is consumed as part of the first ManagedFetchRequest only.
    /// The subscription_id cannot change in subsequent ManagedFetchRequests
    /// within the same subscribe stream, but can be omitted for efficiency.
    #[prost(string, tag = "1")]
    pub subscription_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub developer_name: ::prost::alloc::string::String,
    ///
    /// Number of events a client is ready to accept. Each subsequent FetchRequest informs the server
    /// of additional processing capacity available on the client side. There is no guarantee of equal number of
    /// FetchResponse messages to be sent back. There is not necessarily a correspondence between
    /// number of requested events in FetchRequest and the number of events returned in subsequent
    /// FetchResponses.
    #[prost(int32, tag = "3")]
    pub num_requested: i32,
    /// For internal Salesforce use only.
    #[prost(string, tag = "4")]
    pub auth_refresh: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub commit_replay_id_request: ::core::option::Option<CommitReplayRequest>,
}
///
/// This feature is part of an open beta release and is subject to the applicable
/// Beta Services Terms provided at Agreements and Terms
/// (<https://www.salesforce.com/company/legal/agreements/>).
///
/// Response for the ManagedSubscribe streaming RPC method. This can return
/// ConsumerEvent(s) or CommitReplayResponse along with other metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ManagedFetchResponse {
    /// Received events for subscription for client consumption
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<ConsumerEvent>,
    /// Latest replay ID of a subscription.
    #[prost(bytes = "vec", tag = "2")]
    pub latest_replay_id: ::prost::alloc::vec::Vec<u8>,
    /// RPC ID used to trace errors.
    #[prost(string, tag = "3")]
    pub rpc_id: ::prost::alloc::string::String,
    /// Number of remaining events to be delivered to the client for a Subscribe RPC call.
    #[prost(int32, tag = "4")]
    pub pending_num_requested: i32,
    /// commit response
    #[prost(message, optional, tag = "5")]
    pub commit_response: ::core::option::Option<CommitReplayResponse>,
}
///
/// This feature is part of an open beta release and is subject to the applicable
/// Beta Services Terms provided at Agreements and Terms
/// (<https://www.salesforce.com/company/legal/agreements/>).
///
/// Request to commit a Replay ID for the last processed event or for the latest
/// replay ID received in an empty batch of events.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommitReplayRequest {
    /// commit_request_id to identify commit responses
    #[prost(string, tag = "1")]
    pub commit_request_id: ::prost::alloc::string::String,
    /// replayId to commit
    #[prost(bytes = "vec", tag = "2")]
    pub replay_id: ::prost::alloc::vec::Vec<u8>,
}
///
/// This feature is part of an open beta release and is subject to the applicable
/// Beta Services Terms provided at Agreements and Terms
/// (<https://www.salesforce.com/company/legal/agreements/>).
///
/// There is no guaranteed 1:1 CommitReplayRequest to CommitReplayResponse.
/// N CommitReplayRequest(s) can get compressed in a batch resulting in a single
/// CommitReplayResponse which reflects the latest values of last
/// CommitReplayRequest in that batch.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommitReplayResponse {
    /// commit_request_id to identify commit responses.
    #[prost(string, tag = "1")]
    pub commit_request_id: ::prost::alloc::string::String,
    /// replayId that may have been committed
    #[prost(bytes = "vec", tag = "2")]
    pub replay_id: ::prost::alloc::vec::Vec<u8>,
    /// for failed commits
    #[prost(message, optional, tag = "3")]
    pub error: ::core::option::Option<Error>,
    /// time when server received request in epoch ms
    #[prost(int64, tag = "4")]
    pub process_time: i64,
}
/// Supported error codes
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCode {
    Unknown = 0,
    Publish = 1,
    /// ErrorCode for unrecoverable commit errors.
    Commit = 2,
}
impl ErrorCode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "UNKNOWN",
            Self::Publish => "PUBLISH",
            Self::Commit => "COMMIT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "PUBLISH" => Some(Self::Publish),
            "COMMIT" => Some(Self::Commit),
            _ => None,
        }
    }
}
///
/// Supported subscription replay start values.
/// By default, the subscription will start at the tip of the stream if ReplayPreset is not specified.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReplayPreset {
    /// Start the subscription at the tip of the stream.
    Latest = 0,
    /// Start the subscription at the earliest point in the stream.
    Earliest = 1,
    /// Start the subscription after a custom point in the stream. This must be set with a valid replay_id in the FetchRequest.
    Custom = 2,
}
impl ReplayPreset {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Latest => "LATEST",
            Self::Earliest => "EARLIEST",
            Self::Custom => "CUSTOM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LATEST" => Some(Self::Latest),
            "EARLIEST" => Some(Self::Earliest),
            "CUSTOM" => Some(Self::Custom),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod pub_sub_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    ///
    /// The Pub/Sub API provides a single interface for publishing and subscribing to platform events, including real-time
    /// event monitoring events, and change data capture events. The Pub/Sub API is a gRPC API that is based on HTTP/2.
    ///
    /// A session token is needed to authenticate. Any of the Salesforce supported
    /// OAuth flows can be used to obtain a session token:
    /// https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_flows.htm&type=5
    ///
    /// For each RPC, a client needs to pass authentication information
    /// as metadata headers (https://www.grpc.io/docs/guides/concepts/#metadata) with their method call.
    ///
    /// For Salesforce session token authentication, use:
    ///   accesstoken : access token
    ///   instanceurl : Salesforce instance URL
    ///   tenantid : tenant/org id of the client
    ///
    /// StatusException is thrown in case of response failure for any request.
    #[derive(Debug, Clone)]
    pub struct PubSubClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> PubSubClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
        ) -> PubSubClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            PubSubClient::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
        }
        ///
        /// Bidirectional streaming RPC to subscribe to a Topic. The subscription is pull-based. A client can request
        /// for more events as it consumes events. This enables a client to handle flow control based on the client's processing speed.
        ///
        /// Typical flow:
        /// 1. Client requests for X number of events via FetchRequest.
        /// 2. Server receives request and delivers events until X events are delivered to the client via one or more FetchResponse messages.
        /// 3. Client consumes the FetchResponse messages as they come.
        /// 4. Client issues new FetchRequest for Y more number of events. This request can
        ///    come before the server has delivered the earlier requested X number of events
        ///    so the client gets a continuous stream of events if any.
        ///
        /// If a client requests more events before the server finishes the last
        /// requested amount, the server appends the new amount to the current amount of
        /// events it still needs to fetch and deliver.
        ///
        /// A client can subscribe at any point in the stream by providing a replay option in the first FetchRequest.
        /// The replay option is honored for the first FetchRequest received from a client. Any subsequent FetchRequests with a
        /// new replay option are ignored. A client needs to call the Subscribe RPC again to restart the subscription
        /// at a new point in the stream.
        ///
        /// The first FetchRequest of the stream identifies the topic to subscribe to.
        /// If any subsequent FetchRequest provides topic_name, it must match what
        /// was provided in the first FetchRequest; otherwise, the RPC returns an error
        /// with INVALID_ARGUMENT status.
        pub async fn subscribe(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::FetchRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::FetchResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/Subscribe",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "Subscribe"));
            self.inner.streaming(req, path, codec).await
        }
        /// Get the event schema for a topic based on a schema ID.
        pub async fn get_schema(
            &mut self,
            request: impl tonic::IntoRequest<super::SchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::SchemaInfo>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/GetSchema",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "GetSchema"));
            self.inner.unary(req, path, codec).await
        }
        ///
        /// Get the topic Information related to the specified topic.
        pub async fn get_topic(
            &mut self,
            request: impl tonic::IntoRequest<super::TopicRequest>,
        ) -> std::result::Result<tonic::Response<super::TopicInfo>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/GetTopic",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "GetTopic"));
            self.inner.unary(req, path, codec).await
        }
        ///
        /// Send a publish request to synchronously publish events to a topic.
        pub async fn publish(
            &mut self,
            request: impl tonic::IntoRequest<super::PublishRequest>,
        ) -> std::result::Result<
            tonic::Response<super::PublishResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/Publish",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "Publish"));
            self.inner.unary(req, path, codec).await
        }
        ///
        /// Bidirectional Streaming RPC to publish events to the event bus.
        /// PublishRequest contains the batch of events to publish.
        ///
        /// The first PublishRequest of the stream identifies the topic to publish on.
        /// If any subsequent PublishRequest provides topic_name, it must match what
        /// was provided in the first PublishRequest; otherwise, the RPC returns an error
        /// with INVALID_ARGUMENT status.
        ///
        /// The server returns a PublishResponse for each PublishRequest when publish is
        /// complete for the batch. A client does not have to wait for a PublishResponse
        /// before sending a new PublishRequest, i.e. multiple publish batches can be queued
        /// up, which allows for higher publish rate as a client can asynchronously
        /// publish more events while publishes are still in flight on the server side.
        ///
        /// PublishResponse holds a PublishResult for each event published that indicates success
        /// or failure of the publish. A client can then retry the publish as needed before sending
        /// more PublishRequests for new events to publish.
        ///
        /// A client must send a valid publish request with one or more events every 70 seconds to hold on to the stream.
        /// Otherwise, the server closes the stream and notifies the client. Once the client is notified of the stream closure,
        /// it must make a new PublishStream call to resume publishing.
        pub async fn publish_stream(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::PublishRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::PublishResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/PublishStream",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "PublishStream"));
            self.inner.streaming(req, path, codec).await
        }
        ///
        /// This feature is part of an open beta release and is subject to the applicable
        /// Beta Services Terms provided at Agreements and Terms
        /// (https://www.salesforce.com/company/legal/agreements/).
        ///
        /// Same as Subscribe, but for Managed Subscription clients.
        /// This feature is part of an open beta release.
        pub async fn managed_subscribe(
            &mut self,
            request: impl tonic::IntoStreamingRequest<
                Message = super::ManagedFetchRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::ManagedFetchResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/eventbus.v1.PubSub/ManagedSubscribe",
            );
            let mut req = request.into_streaming_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("eventbus.v1.PubSub", "ManagedSubscribe"));
            self.inner.streaming(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod pub_sub_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with PubSubServer.
    #[async_trait]
    pub trait PubSub: std::marker::Send + std::marker::Sync + 'static {
        /// Server streaming response type for the Subscribe method.
        type SubscribeStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::FetchResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        ///
        /// Bidirectional streaming RPC to subscribe to a Topic. The subscription is pull-based. A client can request
        /// for more events as it consumes events. This enables a client to handle flow control based on the client's processing speed.
        ///
        /// Typical flow:
        /// 1. Client requests for X number of events via FetchRequest.
        /// 2. Server receives request and delivers events until X events are delivered to the client via one or more FetchResponse messages.
        /// 3. Client consumes the FetchResponse messages as they come.
        /// 4. Client issues new FetchRequest for Y more number of events. This request can
        ///    come before the server has delivered the earlier requested X number of events
        ///    so the client gets a continuous stream of events if any.
        ///
        /// If a client requests more events before the server finishes the last
        /// requested amount, the server appends the new amount to the current amount of
        /// events it still needs to fetch and deliver.
        ///
        /// A client can subscribe at any point in the stream by providing a replay option in the first FetchRequest.
        /// The replay option is honored for the first FetchRequest received from a client. Any subsequent FetchRequests with a
        /// new replay option are ignored. A client needs to call the Subscribe RPC again to restart the subscription
        /// at a new point in the stream.
        ///
        /// The first FetchRequest of the stream identifies the topic to subscribe to.
        /// If any subsequent FetchRequest provides topic_name, it must match what
        /// was provided in the first FetchRequest; otherwise, the RPC returns an error
        /// with INVALID_ARGUMENT status.
        async fn subscribe(
            &self,
            request: tonic::Request<tonic::Streaming<super::FetchRequest>>,
        ) -> std::result::Result<tonic::Response<Self::SubscribeStream>, tonic::Status>;
        /// Get the event schema for a topic based on a schema ID.
        async fn get_schema(
            &self,
            request: tonic::Request<super::SchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::SchemaInfo>, tonic::Status>;
        ///
        /// Get the topic Information related to the specified topic.
        async fn get_topic(
            &self,
            request: tonic::Request<super::TopicRequest>,
        ) -> std::result::Result<tonic::Response<super::TopicInfo>, tonic::Status>;
        ///
        /// Send a publish request to synchronously publish events to a topic.
        async fn publish(
            &self,
            request: tonic::Request<super::PublishRequest>,
        ) -> std::result::Result<tonic::Response<super::PublishResponse>, tonic::Status>;
        /// Server streaming response type for the PublishStream method.
        type PublishStreamStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::PublishResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        ///
        /// Bidirectional Streaming RPC to publish events to the event bus.
        /// PublishRequest contains the batch of events to publish.
        ///
        /// The first PublishRequest of the stream identifies the topic to publish on.
        /// If any subsequent PublishRequest provides topic_name, it must match what
        /// was provided in the first PublishRequest; otherwise, the RPC returns an error
        /// with INVALID_ARGUMENT status.
        ///
        /// The server returns a PublishResponse for each PublishRequest when publish is
        /// complete for the batch. A client does not have to wait for a PublishResponse
        /// before sending a new PublishRequest, i.e. multiple publish batches can be queued
        /// up, which allows for higher publish rate as a client can asynchronously
        /// publish more events while publishes are still in flight on the server side.
        ///
        /// PublishResponse holds a PublishResult for each event published that indicates success
        /// or failure of the publish. A client can then retry the publish as needed before sending
        /// more PublishRequests for new events to publish.
        ///
        /// A client must send a valid publish request with one or more events every 70 seconds to hold on to the stream.
        /// Otherwise, the server closes the stream and notifies the client. Once the client is notified of the stream closure,
        /// it must make a new PublishStream call to resume publishing.
        async fn publish_stream(
            &self,
            request: tonic::Request<tonic::Streaming<super::PublishRequest>>,
        ) -> std::result::Result<
            tonic::Response<Self::PublishStreamStream>,
            tonic::Status,
        >;
        /// Server streaming response type for the ManagedSubscribe method.
        type ManagedSubscribeStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::ManagedFetchResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        ///
        /// This feature is part of an open beta release and is subject to the applicable
        /// Beta Services Terms provided at Agreements and Terms
        /// (https://www.salesforce.com/company/legal/agreements/).
        ///
        /// Same as Subscribe, but for Managed Subscription clients.
        /// This feature is part of an open beta release.
        async fn managed_subscribe(
            &self,
            request: tonic::Request<tonic::Streaming<super::ManagedFetchRequest>>,
        ) -> std::result::Result<
            tonic::Response<Self::ManagedSubscribeStream>,
            tonic::Status,
        >;
    }
    ///
    /// The Pub/Sub API provides a single interface for publishing and subscribing to platform events, including real-time
    /// event monitoring events, and change data capture events. The Pub/Sub API is a gRPC API that is based on HTTP/2.
    ///
    /// A session token is needed to authenticate. Any of the Salesforce supported
    /// OAuth flows can be used to obtain a session token:
    /// https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_flows.htm&type=5
    ///
    /// For each RPC, a client needs to pass authentication information
    /// as metadata headers (https://www.grpc.io/docs/guides/concepts/#metadata) with their method call.
    ///
    /// For Salesforce session token authentication, use:
    ///   accesstoken : access token
    ///   instanceurl : Salesforce instance URL
    ///   tenantid : tenant/org id of the client
    ///
    /// StatusException is thrown in case of response failure for any request.
    #[derive(Debug)]
    pub struct PubSubServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> PubSubServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            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 PubSubServer<T>
    where
        T: PubSub,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        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 {
            match req.uri().path() {
                "/eventbus.v1.PubSub/Subscribe" => {
                    #[allow(non_camel_case_types)]
                    struct SubscribeSvc<T: PubSub>(pub Arc<T>);
                    impl<T: PubSub> tonic::server::StreamingService<super::FetchRequest>
                    for SubscribeSvc<T> {
                        type Response = super::FetchResponse;
                        type ResponseStream = T::SubscribeStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::FetchRequest>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::subscribe(&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 method = SubscribeSvc(inner);
                        let codec = tonic_prost::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)
                }
                "/eventbus.v1.PubSub/GetSchema" => {
                    #[allow(non_camel_case_types)]
                    struct GetSchemaSvc<T: PubSub>(pub Arc<T>);
                    impl<T: PubSub> tonic::server::UnaryService<super::SchemaRequest>
                    for GetSchemaSvc<T> {
                        type Response = super::SchemaInfo;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SchemaRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::get_schema(&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 method = GetSchemaSvc(inner);
                        let codec = tonic_prost::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)
                }
                "/eventbus.v1.PubSub/GetTopic" => {
                    #[allow(non_camel_case_types)]
                    struct GetTopicSvc<T: PubSub>(pub Arc<T>);
                    impl<T: PubSub> tonic::server::UnaryService<super::TopicRequest>
                    for GetTopicSvc<T> {
                        type Response = super::TopicInfo;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::TopicRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::get_topic(&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 method = GetTopicSvc(inner);
                        let codec = tonic_prost::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)
                }
                "/eventbus.v1.PubSub/Publish" => {
                    #[allow(non_camel_case_types)]
                    struct PublishSvc<T: PubSub>(pub Arc<T>);
                    impl<T: PubSub> tonic::server::UnaryService<super::PublishRequest>
                    for PublishSvc<T> {
                        type Response = super::PublishResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::PublishRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::publish(&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 method = PublishSvc(inner);
                        let codec = tonic_prost::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)
                }
                "/eventbus.v1.PubSub/PublishStream" => {
                    #[allow(non_camel_case_types)]
                    struct PublishStreamSvc<T: PubSub>(pub Arc<T>);
                    impl<
                        T: PubSub,
                    > tonic::server::StreamingService<super::PublishRequest>
                    for PublishStreamSvc<T> {
                        type Response = super::PublishResponse;
                        type ResponseStream = T::PublishStreamStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::PublishRequest>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::publish_stream(&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 method = PublishStreamSvc(inner);
                        let codec = tonic_prost::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)
                }
                "/eventbus.v1.PubSub/ManagedSubscribe" => {
                    #[allow(non_camel_case_types)]
                    struct ManagedSubscribeSvc<T: PubSub>(pub Arc<T>);
                    impl<
                        T: PubSub,
                    > tonic::server::StreamingService<super::ManagedFetchRequest>
                    for ManagedSubscribeSvc<T> {
                        type Response = super::ManagedFetchResponse;
                        type ResponseStream = T::ManagedSubscribeStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::ManagedFetchRequest>,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as PubSub>::managed_subscribe(&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 method = ManagedSubscribeSvc(inner);
                        let codec = tonic_prost::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 {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for PubSubServer<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,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "eventbus.v1.PubSub";
    impl<T> tonic::server::NamedService for PubSubServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}