Skip to main content

danube_core/proto/
danube.rs

1// This file is @generated by prost-build.
2/// Create Producer request
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct ProducerRequest {
5    #[prost(uint64, tag = "1")]
6    pub request_id: u64,
7    #[prost(string, tag = "2")]
8    pub producer_name: ::prost::alloc::string::String,
9    #[prost(string, tag = "3")]
10    pub topic_name: ::prost::alloc::string::String,
11    #[prost(message, optional, tag = "4")]
12    pub schema_ref: ::core::option::Option<SchemaReference>,
13    #[prost(enumeration = "ProducerAccessMode", tag = "5")]
14    pub producer_access_mode: i32,
15    #[prost(enumeration = "DispatchStrategy", tag = "6")]
16    pub dispatch_strategy: i32,
17}
18/// Reference to a schema in the schema registry
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
20pub struct SchemaReference {
21    /// Subject name (usually topic name)
22    #[prost(string, tag = "1")]
23    pub subject: ::prost::alloc::string::String,
24    #[prost(oneof = "schema_reference::VersionRef", tags = "2, 3, 4")]
25    pub version_ref: ::core::option::Option<schema_reference::VersionRef>,
26}
27/// Nested message and enum types in `SchemaReference`.
28pub mod schema_reference {
29    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
30    pub enum VersionRef {
31        /// Use latest version (true)
32        #[prost(bool, tag = "2")]
33        UseLatest(bool),
34        /// Use specific version number
35        #[prost(uint32, tag = "3")]
36        PinnedVersion(u32),
37        /// Use version >= this number
38        #[prost(uint32, tag = "4")]
39        MinVersion(u32),
40    }
41}
42/// Create Producer response
43#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44pub struct ProducerResponse {
45    #[prost(uint64, tag = "1")]
46    pub request_id: u64,
47    #[prost(uint64, tag = "2")]
48    pub producer_id: u64,
49    #[prost(string, tag = "3")]
50    pub producer_name: ::prost::alloc::string::String,
51}
52/// Producer receive acknowledge for the sent message
53#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
54pub struct MessageResponse {
55    #[prost(uint64, tag = "1")]
56    pub request_id: u64,
57}
58/// Create Consumer request
59#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
60pub struct ConsumerRequest {
61    #[prost(uint64, tag = "1")]
62    pub request_id: u64,
63    #[prost(string, tag = "2")]
64    pub topic_name: ::prost::alloc::string::String,
65    #[prost(string, tag = "3")]
66    pub consumer_name: ::prost::alloc::string::String,
67    #[prost(string, tag = "4")]
68    pub subscription: ::prost::alloc::string::String,
69    #[prost(enumeration = "consumer_request::SubscriptionType", tag = "5")]
70    pub subscription_type: i32,
71}
72/// Nested message and enum types in `ConsumerRequest`.
73pub mod consumer_request {
74    #[derive(
75        Clone,
76        Copy,
77        Debug,
78        PartialEq,
79        Eq,
80        Hash,
81        PartialOrd,
82        Ord,
83        ::prost::Enumeration
84    )]
85    #[repr(i32)]
86    pub enum SubscriptionType {
87        /// Only one consumer can subscribe to the topic at a time.
88        Exclusive = 0,
89        /// Multiple consumers can subscribe to the topic concurrently.
90        Shared = 1,
91        /// Only one consumer (the active consumer) receives messages at any given time.
92        Failover = 2,
93    }
94    impl SubscriptionType {
95        /// String value of the enum field names used in the ProtoBuf definition.
96        ///
97        /// The values are not transformed in any way and thus are considered stable
98        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
99        pub fn as_str_name(&self) -> &'static str {
100            match self {
101                Self::Exclusive => "Exclusive",
102                Self::Shared => "Shared",
103                Self::Failover => "Failover",
104            }
105        }
106        /// Creates an enum from field names used in the ProtoBuf definition.
107        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
108            match value {
109                "Exclusive" => Some(Self::Exclusive),
110                "Shared" => Some(Self::Shared),
111                "Failover" => Some(Self::Failover),
112                _ => None,
113            }
114        }
115    }
116}
117/// Create Consumer response
118#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
119pub struct ConsumerResponse {
120    #[prost(uint64, tag = "1")]
121    pub request_id: u64,
122    #[prost(uint64, tag = "2")]
123    pub consumer_id: u64,
124    #[prost(string, tag = "3")]
125    pub consumer_name: ::prost::alloc::string::String,
126}
127#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
128pub struct ReceiveRequest {
129    #[prost(uint64, tag = "1")]
130    pub request_id: u64,
131    #[prost(uint64, tag = "2")]
132    pub consumer_id: u64,
133}
134/// The message that is sent by producer to topic and then to consumer
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct StreamMessage {
137    /// Unique ID for tracking the message request
138    #[prost(uint64, tag = "1")]
139    pub request_id: u64,
140    /// Identifies the message, associated with a unique topic, subscription and the broker
141    #[prost(message, optional, tag = "2")]
142    pub msg_id: ::core::option::Option<MsgId>,
143    /// The actual payload of the message
144    #[prost(bytes = "vec", tag = "3")]
145    pub payload: ::prost::alloc::vec::Vec<u8>,
146    /// Timestamp for when the message was published
147    #[prost(uint64, tag = "4")]
148    pub publish_time: u64,
149    /// Identifies the producer’s name
150    #[prost(string, tag = "5")]
151    pub producer_name: ::prost::alloc::string::String,
152    /// Subscription name the consumer is subscribed to
153    #[prost(string, tag = "6")]
154    pub subscription_name: ::prost::alloc::string::String,
155    /// User-defined properties/attributes
156    #[prost(map = "string, string", tag = "7")]
157    pub attributes: ::std::collections::HashMap<
158        ::prost::alloc::string::String,
159        ::prost::alloc::string::String,
160    >,
161    /// NEW: Schema identification for registry-based schemas
162    ///
163    /// Global schema ID from registry
164    #[prost(uint64, optional, tag = "8")]
165    pub schema_id: ::core::option::Option<u64>,
166    /// Schema version number
167    #[prost(uint32, optional, tag = "9")]
168    pub schema_version: ::core::option::Option<u32>,
169}
170/// Unique ID of the message
171#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
172pub struct MsgId {
173    /// Identifies the producer, associated with a unique topic
174    #[prost(uint64, tag = "1")]
175    pub producer_id: u64,
176    /// Topic name the message is published to
177    #[prost(string, tag = "2")]
178    pub topic_name: ::prost::alloc::string::String,
179    /// Broker address
180    #[prost(string, tag = "3")]
181    pub broker_addr: ::prost::alloc::string::String,
182    /// Offset within the topic
183    #[prost(uint64, tag = "5")]
184    pub topic_offset: u64,
185}
186#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
187pub struct AckRequest {
188    #[prost(uint64, tag = "1")]
189    pub request_id: u64,
190    /// Identifies the message, associated with a unique topic, subscription and the broker
191    #[prost(message, optional, tag = "2")]
192    pub msg_id: ::core::option::Option<MsgId>,
193    /// Subscription name the consumer is subscribed to
194    #[prost(string, tag = "3")]
195    pub subscription_name: ::prost::alloc::string::String,
196}
197#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
198pub struct AckResponse {
199    #[prost(uint64, tag = "1")]
200    pub request_id: u64,
201}
202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
203pub struct TopicLookupRequest {
204    #[prost(uint64, tag = "1")]
205    pub request_id: u64,
206    #[prost(string, tag = "2")]
207    pub topic: ::prost::alloc::string::String,
208}
209#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
210pub struct TopicLookupResponse {
211    #[prost(uint64, tag = "3")]
212    pub request_id: u64,
213    #[prost(enumeration = "topic_lookup_response::LookupType", tag = "4")]
214    pub response_type: i32,
215    #[prost(string, tag = "5")]
216    pub broker_service_url: ::prost::alloc::string::String,
217}
218/// Nested message and enum types in `TopicLookupResponse`.
219pub mod topic_lookup_response {
220    #[derive(
221        Clone,
222        Copy,
223        Debug,
224        PartialEq,
225        Eq,
226        Hash,
227        PartialOrd,
228        Ord,
229        ::prost::Enumeration
230    )]
231    #[repr(i32)]
232    pub enum LookupType {
233        Redirect = 0,
234        Connect = 1,
235        Failed = 2,
236    }
237    impl LookupType {
238        /// String value of the enum field names used in the ProtoBuf definition.
239        ///
240        /// The values are not transformed in any way and thus are considered stable
241        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
242        pub fn as_str_name(&self) -> &'static str {
243            match self {
244                Self::Redirect => "Redirect",
245                Self::Connect => "Connect",
246                Self::Failed => "Failed",
247            }
248        }
249        /// Creates an enum from field names used in the ProtoBuf definition.
250        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
251            match value {
252                "Redirect" => Some(Self::Redirect),
253                "Connect" => Some(Self::Connect),
254                "Failed" => Some(Self::Failed),
255                _ => None,
256            }
257        }
258    }
259}
260#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
261pub struct TopicPartitionsResponse {
262    #[prost(uint64, tag = "1")]
263    pub request_id: u64,
264    #[prost(string, repeated, tag = "2")]
265    pub partitions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
266}
267#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
268pub struct HealthCheckRequest {
269    #[prost(uint64, tag = "1")]
270    pub request_id: u64,
271    #[prost(enumeration = "health_check_request::ClientType", tag = "2")]
272    pub client: i32,
273    #[prost(uint64, tag = "3")]
274    pub id: u64,
275}
276/// Nested message and enum types in `HealthCheckRequest`.
277pub mod health_check_request {
278    #[derive(
279        Clone,
280        Copy,
281        Debug,
282        PartialEq,
283        Eq,
284        Hash,
285        PartialOrd,
286        Ord,
287        ::prost::Enumeration
288    )]
289    #[repr(i32)]
290    pub enum ClientType {
291        Producer = 0,
292        Consumer = 1,
293    }
294    impl ClientType {
295        /// String value of the enum field names used in the ProtoBuf definition.
296        ///
297        /// The values are not transformed in any way and thus are considered stable
298        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
299        pub fn as_str_name(&self) -> &'static str {
300            match self {
301                Self::Producer => "Producer",
302                Self::Consumer => "Consumer",
303            }
304        }
305        /// Creates an enum from field names used in the ProtoBuf definition.
306        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
307            match value {
308                "Producer" => Some(Self::Producer),
309                "Consumer" => Some(Self::Consumer),
310                _ => None,
311            }
312        }
313    }
314}
315#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
316pub struct HealthCheckResponse {
317    #[prost(enumeration = "health_check_response::ClientStatus", tag = "1")]
318    pub status: i32,
319}
320/// Nested message and enum types in `HealthCheckResponse`.
321pub mod health_check_response {
322    #[derive(
323        Clone,
324        Copy,
325        Debug,
326        PartialEq,
327        Eq,
328        Hash,
329        PartialOrd,
330        Ord,
331        ::prost::Enumeration
332    )]
333    #[repr(i32)]
334    pub enum ClientStatus {
335        Ok = 0,
336        Close = 1,
337    }
338    impl ClientStatus {
339        /// String value of the enum field names used in the ProtoBuf definition.
340        ///
341        /// The values are not transformed in any way and thus are considered stable
342        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
343        pub fn as_str_name(&self) -> &'static str {
344            match self {
345                Self::Ok => "OK",
346                Self::Close => "CLOSE",
347            }
348        }
349        /// Creates an enum from field names used in the ProtoBuf definition.
350        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
351            match value {
352                "OK" => Some(Self::Ok),
353                "CLOSE" => Some(Self::Close),
354                _ => None,
355            }
356        }
357    }
358}
359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
360pub struct AuthRequest {
361    #[prost(string, tag = "1")]
362    pub api_key: ::prost::alloc::string::String,
363}
364#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
365pub struct AuthResponse {
366    #[prost(string, tag = "1")]
367    pub token: ::prost::alloc::string::String,
368}
369#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
370#[repr(i32)]
371pub enum ProducerAccessMode {
372    /// multiple producers can publish on a topic
373    Shared = 0,
374    /// exclusive access for producer
375    Exclusive = 1,
376}
377impl ProducerAccessMode {
378    /// String value of the enum field names used in the ProtoBuf definition.
379    ///
380    /// The values are not transformed in any way and thus are considered stable
381    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
382    pub fn as_str_name(&self) -> &'static str {
383        match self {
384            Self::Shared => "Shared",
385            Self::Exclusive => "Exclusive",
386        }
387    }
388    /// Creates an enum from field names used in the ProtoBuf definition.
389    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
390        match value {
391            "Shared" => Some(Self::Shared),
392            "Exclusive" => Some(Self::Exclusive),
393            _ => None,
394        }
395    }
396}
397#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
398#[repr(i32)]
399pub enum DispatchStrategy {
400    NonReliable = 0,
401    Reliable = 1,
402}
403impl DispatchStrategy {
404    /// String value of the enum field names used in the ProtoBuf definition.
405    ///
406    /// The values are not transformed in any way and thus are considered stable
407    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
408    pub fn as_str_name(&self) -> &'static str {
409        match self {
410            Self::NonReliable => "NonReliable",
411            Self::Reliable => "Reliable",
412        }
413    }
414    /// Creates an enum from field names used in the ProtoBuf definition.
415    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
416        match value {
417            "NonReliable" => Some(Self::NonReliable),
418            "Reliable" => Some(Self::Reliable),
419            _ => None,
420        }
421    }
422}
423/// Generated client implementations.
424pub mod producer_service_client {
425    #![allow(
426        unused_variables,
427        dead_code,
428        missing_docs,
429        clippy::wildcard_imports,
430        clippy::let_unit_value,
431    )]
432    use tonic::codegen::*;
433    use tonic::codegen::http::Uri;
434    #[derive(Debug, Clone)]
435    pub struct ProducerServiceClient<T> {
436        inner: tonic::client::Grpc<T>,
437    }
438    impl ProducerServiceClient<tonic::transport::Channel> {
439        /// Attempt to create a new client by connecting to a given endpoint.
440        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
441        where
442            D: TryInto<tonic::transport::Endpoint>,
443            D::Error: Into<StdError>,
444        {
445            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
446            Ok(Self::new(conn))
447        }
448    }
449    impl<T> ProducerServiceClient<T>
450    where
451        T: tonic::client::GrpcService<tonic::body::Body>,
452        T::Error: Into<StdError>,
453        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
454        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
455    {
456        pub fn new(inner: T) -> Self {
457            let inner = tonic::client::Grpc::new(inner);
458            Self { inner }
459        }
460        pub fn with_origin(inner: T, origin: Uri) -> Self {
461            let inner = tonic::client::Grpc::with_origin(inner, origin);
462            Self { inner }
463        }
464        pub fn with_interceptor<F>(
465            inner: T,
466            interceptor: F,
467        ) -> ProducerServiceClient<InterceptedService<T, F>>
468        where
469            F: tonic::service::Interceptor,
470            T::ResponseBody: Default,
471            T: tonic::codegen::Service<
472                http::Request<tonic::body::Body>,
473                Response = http::Response<
474                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
475                >,
476            >,
477            <T as tonic::codegen::Service<
478                http::Request<tonic::body::Body>,
479            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
480        {
481            ProducerServiceClient::new(InterceptedService::new(inner, interceptor))
482        }
483        /// Compress requests with the given encoding.
484        ///
485        /// This requires the server to support it otherwise it might respond with an
486        /// error.
487        #[must_use]
488        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
489            self.inner = self.inner.send_compressed(encoding);
490            self
491        }
492        /// Enable decompressing responses.
493        #[must_use]
494        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
495            self.inner = self.inner.accept_compressed(encoding);
496            self
497        }
498        /// Limits the maximum size of a decoded message.
499        ///
500        /// Default: `4MB`
501        #[must_use]
502        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
503            self.inner = self.inner.max_decoding_message_size(limit);
504            self
505        }
506        /// Limits the maximum size of an encoded message.
507        ///
508        /// Default: `usize::MAX`
509        #[must_use]
510        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
511            self.inner = self.inner.max_encoding_message_size(limit);
512            self
513        }
514        /// Creates a new Producer on a topic
515        pub async fn create_producer(
516            &mut self,
517            request: impl tonic::IntoRequest<super::ProducerRequest>,
518        ) -> std::result::Result<
519            tonic::Response<super::ProducerResponse>,
520            tonic::Status,
521        > {
522            self.inner
523                .ready()
524                .await
525                .map_err(|e| {
526                    tonic::Status::unknown(
527                        format!("Service was not ready: {}", e.into()),
528                    )
529                })?;
530            let codec = tonic_prost::ProstCodec::default();
531            let path = http::uri::PathAndQuery::from_static(
532                "/danube.ProducerService/CreateProducer",
533            );
534            let mut req = request.into_request();
535            req.extensions_mut()
536                .insert(GrpcMethod::new("danube.ProducerService", "CreateProducer"));
537            self.inner.unary(req, path, codec).await
538        }
539        /// Sends a message from the Producer
540        pub async fn send_message(
541            &mut self,
542            request: impl tonic::IntoRequest<super::StreamMessage>,
543        ) -> std::result::Result<
544            tonic::Response<super::MessageResponse>,
545            tonic::Status,
546        > {
547            self.inner
548                .ready()
549                .await
550                .map_err(|e| {
551                    tonic::Status::unknown(
552                        format!("Service was not ready: {}", e.into()),
553                    )
554                })?;
555            let codec = tonic_prost::ProstCodec::default();
556            let path = http::uri::PathAndQuery::from_static(
557                "/danube.ProducerService/SendMessage",
558            );
559            let mut req = request.into_request();
560            req.extensions_mut()
561                .insert(GrpcMethod::new("danube.ProducerService", "SendMessage"));
562            self.inner.unary(req, path, codec).await
563        }
564    }
565}
566/// Generated server implementations.
567pub mod producer_service_server {
568    #![allow(
569        unused_variables,
570        dead_code,
571        missing_docs,
572        clippy::wildcard_imports,
573        clippy::let_unit_value,
574    )]
575    use tonic::codegen::*;
576    /// Generated trait containing gRPC methods that should be implemented for use with ProducerServiceServer.
577    #[async_trait]
578    pub trait ProducerService: std::marker::Send + std::marker::Sync + 'static {
579        /// Creates a new Producer on a topic
580        async fn create_producer(
581            &self,
582            request: tonic::Request<super::ProducerRequest>,
583        ) -> std::result::Result<
584            tonic::Response<super::ProducerResponse>,
585            tonic::Status,
586        >;
587        /// Sends a message from the Producer
588        async fn send_message(
589            &self,
590            request: tonic::Request<super::StreamMessage>,
591        ) -> std::result::Result<tonic::Response<super::MessageResponse>, tonic::Status>;
592    }
593    #[derive(Debug)]
594    pub struct ProducerServiceServer<T> {
595        inner: Arc<T>,
596        accept_compression_encodings: EnabledCompressionEncodings,
597        send_compression_encodings: EnabledCompressionEncodings,
598        max_decoding_message_size: Option<usize>,
599        max_encoding_message_size: Option<usize>,
600    }
601    impl<T> ProducerServiceServer<T> {
602        pub fn new(inner: T) -> Self {
603            Self::from_arc(Arc::new(inner))
604        }
605        pub fn from_arc(inner: Arc<T>) -> Self {
606            Self {
607                inner,
608                accept_compression_encodings: Default::default(),
609                send_compression_encodings: Default::default(),
610                max_decoding_message_size: None,
611                max_encoding_message_size: None,
612            }
613        }
614        pub fn with_interceptor<F>(
615            inner: T,
616            interceptor: F,
617        ) -> InterceptedService<Self, F>
618        where
619            F: tonic::service::Interceptor,
620        {
621            InterceptedService::new(Self::new(inner), interceptor)
622        }
623        /// Enable decompressing requests with the given encoding.
624        #[must_use]
625        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
626            self.accept_compression_encodings.enable(encoding);
627            self
628        }
629        /// Compress responses with the given encoding, if the client supports it.
630        #[must_use]
631        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
632            self.send_compression_encodings.enable(encoding);
633            self
634        }
635        /// Limits the maximum size of a decoded message.
636        ///
637        /// Default: `4MB`
638        #[must_use]
639        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
640            self.max_decoding_message_size = Some(limit);
641            self
642        }
643        /// Limits the maximum size of an encoded message.
644        ///
645        /// Default: `usize::MAX`
646        #[must_use]
647        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
648            self.max_encoding_message_size = Some(limit);
649            self
650        }
651    }
652    impl<T, B> tonic::codegen::Service<http::Request<B>> for ProducerServiceServer<T>
653    where
654        T: ProducerService,
655        B: Body + std::marker::Send + 'static,
656        B::Error: Into<StdError> + std::marker::Send + 'static,
657    {
658        type Response = http::Response<tonic::body::Body>;
659        type Error = std::convert::Infallible;
660        type Future = BoxFuture<Self::Response, Self::Error>;
661        fn poll_ready(
662            &mut self,
663            _cx: &mut Context<'_>,
664        ) -> Poll<std::result::Result<(), Self::Error>> {
665            Poll::Ready(Ok(()))
666        }
667        fn call(&mut self, req: http::Request<B>) -> Self::Future {
668            match req.uri().path() {
669                "/danube.ProducerService/CreateProducer" => {
670                    #[allow(non_camel_case_types)]
671                    struct CreateProducerSvc<T: ProducerService>(pub Arc<T>);
672                    impl<
673                        T: ProducerService,
674                    > tonic::server::UnaryService<super::ProducerRequest>
675                    for CreateProducerSvc<T> {
676                        type Response = super::ProducerResponse;
677                        type Future = BoxFuture<
678                            tonic::Response<Self::Response>,
679                            tonic::Status,
680                        >;
681                        fn call(
682                            &mut self,
683                            request: tonic::Request<super::ProducerRequest>,
684                        ) -> Self::Future {
685                            let inner = Arc::clone(&self.0);
686                            let fut = async move {
687                                <T as ProducerService>::create_producer(&inner, request)
688                                    .await
689                            };
690                            Box::pin(fut)
691                        }
692                    }
693                    let accept_compression_encodings = self.accept_compression_encodings;
694                    let send_compression_encodings = self.send_compression_encodings;
695                    let max_decoding_message_size = self.max_decoding_message_size;
696                    let max_encoding_message_size = self.max_encoding_message_size;
697                    let inner = self.inner.clone();
698                    let fut = async move {
699                        let method = CreateProducerSvc(inner);
700                        let codec = tonic_prost::ProstCodec::default();
701                        let mut grpc = tonic::server::Grpc::new(codec)
702                            .apply_compression_config(
703                                accept_compression_encodings,
704                                send_compression_encodings,
705                            )
706                            .apply_max_message_size_config(
707                                max_decoding_message_size,
708                                max_encoding_message_size,
709                            );
710                        let res = grpc.unary(method, req).await;
711                        Ok(res)
712                    };
713                    Box::pin(fut)
714                }
715                "/danube.ProducerService/SendMessage" => {
716                    #[allow(non_camel_case_types)]
717                    struct SendMessageSvc<T: ProducerService>(pub Arc<T>);
718                    impl<
719                        T: ProducerService,
720                    > tonic::server::UnaryService<super::StreamMessage>
721                    for SendMessageSvc<T> {
722                        type Response = super::MessageResponse;
723                        type Future = BoxFuture<
724                            tonic::Response<Self::Response>,
725                            tonic::Status,
726                        >;
727                        fn call(
728                            &mut self,
729                            request: tonic::Request<super::StreamMessage>,
730                        ) -> Self::Future {
731                            let inner = Arc::clone(&self.0);
732                            let fut = async move {
733                                <T as ProducerService>::send_message(&inner, request).await
734                            };
735                            Box::pin(fut)
736                        }
737                    }
738                    let accept_compression_encodings = self.accept_compression_encodings;
739                    let send_compression_encodings = self.send_compression_encodings;
740                    let max_decoding_message_size = self.max_decoding_message_size;
741                    let max_encoding_message_size = self.max_encoding_message_size;
742                    let inner = self.inner.clone();
743                    let fut = async move {
744                        let method = SendMessageSvc(inner);
745                        let codec = tonic_prost::ProstCodec::default();
746                        let mut grpc = tonic::server::Grpc::new(codec)
747                            .apply_compression_config(
748                                accept_compression_encodings,
749                                send_compression_encodings,
750                            )
751                            .apply_max_message_size_config(
752                                max_decoding_message_size,
753                                max_encoding_message_size,
754                            );
755                        let res = grpc.unary(method, req).await;
756                        Ok(res)
757                    };
758                    Box::pin(fut)
759                }
760                _ => {
761                    Box::pin(async move {
762                        let mut response = http::Response::new(
763                            tonic::body::Body::default(),
764                        );
765                        let headers = response.headers_mut();
766                        headers
767                            .insert(
768                                tonic::Status::GRPC_STATUS,
769                                (tonic::Code::Unimplemented as i32).into(),
770                            );
771                        headers
772                            .insert(
773                                http::header::CONTENT_TYPE,
774                                tonic::metadata::GRPC_CONTENT_TYPE,
775                            );
776                        Ok(response)
777                    })
778                }
779            }
780        }
781    }
782    impl<T> Clone for ProducerServiceServer<T> {
783        fn clone(&self) -> Self {
784            let inner = self.inner.clone();
785            Self {
786                inner,
787                accept_compression_encodings: self.accept_compression_encodings,
788                send_compression_encodings: self.send_compression_encodings,
789                max_decoding_message_size: self.max_decoding_message_size,
790                max_encoding_message_size: self.max_encoding_message_size,
791            }
792        }
793    }
794    /// Generated gRPC service name
795    pub const SERVICE_NAME: &str = "danube.ProducerService";
796    impl<T> tonic::server::NamedService for ProducerServiceServer<T> {
797        const NAME: &'static str = SERVICE_NAME;
798    }
799}
800/// Generated client implementations.
801pub mod consumer_service_client {
802    #![allow(
803        unused_variables,
804        dead_code,
805        missing_docs,
806        clippy::wildcard_imports,
807        clippy::let_unit_value,
808    )]
809    use tonic::codegen::*;
810    use tonic::codegen::http::Uri;
811    #[derive(Debug, Clone)]
812    pub struct ConsumerServiceClient<T> {
813        inner: tonic::client::Grpc<T>,
814    }
815    impl ConsumerServiceClient<tonic::transport::Channel> {
816        /// Attempt to create a new client by connecting to a given endpoint.
817        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
818        where
819            D: TryInto<tonic::transport::Endpoint>,
820            D::Error: Into<StdError>,
821        {
822            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
823            Ok(Self::new(conn))
824        }
825    }
826    impl<T> ConsumerServiceClient<T>
827    where
828        T: tonic::client::GrpcService<tonic::body::Body>,
829        T::Error: Into<StdError>,
830        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
831        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
832    {
833        pub fn new(inner: T) -> Self {
834            let inner = tonic::client::Grpc::new(inner);
835            Self { inner }
836        }
837        pub fn with_origin(inner: T, origin: Uri) -> Self {
838            let inner = tonic::client::Grpc::with_origin(inner, origin);
839            Self { inner }
840        }
841        pub fn with_interceptor<F>(
842            inner: T,
843            interceptor: F,
844        ) -> ConsumerServiceClient<InterceptedService<T, F>>
845        where
846            F: tonic::service::Interceptor,
847            T::ResponseBody: Default,
848            T: tonic::codegen::Service<
849                http::Request<tonic::body::Body>,
850                Response = http::Response<
851                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
852                >,
853            >,
854            <T as tonic::codegen::Service<
855                http::Request<tonic::body::Body>,
856            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
857        {
858            ConsumerServiceClient::new(InterceptedService::new(inner, interceptor))
859        }
860        /// Compress requests with the given encoding.
861        ///
862        /// This requires the server to support it otherwise it might respond with an
863        /// error.
864        #[must_use]
865        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
866            self.inner = self.inner.send_compressed(encoding);
867            self
868        }
869        /// Enable decompressing responses.
870        #[must_use]
871        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
872            self.inner = self.inner.accept_compressed(encoding);
873            self
874        }
875        /// Limits the maximum size of a decoded message.
876        ///
877        /// Default: `4MB`
878        #[must_use]
879        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
880            self.inner = self.inner.max_decoding_message_size(limit);
881            self
882        }
883        /// Limits the maximum size of an encoded message.
884        ///
885        /// Default: `usize::MAX`
886        #[must_use]
887        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
888            self.inner = self.inner.max_encoding_message_size(limit);
889            self
890        }
891        /// Creates a new Subscriber
892        pub async fn subscribe(
893            &mut self,
894            request: impl tonic::IntoRequest<super::ConsumerRequest>,
895        ) -> std::result::Result<
896            tonic::Response<super::ConsumerResponse>,
897            tonic::Status,
898        > {
899            self.inner
900                .ready()
901                .await
902                .map_err(|e| {
903                    tonic::Status::unknown(
904                        format!("Service was not ready: {}", e.into()),
905                    )
906                })?;
907            let codec = tonic_prost::ProstCodec::default();
908            let path = http::uri::PathAndQuery::from_static(
909                "/danube.ConsumerService/Subscribe",
910            );
911            let mut req = request.into_request();
912            req.extensions_mut()
913                .insert(GrpcMethod::new("danube.ConsumerService", "Subscribe"));
914            self.inner.unary(req, path, codec).await
915        }
916        /// Streaming messages to the Subscriber
917        pub async fn receive_messages(
918            &mut self,
919            request: impl tonic::IntoRequest<super::ReceiveRequest>,
920        ) -> std::result::Result<
921            tonic::Response<tonic::codec::Streaming<super::StreamMessage>>,
922            tonic::Status,
923        > {
924            self.inner
925                .ready()
926                .await
927                .map_err(|e| {
928                    tonic::Status::unknown(
929                        format!("Service was not ready: {}", e.into()),
930                    )
931                })?;
932            let codec = tonic_prost::ProstCodec::default();
933            let path = http::uri::PathAndQuery::from_static(
934                "/danube.ConsumerService/ReceiveMessages",
935            );
936            let mut req = request.into_request();
937            req.extensions_mut()
938                .insert(GrpcMethod::new("danube.ConsumerService", "ReceiveMessages"));
939            self.inner.server_streaming(req, path, codec).await
940        }
941        /// Acknowledges receipt of a message from the Consumer
942        pub async fn ack(
943            &mut self,
944            request: impl tonic::IntoRequest<super::AckRequest>,
945        ) -> std::result::Result<tonic::Response<super::AckResponse>, tonic::Status> {
946            self.inner
947                .ready()
948                .await
949                .map_err(|e| {
950                    tonic::Status::unknown(
951                        format!("Service was not ready: {}", e.into()),
952                    )
953                })?;
954            let codec = tonic_prost::ProstCodec::default();
955            let path = http::uri::PathAndQuery::from_static(
956                "/danube.ConsumerService/Ack",
957            );
958            let mut req = request.into_request();
959            req.extensions_mut()
960                .insert(GrpcMethod::new("danube.ConsumerService", "Ack"));
961            self.inner.unary(req, path, codec).await
962        }
963    }
964}
965/// Generated server implementations.
966pub mod consumer_service_server {
967    #![allow(
968        unused_variables,
969        dead_code,
970        missing_docs,
971        clippy::wildcard_imports,
972        clippy::let_unit_value,
973    )]
974    use tonic::codegen::*;
975    /// Generated trait containing gRPC methods that should be implemented for use with ConsumerServiceServer.
976    #[async_trait]
977    pub trait ConsumerService: std::marker::Send + std::marker::Sync + 'static {
978        /// Creates a new Subscriber
979        async fn subscribe(
980            &self,
981            request: tonic::Request<super::ConsumerRequest>,
982        ) -> std::result::Result<
983            tonic::Response<super::ConsumerResponse>,
984            tonic::Status,
985        >;
986        /// Server streaming response type for the ReceiveMessages method.
987        type ReceiveMessagesStream: tonic::codegen::tokio_stream::Stream<
988                Item = std::result::Result<super::StreamMessage, tonic::Status>,
989            >
990            + std::marker::Send
991            + 'static;
992        /// Streaming messages to the Subscriber
993        async fn receive_messages(
994            &self,
995            request: tonic::Request<super::ReceiveRequest>,
996        ) -> std::result::Result<
997            tonic::Response<Self::ReceiveMessagesStream>,
998            tonic::Status,
999        >;
1000        /// Acknowledges receipt of a message from the Consumer
1001        async fn ack(
1002            &self,
1003            request: tonic::Request<super::AckRequest>,
1004        ) -> std::result::Result<tonic::Response<super::AckResponse>, tonic::Status>;
1005    }
1006    #[derive(Debug)]
1007    pub struct ConsumerServiceServer<T> {
1008        inner: Arc<T>,
1009        accept_compression_encodings: EnabledCompressionEncodings,
1010        send_compression_encodings: EnabledCompressionEncodings,
1011        max_decoding_message_size: Option<usize>,
1012        max_encoding_message_size: Option<usize>,
1013    }
1014    impl<T> ConsumerServiceServer<T> {
1015        pub fn new(inner: T) -> Self {
1016            Self::from_arc(Arc::new(inner))
1017        }
1018        pub fn from_arc(inner: Arc<T>) -> Self {
1019            Self {
1020                inner,
1021                accept_compression_encodings: Default::default(),
1022                send_compression_encodings: Default::default(),
1023                max_decoding_message_size: None,
1024                max_encoding_message_size: None,
1025            }
1026        }
1027        pub fn with_interceptor<F>(
1028            inner: T,
1029            interceptor: F,
1030        ) -> InterceptedService<Self, F>
1031        where
1032            F: tonic::service::Interceptor,
1033        {
1034            InterceptedService::new(Self::new(inner), interceptor)
1035        }
1036        /// Enable decompressing requests with the given encoding.
1037        #[must_use]
1038        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1039            self.accept_compression_encodings.enable(encoding);
1040            self
1041        }
1042        /// Compress responses with the given encoding, if the client supports it.
1043        #[must_use]
1044        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1045            self.send_compression_encodings.enable(encoding);
1046            self
1047        }
1048        /// Limits the maximum size of a decoded message.
1049        ///
1050        /// Default: `4MB`
1051        #[must_use]
1052        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1053            self.max_decoding_message_size = Some(limit);
1054            self
1055        }
1056        /// Limits the maximum size of an encoded message.
1057        ///
1058        /// Default: `usize::MAX`
1059        #[must_use]
1060        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1061            self.max_encoding_message_size = Some(limit);
1062            self
1063        }
1064    }
1065    impl<T, B> tonic::codegen::Service<http::Request<B>> for ConsumerServiceServer<T>
1066    where
1067        T: ConsumerService,
1068        B: Body + std::marker::Send + 'static,
1069        B::Error: Into<StdError> + std::marker::Send + 'static,
1070    {
1071        type Response = http::Response<tonic::body::Body>;
1072        type Error = std::convert::Infallible;
1073        type Future = BoxFuture<Self::Response, Self::Error>;
1074        fn poll_ready(
1075            &mut self,
1076            _cx: &mut Context<'_>,
1077        ) -> Poll<std::result::Result<(), Self::Error>> {
1078            Poll::Ready(Ok(()))
1079        }
1080        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1081            match req.uri().path() {
1082                "/danube.ConsumerService/Subscribe" => {
1083                    #[allow(non_camel_case_types)]
1084                    struct SubscribeSvc<T: ConsumerService>(pub Arc<T>);
1085                    impl<
1086                        T: ConsumerService,
1087                    > tonic::server::UnaryService<super::ConsumerRequest>
1088                    for SubscribeSvc<T> {
1089                        type Response = super::ConsumerResponse;
1090                        type Future = BoxFuture<
1091                            tonic::Response<Self::Response>,
1092                            tonic::Status,
1093                        >;
1094                        fn call(
1095                            &mut self,
1096                            request: tonic::Request<super::ConsumerRequest>,
1097                        ) -> Self::Future {
1098                            let inner = Arc::clone(&self.0);
1099                            let fut = async move {
1100                                <T as ConsumerService>::subscribe(&inner, request).await
1101                            };
1102                            Box::pin(fut)
1103                        }
1104                    }
1105                    let accept_compression_encodings = self.accept_compression_encodings;
1106                    let send_compression_encodings = self.send_compression_encodings;
1107                    let max_decoding_message_size = self.max_decoding_message_size;
1108                    let max_encoding_message_size = self.max_encoding_message_size;
1109                    let inner = self.inner.clone();
1110                    let fut = async move {
1111                        let method = SubscribeSvc(inner);
1112                        let codec = tonic_prost::ProstCodec::default();
1113                        let mut grpc = tonic::server::Grpc::new(codec)
1114                            .apply_compression_config(
1115                                accept_compression_encodings,
1116                                send_compression_encodings,
1117                            )
1118                            .apply_max_message_size_config(
1119                                max_decoding_message_size,
1120                                max_encoding_message_size,
1121                            );
1122                        let res = grpc.unary(method, req).await;
1123                        Ok(res)
1124                    };
1125                    Box::pin(fut)
1126                }
1127                "/danube.ConsumerService/ReceiveMessages" => {
1128                    #[allow(non_camel_case_types)]
1129                    struct ReceiveMessagesSvc<T: ConsumerService>(pub Arc<T>);
1130                    impl<
1131                        T: ConsumerService,
1132                    > tonic::server::ServerStreamingService<super::ReceiveRequest>
1133                    for ReceiveMessagesSvc<T> {
1134                        type Response = super::StreamMessage;
1135                        type ResponseStream = T::ReceiveMessagesStream;
1136                        type Future = BoxFuture<
1137                            tonic::Response<Self::ResponseStream>,
1138                            tonic::Status,
1139                        >;
1140                        fn call(
1141                            &mut self,
1142                            request: tonic::Request<super::ReceiveRequest>,
1143                        ) -> Self::Future {
1144                            let inner = Arc::clone(&self.0);
1145                            let fut = async move {
1146                                <T as ConsumerService>::receive_messages(&inner, request)
1147                                    .await
1148                            };
1149                            Box::pin(fut)
1150                        }
1151                    }
1152                    let accept_compression_encodings = self.accept_compression_encodings;
1153                    let send_compression_encodings = self.send_compression_encodings;
1154                    let max_decoding_message_size = self.max_decoding_message_size;
1155                    let max_encoding_message_size = self.max_encoding_message_size;
1156                    let inner = self.inner.clone();
1157                    let fut = async move {
1158                        let method = ReceiveMessagesSvc(inner);
1159                        let codec = tonic_prost::ProstCodec::default();
1160                        let mut grpc = tonic::server::Grpc::new(codec)
1161                            .apply_compression_config(
1162                                accept_compression_encodings,
1163                                send_compression_encodings,
1164                            )
1165                            .apply_max_message_size_config(
1166                                max_decoding_message_size,
1167                                max_encoding_message_size,
1168                            );
1169                        let res = grpc.server_streaming(method, req).await;
1170                        Ok(res)
1171                    };
1172                    Box::pin(fut)
1173                }
1174                "/danube.ConsumerService/Ack" => {
1175                    #[allow(non_camel_case_types)]
1176                    struct AckSvc<T: ConsumerService>(pub Arc<T>);
1177                    impl<
1178                        T: ConsumerService,
1179                    > tonic::server::UnaryService<super::AckRequest> for AckSvc<T> {
1180                        type Response = super::AckResponse;
1181                        type Future = BoxFuture<
1182                            tonic::Response<Self::Response>,
1183                            tonic::Status,
1184                        >;
1185                        fn call(
1186                            &mut self,
1187                            request: tonic::Request<super::AckRequest>,
1188                        ) -> Self::Future {
1189                            let inner = Arc::clone(&self.0);
1190                            let fut = async move {
1191                                <T as ConsumerService>::ack(&inner, request).await
1192                            };
1193                            Box::pin(fut)
1194                        }
1195                    }
1196                    let accept_compression_encodings = self.accept_compression_encodings;
1197                    let send_compression_encodings = self.send_compression_encodings;
1198                    let max_decoding_message_size = self.max_decoding_message_size;
1199                    let max_encoding_message_size = self.max_encoding_message_size;
1200                    let inner = self.inner.clone();
1201                    let fut = async move {
1202                        let method = AckSvc(inner);
1203                        let codec = tonic_prost::ProstCodec::default();
1204                        let mut grpc = tonic::server::Grpc::new(codec)
1205                            .apply_compression_config(
1206                                accept_compression_encodings,
1207                                send_compression_encodings,
1208                            )
1209                            .apply_max_message_size_config(
1210                                max_decoding_message_size,
1211                                max_encoding_message_size,
1212                            );
1213                        let res = grpc.unary(method, req).await;
1214                        Ok(res)
1215                    };
1216                    Box::pin(fut)
1217                }
1218                _ => {
1219                    Box::pin(async move {
1220                        let mut response = http::Response::new(
1221                            tonic::body::Body::default(),
1222                        );
1223                        let headers = response.headers_mut();
1224                        headers
1225                            .insert(
1226                                tonic::Status::GRPC_STATUS,
1227                                (tonic::Code::Unimplemented as i32).into(),
1228                            );
1229                        headers
1230                            .insert(
1231                                http::header::CONTENT_TYPE,
1232                                tonic::metadata::GRPC_CONTENT_TYPE,
1233                            );
1234                        Ok(response)
1235                    })
1236                }
1237            }
1238        }
1239    }
1240    impl<T> Clone for ConsumerServiceServer<T> {
1241        fn clone(&self) -> Self {
1242            let inner = self.inner.clone();
1243            Self {
1244                inner,
1245                accept_compression_encodings: self.accept_compression_encodings,
1246                send_compression_encodings: self.send_compression_encodings,
1247                max_decoding_message_size: self.max_decoding_message_size,
1248                max_encoding_message_size: self.max_encoding_message_size,
1249            }
1250        }
1251    }
1252    /// Generated gRPC service name
1253    pub const SERVICE_NAME: &str = "danube.ConsumerService";
1254    impl<T> tonic::server::NamedService for ConsumerServiceServer<T> {
1255        const NAME: &'static str = SERVICE_NAME;
1256    }
1257}
1258/// Generated client implementations.
1259pub mod discovery_client {
1260    #![allow(
1261        unused_variables,
1262        dead_code,
1263        missing_docs,
1264        clippy::wildcard_imports,
1265        clippy::let_unit_value,
1266    )]
1267    use tonic::codegen::*;
1268    use tonic::codegen::http::Uri;
1269    #[derive(Debug, Clone)]
1270    pub struct DiscoveryClient<T> {
1271        inner: tonic::client::Grpc<T>,
1272    }
1273    impl DiscoveryClient<tonic::transport::Channel> {
1274        /// Attempt to create a new client by connecting to a given endpoint.
1275        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1276        where
1277            D: TryInto<tonic::transport::Endpoint>,
1278            D::Error: Into<StdError>,
1279        {
1280            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1281            Ok(Self::new(conn))
1282        }
1283    }
1284    impl<T> DiscoveryClient<T>
1285    where
1286        T: tonic::client::GrpcService<tonic::body::Body>,
1287        T::Error: Into<StdError>,
1288        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1289        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1290    {
1291        pub fn new(inner: T) -> Self {
1292            let inner = tonic::client::Grpc::new(inner);
1293            Self { inner }
1294        }
1295        pub fn with_origin(inner: T, origin: Uri) -> Self {
1296            let inner = tonic::client::Grpc::with_origin(inner, origin);
1297            Self { inner }
1298        }
1299        pub fn with_interceptor<F>(
1300            inner: T,
1301            interceptor: F,
1302        ) -> DiscoveryClient<InterceptedService<T, F>>
1303        where
1304            F: tonic::service::Interceptor,
1305            T::ResponseBody: Default,
1306            T: tonic::codegen::Service<
1307                http::Request<tonic::body::Body>,
1308                Response = http::Response<
1309                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1310                >,
1311            >,
1312            <T as tonic::codegen::Service<
1313                http::Request<tonic::body::Body>,
1314            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1315        {
1316            DiscoveryClient::new(InterceptedService::new(inner, interceptor))
1317        }
1318        /// Compress requests with the given encoding.
1319        ///
1320        /// This requires the server to support it otherwise it might respond with an
1321        /// error.
1322        #[must_use]
1323        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1324            self.inner = self.inner.send_compressed(encoding);
1325            self
1326        }
1327        /// Enable decompressing responses.
1328        #[must_use]
1329        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1330            self.inner = self.inner.accept_compressed(encoding);
1331            self
1332        }
1333        /// Limits the maximum size of a decoded message.
1334        ///
1335        /// Default: `4MB`
1336        #[must_use]
1337        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1338            self.inner = self.inner.max_decoding_message_size(limit);
1339            self
1340        }
1341        /// Limits the maximum size of an encoded message.
1342        ///
1343        /// Default: `usize::MAX`
1344        #[must_use]
1345        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1346            self.inner = self.inner.max_encoding_message_size(limit);
1347            self
1348        }
1349        /// Query the Danube broker for information about a specific topic.
1350        /// returns metadata about the topic, including the broker(s) responsible for it.
1351        pub async fn topic_lookup(
1352            &mut self,
1353            request: impl tonic::IntoRequest<super::TopicLookupRequest>,
1354        ) -> std::result::Result<
1355            tonic::Response<super::TopicLookupResponse>,
1356            tonic::Status,
1357        > {
1358            self.inner
1359                .ready()
1360                .await
1361                .map_err(|e| {
1362                    tonic::Status::unknown(
1363                        format!("Service was not ready: {}", e.into()),
1364                    )
1365                })?;
1366            let codec = tonic_prost::ProstCodec::default();
1367            let path = http::uri::PathAndQuery::from_static(
1368                "/danube.Discovery/TopicLookup",
1369            );
1370            let mut req = request.into_request();
1371            req.extensions_mut()
1372                .insert(GrpcMethod::new("danube.Discovery", "TopicLookup"));
1373            self.inner.unary(req, path, codec).await
1374        }
1375        /// Query the Danube broker for information about topic partitions.
1376        /// returns an array with the topic partitions names
1377        pub async fn topic_partitions(
1378            &mut self,
1379            request: impl tonic::IntoRequest<super::TopicLookupRequest>,
1380        ) -> std::result::Result<
1381            tonic::Response<super::TopicPartitionsResponse>,
1382            tonic::Status,
1383        > {
1384            self.inner
1385                .ready()
1386                .await
1387                .map_err(|e| {
1388                    tonic::Status::unknown(
1389                        format!("Service was not ready: {}", e.into()),
1390                    )
1391                })?;
1392            let codec = tonic_prost::ProstCodec::default();
1393            let path = http::uri::PathAndQuery::from_static(
1394                "/danube.Discovery/TopicPartitions",
1395            );
1396            let mut req = request.into_request();
1397            req.extensions_mut()
1398                .insert(GrpcMethod::new("danube.Discovery", "TopicPartitions"));
1399            self.inner.unary(req, path, codec).await
1400        }
1401    }
1402}
1403/// Generated server implementations.
1404pub mod discovery_server {
1405    #![allow(
1406        unused_variables,
1407        dead_code,
1408        missing_docs,
1409        clippy::wildcard_imports,
1410        clippy::let_unit_value,
1411    )]
1412    use tonic::codegen::*;
1413    /// Generated trait containing gRPC methods that should be implemented for use with DiscoveryServer.
1414    #[async_trait]
1415    pub trait Discovery: std::marker::Send + std::marker::Sync + 'static {
1416        /// Query the Danube broker for information about a specific topic.
1417        /// returns metadata about the topic, including the broker(s) responsible for it.
1418        async fn topic_lookup(
1419            &self,
1420            request: tonic::Request<super::TopicLookupRequest>,
1421        ) -> std::result::Result<
1422            tonic::Response<super::TopicLookupResponse>,
1423            tonic::Status,
1424        >;
1425        /// Query the Danube broker for information about topic partitions.
1426        /// returns an array with the topic partitions names
1427        async fn topic_partitions(
1428            &self,
1429            request: tonic::Request<super::TopicLookupRequest>,
1430        ) -> std::result::Result<
1431            tonic::Response<super::TopicPartitionsResponse>,
1432            tonic::Status,
1433        >;
1434    }
1435    #[derive(Debug)]
1436    pub struct DiscoveryServer<T> {
1437        inner: Arc<T>,
1438        accept_compression_encodings: EnabledCompressionEncodings,
1439        send_compression_encodings: EnabledCompressionEncodings,
1440        max_decoding_message_size: Option<usize>,
1441        max_encoding_message_size: Option<usize>,
1442    }
1443    impl<T> DiscoveryServer<T> {
1444        pub fn new(inner: T) -> Self {
1445            Self::from_arc(Arc::new(inner))
1446        }
1447        pub fn from_arc(inner: Arc<T>) -> Self {
1448            Self {
1449                inner,
1450                accept_compression_encodings: Default::default(),
1451                send_compression_encodings: Default::default(),
1452                max_decoding_message_size: None,
1453                max_encoding_message_size: None,
1454            }
1455        }
1456        pub fn with_interceptor<F>(
1457            inner: T,
1458            interceptor: F,
1459        ) -> InterceptedService<Self, F>
1460        where
1461            F: tonic::service::Interceptor,
1462        {
1463            InterceptedService::new(Self::new(inner), interceptor)
1464        }
1465        /// Enable decompressing requests with the given encoding.
1466        #[must_use]
1467        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1468            self.accept_compression_encodings.enable(encoding);
1469            self
1470        }
1471        /// Compress responses with the given encoding, if the client supports it.
1472        #[must_use]
1473        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1474            self.send_compression_encodings.enable(encoding);
1475            self
1476        }
1477        /// Limits the maximum size of a decoded message.
1478        ///
1479        /// Default: `4MB`
1480        #[must_use]
1481        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1482            self.max_decoding_message_size = Some(limit);
1483            self
1484        }
1485        /// Limits the maximum size of an encoded message.
1486        ///
1487        /// Default: `usize::MAX`
1488        #[must_use]
1489        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1490            self.max_encoding_message_size = Some(limit);
1491            self
1492        }
1493    }
1494    impl<T, B> tonic::codegen::Service<http::Request<B>> for DiscoveryServer<T>
1495    where
1496        T: Discovery,
1497        B: Body + std::marker::Send + 'static,
1498        B::Error: Into<StdError> + std::marker::Send + 'static,
1499    {
1500        type Response = http::Response<tonic::body::Body>;
1501        type Error = std::convert::Infallible;
1502        type Future = BoxFuture<Self::Response, Self::Error>;
1503        fn poll_ready(
1504            &mut self,
1505            _cx: &mut Context<'_>,
1506        ) -> Poll<std::result::Result<(), Self::Error>> {
1507            Poll::Ready(Ok(()))
1508        }
1509        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1510            match req.uri().path() {
1511                "/danube.Discovery/TopicLookup" => {
1512                    #[allow(non_camel_case_types)]
1513                    struct TopicLookupSvc<T: Discovery>(pub Arc<T>);
1514                    impl<
1515                        T: Discovery,
1516                    > tonic::server::UnaryService<super::TopicLookupRequest>
1517                    for TopicLookupSvc<T> {
1518                        type Response = super::TopicLookupResponse;
1519                        type Future = BoxFuture<
1520                            tonic::Response<Self::Response>,
1521                            tonic::Status,
1522                        >;
1523                        fn call(
1524                            &mut self,
1525                            request: tonic::Request<super::TopicLookupRequest>,
1526                        ) -> Self::Future {
1527                            let inner = Arc::clone(&self.0);
1528                            let fut = async move {
1529                                <T as Discovery>::topic_lookup(&inner, request).await
1530                            };
1531                            Box::pin(fut)
1532                        }
1533                    }
1534                    let accept_compression_encodings = self.accept_compression_encodings;
1535                    let send_compression_encodings = self.send_compression_encodings;
1536                    let max_decoding_message_size = self.max_decoding_message_size;
1537                    let max_encoding_message_size = self.max_encoding_message_size;
1538                    let inner = self.inner.clone();
1539                    let fut = async move {
1540                        let method = TopicLookupSvc(inner);
1541                        let codec = tonic_prost::ProstCodec::default();
1542                        let mut grpc = tonic::server::Grpc::new(codec)
1543                            .apply_compression_config(
1544                                accept_compression_encodings,
1545                                send_compression_encodings,
1546                            )
1547                            .apply_max_message_size_config(
1548                                max_decoding_message_size,
1549                                max_encoding_message_size,
1550                            );
1551                        let res = grpc.unary(method, req).await;
1552                        Ok(res)
1553                    };
1554                    Box::pin(fut)
1555                }
1556                "/danube.Discovery/TopicPartitions" => {
1557                    #[allow(non_camel_case_types)]
1558                    struct TopicPartitionsSvc<T: Discovery>(pub Arc<T>);
1559                    impl<
1560                        T: Discovery,
1561                    > tonic::server::UnaryService<super::TopicLookupRequest>
1562                    for TopicPartitionsSvc<T> {
1563                        type Response = super::TopicPartitionsResponse;
1564                        type Future = BoxFuture<
1565                            tonic::Response<Self::Response>,
1566                            tonic::Status,
1567                        >;
1568                        fn call(
1569                            &mut self,
1570                            request: tonic::Request<super::TopicLookupRequest>,
1571                        ) -> Self::Future {
1572                            let inner = Arc::clone(&self.0);
1573                            let fut = async move {
1574                                <T as Discovery>::topic_partitions(&inner, request).await
1575                            };
1576                            Box::pin(fut)
1577                        }
1578                    }
1579                    let accept_compression_encodings = self.accept_compression_encodings;
1580                    let send_compression_encodings = self.send_compression_encodings;
1581                    let max_decoding_message_size = self.max_decoding_message_size;
1582                    let max_encoding_message_size = self.max_encoding_message_size;
1583                    let inner = self.inner.clone();
1584                    let fut = async move {
1585                        let method = TopicPartitionsSvc(inner);
1586                        let codec = tonic_prost::ProstCodec::default();
1587                        let mut grpc = tonic::server::Grpc::new(codec)
1588                            .apply_compression_config(
1589                                accept_compression_encodings,
1590                                send_compression_encodings,
1591                            )
1592                            .apply_max_message_size_config(
1593                                max_decoding_message_size,
1594                                max_encoding_message_size,
1595                            );
1596                        let res = grpc.unary(method, req).await;
1597                        Ok(res)
1598                    };
1599                    Box::pin(fut)
1600                }
1601                _ => {
1602                    Box::pin(async move {
1603                        let mut response = http::Response::new(
1604                            tonic::body::Body::default(),
1605                        );
1606                        let headers = response.headers_mut();
1607                        headers
1608                            .insert(
1609                                tonic::Status::GRPC_STATUS,
1610                                (tonic::Code::Unimplemented as i32).into(),
1611                            );
1612                        headers
1613                            .insert(
1614                                http::header::CONTENT_TYPE,
1615                                tonic::metadata::GRPC_CONTENT_TYPE,
1616                            );
1617                        Ok(response)
1618                    })
1619                }
1620            }
1621        }
1622    }
1623    impl<T> Clone for DiscoveryServer<T> {
1624        fn clone(&self) -> Self {
1625            let inner = self.inner.clone();
1626            Self {
1627                inner,
1628                accept_compression_encodings: self.accept_compression_encodings,
1629                send_compression_encodings: self.send_compression_encodings,
1630                max_decoding_message_size: self.max_decoding_message_size,
1631                max_encoding_message_size: self.max_encoding_message_size,
1632            }
1633        }
1634    }
1635    /// Generated gRPC service name
1636    pub const SERVICE_NAME: &str = "danube.Discovery";
1637    impl<T> tonic::server::NamedService for DiscoveryServer<T> {
1638        const NAME: &'static str = SERVICE_NAME;
1639    }
1640}
1641/// Generated client implementations.
1642pub mod health_check_client {
1643    #![allow(
1644        unused_variables,
1645        dead_code,
1646        missing_docs,
1647        clippy::wildcard_imports,
1648        clippy::let_unit_value,
1649    )]
1650    use tonic::codegen::*;
1651    use tonic::codegen::http::Uri;
1652    #[derive(Debug, Clone)]
1653    pub struct HealthCheckClient<T> {
1654        inner: tonic::client::Grpc<T>,
1655    }
1656    impl HealthCheckClient<tonic::transport::Channel> {
1657        /// Attempt to create a new client by connecting to a given endpoint.
1658        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1659        where
1660            D: TryInto<tonic::transport::Endpoint>,
1661            D::Error: Into<StdError>,
1662        {
1663            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1664            Ok(Self::new(conn))
1665        }
1666    }
1667    impl<T> HealthCheckClient<T>
1668    where
1669        T: tonic::client::GrpcService<tonic::body::Body>,
1670        T::Error: Into<StdError>,
1671        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1672        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1673    {
1674        pub fn new(inner: T) -> Self {
1675            let inner = tonic::client::Grpc::new(inner);
1676            Self { inner }
1677        }
1678        pub fn with_origin(inner: T, origin: Uri) -> Self {
1679            let inner = tonic::client::Grpc::with_origin(inner, origin);
1680            Self { inner }
1681        }
1682        pub fn with_interceptor<F>(
1683            inner: T,
1684            interceptor: F,
1685        ) -> HealthCheckClient<InterceptedService<T, F>>
1686        where
1687            F: tonic::service::Interceptor,
1688            T::ResponseBody: Default,
1689            T: tonic::codegen::Service<
1690                http::Request<tonic::body::Body>,
1691                Response = http::Response<
1692                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1693                >,
1694            >,
1695            <T as tonic::codegen::Service<
1696                http::Request<tonic::body::Body>,
1697            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1698        {
1699            HealthCheckClient::new(InterceptedService::new(inner, interceptor))
1700        }
1701        /// Compress requests with the given encoding.
1702        ///
1703        /// This requires the server to support it otherwise it might respond with an
1704        /// error.
1705        #[must_use]
1706        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1707            self.inner = self.inner.send_compressed(encoding);
1708            self
1709        }
1710        /// Enable decompressing responses.
1711        #[must_use]
1712        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1713            self.inner = self.inner.accept_compressed(encoding);
1714            self
1715        }
1716        /// Limits the maximum size of a decoded message.
1717        ///
1718        /// Default: `4MB`
1719        #[must_use]
1720        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1721            self.inner = self.inner.max_decoding_message_size(limit);
1722            self
1723        }
1724        /// Limits the maximum size of an encoded message.
1725        ///
1726        /// Default: `usize::MAX`
1727        #[must_use]
1728        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1729            self.inner = self.inner.max_encoding_message_size(limit);
1730            self
1731        }
1732        pub async fn health_check(
1733            &mut self,
1734            request: impl tonic::IntoRequest<super::HealthCheckRequest>,
1735        ) -> std::result::Result<
1736            tonic::Response<super::HealthCheckResponse>,
1737            tonic::Status,
1738        > {
1739            self.inner
1740                .ready()
1741                .await
1742                .map_err(|e| {
1743                    tonic::Status::unknown(
1744                        format!("Service was not ready: {}", e.into()),
1745                    )
1746                })?;
1747            let codec = tonic_prost::ProstCodec::default();
1748            let path = http::uri::PathAndQuery::from_static(
1749                "/danube.HealthCheck/HealthCheck",
1750            );
1751            let mut req = request.into_request();
1752            req.extensions_mut()
1753                .insert(GrpcMethod::new("danube.HealthCheck", "HealthCheck"));
1754            self.inner.unary(req, path, codec).await
1755        }
1756    }
1757}
1758/// Generated server implementations.
1759pub mod health_check_server {
1760    #![allow(
1761        unused_variables,
1762        dead_code,
1763        missing_docs,
1764        clippy::wildcard_imports,
1765        clippy::let_unit_value,
1766    )]
1767    use tonic::codegen::*;
1768    /// Generated trait containing gRPC methods that should be implemented for use with HealthCheckServer.
1769    #[async_trait]
1770    pub trait HealthCheck: std::marker::Send + std::marker::Sync + 'static {
1771        async fn health_check(
1772            &self,
1773            request: tonic::Request<super::HealthCheckRequest>,
1774        ) -> std::result::Result<
1775            tonic::Response<super::HealthCheckResponse>,
1776            tonic::Status,
1777        >;
1778    }
1779    #[derive(Debug)]
1780    pub struct HealthCheckServer<T> {
1781        inner: Arc<T>,
1782        accept_compression_encodings: EnabledCompressionEncodings,
1783        send_compression_encodings: EnabledCompressionEncodings,
1784        max_decoding_message_size: Option<usize>,
1785        max_encoding_message_size: Option<usize>,
1786    }
1787    impl<T> HealthCheckServer<T> {
1788        pub fn new(inner: T) -> Self {
1789            Self::from_arc(Arc::new(inner))
1790        }
1791        pub fn from_arc(inner: Arc<T>) -> Self {
1792            Self {
1793                inner,
1794                accept_compression_encodings: Default::default(),
1795                send_compression_encodings: Default::default(),
1796                max_decoding_message_size: None,
1797                max_encoding_message_size: None,
1798            }
1799        }
1800        pub fn with_interceptor<F>(
1801            inner: T,
1802            interceptor: F,
1803        ) -> InterceptedService<Self, F>
1804        where
1805            F: tonic::service::Interceptor,
1806        {
1807            InterceptedService::new(Self::new(inner), interceptor)
1808        }
1809        /// Enable decompressing requests with the given encoding.
1810        #[must_use]
1811        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1812            self.accept_compression_encodings.enable(encoding);
1813            self
1814        }
1815        /// Compress responses with the given encoding, if the client supports it.
1816        #[must_use]
1817        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1818            self.send_compression_encodings.enable(encoding);
1819            self
1820        }
1821        /// Limits the maximum size of a decoded message.
1822        ///
1823        /// Default: `4MB`
1824        #[must_use]
1825        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1826            self.max_decoding_message_size = Some(limit);
1827            self
1828        }
1829        /// Limits the maximum size of an encoded message.
1830        ///
1831        /// Default: `usize::MAX`
1832        #[must_use]
1833        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1834            self.max_encoding_message_size = Some(limit);
1835            self
1836        }
1837    }
1838    impl<T, B> tonic::codegen::Service<http::Request<B>> for HealthCheckServer<T>
1839    where
1840        T: HealthCheck,
1841        B: Body + std::marker::Send + 'static,
1842        B::Error: Into<StdError> + std::marker::Send + 'static,
1843    {
1844        type Response = http::Response<tonic::body::Body>;
1845        type Error = std::convert::Infallible;
1846        type Future = BoxFuture<Self::Response, Self::Error>;
1847        fn poll_ready(
1848            &mut self,
1849            _cx: &mut Context<'_>,
1850        ) -> Poll<std::result::Result<(), Self::Error>> {
1851            Poll::Ready(Ok(()))
1852        }
1853        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1854            match req.uri().path() {
1855                "/danube.HealthCheck/HealthCheck" => {
1856                    #[allow(non_camel_case_types)]
1857                    struct HealthCheckSvc<T: HealthCheck>(pub Arc<T>);
1858                    impl<
1859                        T: HealthCheck,
1860                    > tonic::server::UnaryService<super::HealthCheckRequest>
1861                    for HealthCheckSvc<T> {
1862                        type Response = super::HealthCheckResponse;
1863                        type Future = BoxFuture<
1864                            tonic::Response<Self::Response>,
1865                            tonic::Status,
1866                        >;
1867                        fn call(
1868                            &mut self,
1869                            request: tonic::Request<super::HealthCheckRequest>,
1870                        ) -> Self::Future {
1871                            let inner = Arc::clone(&self.0);
1872                            let fut = async move {
1873                                <T as HealthCheck>::health_check(&inner, request).await
1874                            };
1875                            Box::pin(fut)
1876                        }
1877                    }
1878                    let accept_compression_encodings = self.accept_compression_encodings;
1879                    let send_compression_encodings = self.send_compression_encodings;
1880                    let max_decoding_message_size = self.max_decoding_message_size;
1881                    let max_encoding_message_size = self.max_encoding_message_size;
1882                    let inner = self.inner.clone();
1883                    let fut = async move {
1884                        let method = HealthCheckSvc(inner);
1885                        let codec = tonic_prost::ProstCodec::default();
1886                        let mut grpc = tonic::server::Grpc::new(codec)
1887                            .apply_compression_config(
1888                                accept_compression_encodings,
1889                                send_compression_encodings,
1890                            )
1891                            .apply_max_message_size_config(
1892                                max_decoding_message_size,
1893                                max_encoding_message_size,
1894                            );
1895                        let res = grpc.unary(method, req).await;
1896                        Ok(res)
1897                    };
1898                    Box::pin(fut)
1899                }
1900                _ => {
1901                    Box::pin(async move {
1902                        let mut response = http::Response::new(
1903                            tonic::body::Body::default(),
1904                        );
1905                        let headers = response.headers_mut();
1906                        headers
1907                            .insert(
1908                                tonic::Status::GRPC_STATUS,
1909                                (tonic::Code::Unimplemented as i32).into(),
1910                            );
1911                        headers
1912                            .insert(
1913                                http::header::CONTENT_TYPE,
1914                                tonic::metadata::GRPC_CONTENT_TYPE,
1915                            );
1916                        Ok(response)
1917                    })
1918                }
1919            }
1920        }
1921    }
1922    impl<T> Clone for HealthCheckServer<T> {
1923        fn clone(&self) -> Self {
1924            let inner = self.inner.clone();
1925            Self {
1926                inner,
1927                accept_compression_encodings: self.accept_compression_encodings,
1928                send_compression_encodings: self.send_compression_encodings,
1929                max_decoding_message_size: self.max_decoding_message_size,
1930                max_encoding_message_size: self.max_encoding_message_size,
1931            }
1932        }
1933    }
1934    /// Generated gRPC service name
1935    pub const SERVICE_NAME: &str = "danube.HealthCheck";
1936    impl<T> tonic::server::NamedService for HealthCheckServer<T> {
1937        const NAME: &'static str = SERVICE_NAME;
1938    }
1939}
1940/// Generated client implementations.
1941pub mod auth_service_client {
1942    #![allow(
1943        unused_variables,
1944        dead_code,
1945        missing_docs,
1946        clippy::wildcard_imports,
1947        clippy::let_unit_value,
1948    )]
1949    use tonic::codegen::*;
1950    use tonic::codegen::http::Uri;
1951    #[derive(Debug, Clone)]
1952    pub struct AuthServiceClient<T> {
1953        inner: tonic::client::Grpc<T>,
1954    }
1955    impl AuthServiceClient<tonic::transport::Channel> {
1956        /// Attempt to create a new client by connecting to a given endpoint.
1957        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1958        where
1959            D: TryInto<tonic::transport::Endpoint>,
1960            D::Error: Into<StdError>,
1961        {
1962            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1963            Ok(Self::new(conn))
1964        }
1965    }
1966    impl<T> AuthServiceClient<T>
1967    where
1968        T: tonic::client::GrpcService<tonic::body::Body>,
1969        T::Error: Into<StdError>,
1970        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1971        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1972    {
1973        pub fn new(inner: T) -> Self {
1974            let inner = tonic::client::Grpc::new(inner);
1975            Self { inner }
1976        }
1977        pub fn with_origin(inner: T, origin: Uri) -> Self {
1978            let inner = tonic::client::Grpc::with_origin(inner, origin);
1979            Self { inner }
1980        }
1981        pub fn with_interceptor<F>(
1982            inner: T,
1983            interceptor: F,
1984        ) -> AuthServiceClient<InterceptedService<T, F>>
1985        where
1986            F: tonic::service::Interceptor,
1987            T::ResponseBody: Default,
1988            T: tonic::codegen::Service<
1989                http::Request<tonic::body::Body>,
1990                Response = http::Response<
1991                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1992                >,
1993            >,
1994            <T as tonic::codegen::Service<
1995                http::Request<tonic::body::Body>,
1996            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1997        {
1998            AuthServiceClient::new(InterceptedService::new(inner, interceptor))
1999        }
2000        /// Compress requests with the given encoding.
2001        ///
2002        /// This requires the server to support it otherwise it might respond with an
2003        /// error.
2004        #[must_use]
2005        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2006            self.inner = self.inner.send_compressed(encoding);
2007            self
2008        }
2009        /// Enable decompressing responses.
2010        #[must_use]
2011        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2012            self.inner = self.inner.accept_compressed(encoding);
2013            self
2014        }
2015        /// Limits the maximum size of a decoded message.
2016        ///
2017        /// Default: `4MB`
2018        #[must_use]
2019        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2020            self.inner = self.inner.max_decoding_message_size(limit);
2021            self
2022        }
2023        /// Limits the maximum size of an encoded message.
2024        ///
2025        /// Default: `usize::MAX`
2026        #[must_use]
2027        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2028            self.inner = self.inner.max_encoding_message_size(limit);
2029            self
2030        }
2031        pub async fn authenticate(
2032            &mut self,
2033            request: impl tonic::IntoRequest<super::AuthRequest>,
2034        ) -> std::result::Result<tonic::Response<super::AuthResponse>, tonic::Status> {
2035            self.inner
2036                .ready()
2037                .await
2038                .map_err(|e| {
2039                    tonic::Status::unknown(
2040                        format!("Service was not ready: {}", e.into()),
2041                    )
2042                })?;
2043            let codec = tonic_prost::ProstCodec::default();
2044            let path = http::uri::PathAndQuery::from_static(
2045                "/danube.AuthService/Authenticate",
2046            );
2047            let mut req = request.into_request();
2048            req.extensions_mut()
2049                .insert(GrpcMethod::new("danube.AuthService", "Authenticate"));
2050            self.inner.unary(req, path, codec).await
2051        }
2052    }
2053}
2054/// Generated server implementations.
2055pub mod auth_service_server {
2056    #![allow(
2057        unused_variables,
2058        dead_code,
2059        missing_docs,
2060        clippy::wildcard_imports,
2061        clippy::let_unit_value,
2062    )]
2063    use tonic::codegen::*;
2064    /// Generated trait containing gRPC methods that should be implemented for use with AuthServiceServer.
2065    #[async_trait]
2066    pub trait AuthService: std::marker::Send + std::marker::Sync + 'static {
2067        async fn authenticate(
2068            &self,
2069            request: tonic::Request<super::AuthRequest>,
2070        ) -> std::result::Result<tonic::Response<super::AuthResponse>, tonic::Status>;
2071    }
2072    #[derive(Debug)]
2073    pub struct AuthServiceServer<T> {
2074        inner: Arc<T>,
2075        accept_compression_encodings: EnabledCompressionEncodings,
2076        send_compression_encodings: EnabledCompressionEncodings,
2077        max_decoding_message_size: Option<usize>,
2078        max_encoding_message_size: Option<usize>,
2079    }
2080    impl<T> AuthServiceServer<T> {
2081        pub fn new(inner: T) -> Self {
2082            Self::from_arc(Arc::new(inner))
2083        }
2084        pub fn from_arc(inner: Arc<T>) -> Self {
2085            Self {
2086                inner,
2087                accept_compression_encodings: Default::default(),
2088                send_compression_encodings: Default::default(),
2089                max_decoding_message_size: None,
2090                max_encoding_message_size: None,
2091            }
2092        }
2093        pub fn with_interceptor<F>(
2094            inner: T,
2095            interceptor: F,
2096        ) -> InterceptedService<Self, F>
2097        where
2098            F: tonic::service::Interceptor,
2099        {
2100            InterceptedService::new(Self::new(inner), interceptor)
2101        }
2102        /// Enable decompressing requests with the given encoding.
2103        #[must_use]
2104        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2105            self.accept_compression_encodings.enable(encoding);
2106            self
2107        }
2108        /// Compress responses with the given encoding, if the client supports it.
2109        #[must_use]
2110        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2111            self.send_compression_encodings.enable(encoding);
2112            self
2113        }
2114        /// Limits the maximum size of a decoded message.
2115        ///
2116        /// Default: `4MB`
2117        #[must_use]
2118        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2119            self.max_decoding_message_size = Some(limit);
2120            self
2121        }
2122        /// Limits the maximum size of an encoded message.
2123        ///
2124        /// Default: `usize::MAX`
2125        #[must_use]
2126        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2127            self.max_encoding_message_size = Some(limit);
2128            self
2129        }
2130    }
2131    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuthServiceServer<T>
2132    where
2133        T: AuthService,
2134        B: Body + std::marker::Send + 'static,
2135        B::Error: Into<StdError> + std::marker::Send + 'static,
2136    {
2137        type Response = http::Response<tonic::body::Body>;
2138        type Error = std::convert::Infallible;
2139        type Future = BoxFuture<Self::Response, Self::Error>;
2140        fn poll_ready(
2141            &mut self,
2142            _cx: &mut Context<'_>,
2143        ) -> Poll<std::result::Result<(), Self::Error>> {
2144            Poll::Ready(Ok(()))
2145        }
2146        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2147            match req.uri().path() {
2148                "/danube.AuthService/Authenticate" => {
2149                    #[allow(non_camel_case_types)]
2150                    struct AuthenticateSvc<T: AuthService>(pub Arc<T>);
2151                    impl<T: AuthService> tonic::server::UnaryService<super::AuthRequest>
2152                    for AuthenticateSvc<T> {
2153                        type Response = super::AuthResponse;
2154                        type Future = BoxFuture<
2155                            tonic::Response<Self::Response>,
2156                            tonic::Status,
2157                        >;
2158                        fn call(
2159                            &mut self,
2160                            request: tonic::Request<super::AuthRequest>,
2161                        ) -> Self::Future {
2162                            let inner = Arc::clone(&self.0);
2163                            let fut = async move {
2164                                <T as AuthService>::authenticate(&inner, request).await
2165                            };
2166                            Box::pin(fut)
2167                        }
2168                    }
2169                    let accept_compression_encodings = self.accept_compression_encodings;
2170                    let send_compression_encodings = self.send_compression_encodings;
2171                    let max_decoding_message_size = self.max_decoding_message_size;
2172                    let max_encoding_message_size = self.max_encoding_message_size;
2173                    let inner = self.inner.clone();
2174                    let fut = async move {
2175                        let method = AuthenticateSvc(inner);
2176                        let codec = tonic_prost::ProstCodec::default();
2177                        let mut grpc = tonic::server::Grpc::new(codec)
2178                            .apply_compression_config(
2179                                accept_compression_encodings,
2180                                send_compression_encodings,
2181                            )
2182                            .apply_max_message_size_config(
2183                                max_decoding_message_size,
2184                                max_encoding_message_size,
2185                            );
2186                        let res = grpc.unary(method, req).await;
2187                        Ok(res)
2188                    };
2189                    Box::pin(fut)
2190                }
2191                _ => {
2192                    Box::pin(async move {
2193                        let mut response = http::Response::new(
2194                            tonic::body::Body::default(),
2195                        );
2196                        let headers = response.headers_mut();
2197                        headers
2198                            .insert(
2199                                tonic::Status::GRPC_STATUS,
2200                                (tonic::Code::Unimplemented as i32).into(),
2201                            );
2202                        headers
2203                            .insert(
2204                                http::header::CONTENT_TYPE,
2205                                tonic::metadata::GRPC_CONTENT_TYPE,
2206                            );
2207                        Ok(response)
2208                    })
2209                }
2210            }
2211        }
2212    }
2213    impl<T> Clone for AuthServiceServer<T> {
2214        fn clone(&self) -> Self {
2215            let inner = self.inner.clone();
2216            Self {
2217                inner,
2218                accept_compression_encodings: self.accept_compression_encodings,
2219                send_compression_encodings: self.send_compression_encodings,
2220                max_decoding_message_size: self.max_decoding_message_size,
2221                max_encoding_message_size: self.max_encoding_message_size,
2222            }
2223        }
2224    }
2225    /// Generated gRPC service name
2226    pub const SERVICE_NAME: &str = "danube.AuthService";
2227    impl<T> tonic::server::NamedService for AuthServiceServer<T> {
2228        const NAME: &'static str = SERVICE_NAME;
2229    }
2230}