Skip to main content

pidgr_proto/pidgr/v1/
pidgr.v1.tonic.rs

1// @generated
2/// Generated client implementations.
3pub mod action_service_client {
4    #![allow(
5        unused_variables,
6        dead_code,
7        missing_docs,
8        clippy::wildcard_imports,
9        clippy::let_unit_value,
10    )]
11    use tonic::codegen::*;
12    use tonic::codegen::http::Uri;
13    /** Handles user actions on delivered messages.
14 Actions drive workflow progression (e.g. ACK completes a wait step).
15*/
16    #[derive(Debug, Clone)]
17    pub struct ActionServiceClient<T> {
18        inner: tonic::client::Grpc<T>,
19    }
20    impl ActionServiceClient<tonic::transport::Channel> {
21        /// Attempt to create a new client by connecting to a given endpoint.
22        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
23        where
24            D: TryInto<tonic::transport::Endpoint>,
25            D::Error: Into<StdError>,
26        {
27            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
28            Ok(Self::new(conn))
29        }
30    }
31    impl<T> ActionServiceClient<T>
32    where
33        T: tonic::client::GrpcService<tonic::body::Body>,
34        T::Error: Into<StdError>,
35        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
36        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
37    {
38        pub fn new(inner: T) -> Self {
39            let inner = tonic::client::Grpc::new(inner);
40            Self { inner }
41        }
42        pub fn with_origin(inner: T, origin: Uri) -> Self {
43            let inner = tonic::client::Grpc::with_origin(inner, origin);
44            Self { inner }
45        }
46        pub fn with_interceptor<F>(
47            inner: T,
48            interceptor: F,
49        ) -> ActionServiceClient<InterceptedService<T, F>>
50        where
51            F: tonic::service::Interceptor,
52            T::ResponseBody: Default,
53            T: tonic::codegen::Service<
54                http::Request<tonic::body::Body>,
55                Response = http::Response<
56                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
57                >,
58            >,
59            <T as tonic::codegen::Service<
60                http::Request<tonic::body::Body>,
61            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
62        {
63            ActionServiceClient::new(InterceptedService::new(inner, interceptor))
64        }
65        /// Compress requests with the given encoding.
66        ///
67        /// This requires the server to support it otherwise it might respond with an
68        /// error.
69        #[must_use]
70        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
71            self.inner = self.inner.send_compressed(encoding);
72            self
73        }
74        /// Enable decompressing responses.
75        #[must_use]
76        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
77            self.inner = self.inner.accept_compressed(encoding);
78            self
79        }
80        /// Limits the maximum size of a decoded message.
81        ///
82        /// Default: `4MB`
83        #[must_use]
84        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
85            self.inner = self.inner.max_decoding_message_size(limit);
86            self
87        }
88        /// Limits the maximum size of an encoded message.
89        ///
90        /// Default: `usize::MAX`
91        #[must_use]
92        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
93            self.inner = self.inner.max_encoding_message_size(limit);
94            self
95        }
96        /** Submit an action for a specific delivery, advancing the campaign workflow.
97 Backend MUST verify the authenticated user is the delivery recipient.
98*/
99        pub async fn submit_action(
100            &mut self,
101            request: impl tonic::IntoRequest<super::SubmitActionRequest>,
102        ) -> std::result::Result<
103            tonic::Response<super::SubmitActionResponse>,
104            tonic::Status,
105        > {
106            self.inner
107                .ready()
108                .await
109                .map_err(|e| {
110                    tonic::Status::unknown(
111                        format!("Service was not ready: {}", e.into()),
112                    )
113                })?;
114            let codec = tonic_prost::ProstCodec::default();
115            let path = http::uri::PathAndQuery::from_static(
116                "/pidgr.v1.ActionService/SubmitAction",
117            );
118            let mut req = request.into_request();
119            req.extensions_mut()
120                .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
121            self.inner.unary(req, path, codec).await
122        }
123    }
124}
125/// Generated server implementations.
126pub mod action_service_server {
127    #![allow(
128        unused_variables,
129        dead_code,
130        missing_docs,
131        clippy::wildcard_imports,
132        clippy::let_unit_value,
133    )]
134    use tonic::codegen::*;
135    /// Generated trait containing gRPC methods that should be implemented for use with ActionServiceServer.
136    #[async_trait]
137    pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
138        /** Submit an action for a specific delivery, advancing the campaign workflow.
139 Backend MUST verify the authenticated user is the delivery recipient.
140*/
141        async fn submit_action(
142            &self,
143            request: tonic::Request<super::SubmitActionRequest>,
144        ) -> std::result::Result<
145            tonic::Response<super::SubmitActionResponse>,
146            tonic::Status,
147        >;
148    }
149    /** Handles user actions on delivered messages.
150 Actions drive workflow progression (e.g. ACK completes a wait step).
151*/
152    #[derive(Debug)]
153    pub struct ActionServiceServer<T> {
154        inner: Arc<T>,
155        accept_compression_encodings: EnabledCompressionEncodings,
156        send_compression_encodings: EnabledCompressionEncodings,
157        max_decoding_message_size: Option<usize>,
158        max_encoding_message_size: Option<usize>,
159    }
160    impl<T> ActionServiceServer<T> {
161        pub fn new(inner: T) -> Self {
162            Self::from_arc(Arc::new(inner))
163        }
164        pub fn from_arc(inner: Arc<T>) -> Self {
165            Self {
166                inner,
167                accept_compression_encodings: Default::default(),
168                send_compression_encodings: Default::default(),
169                max_decoding_message_size: None,
170                max_encoding_message_size: None,
171            }
172        }
173        pub fn with_interceptor<F>(
174            inner: T,
175            interceptor: F,
176        ) -> InterceptedService<Self, F>
177        where
178            F: tonic::service::Interceptor,
179        {
180            InterceptedService::new(Self::new(inner), interceptor)
181        }
182        /// Enable decompressing requests with the given encoding.
183        #[must_use]
184        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
185            self.accept_compression_encodings.enable(encoding);
186            self
187        }
188        /// Compress responses with the given encoding, if the client supports it.
189        #[must_use]
190        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
191            self.send_compression_encodings.enable(encoding);
192            self
193        }
194        /// Limits the maximum size of a decoded message.
195        ///
196        /// Default: `4MB`
197        #[must_use]
198        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
199            self.max_decoding_message_size = Some(limit);
200            self
201        }
202        /// Limits the maximum size of an encoded message.
203        ///
204        /// Default: `usize::MAX`
205        #[must_use]
206        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
207            self.max_encoding_message_size = Some(limit);
208            self
209        }
210    }
211    impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
212    where
213        T: ActionService,
214        B: Body + std::marker::Send + 'static,
215        B::Error: Into<StdError> + std::marker::Send + 'static,
216    {
217        type Response = http::Response<tonic::body::Body>;
218        type Error = std::convert::Infallible;
219        type Future = BoxFuture<Self::Response, Self::Error>;
220        fn poll_ready(
221            &mut self,
222            _cx: &mut Context<'_>,
223        ) -> Poll<std::result::Result<(), Self::Error>> {
224            Poll::Ready(Ok(()))
225        }
226        fn call(&mut self, req: http::Request<B>) -> Self::Future {
227            match req.uri().path() {
228                "/pidgr.v1.ActionService/SubmitAction" => {
229                    #[allow(non_camel_case_types)]
230                    struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
231                    impl<
232                        T: ActionService,
233                    > tonic::server::UnaryService<super::SubmitActionRequest>
234                    for SubmitActionSvc<T> {
235                        type Response = super::SubmitActionResponse;
236                        type Future = BoxFuture<
237                            tonic::Response<Self::Response>,
238                            tonic::Status,
239                        >;
240                        fn call(
241                            &mut self,
242                            request: tonic::Request<super::SubmitActionRequest>,
243                        ) -> Self::Future {
244                            let inner = Arc::clone(&self.0);
245                            let fut = async move {
246                                <T as ActionService>::submit_action(&inner, request).await
247                            };
248                            Box::pin(fut)
249                        }
250                    }
251                    let accept_compression_encodings = self.accept_compression_encodings;
252                    let send_compression_encodings = self.send_compression_encodings;
253                    let max_decoding_message_size = self.max_decoding_message_size;
254                    let max_encoding_message_size = self.max_encoding_message_size;
255                    let inner = self.inner.clone();
256                    let fut = async move {
257                        let method = SubmitActionSvc(inner);
258                        let codec = tonic_prost::ProstCodec::default();
259                        let mut grpc = tonic::server::Grpc::new(codec)
260                            .apply_compression_config(
261                                accept_compression_encodings,
262                                send_compression_encodings,
263                            )
264                            .apply_max_message_size_config(
265                                max_decoding_message_size,
266                                max_encoding_message_size,
267                            );
268                        let res = grpc.unary(method, req).await;
269                        Ok(res)
270                    };
271                    Box::pin(fut)
272                }
273                _ => {
274                    Box::pin(async move {
275                        let mut response = http::Response::new(
276                            tonic::body::Body::default(),
277                        );
278                        let headers = response.headers_mut();
279                        headers
280                            .insert(
281                                tonic::Status::GRPC_STATUS,
282                                (tonic::Code::Unimplemented as i32).into(),
283                            );
284                        headers
285                            .insert(
286                                http::header::CONTENT_TYPE,
287                                tonic::metadata::GRPC_CONTENT_TYPE,
288                            );
289                        Ok(response)
290                    })
291                }
292            }
293        }
294    }
295    impl<T> Clone for ActionServiceServer<T> {
296        fn clone(&self) -> Self {
297            let inner = self.inner.clone();
298            Self {
299                inner,
300                accept_compression_encodings: self.accept_compression_encodings,
301                send_compression_encodings: self.send_compression_encodings,
302                max_decoding_message_size: self.max_decoding_message_size,
303                max_encoding_message_size: self.max_encoding_message_size,
304            }
305        }
306    }
307    /// Generated gRPC service name
308    pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
309    impl<T> tonic::server::NamedService for ActionServiceServer<T> {
310        const NAME: &'static str = SERVICE_NAME;
311    }
312}
313/// Generated client implementations.
314pub mod channel_events_service_client {
315    #![allow(
316        unused_variables,
317        dead_code,
318        missing_docs,
319        clippy::wildcard_imports,
320        clippy::let_unit_value,
321    )]
322    use tonic::codegen::*;
323    use tonic::codegen::http::Uri;
324    /** ChannelEventsService records third-party channel dispatch events into the
325 platform's append-only audit table. Intended for internal-service callers
326 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
327*/
328    #[derive(Debug, Clone)]
329    pub struct ChannelEventsServiceClient<T> {
330        inner: tonic::client::Grpc<T>,
331    }
332    impl ChannelEventsServiceClient<tonic::transport::Channel> {
333        /// Attempt to create a new client by connecting to a given endpoint.
334        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
335        where
336            D: TryInto<tonic::transport::Endpoint>,
337            D::Error: Into<StdError>,
338        {
339            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
340            Ok(Self::new(conn))
341        }
342    }
343    impl<T> ChannelEventsServiceClient<T>
344    where
345        T: tonic::client::GrpcService<tonic::body::Body>,
346        T::Error: Into<StdError>,
347        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
348        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
349    {
350        pub fn new(inner: T) -> Self {
351            let inner = tonic::client::Grpc::new(inner);
352            Self { inner }
353        }
354        pub fn with_origin(inner: T, origin: Uri) -> Self {
355            let inner = tonic::client::Grpc::with_origin(inner, origin);
356            Self { inner }
357        }
358        pub fn with_interceptor<F>(
359            inner: T,
360            interceptor: F,
361        ) -> ChannelEventsServiceClient<InterceptedService<T, F>>
362        where
363            F: tonic::service::Interceptor,
364            T::ResponseBody: Default,
365            T: tonic::codegen::Service<
366                http::Request<tonic::body::Body>,
367                Response = http::Response<
368                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
369                >,
370            >,
371            <T as tonic::codegen::Service<
372                http::Request<tonic::body::Body>,
373            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
374        {
375            ChannelEventsServiceClient::new(InterceptedService::new(inner, interceptor))
376        }
377        /// Compress requests with the given encoding.
378        ///
379        /// This requires the server to support it otherwise it might respond with an
380        /// error.
381        #[must_use]
382        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
383            self.inner = self.inner.send_compressed(encoding);
384            self
385        }
386        /// Enable decompressing responses.
387        #[must_use]
388        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
389            self.inner = self.inner.accept_compressed(encoding);
390            self
391        }
392        /// Limits the maximum size of a decoded message.
393        ///
394        /// Default: `4MB`
395        #[must_use]
396        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
397            self.inner = self.inner.max_decoding_message_size(limit);
398            self
399        }
400        /// Limits the maximum size of an encoded message.
401        ///
402        /// Default: `usize::MAX`
403        #[must_use]
404        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
405            self.inner = self.inner.max_encoding_message_size(limit);
406            self
407        }
408        /** Record a single channel event. Returns accepted=false reason="duplicate"
409 when the partial unique index rejects (caller treats as already-recorded,
410 not as an error).
411*/
412        pub async fn record_channel_event(
413            &mut self,
414            request: impl tonic::IntoRequest<super::RecordChannelEventRequest>,
415        ) -> std::result::Result<
416            tonic::Response<super::RecordChannelEventResponse>,
417            tonic::Status,
418        > {
419            self.inner
420                .ready()
421                .await
422                .map_err(|e| {
423                    tonic::Status::unknown(
424                        format!("Service was not ready: {}", e.into()),
425                    )
426                })?;
427            let codec = tonic_prost::ProstCodec::default();
428            let path = http::uri::PathAndQuery::from_static(
429                "/pidgr.v1.ChannelEventsService/RecordChannelEvent",
430            );
431            let mut req = request.into_request();
432            req.extensions_mut()
433                .insert(
434                    GrpcMethod::new(
435                        "pidgr.v1.ChannelEventsService",
436                        "RecordChannelEvent",
437                    ),
438                );
439            self.inner.unary(req, path, codec).await
440        }
441        /** Record N events in one round-trip. Used by webhook ingress when a
442 provider delivers multiple state transitions in one payload (e.g. a
443 batched delivery report). Best-effort per-row.
444*/
445        pub async fn record_channel_event_batch(
446            &mut self,
447            request: impl tonic::IntoRequest<super::RecordChannelEventBatchRequest>,
448        ) -> std::result::Result<
449            tonic::Response<super::RecordChannelEventBatchResponse>,
450            tonic::Status,
451        > {
452            self.inner
453                .ready()
454                .await
455                .map_err(|e| {
456                    tonic::Status::unknown(
457                        format!("Service was not ready: {}", e.into()),
458                    )
459                })?;
460            let codec = tonic_prost::ProstCodec::default();
461            let path = http::uri::PathAndQuery::from_static(
462                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch",
463            );
464            let mut req = request.into_request();
465            req.extensions_mut()
466                .insert(
467                    GrpcMethod::new(
468                        "pidgr.v1.ChannelEventsService",
469                        "RecordChannelEventBatch",
470                    ),
471                );
472            self.inner.unary(req, path, codec).await
473        }
474    }
475}
476/// Generated server implementations.
477pub mod channel_events_service_server {
478    #![allow(
479        unused_variables,
480        dead_code,
481        missing_docs,
482        clippy::wildcard_imports,
483        clippy::let_unit_value,
484    )]
485    use tonic::codegen::*;
486    /// Generated trait containing gRPC methods that should be implemented for use with ChannelEventsServiceServer.
487    #[async_trait]
488    pub trait ChannelEventsService: std::marker::Send + std::marker::Sync + 'static {
489        /** Record a single channel event. Returns accepted=false reason="duplicate"
490 when the partial unique index rejects (caller treats as already-recorded,
491 not as an error).
492*/
493        async fn record_channel_event(
494            &self,
495            request: tonic::Request<super::RecordChannelEventRequest>,
496        ) -> std::result::Result<
497            tonic::Response<super::RecordChannelEventResponse>,
498            tonic::Status,
499        >;
500        /** Record N events in one round-trip. Used by webhook ingress when a
501 provider delivers multiple state transitions in one payload (e.g. a
502 batched delivery report). Best-effort per-row.
503*/
504        async fn record_channel_event_batch(
505            &self,
506            request: tonic::Request<super::RecordChannelEventBatchRequest>,
507        ) -> std::result::Result<
508            tonic::Response<super::RecordChannelEventBatchResponse>,
509            tonic::Status,
510        >;
511    }
512    /** ChannelEventsService records third-party channel dispatch events into the
513 platform's append-only audit table. Intended for internal-service callers
514 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
515*/
516    #[derive(Debug)]
517    pub struct ChannelEventsServiceServer<T> {
518        inner: Arc<T>,
519        accept_compression_encodings: EnabledCompressionEncodings,
520        send_compression_encodings: EnabledCompressionEncodings,
521        max_decoding_message_size: Option<usize>,
522        max_encoding_message_size: Option<usize>,
523    }
524    impl<T> ChannelEventsServiceServer<T> {
525        pub fn new(inner: T) -> Self {
526            Self::from_arc(Arc::new(inner))
527        }
528        pub fn from_arc(inner: Arc<T>) -> Self {
529            Self {
530                inner,
531                accept_compression_encodings: Default::default(),
532                send_compression_encodings: Default::default(),
533                max_decoding_message_size: None,
534                max_encoding_message_size: None,
535            }
536        }
537        pub fn with_interceptor<F>(
538            inner: T,
539            interceptor: F,
540        ) -> InterceptedService<Self, F>
541        where
542            F: tonic::service::Interceptor,
543        {
544            InterceptedService::new(Self::new(inner), interceptor)
545        }
546        /// Enable decompressing requests with the given encoding.
547        #[must_use]
548        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
549            self.accept_compression_encodings.enable(encoding);
550            self
551        }
552        /// Compress responses with the given encoding, if the client supports it.
553        #[must_use]
554        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
555            self.send_compression_encodings.enable(encoding);
556            self
557        }
558        /// Limits the maximum size of a decoded message.
559        ///
560        /// Default: `4MB`
561        #[must_use]
562        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
563            self.max_decoding_message_size = Some(limit);
564            self
565        }
566        /// Limits the maximum size of an encoded message.
567        ///
568        /// Default: `usize::MAX`
569        #[must_use]
570        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
571            self.max_encoding_message_size = Some(limit);
572            self
573        }
574    }
575    impl<T, B> tonic::codegen::Service<http::Request<B>>
576    for ChannelEventsServiceServer<T>
577    where
578        T: ChannelEventsService,
579        B: Body + std::marker::Send + 'static,
580        B::Error: Into<StdError> + std::marker::Send + 'static,
581    {
582        type Response = http::Response<tonic::body::Body>;
583        type Error = std::convert::Infallible;
584        type Future = BoxFuture<Self::Response, Self::Error>;
585        fn poll_ready(
586            &mut self,
587            _cx: &mut Context<'_>,
588        ) -> Poll<std::result::Result<(), Self::Error>> {
589            Poll::Ready(Ok(()))
590        }
591        fn call(&mut self, req: http::Request<B>) -> Self::Future {
592            match req.uri().path() {
593                "/pidgr.v1.ChannelEventsService/RecordChannelEvent" => {
594                    #[allow(non_camel_case_types)]
595                    struct RecordChannelEventSvc<T: ChannelEventsService>(pub Arc<T>);
596                    impl<
597                        T: ChannelEventsService,
598                    > tonic::server::UnaryService<super::RecordChannelEventRequest>
599                    for RecordChannelEventSvc<T> {
600                        type Response = super::RecordChannelEventResponse;
601                        type Future = BoxFuture<
602                            tonic::Response<Self::Response>,
603                            tonic::Status,
604                        >;
605                        fn call(
606                            &mut self,
607                            request: tonic::Request<super::RecordChannelEventRequest>,
608                        ) -> Self::Future {
609                            let inner = Arc::clone(&self.0);
610                            let fut = async move {
611                                <T as ChannelEventsService>::record_channel_event(
612                                        &inner,
613                                        request,
614                                    )
615                                    .await
616                            };
617                            Box::pin(fut)
618                        }
619                    }
620                    let accept_compression_encodings = self.accept_compression_encodings;
621                    let send_compression_encodings = self.send_compression_encodings;
622                    let max_decoding_message_size = self.max_decoding_message_size;
623                    let max_encoding_message_size = self.max_encoding_message_size;
624                    let inner = self.inner.clone();
625                    let fut = async move {
626                        let method = RecordChannelEventSvc(inner);
627                        let codec = tonic_prost::ProstCodec::default();
628                        let mut grpc = tonic::server::Grpc::new(codec)
629                            .apply_compression_config(
630                                accept_compression_encodings,
631                                send_compression_encodings,
632                            )
633                            .apply_max_message_size_config(
634                                max_decoding_message_size,
635                                max_encoding_message_size,
636                            );
637                        let res = grpc.unary(method, req).await;
638                        Ok(res)
639                    };
640                    Box::pin(fut)
641                }
642                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch" => {
643                    #[allow(non_camel_case_types)]
644                    struct RecordChannelEventBatchSvc<T: ChannelEventsService>(
645                        pub Arc<T>,
646                    );
647                    impl<
648                        T: ChannelEventsService,
649                    > tonic::server::UnaryService<super::RecordChannelEventBatchRequest>
650                    for RecordChannelEventBatchSvc<T> {
651                        type Response = super::RecordChannelEventBatchResponse;
652                        type Future = BoxFuture<
653                            tonic::Response<Self::Response>,
654                            tonic::Status,
655                        >;
656                        fn call(
657                            &mut self,
658                            request: tonic::Request<
659                                super::RecordChannelEventBatchRequest,
660                            >,
661                        ) -> Self::Future {
662                            let inner = Arc::clone(&self.0);
663                            let fut = async move {
664                                <T as ChannelEventsService>::record_channel_event_batch(
665                                        &inner,
666                                        request,
667                                    )
668                                    .await
669                            };
670                            Box::pin(fut)
671                        }
672                    }
673                    let accept_compression_encodings = self.accept_compression_encodings;
674                    let send_compression_encodings = self.send_compression_encodings;
675                    let max_decoding_message_size = self.max_decoding_message_size;
676                    let max_encoding_message_size = self.max_encoding_message_size;
677                    let inner = self.inner.clone();
678                    let fut = async move {
679                        let method = RecordChannelEventBatchSvc(inner);
680                        let codec = tonic_prost::ProstCodec::default();
681                        let mut grpc = tonic::server::Grpc::new(codec)
682                            .apply_compression_config(
683                                accept_compression_encodings,
684                                send_compression_encodings,
685                            )
686                            .apply_max_message_size_config(
687                                max_decoding_message_size,
688                                max_encoding_message_size,
689                            );
690                        let res = grpc.unary(method, req).await;
691                        Ok(res)
692                    };
693                    Box::pin(fut)
694                }
695                _ => {
696                    Box::pin(async move {
697                        let mut response = http::Response::new(
698                            tonic::body::Body::default(),
699                        );
700                        let headers = response.headers_mut();
701                        headers
702                            .insert(
703                                tonic::Status::GRPC_STATUS,
704                                (tonic::Code::Unimplemented as i32).into(),
705                            );
706                        headers
707                            .insert(
708                                http::header::CONTENT_TYPE,
709                                tonic::metadata::GRPC_CONTENT_TYPE,
710                            );
711                        Ok(response)
712                    })
713                }
714            }
715        }
716    }
717    impl<T> Clone for ChannelEventsServiceServer<T> {
718        fn clone(&self) -> Self {
719            let inner = self.inner.clone();
720            Self {
721                inner,
722                accept_compression_encodings: self.accept_compression_encodings,
723                send_compression_encodings: self.send_compression_encodings,
724                max_decoding_message_size: self.max_decoding_message_size,
725                max_encoding_message_size: self.max_encoding_message_size,
726            }
727        }
728    }
729    /// Generated gRPC service name
730    pub const SERVICE_NAME: &str = "pidgr.v1.ChannelEventsService";
731    impl<T> tonic::server::NamedService for ChannelEventsServiceServer<T> {
732        const NAME: &'static str = SERVICE_NAME;
733    }
734}
735/// Generated client implementations.
736pub mod api_key_service_client {
737    #![allow(
738        unused_variables,
739        dead_code,
740        missing_docs,
741        clippy::wildcard_imports,
742        clippy::let_unit_value,
743    )]
744    use tonic::codegen::*;
745    use tonic::codegen::http::Uri;
746    /** Manages scoped API keys for programmatic access.
747 All RPCs operate within the caller's org (extracted from JWT).
748*/
749    #[derive(Debug, Clone)]
750    pub struct ApiKeyServiceClient<T> {
751        inner: tonic::client::Grpc<T>,
752    }
753    impl ApiKeyServiceClient<tonic::transport::Channel> {
754        /// Attempt to create a new client by connecting to a given endpoint.
755        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
756        where
757            D: TryInto<tonic::transport::Endpoint>,
758            D::Error: Into<StdError>,
759        {
760            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
761            Ok(Self::new(conn))
762        }
763    }
764    impl<T> ApiKeyServiceClient<T>
765    where
766        T: tonic::client::GrpcService<tonic::body::Body>,
767        T::Error: Into<StdError>,
768        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
769        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
770    {
771        pub fn new(inner: T) -> Self {
772            let inner = tonic::client::Grpc::new(inner);
773            Self { inner }
774        }
775        pub fn with_origin(inner: T, origin: Uri) -> Self {
776            let inner = tonic::client::Grpc::with_origin(inner, origin);
777            Self { inner }
778        }
779        pub fn with_interceptor<F>(
780            inner: T,
781            interceptor: F,
782        ) -> ApiKeyServiceClient<InterceptedService<T, F>>
783        where
784            F: tonic::service::Interceptor,
785            T::ResponseBody: Default,
786            T: tonic::codegen::Service<
787                http::Request<tonic::body::Body>,
788                Response = http::Response<
789                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
790                >,
791            >,
792            <T as tonic::codegen::Service<
793                http::Request<tonic::body::Body>,
794            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
795        {
796            ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
797        }
798        /// Compress requests with the given encoding.
799        ///
800        /// This requires the server to support it otherwise it might respond with an
801        /// error.
802        #[must_use]
803        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
804            self.inner = self.inner.send_compressed(encoding);
805            self
806        }
807        /// Enable decompressing responses.
808        #[must_use]
809        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
810            self.inner = self.inner.accept_compressed(encoding);
811            self
812        }
813        /// Limits the maximum size of a decoded message.
814        ///
815        /// Default: `4MB`
816        #[must_use]
817        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
818            self.inner = self.inner.max_decoding_message_size(limit);
819            self
820        }
821        /// Limits the maximum size of an encoded message.
822        ///
823        /// Default: `usize::MAX`
824        #[must_use]
825        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
826            self.inner = self.inner.max_encoding_message_size(limit);
827            self
828        }
829        /** Create a new scoped API key with specific permissions.
830 The full secret key is only returned in the response — store it securely.
831 Authorization: Requires PERMISSION_ORG_WRITE.
832*/
833        pub async fn create_api_key(
834            &mut self,
835            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
836        ) -> std::result::Result<
837            tonic::Response<super::CreateApiKeyResponse>,
838            tonic::Status,
839        > {
840            self.inner
841                .ready()
842                .await
843                .map_err(|e| {
844                    tonic::Status::unknown(
845                        format!("Service was not ready: {}", e.into()),
846                    )
847                })?;
848            let codec = tonic_prost::ProstCodec::default();
849            let path = http::uri::PathAndQuery::from_static(
850                "/pidgr.v1.ApiKeyService/CreateApiKey",
851            );
852            let mut req = request.into_request();
853            req.extensions_mut()
854                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
855            self.inner.unary(req, path, codec).await
856        }
857        /** List all active API keys in the organization (metadata only, no secrets).
858 Authorization: Requires PERMISSION_ORG_READ.
859*/
860        pub async fn list_api_keys(
861            &mut self,
862            request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
863        ) -> std::result::Result<
864            tonic::Response<super::ListApiKeysResponse>,
865            tonic::Status,
866        > {
867            self.inner
868                .ready()
869                .await
870                .map_err(|e| {
871                    tonic::Status::unknown(
872                        format!("Service was not ready: {}", e.into()),
873                    )
874                })?;
875            let codec = tonic_prost::ProstCodec::default();
876            let path = http::uri::PathAndQuery::from_static(
877                "/pidgr.v1.ApiKeyService/ListApiKeys",
878            );
879            let mut req = request.into_request();
880            req.extensions_mut()
881                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
882            self.inner.unary(req, path, codec).await
883        }
884        /** Revoke an API key. The key becomes immediately unusable.
885 Authorization: Requires PERMISSION_ORG_WRITE.
886*/
887        pub async fn revoke_api_key(
888            &mut self,
889            request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
890        ) -> std::result::Result<
891            tonic::Response<super::RevokeApiKeyResponse>,
892            tonic::Status,
893        > {
894            self.inner
895                .ready()
896                .await
897                .map_err(|e| {
898                    tonic::Status::unknown(
899                        format!("Service was not ready: {}", e.into()),
900                    )
901                })?;
902            let codec = tonic_prost::ProstCodec::default();
903            let path = http::uri::PathAndQuery::from_static(
904                "/pidgr.v1.ApiKeyService/RevokeApiKey",
905            );
906            let mut req = request.into_request();
907            req.extensions_mut()
908                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
909            self.inner.unary(req, path, codec).await
910        }
911    }
912}
913/// Generated server implementations.
914pub mod api_key_service_server {
915    #![allow(
916        unused_variables,
917        dead_code,
918        missing_docs,
919        clippy::wildcard_imports,
920        clippy::let_unit_value,
921    )]
922    use tonic::codegen::*;
923    /// Generated trait containing gRPC methods that should be implemented for use with ApiKeyServiceServer.
924    #[async_trait]
925    pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
926        /** Create a new scoped API key with specific permissions.
927 The full secret key is only returned in the response — store it securely.
928 Authorization: Requires PERMISSION_ORG_WRITE.
929*/
930        async fn create_api_key(
931            &self,
932            request: tonic::Request<super::CreateApiKeyRequest>,
933        ) -> std::result::Result<
934            tonic::Response<super::CreateApiKeyResponse>,
935            tonic::Status,
936        >;
937        /** List all active API keys in the organization (metadata only, no secrets).
938 Authorization: Requires PERMISSION_ORG_READ.
939*/
940        async fn list_api_keys(
941            &self,
942            request: tonic::Request<super::ListApiKeysRequest>,
943        ) -> std::result::Result<
944            tonic::Response<super::ListApiKeysResponse>,
945            tonic::Status,
946        >;
947        /** Revoke an API key. The key becomes immediately unusable.
948 Authorization: Requires PERMISSION_ORG_WRITE.
949*/
950        async fn revoke_api_key(
951            &self,
952            request: tonic::Request<super::RevokeApiKeyRequest>,
953        ) -> std::result::Result<
954            tonic::Response<super::RevokeApiKeyResponse>,
955            tonic::Status,
956        >;
957    }
958    /** Manages scoped API keys for programmatic access.
959 All RPCs operate within the caller's org (extracted from JWT).
960*/
961    #[derive(Debug)]
962    pub struct ApiKeyServiceServer<T> {
963        inner: Arc<T>,
964        accept_compression_encodings: EnabledCompressionEncodings,
965        send_compression_encodings: EnabledCompressionEncodings,
966        max_decoding_message_size: Option<usize>,
967        max_encoding_message_size: Option<usize>,
968    }
969    impl<T> ApiKeyServiceServer<T> {
970        pub fn new(inner: T) -> Self {
971            Self::from_arc(Arc::new(inner))
972        }
973        pub fn from_arc(inner: Arc<T>) -> Self {
974            Self {
975                inner,
976                accept_compression_encodings: Default::default(),
977                send_compression_encodings: Default::default(),
978                max_decoding_message_size: None,
979                max_encoding_message_size: None,
980            }
981        }
982        pub fn with_interceptor<F>(
983            inner: T,
984            interceptor: F,
985        ) -> InterceptedService<Self, F>
986        where
987            F: tonic::service::Interceptor,
988        {
989            InterceptedService::new(Self::new(inner), interceptor)
990        }
991        /// Enable decompressing requests with the given encoding.
992        #[must_use]
993        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
994            self.accept_compression_encodings.enable(encoding);
995            self
996        }
997        /// Compress responses with the given encoding, if the client supports it.
998        #[must_use]
999        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1000            self.send_compression_encodings.enable(encoding);
1001            self
1002        }
1003        /// Limits the maximum size of a decoded message.
1004        ///
1005        /// Default: `4MB`
1006        #[must_use]
1007        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1008            self.max_decoding_message_size = Some(limit);
1009            self
1010        }
1011        /// Limits the maximum size of an encoded message.
1012        ///
1013        /// Default: `usize::MAX`
1014        #[must_use]
1015        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1016            self.max_encoding_message_size = Some(limit);
1017            self
1018        }
1019    }
1020    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1021    where
1022        T: ApiKeyService,
1023        B: Body + std::marker::Send + 'static,
1024        B::Error: Into<StdError> + std::marker::Send + 'static,
1025    {
1026        type Response = http::Response<tonic::body::Body>;
1027        type Error = std::convert::Infallible;
1028        type Future = BoxFuture<Self::Response, Self::Error>;
1029        fn poll_ready(
1030            &mut self,
1031            _cx: &mut Context<'_>,
1032        ) -> Poll<std::result::Result<(), Self::Error>> {
1033            Poll::Ready(Ok(()))
1034        }
1035        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1036            match req.uri().path() {
1037                "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1038                    #[allow(non_camel_case_types)]
1039                    struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1040                    impl<
1041                        T: ApiKeyService,
1042                    > tonic::server::UnaryService<super::CreateApiKeyRequest>
1043                    for CreateApiKeySvc<T> {
1044                        type Response = super::CreateApiKeyResponse;
1045                        type Future = BoxFuture<
1046                            tonic::Response<Self::Response>,
1047                            tonic::Status,
1048                        >;
1049                        fn call(
1050                            &mut self,
1051                            request: tonic::Request<super::CreateApiKeyRequest>,
1052                        ) -> Self::Future {
1053                            let inner = Arc::clone(&self.0);
1054                            let fut = async move {
1055                                <T as ApiKeyService>::create_api_key(&inner, request).await
1056                            };
1057                            Box::pin(fut)
1058                        }
1059                    }
1060                    let accept_compression_encodings = self.accept_compression_encodings;
1061                    let send_compression_encodings = self.send_compression_encodings;
1062                    let max_decoding_message_size = self.max_decoding_message_size;
1063                    let max_encoding_message_size = self.max_encoding_message_size;
1064                    let inner = self.inner.clone();
1065                    let fut = async move {
1066                        let method = CreateApiKeySvc(inner);
1067                        let codec = tonic_prost::ProstCodec::default();
1068                        let mut grpc = tonic::server::Grpc::new(codec)
1069                            .apply_compression_config(
1070                                accept_compression_encodings,
1071                                send_compression_encodings,
1072                            )
1073                            .apply_max_message_size_config(
1074                                max_decoding_message_size,
1075                                max_encoding_message_size,
1076                            );
1077                        let res = grpc.unary(method, req).await;
1078                        Ok(res)
1079                    };
1080                    Box::pin(fut)
1081                }
1082                "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1083                    #[allow(non_camel_case_types)]
1084                    struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1085                    impl<
1086                        T: ApiKeyService,
1087                    > tonic::server::UnaryService<super::ListApiKeysRequest>
1088                    for ListApiKeysSvc<T> {
1089                        type Response = super::ListApiKeysResponse;
1090                        type Future = BoxFuture<
1091                            tonic::Response<Self::Response>,
1092                            tonic::Status,
1093                        >;
1094                        fn call(
1095                            &mut self,
1096                            request: tonic::Request<super::ListApiKeysRequest>,
1097                        ) -> Self::Future {
1098                            let inner = Arc::clone(&self.0);
1099                            let fut = async move {
1100                                <T as ApiKeyService>::list_api_keys(&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 = ListApiKeysSvc(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                "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1128                    #[allow(non_camel_case_types)]
1129                    struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1130                    impl<
1131                        T: ApiKeyService,
1132                    > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1133                    for RevokeApiKeySvc<T> {
1134                        type Response = super::RevokeApiKeyResponse;
1135                        type Future = BoxFuture<
1136                            tonic::Response<Self::Response>,
1137                            tonic::Status,
1138                        >;
1139                        fn call(
1140                            &mut self,
1141                            request: tonic::Request<super::RevokeApiKeyRequest>,
1142                        ) -> Self::Future {
1143                            let inner = Arc::clone(&self.0);
1144                            let fut = async move {
1145                                <T as ApiKeyService>::revoke_api_key(&inner, request).await
1146                            };
1147                            Box::pin(fut)
1148                        }
1149                    }
1150                    let accept_compression_encodings = self.accept_compression_encodings;
1151                    let send_compression_encodings = self.send_compression_encodings;
1152                    let max_decoding_message_size = self.max_decoding_message_size;
1153                    let max_encoding_message_size = self.max_encoding_message_size;
1154                    let inner = self.inner.clone();
1155                    let fut = async move {
1156                        let method = RevokeApiKeySvc(inner);
1157                        let codec = tonic_prost::ProstCodec::default();
1158                        let mut grpc = tonic::server::Grpc::new(codec)
1159                            .apply_compression_config(
1160                                accept_compression_encodings,
1161                                send_compression_encodings,
1162                            )
1163                            .apply_max_message_size_config(
1164                                max_decoding_message_size,
1165                                max_encoding_message_size,
1166                            );
1167                        let res = grpc.unary(method, req).await;
1168                        Ok(res)
1169                    };
1170                    Box::pin(fut)
1171                }
1172                _ => {
1173                    Box::pin(async move {
1174                        let mut response = http::Response::new(
1175                            tonic::body::Body::default(),
1176                        );
1177                        let headers = response.headers_mut();
1178                        headers
1179                            .insert(
1180                                tonic::Status::GRPC_STATUS,
1181                                (tonic::Code::Unimplemented as i32).into(),
1182                            );
1183                        headers
1184                            .insert(
1185                                http::header::CONTENT_TYPE,
1186                                tonic::metadata::GRPC_CONTENT_TYPE,
1187                            );
1188                        Ok(response)
1189                    })
1190                }
1191            }
1192        }
1193    }
1194    impl<T> Clone for ApiKeyServiceServer<T> {
1195        fn clone(&self) -> Self {
1196            let inner = self.inner.clone();
1197            Self {
1198                inner,
1199                accept_compression_encodings: self.accept_compression_encodings,
1200                send_compression_encodings: self.send_compression_encodings,
1201                max_decoding_message_size: self.max_decoding_message_size,
1202                max_encoding_message_size: self.max_encoding_message_size,
1203            }
1204        }
1205    }
1206    /// Generated gRPC service name
1207    pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1208    impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1209        const NAME: &'static str = SERVICE_NAME;
1210    }
1211}
1212/// Generated client implementations.
1213pub mod privacy_service_client {
1214    #![allow(
1215        unused_variables,
1216        dead_code,
1217        missing_docs,
1218        clippy::wildcard_imports,
1219        clippy::let_unit_value,
1220    )]
1221    use tonic::codegen::*;
1222    use tonic::codegen::http::Uri;
1223    /** PrivacyService handles GDPR/LGPD data subject rights.
1224 All RPCs extract org_id from the JWT — it is never in request messages.
1225*/
1226    #[derive(Debug, Clone)]
1227    pub struct PrivacyServiceClient<T> {
1228        inner: tonic::client::Grpc<T>,
1229    }
1230    impl PrivacyServiceClient<tonic::transport::Channel> {
1231        /// Attempt to create a new client by connecting to a given endpoint.
1232        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1233        where
1234            D: TryInto<tonic::transport::Endpoint>,
1235            D::Error: Into<StdError>,
1236        {
1237            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1238            Ok(Self::new(conn))
1239        }
1240    }
1241    impl<T> PrivacyServiceClient<T>
1242    where
1243        T: tonic::client::GrpcService<tonic::body::Body>,
1244        T::Error: Into<StdError>,
1245        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1246        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1247    {
1248        pub fn new(inner: T) -> Self {
1249            let inner = tonic::client::Grpc::new(inner);
1250            Self { inner }
1251        }
1252        pub fn with_origin(inner: T, origin: Uri) -> Self {
1253            let inner = tonic::client::Grpc::with_origin(inner, origin);
1254            Self { inner }
1255        }
1256        pub fn with_interceptor<F>(
1257            inner: T,
1258            interceptor: F,
1259        ) -> PrivacyServiceClient<InterceptedService<T, F>>
1260        where
1261            F: tonic::service::Interceptor,
1262            T::ResponseBody: Default,
1263            T: tonic::codegen::Service<
1264                http::Request<tonic::body::Body>,
1265                Response = http::Response<
1266                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1267                >,
1268            >,
1269            <T as tonic::codegen::Service<
1270                http::Request<tonic::body::Body>,
1271            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1272        {
1273            PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1274        }
1275        /// Compress requests with the given encoding.
1276        ///
1277        /// This requires the server to support it otherwise it might respond with an
1278        /// error.
1279        #[must_use]
1280        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1281            self.inner = self.inner.send_compressed(encoding);
1282            self
1283        }
1284        /// Enable decompressing responses.
1285        #[must_use]
1286        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1287            self.inner = self.inner.accept_compressed(encoding);
1288            self
1289        }
1290        /// Limits the maximum size of a decoded message.
1291        ///
1292        /// Default: `4MB`
1293        #[must_use]
1294        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1295            self.inner = self.inner.max_decoding_message_size(limit);
1296            self
1297        }
1298        /// Limits the maximum size of an encoded message.
1299        ///
1300        /// Default: `usize::MAX`
1301        #[must_use]
1302        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1303            self.inner = self.inner.max_encoding_message_size(limit);
1304            self
1305        }
1306        /** Export all personal data associated with a user as a downloadable ZIP.
1307 Async operation — returns immediately with PENDING status, sends push
1308 notification when the export is ready.
1309 Auth: Requires JWT. Callable by the user themselves or an org admin.
1310*/
1311        pub async fn export_user_data(
1312            &mut self,
1313            request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1314        ) -> std::result::Result<
1315            tonic::Response<super::ExportUserDataResponse>,
1316            tonic::Status,
1317        > {
1318            self.inner
1319                .ready()
1320                .await
1321                .map_err(|e| {
1322                    tonic::Status::unknown(
1323                        format!("Service was not ready: {}", e.into()),
1324                    )
1325                })?;
1326            let codec = tonic_prost::ProstCodec::default();
1327            let path = http::uri::PathAndQuery::from_static(
1328                "/pidgr.v1.PrivacyService/ExportUserData",
1329            );
1330            let mut req = request.into_request();
1331            req.extensions_mut()
1332                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1333            self.inner.unary(req, path, codec).await
1334        }
1335        /** Export all data associated with the calling organization as an encrypted
1336 bundle (GDPR Art. 20). The workflow assembles org configuration, users,
1337 campaigns, deliveries, and audit events; the bundle is delivered via a
1338 pre-signed S3 URL. Async operation — returns immediately with PENDING
1339 status and an export_id to poll.
1340 Auth: Requires JWT. Org admin only.
1341*/
1342        pub async fn export_org_data(
1343            &mut self,
1344            request: impl tonic::IntoRequest<super::ExportOrgDataRequest>,
1345        ) -> std::result::Result<
1346            tonic::Response<super::ExportOrgDataResponse>,
1347            tonic::Status,
1348        > {
1349            self.inner
1350                .ready()
1351                .await
1352                .map_err(|e| {
1353                    tonic::Status::unknown(
1354                        format!("Service was not ready: {}", e.into()),
1355                    )
1356                })?;
1357            let codec = tonic_prost::ProstCodec::default();
1358            let path = http::uri::PathAndQuery::from_static(
1359                "/pidgr.v1.PrivacyService/ExportOrgData",
1360            );
1361            let mut req = request.into_request();
1362            req.extensions_mut()
1363                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportOrgData"));
1364            self.inner.unary(req, path, codec).await
1365        }
1366        /** Delete or anonymize all personal data associated with a user.
1367 Deletion has a 30-day grace period during which processing is restricted
1368 and the request can be cancelled. After 30 days, deletion is irreversible.
1369 Auth: Requires JWT. Admin only.
1370*/
1371        pub async fn delete_user_data(
1372            &mut self,
1373            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1374        ) -> std::result::Result<
1375            tonic::Response<super::DeleteUserDataResponse>,
1376            tonic::Status,
1377        > {
1378            self.inner
1379                .ready()
1380                .await
1381                .map_err(|e| {
1382                    tonic::Status::unknown(
1383                        format!("Service was not ready: {}", e.into()),
1384                    )
1385                })?;
1386            let codec = tonic_prost::ProstCodec::default();
1387            let path = http::uri::PathAndQuery::from_static(
1388                "/pidgr.v1.PrivacyService/DeleteUserData",
1389            );
1390            let mut req = request.into_request();
1391            req.extensions_mut()
1392                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1393            self.inner.unary(req, path, codec).await
1394        }
1395        /** Correct personal data for a user. Propagates corrections to all stored
1396 locations (profile, delivery records, analytics metadata).
1397 Auth: Requires JWT. Callable by the user themselves or an org admin.
1398*/
1399        pub async fn rectify_user_data(
1400            &mut self,
1401            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1402        ) -> std::result::Result<
1403            tonic::Response<super::RectifyUserDataResponse>,
1404            tonic::Status,
1405        > {
1406            self.inner
1407                .ready()
1408                .await
1409                .map_err(|e| {
1410                    tonic::Status::unknown(
1411                        format!("Service was not ready: {}", e.into()),
1412                    )
1413                })?;
1414            let codec = tonic_prost::ProstCodec::default();
1415            let path = http::uri::PathAndQuery::from_static(
1416                "/pidgr.v1.PrivacyService/RectifyUserData",
1417            );
1418            let mut req = request.into_request();
1419            req.extensions_mut()
1420                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1421            self.inner.unary(req, path, codec).await
1422        }
1423        /** Restrict or unrestrict processing for a user. When restricted, the API
1424 skips this user in campaigns, analytics, and session replay.
1425 Auth: Requires JWT. Admin only.
1426*/
1427        pub async fn restrict_processing(
1428            &mut self,
1429            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1430        ) -> std::result::Result<
1431            tonic::Response<super::RestrictProcessingResponse>,
1432            tonic::Status,
1433        > {
1434            self.inner
1435                .ready()
1436                .await
1437                .map_err(|e| {
1438                    tonic::Status::unknown(
1439                        format!("Service was not ready: {}", e.into()),
1440                    )
1441                })?;
1442            let codec = tonic_prost::ProstCodec::default();
1443            let path = http::uri::PathAndQuery::from_static(
1444                "/pidgr.v1.PrivacyService/RestrictProcessing",
1445            );
1446            let mut req = request.into_request();
1447            req.extensions_mut()
1448                .insert(
1449                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1450                );
1451            self.inner.unary(req, path, codec).await
1452        }
1453        /** Confirm whether personal data exists for a user and list data categories.
1454 LGPD-specific: confirmação de existência (Art. 18, I).
1455 Auth: Requires JWT. Admin only.
1456*/
1457        pub async fn get_data_existence_confirmation(
1458            &mut self,
1459            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1460        ) -> std::result::Result<
1461            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1462            tonic::Status,
1463        > {
1464            self.inner
1465                .ready()
1466                .await
1467                .map_err(|e| {
1468                    tonic::Status::unknown(
1469                        format!("Service was not ready: {}", e.into()),
1470                    )
1471                })?;
1472            let codec = tonic_prost::ProstCodec::default();
1473            let path = http::uri::PathAndQuery::from_static(
1474                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1475            );
1476            let mut req = request.into_request();
1477            req.extensions_mut()
1478                .insert(
1479                    GrpcMethod::new(
1480                        "pidgr.v1.PrivacyService",
1481                        "GetDataExistenceConfirmation",
1482                    ),
1483                );
1484            self.inner.unary(req, path, codec).await
1485        }
1486        /** List privacy requests for the organization, with optional filters.
1487 Used by the admin UI to show scheduled deletions table.
1488 Auth: Requires JWT. Admin only.
1489*/
1490        pub async fn list_privacy_requests(
1491            &mut self,
1492            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1493        ) -> std::result::Result<
1494            tonic::Response<super::ListPrivacyRequestsResponse>,
1495            tonic::Status,
1496        > {
1497            self.inner
1498                .ready()
1499                .await
1500                .map_err(|e| {
1501                    tonic::Status::unknown(
1502                        format!("Service was not ready: {}", e.into()),
1503                    )
1504                })?;
1505            let codec = tonic_prost::ProstCodec::default();
1506            let path = http::uri::PathAndQuery::from_static(
1507                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1508            );
1509            let mut req = request.into_request();
1510            req.extensions_mut()
1511                .insert(
1512                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1513                );
1514            self.inner.unary(req, path, codec).await
1515        }
1516        /** Cancel a pending deletion request. Reactivates the user and aborts
1517 the deletion workflow. Only valid during the 30-day grace period.
1518 Auth: Requires JWT. Admin only.
1519*/
1520        pub async fn cancel_deletion(
1521            &mut self,
1522            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1523        ) -> std::result::Result<
1524            tonic::Response<super::CancelDeletionResponse>,
1525            tonic::Status,
1526        > {
1527            self.inner
1528                .ready()
1529                .await
1530                .map_err(|e| {
1531                    tonic::Status::unknown(
1532                        format!("Service was not ready: {}", e.into()),
1533                    )
1534                })?;
1535            let codec = tonic_prost::ProstCodec::default();
1536            let path = http::uri::PathAndQuery::from_static(
1537                "/pidgr.v1.PrivacyService/CancelDeletion",
1538            );
1539            let mut req = request.into_request();
1540            req.extensions_mut()
1541                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1542            self.inner.unary(req, path, codec).await
1543        }
1544        /** Skip the grace period and delete immediately. Signals the deletion
1545 workflow to proceed without waiting for the 30-day timer.
1546 Auth: Requires JWT. Admin only.
1547*/
1548        pub async fn immediate_delete(
1549            &mut self,
1550            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1551        ) -> std::result::Result<
1552            tonic::Response<super::ImmediateDeleteResponse>,
1553            tonic::Status,
1554        > {
1555            self.inner
1556                .ready()
1557                .await
1558                .map_err(|e| {
1559                    tonic::Status::unknown(
1560                        format!("Service was not ready: {}", e.into()),
1561                    )
1562                })?;
1563            let codec = tonic_prost::ProstCodec::default();
1564            let path = http::uri::PathAndQuery::from_static(
1565                "/pidgr.v1.PrivacyService/ImmediateDelete",
1566            );
1567            let mut req = request.into_request();
1568            req.extensions_mut()
1569                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1570            self.inner.unary(req, path, codec).await
1571        }
1572        /** List the calling user's own privacy requests (export, rectify).
1573 The server extracts user_id from the JWT — no admin permission required.
1574 Auth: Requires JWT. Any authenticated user.
1575*/
1576        pub async fn list_my_privacy_requests(
1577            &mut self,
1578            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1579        ) -> std::result::Result<
1580            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1581            tonic::Status,
1582        > {
1583            self.inner
1584                .ready()
1585                .await
1586                .map_err(|e| {
1587                    tonic::Status::unknown(
1588                        format!("Service was not ready: {}", e.into()),
1589                    )
1590                })?;
1591            let codec = tonic_prost::ProstCodec::default();
1592            let path = http::uri::PathAndQuery::from_static(
1593                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1594            );
1595            let mut req = request.into_request();
1596            req.extensions_mut()
1597                .insert(
1598                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1599                );
1600            self.inner.unary(req, path, codec).await
1601        }
1602        /** List security incidents that touched the calling organization, newest
1603 first. Read-only org-facing subset of the staff incident queue — used by
1604 the admin breach feed (GDPR Art. 33/34 transparency).
1605 Auth: Requires JWT. Admin only.
1606*/
1607        pub async fn list_org_security_incidents(
1608            &mut self,
1609            request: impl tonic::IntoRequest<super::ListOrgSecurityIncidentsRequest>,
1610        ) -> std::result::Result<
1611            tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1612            tonic::Status,
1613        > {
1614            self.inner
1615                .ready()
1616                .await
1617                .map_err(|e| {
1618                    tonic::Status::unknown(
1619                        format!("Service was not ready: {}", e.into()),
1620                    )
1621                })?;
1622            let codec = tonic_prost::ProstCodec::default();
1623            let path = http::uri::PathAndQuery::from_static(
1624                "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents",
1625            );
1626            let mut req = request.into_request();
1627            req.extensions_mut()
1628                .insert(
1629                    GrpcMethod::new(
1630                        "pidgr.v1.PrivacyService",
1631                        "ListOrgSecurityIncidents",
1632                    ),
1633                );
1634            self.inner.unary(req, path, codec).await
1635        }
1636    }
1637}
1638/// Generated server implementations.
1639pub mod privacy_service_server {
1640    #![allow(
1641        unused_variables,
1642        dead_code,
1643        missing_docs,
1644        clippy::wildcard_imports,
1645        clippy::let_unit_value,
1646    )]
1647    use tonic::codegen::*;
1648    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
1649    #[async_trait]
1650    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1651        /** Export all personal data associated with a user as a downloadable ZIP.
1652 Async operation — returns immediately with PENDING status, sends push
1653 notification when the export is ready.
1654 Auth: Requires JWT. Callable by the user themselves or an org admin.
1655*/
1656        async fn export_user_data(
1657            &self,
1658            request: tonic::Request<super::ExportUserDataRequest>,
1659        ) -> std::result::Result<
1660            tonic::Response<super::ExportUserDataResponse>,
1661            tonic::Status,
1662        >;
1663        /** Export all data associated with the calling organization as an encrypted
1664 bundle (GDPR Art. 20). The workflow assembles org configuration, users,
1665 campaigns, deliveries, and audit events; the bundle is delivered via a
1666 pre-signed S3 URL. Async operation — returns immediately with PENDING
1667 status and an export_id to poll.
1668 Auth: Requires JWT. Org admin only.
1669*/
1670        async fn export_org_data(
1671            &self,
1672            request: tonic::Request<super::ExportOrgDataRequest>,
1673        ) -> std::result::Result<
1674            tonic::Response<super::ExportOrgDataResponse>,
1675            tonic::Status,
1676        >;
1677        /** Delete or anonymize all personal data associated with a user.
1678 Deletion has a 30-day grace period during which processing is restricted
1679 and the request can be cancelled. After 30 days, deletion is irreversible.
1680 Auth: Requires JWT. Admin only.
1681*/
1682        async fn delete_user_data(
1683            &self,
1684            request: tonic::Request<super::DeleteUserDataRequest>,
1685        ) -> std::result::Result<
1686            tonic::Response<super::DeleteUserDataResponse>,
1687            tonic::Status,
1688        >;
1689        /** Correct personal data for a user. Propagates corrections to all stored
1690 locations (profile, delivery records, analytics metadata).
1691 Auth: Requires JWT. Callable by the user themselves or an org admin.
1692*/
1693        async fn rectify_user_data(
1694            &self,
1695            request: tonic::Request<super::RectifyUserDataRequest>,
1696        ) -> std::result::Result<
1697            tonic::Response<super::RectifyUserDataResponse>,
1698            tonic::Status,
1699        >;
1700        /** Restrict or unrestrict processing for a user. When restricted, the API
1701 skips this user in campaigns, analytics, and session replay.
1702 Auth: Requires JWT. Admin only.
1703*/
1704        async fn restrict_processing(
1705            &self,
1706            request: tonic::Request<super::RestrictProcessingRequest>,
1707        ) -> std::result::Result<
1708            tonic::Response<super::RestrictProcessingResponse>,
1709            tonic::Status,
1710        >;
1711        /** Confirm whether personal data exists for a user and list data categories.
1712 LGPD-specific: confirmação de existência (Art. 18, I).
1713 Auth: Requires JWT. Admin only.
1714*/
1715        async fn get_data_existence_confirmation(
1716            &self,
1717            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1718        ) -> std::result::Result<
1719            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1720            tonic::Status,
1721        >;
1722        /** List privacy requests for the organization, with optional filters.
1723 Used by the admin UI to show scheduled deletions table.
1724 Auth: Requires JWT. Admin only.
1725*/
1726        async fn list_privacy_requests(
1727            &self,
1728            request: tonic::Request<super::ListPrivacyRequestsRequest>,
1729        ) -> std::result::Result<
1730            tonic::Response<super::ListPrivacyRequestsResponse>,
1731            tonic::Status,
1732        >;
1733        /** Cancel a pending deletion request. Reactivates the user and aborts
1734 the deletion workflow. Only valid during the 30-day grace period.
1735 Auth: Requires JWT. Admin only.
1736*/
1737        async fn cancel_deletion(
1738            &self,
1739            request: tonic::Request<super::CancelDeletionRequest>,
1740        ) -> std::result::Result<
1741            tonic::Response<super::CancelDeletionResponse>,
1742            tonic::Status,
1743        >;
1744        /** Skip the grace period and delete immediately. Signals the deletion
1745 workflow to proceed without waiting for the 30-day timer.
1746 Auth: Requires JWT. Admin only.
1747*/
1748        async fn immediate_delete(
1749            &self,
1750            request: tonic::Request<super::ImmediateDeleteRequest>,
1751        ) -> std::result::Result<
1752            tonic::Response<super::ImmediateDeleteResponse>,
1753            tonic::Status,
1754        >;
1755        /** List the calling user's own privacy requests (export, rectify).
1756 The server extracts user_id from the JWT — no admin permission required.
1757 Auth: Requires JWT. Any authenticated user.
1758*/
1759        async fn list_my_privacy_requests(
1760            &self,
1761            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1762        ) -> std::result::Result<
1763            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1764            tonic::Status,
1765        >;
1766        /** List security incidents that touched the calling organization, newest
1767 first. Read-only org-facing subset of the staff incident queue — used by
1768 the admin breach feed (GDPR Art. 33/34 transparency).
1769 Auth: Requires JWT. Admin only.
1770*/
1771        async fn list_org_security_incidents(
1772            &self,
1773            request: tonic::Request<super::ListOrgSecurityIncidentsRequest>,
1774        ) -> std::result::Result<
1775            tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1776            tonic::Status,
1777        >;
1778    }
1779    /** PrivacyService handles GDPR/LGPD data subject rights.
1780 All RPCs extract org_id from the JWT — it is never in request messages.
1781*/
1782    #[derive(Debug)]
1783    pub struct PrivacyServiceServer<T> {
1784        inner: Arc<T>,
1785        accept_compression_encodings: EnabledCompressionEncodings,
1786        send_compression_encodings: EnabledCompressionEncodings,
1787        max_decoding_message_size: Option<usize>,
1788        max_encoding_message_size: Option<usize>,
1789    }
1790    impl<T> PrivacyServiceServer<T> {
1791        pub fn new(inner: T) -> Self {
1792            Self::from_arc(Arc::new(inner))
1793        }
1794        pub fn from_arc(inner: Arc<T>) -> Self {
1795            Self {
1796                inner,
1797                accept_compression_encodings: Default::default(),
1798                send_compression_encodings: Default::default(),
1799                max_decoding_message_size: None,
1800                max_encoding_message_size: None,
1801            }
1802        }
1803        pub fn with_interceptor<F>(
1804            inner: T,
1805            interceptor: F,
1806        ) -> InterceptedService<Self, F>
1807        where
1808            F: tonic::service::Interceptor,
1809        {
1810            InterceptedService::new(Self::new(inner), interceptor)
1811        }
1812        /// Enable decompressing requests with the given encoding.
1813        #[must_use]
1814        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1815            self.accept_compression_encodings.enable(encoding);
1816            self
1817        }
1818        /// Compress responses with the given encoding, if the client supports it.
1819        #[must_use]
1820        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1821            self.send_compression_encodings.enable(encoding);
1822            self
1823        }
1824        /// Limits the maximum size of a decoded message.
1825        ///
1826        /// Default: `4MB`
1827        #[must_use]
1828        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1829            self.max_decoding_message_size = Some(limit);
1830            self
1831        }
1832        /// Limits the maximum size of an encoded message.
1833        ///
1834        /// Default: `usize::MAX`
1835        #[must_use]
1836        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1837            self.max_encoding_message_size = Some(limit);
1838            self
1839        }
1840    }
1841    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1842    where
1843        T: PrivacyService,
1844        B: Body + std::marker::Send + 'static,
1845        B::Error: Into<StdError> + std::marker::Send + 'static,
1846    {
1847        type Response = http::Response<tonic::body::Body>;
1848        type Error = std::convert::Infallible;
1849        type Future = BoxFuture<Self::Response, Self::Error>;
1850        fn poll_ready(
1851            &mut self,
1852            _cx: &mut Context<'_>,
1853        ) -> Poll<std::result::Result<(), Self::Error>> {
1854            Poll::Ready(Ok(()))
1855        }
1856        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1857            match req.uri().path() {
1858                "/pidgr.v1.PrivacyService/ExportUserData" => {
1859                    #[allow(non_camel_case_types)]
1860                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1861                    impl<
1862                        T: PrivacyService,
1863                    > tonic::server::UnaryService<super::ExportUserDataRequest>
1864                    for ExportUserDataSvc<T> {
1865                        type Response = super::ExportUserDataResponse;
1866                        type Future = BoxFuture<
1867                            tonic::Response<Self::Response>,
1868                            tonic::Status,
1869                        >;
1870                        fn call(
1871                            &mut self,
1872                            request: tonic::Request<super::ExportUserDataRequest>,
1873                        ) -> Self::Future {
1874                            let inner = Arc::clone(&self.0);
1875                            let fut = async move {
1876                                <T as PrivacyService>::export_user_data(&inner, request)
1877                                    .await
1878                            };
1879                            Box::pin(fut)
1880                        }
1881                    }
1882                    let accept_compression_encodings = self.accept_compression_encodings;
1883                    let send_compression_encodings = self.send_compression_encodings;
1884                    let max_decoding_message_size = self.max_decoding_message_size;
1885                    let max_encoding_message_size = self.max_encoding_message_size;
1886                    let inner = self.inner.clone();
1887                    let fut = async move {
1888                        let method = ExportUserDataSvc(inner);
1889                        let codec = tonic_prost::ProstCodec::default();
1890                        let mut grpc = tonic::server::Grpc::new(codec)
1891                            .apply_compression_config(
1892                                accept_compression_encodings,
1893                                send_compression_encodings,
1894                            )
1895                            .apply_max_message_size_config(
1896                                max_decoding_message_size,
1897                                max_encoding_message_size,
1898                            );
1899                        let res = grpc.unary(method, req).await;
1900                        Ok(res)
1901                    };
1902                    Box::pin(fut)
1903                }
1904                "/pidgr.v1.PrivacyService/ExportOrgData" => {
1905                    #[allow(non_camel_case_types)]
1906                    struct ExportOrgDataSvc<T: PrivacyService>(pub Arc<T>);
1907                    impl<
1908                        T: PrivacyService,
1909                    > tonic::server::UnaryService<super::ExportOrgDataRequest>
1910                    for ExportOrgDataSvc<T> {
1911                        type Response = super::ExportOrgDataResponse;
1912                        type Future = BoxFuture<
1913                            tonic::Response<Self::Response>,
1914                            tonic::Status,
1915                        >;
1916                        fn call(
1917                            &mut self,
1918                            request: tonic::Request<super::ExportOrgDataRequest>,
1919                        ) -> Self::Future {
1920                            let inner = Arc::clone(&self.0);
1921                            let fut = async move {
1922                                <T as PrivacyService>::export_org_data(&inner, request)
1923                                    .await
1924                            };
1925                            Box::pin(fut)
1926                        }
1927                    }
1928                    let accept_compression_encodings = self.accept_compression_encodings;
1929                    let send_compression_encodings = self.send_compression_encodings;
1930                    let max_decoding_message_size = self.max_decoding_message_size;
1931                    let max_encoding_message_size = self.max_encoding_message_size;
1932                    let inner = self.inner.clone();
1933                    let fut = async move {
1934                        let method = ExportOrgDataSvc(inner);
1935                        let codec = tonic_prost::ProstCodec::default();
1936                        let mut grpc = tonic::server::Grpc::new(codec)
1937                            .apply_compression_config(
1938                                accept_compression_encodings,
1939                                send_compression_encodings,
1940                            )
1941                            .apply_max_message_size_config(
1942                                max_decoding_message_size,
1943                                max_encoding_message_size,
1944                            );
1945                        let res = grpc.unary(method, req).await;
1946                        Ok(res)
1947                    };
1948                    Box::pin(fut)
1949                }
1950                "/pidgr.v1.PrivacyService/DeleteUserData" => {
1951                    #[allow(non_camel_case_types)]
1952                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1953                    impl<
1954                        T: PrivacyService,
1955                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
1956                    for DeleteUserDataSvc<T> {
1957                        type Response = super::DeleteUserDataResponse;
1958                        type Future = BoxFuture<
1959                            tonic::Response<Self::Response>,
1960                            tonic::Status,
1961                        >;
1962                        fn call(
1963                            &mut self,
1964                            request: tonic::Request<super::DeleteUserDataRequest>,
1965                        ) -> Self::Future {
1966                            let inner = Arc::clone(&self.0);
1967                            let fut = async move {
1968                                <T as PrivacyService>::delete_user_data(&inner, request)
1969                                    .await
1970                            };
1971                            Box::pin(fut)
1972                        }
1973                    }
1974                    let accept_compression_encodings = self.accept_compression_encodings;
1975                    let send_compression_encodings = self.send_compression_encodings;
1976                    let max_decoding_message_size = self.max_decoding_message_size;
1977                    let max_encoding_message_size = self.max_encoding_message_size;
1978                    let inner = self.inner.clone();
1979                    let fut = async move {
1980                        let method = DeleteUserDataSvc(inner);
1981                        let codec = tonic_prost::ProstCodec::default();
1982                        let mut grpc = tonic::server::Grpc::new(codec)
1983                            .apply_compression_config(
1984                                accept_compression_encodings,
1985                                send_compression_encodings,
1986                            )
1987                            .apply_max_message_size_config(
1988                                max_decoding_message_size,
1989                                max_encoding_message_size,
1990                            );
1991                        let res = grpc.unary(method, req).await;
1992                        Ok(res)
1993                    };
1994                    Box::pin(fut)
1995                }
1996                "/pidgr.v1.PrivacyService/RectifyUserData" => {
1997                    #[allow(non_camel_case_types)]
1998                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1999                    impl<
2000                        T: PrivacyService,
2001                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
2002                    for RectifyUserDataSvc<T> {
2003                        type Response = super::RectifyUserDataResponse;
2004                        type Future = BoxFuture<
2005                            tonic::Response<Self::Response>,
2006                            tonic::Status,
2007                        >;
2008                        fn call(
2009                            &mut self,
2010                            request: tonic::Request<super::RectifyUserDataRequest>,
2011                        ) -> Self::Future {
2012                            let inner = Arc::clone(&self.0);
2013                            let fut = async move {
2014                                <T as PrivacyService>::rectify_user_data(&inner, request)
2015                                    .await
2016                            };
2017                            Box::pin(fut)
2018                        }
2019                    }
2020                    let accept_compression_encodings = self.accept_compression_encodings;
2021                    let send_compression_encodings = self.send_compression_encodings;
2022                    let max_decoding_message_size = self.max_decoding_message_size;
2023                    let max_encoding_message_size = self.max_encoding_message_size;
2024                    let inner = self.inner.clone();
2025                    let fut = async move {
2026                        let method = RectifyUserDataSvc(inner);
2027                        let codec = tonic_prost::ProstCodec::default();
2028                        let mut grpc = tonic::server::Grpc::new(codec)
2029                            .apply_compression_config(
2030                                accept_compression_encodings,
2031                                send_compression_encodings,
2032                            )
2033                            .apply_max_message_size_config(
2034                                max_decoding_message_size,
2035                                max_encoding_message_size,
2036                            );
2037                        let res = grpc.unary(method, req).await;
2038                        Ok(res)
2039                    };
2040                    Box::pin(fut)
2041                }
2042                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
2043                    #[allow(non_camel_case_types)]
2044                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
2045                    impl<
2046                        T: PrivacyService,
2047                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
2048                    for RestrictProcessingSvc<T> {
2049                        type Response = super::RestrictProcessingResponse;
2050                        type Future = BoxFuture<
2051                            tonic::Response<Self::Response>,
2052                            tonic::Status,
2053                        >;
2054                        fn call(
2055                            &mut self,
2056                            request: tonic::Request<super::RestrictProcessingRequest>,
2057                        ) -> Self::Future {
2058                            let inner = Arc::clone(&self.0);
2059                            let fut = async move {
2060                                <T as PrivacyService>::restrict_processing(&inner, request)
2061                                    .await
2062                            };
2063                            Box::pin(fut)
2064                        }
2065                    }
2066                    let accept_compression_encodings = self.accept_compression_encodings;
2067                    let send_compression_encodings = self.send_compression_encodings;
2068                    let max_decoding_message_size = self.max_decoding_message_size;
2069                    let max_encoding_message_size = self.max_encoding_message_size;
2070                    let inner = self.inner.clone();
2071                    let fut = async move {
2072                        let method = RestrictProcessingSvc(inner);
2073                        let codec = tonic_prost::ProstCodec::default();
2074                        let mut grpc = tonic::server::Grpc::new(codec)
2075                            .apply_compression_config(
2076                                accept_compression_encodings,
2077                                send_compression_encodings,
2078                            )
2079                            .apply_max_message_size_config(
2080                                max_decoding_message_size,
2081                                max_encoding_message_size,
2082                            );
2083                        let res = grpc.unary(method, req).await;
2084                        Ok(res)
2085                    };
2086                    Box::pin(fut)
2087                }
2088                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2089                    #[allow(non_camel_case_types)]
2090                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2091                        pub Arc<T>,
2092                    );
2093                    impl<
2094                        T: PrivacyService,
2095                    > tonic::server::UnaryService<
2096                        super::GetDataExistenceConfirmationRequest,
2097                    > for GetDataExistenceConfirmationSvc<T> {
2098                        type Response = super::GetDataExistenceConfirmationResponse;
2099                        type Future = BoxFuture<
2100                            tonic::Response<Self::Response>,
2101                            tonic::Status,
2102                        >;
2103                        fn call(
2104                            &mut self,
2105                            request: tonic::Request<
2106                                super::GetDataExistenceConfirmationRequest,
2107                            >,
2108                        ) -> Self::Future {
2109                            let inner = Arc::clone(&self.0);
2110                            let fut = async move {
2111                                <T as PrivacyService>::get_data_existence_confirmation(
2112                                        &inner,
2113                                        request,
2114                                    )
2115                                    .await
2116                            };
2117                            Box::pin(fut)
2118                        }
2119                    }
2120                    let accept_compression_encodings = self.accept_compression_encodings;
2121                    let send_compression_encodings = self.send_compression_encodings;
2122                    let max_decoding_message_size = self.max_decoding_message_size;
2123                    let max_encoding_message_size = self.max_encoding_message_size;
2124                    let inner = self.inner.clone();
2125                    let fut = async move {
2126                        let method = GetDataExistenceConfirmationSvc(inner);
2127                        let codec = tonic_prost::ProstCodec::default();
2128                        let mut grpc = tonic::server::Grpc::new(codec)
2129                            .apply_compression_config(
2130                                accept_compression_encodings,
2131                                send_compression_encodings,
2132                            )
2133                            .apply_max_message_size_config(
2134                                max_decoding_message_size,
2135                                max_encoding_message_size,
2136                            );
2137                        let res = grpc.unary(method, req).await;
2138                        Ok(res)
2139                    };
2140                    Box::pin(fut)
2141                }
2142                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2143                    #[allow(non_camel_case_types)]
2144                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2145                    impl<
2146                        T: PrivacyService,
2147                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2148                    for ListPrivacyRequestsSvc<T> {
2149                        type Response = super::ListPrivacyRequestsResponse;
2150                        type Future = BoxFuture<
2151                            tonic::Response<Self::Response>,
2152                            tonic::Status,
2153                        >;
2154                        fn call(
2155                            &mut self,
2156                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2157                        ) -> Self::Future {
2158                            let inner = Arc::clone(&self.0);
2159                            let fut = async move {
2160                                <T as PrivacyService>::list_privacy_requests(
2161                                        &inner,
2162                                        request,
2163                                    )
2164                                    .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 = ListPrivacyRequestsSvc(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                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2192                    #[allow(non_camel_case_types)]
2193                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2194                    impl<
2195                        T: PrivacyService,
2196                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2197                    for CancelDeletionSvc<T> {
2198                        type Response = super::CancelDeletionResponse;
2199                        type Future = BoxFuture<
2200                            tonic::Response<Self::Response>,
2201                            tonic::Status,
2202                        >;
2203                        fn call(
2204                            &mut self,
2205                            request: tonic::Request<super::CancelDeletionRequest>,
2206                        ) -> Self::Future {
2207                            let inner = Arc::clone(&self.0);
2208                            let fut = async move {
2209                                <T as PrivacyService>::cancel_deletion(&inner, request)
2210                                    .await
2211                            };
2212                            Box::pin(fut)
2213                        }
2214                    }
2215                    let accept_compression_encodings = self.accept_compression_encodings;
2216                    let send_compression_encodings = self.send_compression_encodings;
2217                    let max_decoding_message_size = self.max_decoding_message_size;
2218                    let max_encoding_message_size = self.max_encoding_message_size;
2219                    let inner = self.inner.clone();
2220                    let fut = async move {
2221                        let method = CancelDeletionSvc(inner);
2222                        let codec = tonic_prost::ProstCodec::default();
2223                        let mut grpc = tonic::server::Grpc::new(codec)
2224                            .apply_compression_config(
2225                                accept_compression_encodings,
2226                                send_compression_encodings,
2227                            )
2228                            .apply_max_message_size_config(
2229                                max_decoding_message_size,
2230                                max_encoding_message_size,
2231                            );
2232                        let res = grpc.unary(method, req).await;
2233                        Ok(res)
2234                    };
2235                    Box::pin(fut)
2236                }
2237                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2238                    #[allow(non_camel_case_types)]
2239                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2240                    impl<
2241                        T: PrivacyService,
2242                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2243                    for ImmediateDeleteSvc<T> {
2244                        type Response = super::ImmediateDeleteResponse;
2245                        type Future = BoxFuture<
2246                            tonic::Response<Self::Response>,
2247                            tonic::Status,
2248                        >;
2249                        fn call(
2250                            &mut self,
2251                            request: tonic::Request<super::ImmediateDeleteRequest>,
2252                        ) -> Self::Future {
2253                            let inner = Arc::clone(&self.0);
2254                            let fut = async move {
2255                                <T as PrivacyService>::immediate_delete(&inner, request)
2256                                    .await
2257                            };
2258                            Box::pin(fut)
2259                        }
2260                    }
2261                    let accept_compression_encodings = self.accept_compression_encodings;
2262                    let send_compression_encodings = self.send_compression_encodings;
2263                    let max_decoding_message_size = self.max_decoding_message_size;
2264                    let max_encoding_message_size = self.max_encoding_message_size;
2265                    let inner = self.inner.clone();
2266                    let fut = async move {
2267                        let method = ImmediateDeleteSvc(inner);
2268                        let codec = tonic_prost::ProstCodec::default();
2269                        let mut grpc = tonic::server::Grpc::new(codec)
2270                            .apply_compression_config(
2271                                accept_compression_encodings,
2272                                send_compression_encodings,
2273                            )
2274                            .apply_max_message_size_config(
2275                                max_decoding_message_size,
2276                                max_encoding_message_size,
2277                            );
2278                        let res = grpc.unary(method, req).await;
2279                        Ok(res)
2280                    };
2281                    Box::pin(fut)
2282                }
2283                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2284                    #[allow(non_camel_case_types)]
2285                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2286                    impl<
2287                        T: PrivacyService,
2288                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2289                    for ListMyPrivacyRequestsSvc<T> {
2290                        type Response = super::ListMyPrivacyRequestsResponse;
2291                        type Future = BoxFuture<
2292                            tonic::Response<Self::Response>,
2293                            tonic::Status,
2294                        >;
2295                        fn call(
2296                            &mut self,
2297                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2298                        ) -> Self::Future {
2299                            let inner = Arc::clone(&self.0);
2300                            let fut = async move {
2301                                <T as PrivacyService>::list_my_privacy_requests(
2302                                        &inner,
2303                                        request,
2304                                    )
2305                                    .await
2306                            };
2307                            Box::pin(fut)
2308                        }
2309                    }
2310                    let accept_compression_encodings = self.accept_compression_encodings;
2311                    let send_compression_encodings = self.send_compression_encodings;
2312                    let max_decoding_message_size = self.max_decoding_message_size;
2313                    let max_encoding_message_size = self.max_encoding_message_size;
2314                    let inner = self.inner.clone();
2315                    let fut = async move {
2316                        let method = ListMyPrivacyRequestsSvc(inner);
2317                        let codec = tonic_prost::ProstCodec::default();
2318                        let mut grpc = tonic::server::Grpc::new(codec)
2319                            .apply_compression_config(
2320                                accept_compression_encodings,
2321                                send_compression_encodings,
2322                            )
2323                            .apply_max_message_size_config(
2324                                max_decoding_message_size,
2325                                max_encoding_message_size,
2326                            );
2327                        let res = grpc.unary(method, req).await;
2328                        Ok(res)
2329                    };
2330                    Box::pin(fut)
2331                }
2332                "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents" => {
2333                    #[allow(non_camel_case_types)]
2334                    struct ListOrgSecurityIncidentsSvc<T: PrivacyService>(pub Arc<T>);
2335                    impl<
2336                        T: PrivacyService,
2337                    > tonic::server::UnaryService<super::ListOrgSecurityIncidentsRequest>
2338                    for ListOrgSecurityIncidentsSvc<T> {
2339                        type Response = super::ListOrgSecurityIncidentsResponse;
2340                        type Future = BoxFuture<
2341                            tonic::Response<Self::Response>,
2342                            tonic::Status,
2343                        >;
2344                        fn call(
2345                            &mut self,
2346                            request: tonic::Request<
2347                                super::ListOrgSecurityIncidentsRequest,
2348                            >,
2349                        ) -> Self::Future {
2350                            let inner = Arc::clone(&self.0);
2351                            let fut = async move {
2352                                <T as PrivacyService>::list_org_security_incidents(
2353                                        &inner,
2354                                        request,
2355                                    )
2356                                    .await
2357                            };
2358                            Box::pin(fut)
2359                        }
2360                    }
2361                    let accept_compression_encodings = self.accept_compression_encodings;
2362                    let send_compression_encodings = self.send_compression_encodings;
2363                    let max_decoding_message_size = self.max_decoding_message_size;
2364                    let max_encoding_message_size = self.max_encoding_message_size;
2365                    let inner = self.inner.clone();
2366                    let fut = async move {
2367                        let method = ListOrgSecurityIncidentsSvc(inner);
2368                        let codec = tonic_prost::ProstCodec::default();
2369                        let mut grpc = tonic::server::Grpc::new(codec)
2370                            .apply_compression_config(
2371                                accept_compression_encodings,
2372                                send_compression_encodings,
2373                            )
2374                            .apply_max_message_size_config(
2375                                max_decoding_message_size,
2376                                max_encoding_message_size,
2377                            );
2378                        let res = grpc.unary(method, req).await;
2379                        Ok(res)
2380                    };
2381                    Box::pin(fut)
2382                }
2383                _ => {
2384                    Box::pin(async move {
2385                        let mut response = http::Response::new(
2386                            tonic::body::Body::default(),
2387                        );
2388                        let headers = response.headers_mut();
2389                        headers
2390                            .insert(
2391                                tonic::Status::GRPC_STATUS,
2392                                (tonic::Code::Unimplemented as i32).into(),
2393                            );
2394                        headers
2395                            .insert(
2396                                http::header::CONTENT_TYPE,
2397                                tonic::metadata::GRPC_CONTENT_TYPE,
2398                            );
2399                        Ok(response)
2400                    })
2401                }
2402            }
2403        }
2404    }
2405    impl<T> Clone for PrivacyServiceServer<T> {
2406        fn clone(&self) -> Self {
2407            let inner = self.inner.clone();
2408            Self {
2409                inner,
2410                accept_compression_encodings: self.accept_compression_encodings,
2411                send_compression_encodings: self.send_compression_encodings,
2412                max_decoding_message_size: self.max_decoding_message_size,
2413                max_encoding_message_size: self.max_encoding_message_size,
2414            }
2415        }
2416    }
2417    /// Generated gRPC service name
2418    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2419    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2420        const NAME: &'static str = SERVICE_NAME;
2421    }
2422}
2423/// Generated client implementations.
2424pub mod audit_service_client {
2425    #![allow(
2426        unused_variables,
2427        dead_code,
2428        missing_docs,
2429        clippy::wildcard_imports,
2430        clippy::let_unit_value,
2431    )]
2432    use tonic::codegen::*;
2433    use tonic::codegen::http::Uri;
2434    /** AuditService provides read access to the append-only audit trail, plus an
2435 internal-mTLS-only Append RPC for sibling services that need to record
2436 their own audit events into the shared trail.
2437
2438 All read RPCs extract org_id from the JWT — it is never in request
2439 messages. The Append RPC carries org_id explicitly because it is
2440 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2441*/
2442    #[derive(Debug, Clone)]
2443    pub struct AuditServiceClient<T> {
2444        inner: tonic::client::Grpc<T>,
2445    }
2446    impl AuditServiceClient<tonic::transport::Channel> {
2447        /// Attempt to create a new client by connecting to a given endpoint.
2448        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2449        where
2450            D: TryInto<tonic::transport::Endpoint>,
2451            D::Error: Into<StdError>,
2452        {
2453            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2454            Ok(Self::new(conn))
2455        }
2456    }
2457    impl<T> AuditServiceClient<T>
2458    where
2459        T: tonic::client::GrpcService<tonic::body::Body>,
2460        T::Error: Into<StdError>,
2461        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2462        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2463    {
2464        pub fn new(inner: T) -> Self {
2465            let inner = tonic::client::Grpc::new(inner);
2466            Self { inner }
2467        }
2468        pub fn with_origin(inner: T, origin: Uri) -> Self {
2469            let inner = tonic::client::Grpc::with_origin(inner, origin);
2470            Self { inner }
2471        }
2472        pub fn with_interceptor<F>(
2473            inner: T,
2474            interceptor: F,
2475        ) -> AuditServiceClient<InterceptedService<T, F>>
2476        where
2477            F: tonic::service::Interceptor,
2478            T::ResponseBody: Default,
2479            T: tonic::codegen::Service<
2480                http::Request<tonic::body::Body>,
2481                Response = http::Response<
2482                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2483                >,
2484            >,
2485            <T as tonic::codegen::Service<
2486                http::Request<tonic::body::Body>,
2487            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2488        {
2489            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2490        }
2491        /// Compress requests with the given encoding.
2492        ///
2493        /// This requires the server to support it otherwise it might respond with an
2494        /// error.
2495        #[must_use]
2496        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2497            self.inner = self.inner.send_compressed(encoding);
2498            self
2499        }
2500        /// Enable decompressing responses.
2501        #[must_use]
2502        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2503            self.inner = self.inner.accept_compressed(encoding);
2504            self
2505        }
2506        /// Limits the maximum size of a decoded message.
2507        ///
2508        /// Default: `4MB`
2509        #[must_use]
2510        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2511            self.inner = self.inner.max_decoding_message_size(limit);
2512            self
2513        }
2514        /// Limits the maximum size of an encoded message.
2515        ///
2516        /// Default: `usize::MAX`
2517        #[must_use]
2518        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2519            self.inner = self.inner.max_encoding_message_size(limit);
2520            self
2521        }
2522        /** List audit events with optional filtering by event type, actor, and date range.
2523 Results are ordered by created_at descending (newest first).
2524 Auth: Requires JWT. Admin only.
2525*/
2526        pub async fn list_audit_events(
2527            &mut self,
2528            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2529        ) -> std::result::Result<
2530            tonic::Response<super::ListAuditEventsResponse>,
2531            tonic::Status,
2532        > {
2533            self.inner
2534                .ready()
2535                .await
2536                .map_err(|e| {
2537                    tonic::Status::unknown(
2538                        format!("Service was not ready: {}", e.into()),
2539                    )
2540                })?;
2541            let codec = tonic_prost::ProstCodec::default();
2542            let path = http::uri::PathAndQuery::from_static(
2543                "/pidgr.v1.AuditService/ListAuditEvents",
2544            );
2545            let mut req = request.into_request();
2546            req.extensions_mut()
2547                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2548            self.inner.unary(req, path, codec).await
2549        }
2550        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2551 Creates a persistent record and starts an async Temporal workflow.
2552 Auth: Requires JWT. Admin only.
2553*/
2554        pub async fn export_audit_trail(
2555            &mut self,
2556            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2557        ) -> std::result::Result<
2558            tonic::Response<super::ExportAuditTrailResponse>,
2559            tonic::Status,
2560        > {
2561            self.inner
2562                .ready()
2563                .await
2564                .map_err(|e| {
2565                    tonic::Status::unknown(
2566                        format!("Service was not ready: {}", e.into()),
2567                    )
2568                })?;
2569            let codec = tonic_prost::ProstCodec::default();
2570            let path = http::uri::PathAndQuery::from_static(
2571                "/pidgr.v1.AuditService/ExportAuditTrail",
2572            );
2573            let mut req = request.into_request();
2574            req.extensions_mut()
2575                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2576            self.inner.unary(req, path, codec).await
2577        }
2578        /** List audit export history for the organization.
2579 Auth: Requires JWT. Admin only.
2580*/
2581        pub async fn list_audit_exports(
2582            &mut self,
2583            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2584        ) -> std::result::Result<
2585            tonic::Response<super::ListAuditExportsResponse>,
2586            tonic::Status,
2587        > {
2588            self.inner
2589                .ready()
2590                .await
2591                .map_err(|e| {
2592                    tonic::Status::unknown(
2593                        format!("Service was not ready: {}", e.into()),
2594                    )
2595                })?;
2596            let codec = tonic_prost::ProstCodec::default();
2597            let path = http::uri::PathAndQuery::from_static(
2598                "/pidgr.v1.AuditService/ListAuditExports",
2599            );
2600            let mut req = request.into_request();
2601            req.extensions_mut()
2602                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2603            self.inner.unary(req, path, codec).await
2604        }
2605        /** Append one audit event to the trail. Used by sibling services
2606 (pidgr-integrations, future internal services) to record GDPR-relevant
2607 events that originate outside pidgr-api.
2608
2609 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2610 presents only a JWT. The server MUST allowlist callers by their mTLS
2611 client-certificate subject DN.
2612*/
2613        pub async fn append(
2614            &mut self,
2615            request: impl tonic::IntoRequest<super::AppendRequest>,
2616        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status> {
2617            self.inner
2618                .ready()
2619                .await
2620                .map_err(|e| {
2621                    tonic::Status::unknown(
2622                        format!("Service was not ready: {}", e.into()),
2623                    )
2624                })?;
2625            let codec = tonic_prost::ProstCodec::default();
2626            let path = http::uri::PathAndQuery::from_static(
2627                "/pidgr.v1.AuditService/Append",
2628            );
2629            let mut req = request.into_request();
2630            req.extensions_mut()
2631                .insert(GrpcMethod::new("pidgr.v1.AuditService", "Append"));
2632            self.inner.unary(req, path, codec).await
2633        }
2634    }
2635}
2636/// Generated server implementations.
2637pub mod audit_service_server {
2638    #![allow(
2639        unused_variables,
2640        dead_code,
2641        missing_docs,
2642        clippy::wildcard_imports,
2643        clippy::let_unit_value,
2644    )]
2645    use tonic::codegen::*;
2646    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2647    #[async_trait]
2648    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2649        /** List audit events with optional filtering by event type, actor, and date range.
2650 Results are ordered by created_at descending (newest first).
2651 Auth: Requires JWT. Admin only.
2652*/
2653        async fn list_audit_events(
2654            &self,
2655            request: tonic::Request<super::ListAuditEventsRequest>,
2656        ) -> std::result::Result<
2657            tonic::Response<super::ListAuditEventsResponse>,
2658            tonic::Status,
2659        >;
2660        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2661 Creates a persistent record and starts an async Temporal workflow.
2662 Auth: Requires JWT. Admin only.
2663*/
2664        async fn export_audit_trail(
2665            &self,
2666            request: tonic::Request<super::ExportAuditTrailRequest>,
2667        ) -> std::result::Result<
2668            tonic::Response<super::ExportAuditTrailResponse>,
2669            tonic::Status,
2670        >;
2671        /** List audit export history for the organization.
2672 Auth: Requires JWT. Admin only.
2673*/
2674        async fn list_audit_exports(
2675            &self,
2676            request: tonic::Request<super::ListAuditExportsRequest>,
2677        ) -> std::result::Result<
2678            tonic::Response<super::ListAuditExportsResponse>,
2679            tonic::Status,
2680        >;
2681        /** Append one audit event to the trail. Used by sibling services
2682 (pidgr-integrations, future internal services) to record GDPR-relevant
2683 events that originate outside pidgr-api.
2684
2685 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2686 presents only a JWT. The server MUST allowlist callers by their mTLS
2687 client-certificate subject DN.
2688*/
2689        async fn append(
2690            &self,
2691            request: tonic::Request<super::AppendRequest>,
2692        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
2693    }
2694    /** AuditService provides read access to the append-only audit trail, plus an
2695 internal-mTLS-only Append RPC for sibling services that need to record
2696 their own audit events into the shared trail.
2697
2698 All read RPCs extract org_id from the JWT — it is never in request
2699 messages. The Append RPC carries org_id explicitly because it is
2700 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2701*/
2702    #[derive(Debug)]
2703    pub struct AuditServiceServer<T> {
2704        inner: Arc<T>,
2705        accept_compression_encodings: EnabledCompressionEncodings,
2706        send_compression_encodings: EnabledCompressionEncodings,
2707        max_decoding_message_size: Option<usize>,
2708        max_encoding_message_size: Option<usize>,
2709    }
2710    impl<T> AuditServiceServer<T> {
2711        pub fn new(inner: T) -> Self {
2712            Self::from_arc(Arc::new(inner))
2713        }
2714        pub fn from_arc(inner: Arc<T>) -> Self {
2715            Self {
2716                inner,
2717                accept_compression_encodings: Default::default(),
2718                send_compression_encodings: Default::default(),
2719                max_decoding_message_size: None,
2720                max_encoding_message_size: None,
2721            }
2722        }
2723        pub fn with_interceptor<F>(
2724            inner: T,
2725            interceptor: F,
2726        ) -> InterceptedService<Self, F>
2727        where
2728            F: tonic::service::Interceptor,
2729        {
2730            InterceptedService::new(Self::new(inner), interceptor)
2731        }
2732        /// Enable decompressing requests with the given encoding.
2733        #[must_use]
2734        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2735            self.accept_compression_encodings.enable(encoding);
2736            self
2737        }
2738        /// Compress responses with the given encoding, if the client supports it.
2739        #[must_use]
2740        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2741            self.send_compression_encodings.enable(encoding);
2742            self
2743        }
2744        /// Limits the maximum size of a decoded message.
2745        ///
2746        /// Default: `4MB`
2747        #[must_use]
2748        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2749            self.max_decoding_message_size = Some(limit);
2750            self
2751        }
2752        /// Limits the maximum size of an encoded message.
2753        ///
2754        /// Default: `usize::MAX`
2755        #[must_use]
2756        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2757            self.max_encoding_message_size = Some(limit);
2758            self
2759        }
2760    }
2761    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2762    where
2763        T: AuditService,
2764        B: Body + std::marker::Send + 'static,
2765        B::Error: Into<StdError> + std::marker::Send + 'static,
2766    {
2767        type Response = http::Response<tonic::body::Body>;
2768        type Error = std::convert::Infallible;
2769        type Future = BoxFuture<Self::Response, Self::Error>;
2770        fn poll_ready(
2771            &mut self,
2772            _cx: &mut Context<'_>,
2773        ) -> Poll<std::result::Result<(), Self::Error>> {
2774            Poll::Ready(Ok(()))
2775        }
2776        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2777            match req.uri().path() {
2778                "/pidgr.v1.AuditService/ListAuditEvents" => {
2779                    #[allow(non_camel_case_types)]
2780                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2781                    impl<
2782                        T: AuditService,
2783                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
2784                    for ListAuditEventsSvc<T> {
2785                        type Response = super::ListAuditEventsResponse;
2786                        type Future = BoxFuture<
2787                            tonic::Response<Self::Response>,
2788                            tonic::Status,
2789                        >;
2790                        fn call(
2791                            &mut self,
2792                            request: tonic::Request<super::ListAuditEventsRequest>,
2793                        ) -> Self::Future {
2794                            let inner = Arc::clone(&self.0);
2795                            let fut = async move {
2796                                <T as AuditService>::list_audit_events(&inner, request)
2797                                    .await
2798                            };
2799                            Box::pin(fut)
2800                        }
2801                    }
2802                    let accept_compression_encodings = self.accept_compression_encodings;
2803                    let send_compression_encodings = self.send_compression_encodings;
2804                    let max_decoding_message_size = self.max_decoding_message_size;
2805                    let max_encoding_message_size = self.max_encoding_message_size;
2806                    let inner = self.inner.clone();
2807                    let fut = async move {
2808                        let method = ListAuditEventsSvc(inner);
2809                        let codec = tonic_prost::ProstCodec::default();
2810                        let mut grpc = tonic::server::Grpc::new(codec)
2811                            .apply_compression_config(
2812                                accept_compression_encodings,
2813                                send_compression_encodings,
2814                            )
2815                            .apply_max_message_size_config(
2816                                max_decoding_message_size,
2817                                max_encoding_message_size,
2818                            );
2819                        let res = grpc.unary(method, req).await;
2820                        Ok(res)
2821                    };
2822                    Box::pin(fut)
2823                }
2824                "/pidgr.v1.AuditService/ExportAuditTrail" => {
2825                    #[allow(non_camel_case_types)]
2826                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2827                    impl<
2828                        T: AuditService,
2829                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2830                    for ExportAuditTrailSvc<T> {
2831                        type Response = super::ExportAuditTrailResponse;
2832                        type Future = BoxFuture<
2833                            tonic::Response<Self::Response>,
2834                            tonic::Status,
2835                        >;
2836                        fn call(
2837                            &mut self,
2838                            request: tonic::Request<super::ExportAuditTrailRequest>,
2839                        ) -> Self::Future {
2840                            let inner = Arc::clone(&self.0);
2841                            let fut = async move {
2842                                <T as AuditService>::export_audit_trail(&inner, request)
2843                                    .await
2844                            };
2845                            Box::pin(fut)
2846                        }
2847                    }
2848                    let accept_compression_encodings = self.accept_compression_encodings;
2849                    let send_compression_encodings = self.send_compression_encodings;
2850                    let max_decoding_message_size = self.max_decoding_message_size;
2851                    let max_encoding_message_size = self.max_encoding_message_size;
2852                    let inner = self.inner.clone();
2853                    let fut = async move {
2854                        let method = ExportAuditTrailSvc(inner);
2855                        let codec = tonic_prost::ProstCodec::default();
2856                        let mut grpc = tonic::server::Grpc::new(codec)
2857                            .apply_compression_config(
2858                                accept_compression_encodings,
2859                                send_compression_encodings,
2860                            )
2861                            .apply_max_message_size_config(
2862                                max_decoding_message_size,
2863                                max_encoding_message_size,
2864                            );
2865                        let res = grpc.unary(method, req).await;
2866                        Ok(res)
2867                    };
2868                    Box::pin(fut)
2869                }
2870                "/pidgr.v1.AuditService/ListAuditExports" => {
2871                    #[allow(non_camel_case_types)]
2872                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2873                    impl<
2874                        T: AuditService,
2875                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
2876                    for ListAuditExportsSvc<T> {
2877                        type Response = super::ListAuditExportsResponse;
2878                        type Future = BoxFuture<
2879                            tonic::Response<Self::Response>,
2880                            tonic::Status,
2881                        >;
2882                        fn call(
2883                            &mut self,
2884                            request: tonic::Request<super::ListAuditExportsRequest>,
2885                        ) -> Self::Future {
2886                            let inner = Arc::clone(&self.0);
2887                            let fut = async move {
2888                                <T as AuditService>::list_audit_exports(&inner, request)
2889                                    .await
2890                            };
2891                            Box::pin(fut)
2892                        }
2893                    }
2894                    let accept_compression_encodings = self.accept_compression_encodings;
2895                    let send_compression_encodings = self.send_compression_encodings;
2896                    let max_decoding_message_size = self.max_decoding_message_size;
2897                    let max_encoding_message_size = self.max_encoding_message_size;
2898                    let inner = self.inner.clone();
2899                    let fut = async move {
2900                        let method = ListAuditExportsSvc(inner);
2901                        let codec = tonic_prost::ProstCodec::default();
2902                        let mut grpc = tonic::server::Grpc::new(codec)
2903                            .apply_compression_config(
2904                                accept_compression_encodings,
2905                                send_compression_encodings,
2906                            )
2907                            .apply_max_message_size_config(
2908                                max_decoding_message_size,
2909                                max_encoding_message_size,
2910                            );
2911                        let res = grpc.unary(method, req).await;
2912                        Ok(res)
2913                    };
2914                    Box::pin(fut)
2915                }
2916                "/pidgr.v1.AuditService/Append" => {
2917                    #[allow(non_camel_case_types)]
2918                    struct AppendSvc<T: AuditService>(pub Arc<T>);
2919                    impl<
2920                        T: AuditService,
2921                    > tonic::server::UnaryService<super::AppendRequest>
2922                    for AppendSvc<T> {
2923                        type Response = super::AppendResponse;
2924                        type Future = BoxFuture<
2925                            tonic::Response<Self::Response>,
2926                            tonic::Status,
2927                        >;
2928                        fn call(
2929                            &mut self,
2930                            request: tonic::Request<super::AppendRequest>,
2931                        ) -> Self::Future {
2932                            let inner = Arc::clone(&self.0);
2933                            let fut = async move {
2934                                <T as AuditService>::append(&inner, request).await
2935                            };
2936                            Box::pin(fut)
2937                        }
2938                    }
2939                    let accept_compression_encodings = self.accept_compression_encodings;
2940                    let send_compression_encodings = self.send_compression_encodings;
2941                    let max_decoding_message_size = self.max_decoding_message_size;
2942                    let max_encoding_message_size = self.max_encoding_message_size;
2943                    let inner = self.inner.clone();
2944                    let fut = async move {
2945                        let method = AppendSvc(inner);
2946                        let codec = tonic_prost::ProstCodec::default();
2947                        let mut grpc = tonic::server::Grpc::new(codec)
2948                            .apply_compression_config(
2949                                accept_compression_encodings,
2950                                send_compression_encodings,
2951                            )
2952                            .apply_max_message_size_config(
2953                                max_decoding_message_size,
2954                                max_encoding_message_size,
2955                            );
2956                        let res = grpc.unary(method, req).await;
2957                        Ok(res)
2958                    };
2959                    Box::pin(fut)
2960                }
2961                _ => {
2962                    Box::pin(async move {
2963                        let mut response = http::Response::new(
2964                            tonic::body::Body::default(),
2965                        );
2966                        let headers = response.headers_mut();
2967                        headers
2968                            .insert(
2969                                tonic::Status::GRPC_STATUS,
2970                                (tonic::Code::Unimplemented as i32).into(),
2971                            );
2972                        headers
2973                            .insert(
2974                                http::header::CONTENT_TYPE,
2975                                tonic::metadata::GRPC_CONTENT_TYPE,
2976                            );
2977                        Ok(response)
2978                    })
2979                }
2980            }
2981        }
2982    }
2983    impl<T> Clone for AuditServiceServer<T> {
2984        fn clone(&self) -> Self {
2985            let inner = self.inner.clone();
2986            Self {
2987                inner,
2988                accept_compression_encodings: self.accept_compression_encodings,
2989                send_compression_encodings: self.send_compression_encodings,
2990                max_decoding_message_size: self.max_decoding_message_size,
2991                max_encoding_message_size: self.max_encoding_message_size,
2992            }
2993        }
2994    }
2995    /// Generated gRPC service name
2996    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2997    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2998        const NAME: &'static str = SERVICE_NAME;
2999    }
3000}
3001/// Generated client implementations.
3002pub mod authorization_service_client {
3003    #![allow(
3004        unused_variables,
3005        dead_code,
3006        missing_docs,
3007        clippy::wildcard_imports,
3008        clippy::let_unit_value,
3009    )]
3010    use tonic::codegen::*;
3011    use tonic::codegen::http::Uri;
3012    /** AuthorizationService resolves the effective permission set for a principal
3013 so a resource server can make authorization decisions without owning the
3014 role and permission data itself.
3015
3016 AUTH: INTERNAL service-to-service only. This service is served by the core
3017 API and called by other backend services. It MUST NOT be exposed on the
3018 public ingress to JWT-authenticated end-user clients.
3019*/
3020    #[derive(Debug, Clone)]
3021    pub struct AuthorizationServiceClient<T> {
3022        inner: tonic::client::Grpc<T>,
3023    }
3024    impl AuthorizationServiceClient<tonic::transport::Channel> {
3025        /// Attempt to create a new client by connecting to a given endpoint.
3026        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3027        where
3028            D: TryInto<tonic::transport::Endpoint>,
3029            D::Error: Into<StdError>,
3030        {
3031            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3032            Ok(Self::new(conn))
3033        }
3034    }
3035    impl<T> AuthorizationServiceClient<T>
3036    where
3037        T: tonic::client::GrpcService<tonic::body::Body>,
3038        T::Error: Into<StdError>,
3039        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3040        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3041    {
3042        pub fn new(inner: T) -> Self {
3043            let inner = tonic::client::Grpc::new(inner);
3044            Self { inner }
3045        }
3046        pub fn with_origin(inner: T, origin: Uri) -> Self {
3047            let inner = tonic::client::Grpc::with_origin(inner, origin);
3048            Self { inner }
3049        }
3050        pub fn with_interceptor<F>(
3051            inner: T,
3052            interceptor: F,
3053        ) -> AuthorizationServiceClient<InterceptedService<T, F>>
3054        where
3055            F: tonic::service::Interceptor,
3056            T::ResponseBody: Default,
3057            T: tonic::codegen::Service<
3058                http::Request<tonic::body::Body>,
3059                Response = http::Response<
3060                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3061                >,
3062            >,
3063            <T as tonic::codegen::Service<
3064                http::Request<tonic::body::Body>,
3065            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3066        {
3067            AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor))
3068        }
3069        /// Compress requests with the given encoding.
3070        ///
3071        /// This requires the server to support it otherwise it might respond with an
3072        /// error.
3073        #[must_use]
3074        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3075            self.inner = self.inner.send_compressed(encoding);
3076            self
3077        }
3078        /// Enable decompressing responses.
3079        #[must_use]
3080        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3081            self.inner = self.inner.accept_compressed(encoding);
3082            self
3083        }
3084        /// Limits the maximum size of a decoded message.
3085        ///
3086        /// Default: `4MB`
3087        #[must_use]
3088        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3089            self.inner = self.inner.max_decoding_message_size(limit);
3090            self
3091        }
3092        /// Limits the maximum size of an encoded message.
3093        ///
3094        /// Default: `usize::MAX`
3095        #[must_use]
3096        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3097            self.inner = self.inner.max_encoding_message_size(limit);
3098            self
3099        }
3100        /** Resolve the effective permissions for one (subject, org, principal type).
3101*/
3102        pub async fn resolve_principal_permissions(
3103            &mut self,
3104            request: impl tonic::IntoRequest<super::ResolvePrincipalPermissionsRequest>,
3105        ) -> std::result::Result<
3106            tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3107            tonic::Status,
3108        > {
3109            self.inner
3110                .ready()
3111                .await
3112                .map_err(|e| {
3113                    tonic::Status::unknown(
3114                        format!("Service was not ready: {}", e.into()),
3115                    )
3116                })?;
3117            let codec = tonic_prost::ProstCodec::default();
3118            let path = http::uri::PathAndQuery::from_static(
3119                "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions",
3120            );
3121            let mut req = request.into_request();
3122            req.extensions_mut()
3123                .insert(
3124                    GrpcMethod::new(
3125                        "pidgr.v1.AuthorizationService",
3126                        "ResolvePrincipalPermissions",
3127                    ),
3128                );
3129            self.inner.unary(req, path, codec).await
3130        }
3131    }
3132}
3133/// Generated server implementations.
3134pub mod authorization_service_server {
3135    #![allow(
3136        unused_variables,
3137        dead_code,
3138        missing_docs,
3139        clippy::wildcard_imports,
3140        clippy::let_unit_value,
3141    )]
3142    use tonic::codegen::*;
3143    /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer.
3144    #[async_trait]
3145    pub trait AuthorizationService: std::marker::Send + std::marker::Sync + 'static {
3146        /** Resolve the effective permissions for one (subject, org, principal type).
3147*/
3148        async fn resolve_principal_permissions(
3149            &self,
3150            request: tonic::Request<super::ResolvePrincipalPermissionsRequest>,
3151        ) -> std::result::Result<
3152            tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3153            tonic::Status,
3154        >;
3155    }
3156    /** AuthorizationService resolves the effective permission set for a principal
3157 so a resource server can make authorization decisions without owning the
3158 role and permission data itself.
3159
3160 AUTH: INTERNAL service-to-service only. This service is served by the core
3161 API and called by other backend services. It MUST NOT be exposed on the
3162 public ingress to JWT-authenticated end-user clients.
3163*/
3164    #[derive(Debug)]
3165    pub struct AuthorizationServiceServer<T> {
3166        inner: Arc<T>,
3167        accept_compression_encodings: EnabledCompressionEncodings,
3168        send_compression_encodings: EnabledCompressionEncodings,
3169        max_decoding_message_size: Option<usize>,
3170        max_encoding_message_size: Option<usize>,
3171    }
3172    impl<T> AuthorizationServiceServer<T> {
3173        pub fn new(inner: T) -> Self {
3174            Self::from_arc(Arc::new(inner))
3175        }
3176        pub fn from_arc(inner: Arc<T>) -> Self {
3177            Self {
3178                inner,
3179                accept_compression_encodings: Default::default(),
3180                send_compression_encodings: Default::default(),
3181                max_decoding_message_size: None,
3182                max_encoding_message_size: None,
3183            }
3184        }
3185        pub fn with_interceptor<F>(
3186            inner: T,
3187            interceptor: F,
3188        ) -> InterceptedService<Self, F>
3189        where
3190            F: tonic::service::Interceptor,
3191        {
3192            InterceptedService::new(Self::new(inner), interceptor)
3193        }
3194        /// Enable decompressing requests with the given encoding.
3195        #[must_use]
3196        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3197            self.accept_compression_encodings.enable(encoding);
3198            self
3199        }
3200        /// Compress responses with the given encoding, if the client supports it.
3201        #[must_use]
3202        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3203            self.send_compression_encodings.enable(encoding);
3204            self
3205        }
3206        /// Limits the maximum size of a decoded message.
3207        ///
3208        /// Default: `4MB`
3209        #[must_use]
3210        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3211            self.max_decoding_message_size = Some(limit);
3212            self
3213        }
3214        /// Limits the maximum size of an encoded message.
3215        ///
3216        /// Default: `usize::MAX`
3217        #[must_use]
3218        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3219            self.max_encoding_message_size = Some(limit);
3220            self
3221        }
3222    }
3223    impl<T, B> tonic::codegen::Service<http::Request<B>>
3224    for AuthorizationServiceServer<T>
3225    where
3226        T: AuthorizationService,
3227        B: Body + std::marker::Send + 'static,
3228        B::Error: Into<StdError> + std::marker::Send + 'static,
3229    {
3230        type Response = http::Response<tonic::body::Body>;
3231        type Error = std::convert::Infallible;
3232        type Future = BoxFuture<Self::Response, Self::Error>;
3233        fn poll_ready(
3234            &mut self,
3235            _cx: &mut Context<'_>,
3236        ) -> Poll<std::result::Result<(), Self::Error>> {
3237            Poll::Ready(Ok(()))
3238        }
3239        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3240            match req.uri().path() {
3241                "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions" => {
3242                    #[allow(non_camel_case_types)]
3243                    struct ResolvePrincipalPermissionsSvc<T: AuthorizationService>(
3244                        pub Arc<T>,
3245                    );
3246                    impl<
3247                        T: AuthorizationService,
3248                    > tonic::server::UnaryService<
3249                        super::ResolvePrincipalPermissionsRequest,
3250                    > for ResolvePrincipalPermissionsSvc<T> {
3251                        type Response = super::ResolvePrincipalPermissionsResponse;
3252                        type Future = BoxFuture<
3253                            tonic::Response<Self::Response>,
3254                            tonic::Status,
3255                        >;
3256                        fn call(
3257                            &mut self,
3258                            request: tonic::Request<
3259                                super::ResolvePrincipalPermissionsRequest,
3260                            >,
3261                        ) -> Self::Future {
3262                            let inner = Arc::clone(&self.0);
3263                            let fut = async move {
3264                                <T as AuthorizationService>::resolve_principal_permissions(
3265                                        &inner,
3266                                        request,
3267                                    )
3268                                    .await
3269                            };
3270                            Box::pin(fut)
3271                        }
3272                    }
3273                    let accept_compression_encodings = self.accept_compression_encodings;
3274                    let send_compression_encodings = self.send_compression_encodings;
3275                    let max_decoding_message_size = self.max_decoding_message_size;
3276                    let max_encoding_message_size = self.max_encoding_message_size;
3277                    let inner = self.inner.clone();
3278                    let fut = async move {
3279                        let method = ResolvePrincipalPermissionsSvc(inner);
3280                        let codec = tonic_prost::ProstCodec::default();
3281                        let mut grpc = tonic::server::Grpc::new(codec)
3282                            .apply_compression_config(
3283                                accept_compression_encodings,
3284                                send_compression_encodings,
3285                            )
3286                            .apply_max_message_size_config(
3287                                max_decoding_message_size,
3288                                max_encoding_message_size,
3289                            );
3290                        let res = grpc.unary(method, req).await;
3291                        Ok(res)
3292                    };
3293                    Box::pin(fut)
3294                }
3295                _ => {
3296                    Box::pin(async move {
3297                        let mut response = http::Response::new(
3298                            tonic::body::Body::default(),
3299                        );
3300                        let headers = response.headers_mut();
3301                        headers
3302                            .insert(
3303                                tonic::Status::GRPC_STATUS,
3304                                (tonic::Code::Unimplemented as i32).into(),
3305                            );
3306                        headers
3307                            .insert(
3308                                http::header::CONTENT_TYPE,
3309                                tonic::metadata::GRPC_CONTENT_TYPE,
3310                            );
3311                        Ok(response)
3312                    })
3313                }
3314            }
3315        }
3316    }
3317    impl<T> Clone for AuthorizationServiceServer<T> {
3318        fn clone(&self) -> Self {
3319            let inner = self.inner.clone();
3320            Self {
3321                inner,
3322                accept_compression_encodings: self.accept_compression_encodings,
3323                send_compression_encodings: self.send_compression_encodings,
3324                max_decoding_message_size: self.max_decoding_message_size,
3325                max_encoding_message_size: self.max_encoding_message_size,
3326            }
3327        }
3328    }
3329    /// Generated gRPC service name
3330    pub const SERVICE_NAME: &str = "pidgr.v1.AuthorizationService";
3331    impl<T> tonic::server::NamedService for AuthorizationServiceServer<T> {
3332        const NAME: &'static str = SERVICE_NAME;
3333    }
3334}
3335/// Generated client implementations.
3336pub mod campaign_service_client {
3337    #![allow(
3338        unused_variables,
3339        dead_code,
3340        missing_docs,
3341        clippy::wildcard_imports,
3342        clippy::let_unit_value,
3343    )]
3344    use tonic::codegen::*;
3345    use tonic::codegen::http::Uri;
3346    /** Manages the full lifecycle of communication campaigns — creation,
3347 execution, monitoring, and cancellation.
3348*/
3349    #[derive(Debug, Clone)]
3350    pub struct CampaignServiceClient<T> {
3351        inner: tonic::client::Grpc<T>,
3352    }
3353    impl CampaignServiceClient<tonic::transport::Channel> {
3354        /// Attempt to create a new client by connecting to a given endpoint.
3355        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3356        where
3357            D: TryInto<tonic::transport::Endpoint>,
3358            D::Error: Into<StdError>,
3359        {
3360            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3361            Ok(Self::new(conn))
3362        }
3363    }
3364    impl<T> CampaignServiceClient<T>
3365    where
3366        T: tonic::client::GrpcService<tonic::body::Body>,
3367        T::Error: Into<StdError>,
3368        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3369        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3370    {
3371        pub fn new(inner: T) -> Self {
3372            let inner = tonic::client::Grpc::new(inner);
3373            Self { inner }
3374        }
3375        pub fn with_origin(inner: T, origin: Uri) -> Self {
3376            let inner = tonic::client::Grpc::with_origin(inner, origin);
3377            Self { inner }
3378        }
3379        pub fn with_interceptor<F>(
3380            inner: T,
3381            interceptor: F,
3382        ) -> CampaignServiceClient<InterceptedService<T, F>>
3383        where
3384            F: tonic::service::Interceptor,
3385            T::ResponseBody: Default,
3386            T: tonic::codegen::Service<
3387                http::Request<tonic::body::Body>,
3388                Response = http::Response<
3389                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3390                >,
3391            >,
3392            <T as tonic::codegen::Service<
3393                http::Request<tonic::body::Body>,
3394            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3395        {
3396            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3397        }
3398        /// Compress requests with the given encoding.
3399        ///
3400        /// This requires the server to support it otherwise it might respond with an
3401        /// error.
3402        #[must_use]
3403        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3404            self.inner = self.inner.send_compressed(encoding);
3405            self
3406        }
3407        /// Enable decompressing responses.
3408        #[must_use]
3409        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3410            self.inner = self.inner.accept_compressed(encoding);
3411            self
3412        }
3413        /// Limits the maximum size of a decoded message.
3414        ///
3415        /// Default: `4MB`
3416        #[must_use]
3417        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3418            self.inner = self.inner.max_decoding_message_size(limit);
3419            self
3420        }
3421        /// Limits the maximum size of an encoded message.
3422        ///
3423        /// Default: `usize::MAX`
3424        #[must_use]
3425        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3426            self.inner = self.inner.max_encoding_message_size(limit);
3427            self
3428        }
3429        /** Create a new campaign with a template, audience, and workflow.
3430 Authorization: Requires MANAGER+ role.
3431*/
3432        pub async fn create_campaign(
3433            &mut self,
3434            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3435        ) -> std::result::Result<
3436            tonic::Response<super::CreateCampaignResponse>,
3437            tonic::Status,
3438        > {
3439            self.inner
3440                .ready()
3441                .await
3442                .map_err(|e| {
3443                    tonic::Status::unknown(
3444                        format!("Service was not ready: {}", e.into()),
3445                    )
3446                })?;
3447            let codec = tonic_prost::ProstCodec::default();
3448            let path = http::uri::PathAndQuery::from_static(
3449                "/pidgr.v1.CampaignService/CreateCampaign",
3450            );
3451            let mut req = request.into_request();
3452            req.extensions_mut()
3453                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3454            self.inner.unary(req, path, codec).await
3455        }
3456        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3457 Authorization: Requires MANAGER+ role.
3458*/
3459        pub async fn start_campaign(
3460            &mut self,
3461            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3462        ) -> std::result::Result<
3463            tonic::Response<super::StartCampaignResponse>,
3464            tonic::Status,
3465        > {
3466            self.inner
3467                .ready()
3468                .await
3469                .map_err(|e| {
3470                    tonic::Status::unknown(
3471                        format!("Service was not ready: {}", e.into()),
3472                    )
3473                })?;
3474            let codec = tonic_prost::ProstCodec::default();
3475            let path = http::uri::PathAndQuery::from_static(
3476                "/pidgr.v1.CampaignService/StartCampaign",
3477            );
3478            let mut req = request.into_request();
3479            req.extensions_mut()
3480                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3481            self.inner.unary(req, path, codec).await
3482        }
3483        /** Retrieve a single campaign by ID.
3484 Authorization: Authenticated user within the organization.
3485*/
3486        pub async fn get_campaign(
3487            &mut self,
3488            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3489        ) -> std::result::Result<
3490            tonic::Response<super::GetCampaignResponse>,
3491            tonic::Status,
3492        > {
3493            self.inner
3494                .ready()
3495                .await
3496                .map_err(|e| {
3497                    tonic::Status::unknown(
3498                        format!("Service was not ready: {}", e.into()),
3499                    )
3500                })?;
3501            let codec = tonic_prost::ProstCodec::default();
3502            let path = http::uri::PathAndQuery::from_static(
3503                "/pidgr.v1.CampaignService/GetCampaign",
3504            );
3505            let mut req = request.into_request();
3506            req.extensions_mut()
3507                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3508            self.inner.unary(req, path, codec).await
3509        }
3510        /** List campaigns for the organization with pagination.
3511 Authorization: Authenticated user within the organization.
3512*/
3513        pub async fn list_campaigns(
3514            &mut self,
3515            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3516        ) -> std::result::Result<
3517            tonic::Response<super::ListCampaignsResponse>,
3518            tonic::Status,
3519        > {
3520            self.inner
3521                .ready()
3522                .await
3523                .map_err(|e| {
3524                    tonic::Status::unknown(
3525                        format!("Service was not ready: {}", e.into()),
3526                    )
3527                })?;
3528            let codec = tonic_prost::ProstCodec::default();
3529            let path = http::uri::PathAndQuery::from_static(
3530                "/pidgr.v1.CampaignService/ListCampaigns",
3531            );
3532            let mut req = request.into_request();
3533            req.extensions_mut()
3534                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3535            self.inner.unary(req, path, codec).await
3536        }
3537        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3538 Authorization: Requires MANAGER+ role.
3539*/
3540        pub async fn update_campaign(
3541            &mut self,
3542            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3543        ) -> std::result::Result<
3544            tonic::Response<super::UpdateCampaignResponse>,
3545            tonic::Status,
3546        > {
3547            self.inner
3548                .ready()
3549                .await
3550                .map_err(|e| {
3551                    tonic::Status::unknown(
3552                        format!("Service was not ready: {}", e.into()),
3553                    )
3554                })?;
3555            let codec = tonic_prost::ProstCodec::default();
3556            let path = http::uri::PathAndQuery::from_static(
3557                "/pidgr.v1.CampaignService/UpdateCampaign",
3558            );
3559            let mut req = request.into_request();
3560            req.extensions_mut()
3561                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3562            self.inner.unary(req, path, codec).await
3563        }
3564        /** Read a campaign's frozen audience snapshot, enriched with member
3565 identity so clients can render and edit it. Empty for campaigns
3566 without a snapshot.
3567 Authorization: Authenticated user within the organization.
3568*/
3569        pub async fn get_campaign_audience(
3570            &mut self,
3571            request: impl tonic::IntoRequest<super::GetCampaignAudienceRequest>,
3572        ) -> std::result::Result<
3573            tonic::Response<super::GetCampaignAudienceResponse>,
3574            tonic::Status,
3575        > {
3576            self.inner
3577                .ready()
3578                .await
3579                .map_err(|e| {
3580                    tonic::Status::unknown(
3581                        format!("Service was not ready: {}", e.into()),
3582                    )
3583                })?;
3584            let codec = tonic_prost::ProstCodec::default();
3585            let path = http::uri::PathAndQuery::from_static(
3586                "/pidgr.v1.CampaignService/GetCampaignAudience",
3587            );
3588            let mut req = request.into_request();
3589            req.extensions_mut()
3590                .insert(
3591                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignAudience"),
3592                );
3593            self.inner.unary(req, path, codec).await
3594        }
3595        /** Cancel a running campaign, stopping further deliveries and reminders.
3596 Authorization: Requires MANAGER+ role.
3597*/
3598        pub async fn cancel_campaign(
3599            &mut self,
3600            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3601        ) -> std::result::Result<
3602            tonic::Response<super::CancelCampaignResponse>,
3603            tonic::Status,
3604        > {
3605            self.inner
3606                .ready()
3607                .await
3608                .map_err(|e| {
3609                    tonic::Status::unknown(
3610                        format!("Service was not ready: {}", e.into()),
3611                    )
3612                })?;
3613            let codec = tonic_prost::ProstCodec::default();
3614            let path = http::uri::PathAndQuery::from_static(
3615                "/pidgr.v1.CampaignService/CancelCampaign",
3616            );
3617            let mut req = request.into_request();
3618            req.extensions_mut()
3619                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3620            self.inner.unary(req, path, codec).await
3621        }
3622        /** List delivery records for a campaign, optionally filtered by status.
3623 Authorization: Authenticated user within the organization.
3624*/
3625        pub async fn list_deliveries(
3626            &mut self,
3627            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3628        ) -> std::result::Result<
3629            tonic::Response<super::ListDeliveriesResponse>,
3630            tonic::Status,
3631        > {
3632            self.inner
3633                .ready()
3634                .await
3635                .map_err(|e| {
3636                    tonic::Status::unknown(
3637                        format!("Service was not ready: {}", e.into()),
3638                    )
3639                })?;
3640            let codec = tonic_prost::ProstCodec::default();
3641            let path = http::uri::PathAndQuery::from_static(
3642                "/pidgr.v1.CampaignService/ListDeliveries",
3643            );
3644            let mut req = request.into_request();
3645            req.extensions_mut()
3646                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3647            self.inner.unary(req, path, codec).await
3648        }
3649        /** Break down a campaign's recipients by current archetype membership
3650 and return ack-rate per bucket, with k-anonymity gate applied.
3651 Only valid for campaigns whose originating_archetype is set.
3652 Authorization: Authenticated user within the organization.
3653*/
3654        pub async fn get_campaign_archetype_breakdown(
3655            &mut self,
3656            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3657        ) -> std::result::Result<
3658            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3659            tonic::Status,
3660        > {
3661            self.inner
3662                .ready()
3663                .await
3664                .map_err(|e| {
3665                    tonic::Status::unknown(
3666                        format!("Service was not ready: {}", e.into()),
3667                    )
3668                })?;
3669            let codec = tonic_prost::ProstCodec::default();
3670            let path = http::uri::PathAndQuery::from_static(
3671                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3672            );
3673            let mut req = request.into_request();
3674            req.extensions_mut()
3675                .insert(
3676                    GrpcMethod::new(
3677                        "pidgr.v1.CampaignService",
3678                        "GetCampaignArchetypeBreakdown",
3679                    ),
3680                );
3681            self.inner.unary(req, path, codec).await
3682        }
3683        /** Resolve a campaign's 8-character base62 short-code, lazily
3684 generating one on the first call. Stable for the campaign's
3685 lifetime; the same campaign always returns the same code.
3686 Authorization: Internal-service callers only (mTLS-gated). The
3687 dispatch layer calls this when assembling a third-party-channel
3688 deeplink.
3689*/
3690        pub async fn resolve_or_create_short_code(
3691            &mut self,
3692            request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3693        ) -> std::result::Result<
3694            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3695            tonic::Status,
3696        > {
3697            self.inner
3698                .ready()
3699                .await
3700                .map_err(|e| {
3701                    tonic::Status::unknown(
3702                        format!("Service was not ready: {}", e.into()),
3703                    )
3704                })?;
3705            let codec = tonic_prost::ProstCodec::default();
3706            let path = http::uri::PathAndQuery::from_static(
3707                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3708            );
3709            let mut req = request.into_request();
3710            req.extensions_mut()
3711                .insert(
3712                    GrpcMethod::new(
3713                        "pidgr.v1.CampaignService",
3714                        "ResolveOrCreateShortCode",
3715                    ),
3716                );
3717            self.inner.unary(req, path, codec).await
3718        }
3719        /** Look up a campaign by its short-code. Returns minimal, non-PII
3720 metadata sufficient for the native app to route a tapped
3721 third-party-channel deeplink to the correct campaign card and
3722 show org branding before the auth gate.
3723 Authorization: Unauthenticated. The short-code IS the lookup key;
3724 returned fields are already visible to the recipient via their
3725 inbox or the org's public profile.
3726*/
3727        pub async fn get_campaign_by_short_code(
3728            &mut self,
3729            request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3730        ) -> std::result::Result<
3731            tonic::Response<super::GetCampaignByShortCodeResponse>,
3732            tonic::Status,
3733        > {
3734            self.inner
3735                .ready()
3736                .await
3737                .map_err(|e| {
3738                    tonic::Status::unknown(
3739                        format!("Service was not ready: {}", e.into()),
3740                    )
3741                })?;
3742            let codec = tonic_prost::ProstCodec::default();
3743            let path = http::uri::PathAndQuery::from_static(
3744                "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3745            );
3746            let mut req = request.into_request();
3747            req.extensions_mut()
3748                .insert(
3749                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3750                );
3751            self.inner.unary(req, path, codec).await
3752        }
3753    }
3754}
3755/// Generated server implementations.
3756pub mod campaign_service_server {
3757    #![allow(
3758        unused_variables,
3759        dead_code,
3760        missing_docs,
3761        clippy::wildcard_imports,
3762        clippy::let_unit_value,
3763    )]
3764    use tonic::codegen::*;
3765    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3766    #[async_trait]
3767    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3768        /** Create a new campaign with a template, audience, and workflow.
3769 Authorization: Requires MANAGER+ role.
3770*/
3771        async fn create_campaign(
3772            &self,
3773            request: tonic::Request<super::CreateCampaignRequest>,
3774        ) -> std::result::Result<
3775            tonic::Response<super::CreateCampaignResponse>,
3776            tonic::Status,
3777        >;
3778        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3779 Authorization: Requires MANAGER+ role.
3780*/
3781        async fn start_campaign(
3782            &self,
3783            request: tonic::Request<super::StartCampaignRequest>,
3784        ) -> std::result::Result<
3785            tonic::Response<super::StartCampaignResponse>,
3786            tonic::Status,
3787        >;
3788        /** Retrieve a single campaign by ID.
3789 Authorization: Authenticated user within the organization.
3790*/
3791        async fn get_campaign(
3792            &self,
3793            request: tonic::Request<super::GetCampaignRequest>,
3794        ) -> std::result::Result<
3795            tonic::Response<super::GetCampaignResponse>,
3796            tonic::Status,
3797        >;
3798        /** List campaigns for the organization with pagination.
3799 Authorization: Authenticated user within the organization.
3800*/
3801        async fn list_campaigns(
3802            &self,
3803            request: tonic::Request<super::ListCampaignsRequest>,
3804        ) -> std::result::Result<
3805            tonic::Response<super::ListCampaignsResponse>,
3806            tonic::Status,
3807        >;
3808        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3809 Authorization: Requires MANAGER+ role.
3810*/
3811        async fn update_campaign(
3812            &self,
3813            request: tonic::Request<super::UpdateCampaignRequest>,
3814        ) -> std::result::Result<
3815            tonic::Response<super::UpdateCampaignResponse>,
3816            tonic::Status,
3817        >;
3818        /** Read a campaign's frozen audience snapshot, enriched with member
3819 identity so clients can render and edit it. Empty for campaigns
3820 without a snapshot.
3821 Authorization: Authenticated user within the organization.
3822*/
3823        async fn get_campaign_audience(
3824            &self,
3825            request: tonic::Request<super::GetCampaignAudienceRequest>,
3826        ) -> std::result::Result<
3827            tonic::Response<super::GetCampaignAudienceResponse>,
3828            tonic::Status,
3829        >;
3830        /** Cancel a running campaign, stopping further deliveries and reminders.
3831 Authorization: Requires MANAGER+ role.
3832*/
3833        async fn cancel_campaign(
3834            &self,
3835            request: tonic::Request<super::CancelCampaignRequest>,
3836        ) -> std::result::Result<
3837            tonic::Response<super::CancelCampaignResponse>,
3838            tonic::Status,
3839        >;
3840        /** List delivery records for a campaign, optionally filtered by status.
3841 Authorization: Authenticated user within the organization.
3842*/
3843        async fn list_deliveries(
3844            &self,
3845            request: tonic::Request<super::ListDeliveriesRequest>,
3846        ) -> std::result::Result<
3847            tonic::Response<super::ListDeliveriesResponse>,
3848            tonic::Status,
3849        >;
3850        /** Break down a campaign's recipients by current archetype membership
3851 and return ack-rate per bucket, with k-anonymity gate applied.
3852 Only valid for campaigns whose originating_archetype is set.
3853 Authorization: Authenticated user within the organization.
3854*/
3855        async fn get_campaign_archetype_breakdown(
3856            &self,
3857            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3858        ) -> std::result::Result<
3859            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3860            tonic::Status,
3861        >;
3862        /** Resolve a campaign's 8-character base62 short-code, lazily
3863 generating one on the first call. Stable for the campaign's
3864 lifetime; the same campaign always returns the same code.
3865 Authorization: Internal-service callers only (mTLS-gated). The
3866 dispatch layer calls this when assembling a third-party-channel
3867 deeplink.
3868*/
3869        async fn resolve_or_create_short_code(
3870            &self,
3871            request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3872        ) -> std::result::Result<
3873            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3874            tonic::Status,
3875        >;
3876        /** Look up a campaign by its short-code. Returns minimal, non-PII
3877 metadata sufficient for the native app to route a tapped
3878 third-party-channel deeplink to the correct campaign card and
3879 show org branding before the auth gate.
3880 Authorization: Unauthenticated. The short-code IS the lookup key;
3881 returned fields are already visible to the recipient via their
3882 inbox or the org's public profile.
3883*/
3884        async fn get_campaign_by_short_code(
3885            &self,
3886            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3887        ) -> std::result::Result<
3888            tonic::Response<super::GetCampaignByShortCodeResponse>,
3889            tonic::Status,
3890        >;
3891    }
3892    /** Manages the full lifecycle of communication campaigns — creation,
3893 execution, monitoring, and cancellation.
3894*/
3895    #[derive(Debug)]
3896    pub struct CampaignServiceServer<T> {
3897        inner: Arc<T>,
3898        accept_compression_encodings: EnabledCompressionEncodings,
3899        send_compression_encodings: EnabledCompressionEncodings,
3900        max_decoding_message_size: Option<usize>,
3901        max_encoding_message_size: Option<usize>,
3902    }
3903    impl<T> CampaignServiceServer<T> {
3904        pub fn new(inner: T) -> Self {
3905            Self::from_arc(Arc::new(inner))
3906        }
3907        pub fn from_arc(inner: Arc<T>) -> Self {
3908            Self {
3909                inner,
3910                accept_compression_encodings: Default::default(),
3911                send_compression_encodings: Default::default(),
3912                max_decoding_message_size: None,
3913                max_encoding_message_size: None,
3914            }
3915        }
3916        pub fn with_interceptor<F>(
3917            inner: T,
3918            interceptor: F,
3919        ) -> InterceptedService<Self, F>
3920        where
3921            F: tonic::service::Interceptor,
3922        {
3923            InterceptedService::new(Self::new(inner), interceptor)
3924        }
3925        /// Enable decompressing requests with the given encoding.
3926        #[must_use]
3927        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3928            self.accept_compression_encodings.enable(encoding);
3929            self
3930        }
3931        /// Compress responses with the given encoding, if the client supports it.
3932        #[must_use]
3933        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3934            self.send_compression_encodings.enable(encoding);
3935            self
3936        }
3937        /// Limits the maximum size of a decoded message.
3938        ///
3939        /// Default: `4MB`
3940        #[must_use]
3941        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3942            self.max_decoding_message_size = Some(limit);
3943            self
3944        }
3945        /// Limits the maximum size of an encoded message.
3946        ///
3947        /// Default: `usize::MAX`
3948        #[must_use]
3949        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3950            self.max_encoding_message_size = Some(limit);
3951            self
3952        }
3953    }
3954    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3955    where
3956        T: CampaignService,
3957        B: Body + std::marker::Send + 'static,
3958        B::Error: Into<StdError> + std::marker::Send + 'static,
3959    {
3960        type Response = http::Response<tonic::body::Body>;
3961        type Error = std::convert::Infallible;
3962        type Future = BoxFuture<Self::Response, Self::Error>;
3963        fn poll_ready(
3964            &mut self,
3965            _cx: &mut Context<'_>,
3966        ) -> Poll<std::result::Result<(), Self::Error>> {
3967            Poll::Ready(Ok(()))
3968        }
3969        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3970            match req.uri().path() {
3971                "/pidgr.v1.CampaignService/CreateCampaign" => {
3972                    #[allow(non_camel_case_types)]
3973                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3974                    impl<
3975                        T: CampaignService,
3976                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3977                    for CreateCampaignSvc<T> {
3978                        type Response = super::CreateCampaignResponse;
3979                        type Future = BoxFuture<
3980                            tonic::Response<Self::Response>,
3981                            tonic::Status,
3982                        >;
3983                        fn call(
3984                            &mut self,
3985                            request: tonic::Request<super::CreateCampaignRequest>,
3986                        ) -> Self::Future {
3987                            let inner = Arc::clone(&self.0);
3988                            let fut = async move {
3989                                <T as CampaignService>::create_campaign(&inner, request)
3990                                    .await
3991                            };
3992                            Box::pin(fut)
3993                        }
3994                    }
3995                    let accept_compression_encodings = self.accept_compression_encodings;
3996                    let send_compression_encodings = self.send_compression_encodings;
3997                    let max_decoding_message_size = self.max_decoding_message_size;
3998                    let max_encoding_message_size = self.max_encoding_message_size;
3999                    let inner = self.inner.clone();
4000                    let fut = async move {
4001                        let method = CreateCampaignSvc(inner);
4002                        let codec = tonic_prost::ProstCodec::default();
4003                        let mut grpc = tonic::server::Grpc::new(codec)
4004                            .apply_compression_config(
4005                                accept_compression_encodings,
4006                                send_compression_encodings,
4007                            )
4008                            .apply_max_message_size_config(
4009                                max_decoding_message_size,
4010                                max_encoding_message_size,
4011                            );
4012                        let res = grpc.unary(method, req).await;
4013                        Ok(res)
4014                    };
4015                    Box::pin(fut)
4016                }
4017                "/pidgr.v1.CampaignService/StartCampaign" => {
4018                    #[allow(non_camel_case_types)]
4019                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
4020                    impl<
4021                        T: CampaignService,
4022                    > tonic::server::UnaryService<super::StartCampaignRequest>
4023                    for StartCampaignSvc<T> {
4024                        type Response = super::StartCampaignResponse;
4025                        type Future = BoxFuture<
4026                            tonic::Response<Self::Response>,
4027                            tonic::Status,
4028                        >;
4029                        fn call(
4030                            &mut self,
4031                            request: tonic::Request<super::StartCampaignRequest>,
4032                        ) -> Self::Future {
4033                            let inner = Arc::clone(&self.0);
4034                            let fut = async move {
4035                                <T as CampaignService>::start_campaign(&inner, request)
4036                                    .await
4037                            };
4038                            Box::pin(fut)
4039                        }
4040                    }
4041                    let accept_compression_encodings = self.accept_compression_encodings;
4042                    let send_compression_encodings = self.send_compression_encodings;
4043                    let max_decoding_message_size = self.max_decoding_message_size;
4044                    let max_encoding_message_size = self.max_encoding_message_size;
4045                    let inner = self.inner.clone();
4046                    let fut = async move {
4047                        let method = StartCampaignSvc(inner);
4048                        let codec = tonic_prost::ProstCodec::default();
4049                        let mut grpc = tonic::server::Grpc::new(codec)
4050                            .apply_compression_config(
4051                                accept_compression_encodings,
4052                                send_compression_encodings,
4053                            )
4054                            .apply_max_message_size_config(
4055                                max_decoding_message_size,
4056                                max_encoding_message_size,
4057                            );
4058                        let res = grpc.unary(method, req).await;
4059                        Ok(res)
4060                    };
4061                    Box::pin(fut)
4062                }
4063                "/pidgr.v1.CampaignService/GetCampaign" => {
4064                    #[allow(non_camel_case_types)]
4065                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
4066                    impl<
4067                        T: CampaignService,
4068                    > tonic::server::UnaryService<super::GetCampaignRequest>
4069                    for GetCampaignSvc<T> {
4070                        type Response = super::GetCampaignResponse;
4071                        type Future = BoxFuture<
4072                            tonic::Response<Self::Response>,
4073                            tonic::Status,
4074                        >;
4075                        fn call(
4076                            &mut self,
4077                            request: tonic::Request<super::GetCampaignRequest>,
4078                        ) -> Self::Future {
4079                            let inner = Arc::clone(&self.0);
4080                            let fut = async move {
4081                                <T as CampaignService>::get_campaign(&inner, request).await
4082                            };
4083                            Box::pin(fut)
4084                        }
4085                    }
4086                    let accept_compression_encodings = self.accept_compression_encodings;
4087                    let send_compression_encodings = self.send_compression_encodings;
4088                    let max_decoding_message_size = self.max_decoding_message_size;
4089                    let max_encoding_message_size = self.max_encoding_message_size;
4090                    let inner = self.inner.clone();
4091                    let fut = async move {
4092                        let method = GetCampaignSvc(inner);
4093                        let codec = tonic_prost::ProstCodec::default();
4094                        let mut grpc = tonic::server::Grpc::new(codec)
4095                            .apply_compression_config(
4096                                accept_compression_encodings,
4097                                send_compression_encodings,
4098                            )
4099                            .apply_max_message_size_config(
4100                                max_decoding_message_size,
4101                                max_encoding_message_size,
4102                            );
4103                        let res = grpc.unary(method, req).await;
4104                        Ok(res)
4105                    };
4106                    Box::pin(fut)
4107                }
4108                "/pidgr.v1.CampaignService/ListCampaigns" => {
4109                    #[allow(non_camel_case_types)]
4110                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
4111                    impl<
4112                        T: CampaignService,
4113                    > tonic::server::UnaryService<super::ListCampaignsRequest>
4114                    for ListCampaignsSvc<T> {
4115                        type Response = super::ListCampaignsResponse;
4116                        type Future = BoxFuture<
4117                            tonic::Response<Self::Response>,
4118                            tonic::Status,
4119                        >;
4120                        fn call(
4121                            &mut self,
4122                            request: tonic::Request<super::ListCampaignsRequest>,
4123                        ) -> Self::Future {
4124                            let inner = Arc::clone(&self.0);
4125                            let fut = async move {
4126                                <T as CampaignService>::list_campaigns(&inner, request)
4127                                    .await
4128                            };
4129                            Box::pin(fut)
4130                        }
4131                    }
4132                    let accept_compression_encodings = self.accept_compression_encodings;
4133                    let send_compression_encodings = self.send_compression_encodings;
4134                    let max_decoding_message_size = self.max_decoding_message_size;
4135                    let max_encoding_message_size = self.max_encoding_message_size;
4136                    let inner = self.inner.clone();
4137                    let fut = async move {
4138                        let method = ListCampaignsSvc(inner);
4139                        let codec = tonic_prost::ProstCodec::default();
4140                        let mut grpc = tonic::server::Grpc::new(codec)
4141                            .apply_compression_config(
4142                                accept_compression_encodings,
4143                                send_compression_encodings,
4144                            )
4145                            .apply_max_message_size_config(
4146                                max_decoding_message_size,
4147                                max_encoding_message_size,
4148                            );
4149                        let res = grpc.unary(method, req).await;
4150                        Ok(res)
4151                    };
4152                    Box::pin(fut)
4153                }
4154                "/pidgr.v1.CampaignService/UpdateCampaign" => {
4155                    #[allow(non_camel_case_types)]
4156                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
4157                    impl<
4158                        T: CampaignService,
4159                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
4160                    for UpdateCampaignSvc<T> {
4161                        type Response = super::UpdateCampaignResponse;
4162                        type Future = BoxFuture<
4163                            tonic::Response<Self::Response>,
4164                            tonic::Status,
4165                        >;
4166                        fn call(
4167                            &mut self,
4168                            request: tonic::Request<super::UpdateCampaignRequest>,
4169                        ) -> Self::Future {
4170                            let inner = Arc::clone(&self.0);
4171                            let fut = async move {
4172                                <T as CampaignService>::update_campaign(&inner, request)
4173                                    .await
4174                            };
4175                            Box::pin(fut)
4176                        }
4177                    }
4178                    let accept_compression_encodings = self.accept_compression_encodings;
4179                    let send_compression_encodings = self.send_compression_encodings;
4180                    let max_decoding_message_size = self.max_decoding_message_size;
4181                    let max_encoding_message_size = self.max_encoding_message_size;
4182                    let inner = self.inner.clone();
4183                    let fut = async move {
4184                        let method = UpdateCampaignSvc(inner);
4185                        let codec = tonic_prost::ProstCodec::default();
4186                        let mut grpc = tonic::server::Grpc::new(codec)
4187                            .apply_compression_config(
4188                                accept_compression_encodings,
4189                                send_compression_encodings,
4190                            )
4191                            .apply_max_message_size_config(
4192                                max_decoding_message_size,
4193                                max_encoding_message_size,
4194                            );
4195                        let res = grpc.unary(method, req).await;
4196                        Ok(res)
4197                    };
4198                    Box::pin(fut)
4199                }
4200                "/pidgr.v1.CampaignService/GetCampaignAudience" => {
4201                    #[allow(non_camel_case_types)]
4202                    struct GetCampaignAudienceSvc<T: CampaignService>(pub Arc<T>);
4203                    impl<
4204                        T: CampaignService,
4205                    > tonic::server::UnaryService<super::GetCampaignAudienceRequest>
4206                    for GetCampaignAudienceSvc<T> {
4207                        type Response = super::GetCampaignAudienceResponse;
4208                        type Future = BoxFuture<
4209                            tonic::Response<Self::Response>,
4210                            tonic::Status,
4211                        >;
4212                        fn call(
4213                            &mut self,
4214                            request: tonic::Request<super::GetCampaignAudienceRequest>,
4215                        ) -> Self::Future {
4216                            let inner = Arc::clone(&self.0);
4217                            let fut = async move {
4218                                <T as CampaignService>::get_campaign_audience(
4219                                        &inner,
4220                                        request,
4221                                    )
4222                                    .await
4223                            };
4224                            Box::pin(fut)
4225                        }
4226                    }
4227                    let accept_compression_encodings = self.accept_compression_encodings;
4228                    let send_compression_encodings = self.send_compression_encodings;
4229                    let max_decoding_message_size = self.max_decoding_message_size;
4230                    let max_encoding_message_size = self.max_encoding_message_size;
4231                    let inner = self.inner.clone();
4232                    let fut = async move {
4233                        let method = GetCampaignAudienceSvc(inner);
4234                        let codec = tonic_prost::ProstCodec::default();
4235                        let mut grpc = tonic::server::Grpc::new(codec)
4236                            .apply_compression_config(
4237                                accept_compression_encodings,
4238                                send_compression_encodings,
4239                            )
4240                            .apply_max_message_size_config(
4241                                max_decoding_message_size,
4242                                max_encoding_message_size,
4243                            );
4244                        let res = grpc.unary(method, req).await;
4245                        Ok(res)
4246                    };
4247                    Box::pin(fut)
4248                }
4249                "/pidgr.v1.CampaignService/CancelCampaign" => {
4250                    #[allow(non_camel_case_types)]
4251                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
4252                    impl<
4253                        T: CampaignService,
4254                    > tonic::server::UnaryService<super::CancelCampaignRequest>
4255                    for CancelCampaignSvc<T> {
4256                        type Response = super::CancelCampaignResponse;
4257                        type Future = BoxFuture<
4258                            tonic::Response<Self::Response>,
4259                            tonic::Status,
4260                        >;
4261                        fn call(
4262                            &mut self,
4263                            request: tonic::Request<super::CancelCampaignRequest>,
4264                        ) -> Self::Future {
4265                            let inner = Arc::clone(&self.0);
4266                            let fut = async move {
4267                                <T as CampaignService>::cancel_campaign(&inner, request)
4268                                    .await
4269                            };
4270                            Box::pin(fut)
4271                        }
4272                    }
4273                    let accept_compression_encodings = self.accept_compression_encodings;
4274                    let send_compression_encodings = self.send_compression_encodings;
4275                    let max_decoding_message_size = self.max_decoding_message_size;
4276                    let max_encoding_message_size = self.max_encoding_message_size;
4277                    let inner = self.inner.clone();
4278                    let fut = async move {
4279                        let method = CancelCampaignSvc(inner);
4280                        let codec = tonic_prost::ProstCodec::default();
4281                        let mut grpc = tonic::server::Grpc::new(codec)
4282                            .apply_compression_config(
4283                                accept_compression_encodings,
4284                                send_compression_encodings,
4285                            )
4286                            .apply_max_message_size_config(
4287                                max_decoding_message_size,
4288                                max_encoding_message_size,
4289                            );
4290                        let res = grpc.unary(method, req).await;
4291                        Ok(res)
4292                    };
4293                    Box::pin(fut)
4294                }
4295                "/pidgr.v1.CampaignService/ListDeliveries" => {
4296                    #[allow(non_camel_case_types)]
4297                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
4298                    impl<
4299                        T: CampaignService,
4300                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
4301                    for ListDeliveriesSvc<T> {
4302                        type Response = super::ListDeliveriesResponse;
4303                        type Future = BoxFuture<
4304                            tonic::Response<Self::Response>,
4305                            tonic::Status,
4306                        >;
4307                        fn call(
4308                            &mut self,
4309                            request: tonic::Request<super::ListDeliveriesRequest>,
4310                        ) -> Self::Future {
4311                            let inner = Arc::clone(&self.0);
4312                            let fut = async move {
4313                                <T as CampaignService>::list_deliveries(&inner, request)
4314                                    .await
4315                            };
4316                            Box::pin(fut)
4317                        }
4318                    }
4319                    let accept_compression_encodings = self.accept_compression_encodings;
4320                    let send_compression_encodings = self.send_compression_encodings;
4321                    let max_decoding_message_size = self.max_decoding_message_size;
4322                    let max_encoding_message_size = self.max_encoding_message_size;
4323                    let inner = self.inner.clone();
4324                    let fut = async move {
4325                        let method = ListDeliveriesSvc(inner);
4326                        let codec = tonic_prost::ProstCodec::default();
4327                        let mut grpc = tonic::server::Grpc::new(codec)
4328                            .apply_compression_config(
4329                                accept_compression_encodings,
4330                                send_compression_encodings,
4331                            )
4332                            .apply_max_message_size_config(
4333                                max_decoding_message_size,
4334                                max_encoding_message_size,
4335                            );
4336                        let res = grpc.unary(method, req).await;
4337                        Ok(res)
4338                    };
4339                    Box::pin(fut)
4340                }
4341                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
4342                    #[allow(non_camel_case_types)]
4343                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
4344                        pub Arc<T>,
4345                    );
4346                    impl<
4347                        T: CampaignService,
4348                    > tonic::server::UnaryService<
4349                        super::GetCampaignArchetypeBreakdownRequest,
4350                    > for GetCampaignArchetypeBreakdownSvc<T> {
4351                        type Response = super::GetCampaignArchetypeBreakdownResponse;
4352                        type Future = BoxFuture<
4353                            tonic::Response<Self::Response>,
4354                            tonic::Status,
4355                        >;
4356                        fn call(
4357                            &mut self,
4358                            request: tonic::Request<
4359                                super::GetCampaignArchetypeBreakdownRequest,
4360                            >,
4361                        ) -> Self::Future {
4362                            let inner = Arc::clone(&self.0);
4363                            let fut = async move {
4364                                <T as CampaignService>::get_campaign_archetype_breakdown(
4365                                        &inner,
4366                                        request,
4367                                    )
4368                                    .await
4369                            };
4370                            Box::pin(fut)
4371                        }
4372                    }
4373                    let accept_compression_encodings = self.accept_compression_encodings;
4374                    let send_compression_encodings = self.send_compression_encodings;
4375                    let max_decoding_message_size = self.max_decoding_message_size;
4376                    let max_encoding_message_size = self.max_encoding_message_size;
4377                    let inner = self.inner.clone();
4378                    let fut = async move {
4379                        let method = GetCampaignArchetypeBreakdownSvc(inner);
4380                        let codec = tonic_prost::ProstCodec::default();
4381                        let mut grpc = tonic::server::Grpc::new(codec)
4382                            .apply_compression_config(
4383                                accept_compression_encodings,
4384                                send_compression_encodings,
4385                            )
4386                            .apply_max_message_size_config(
4387                                max_decoding_message_size,
4388                                max_encoding_message_size,
4389                            );
4390                        let res = grpc.unary(method, req).await;
4391                        Ok(res)
4392                    };
4393                    Box::pin(fut)
4394                }
4395                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
4396                    #[allow(non_camel_case_types)]
4397                    struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
4398                    impl<
4399                        T: CampaignService,
4400                    > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
4401                    for ResolveOrCreateShortCodeSvc<T> {
4402                        type Response = super::ResolveOrCreateShortCodeResponse;
4403                        type Future = BoxFuture<
4404                            tonic::Response<Self::Response>,
4405                            tonic::Status,
4406                        >;
4407                        fn call(
4408                            &mut self,
4409                            request: tonic::Request<
4410                                super::ResolveOrCreateShortCodeRequest,
4411                            >,
4412                        ) -> Self::Future {
4413                            let inner = Arc::clone(&self.0);
4414                            let fut = async move {
4415                                <T as CampaignService>::resolve_or_create_short_code(
4416                                        &inner,
4417                                        request,
4418                                    )
4419                                    .await
4420                            };
4421                            Box::pin(fut)
4422                        }
4423                    }
4424                    let accept_compression_encodings = self.accept_compression_encodings;
4425                    let send_compression_encodings = self.send_compression_encodings;
4426                    let max_decoding_message_size = self.max_decoding_message_size;
4427                    let max_encoding_message_size = self.max_encoding_message_size;
4428                    let inner = self.inner.clone();
4429                    let fut = async move {
4430                        let method = ResolveOrCreateShortCodeSvc(inner);
4431                        let codec = tonic_prost::ProstCodec::default();
4432                        let mut grpc = tonic::server::Grpc::new(codec)
4433                            .apply_compression_config(
4434                                accept_compression_encodings,
4435                                send_compression_encodings,
4436                            )
4437                            .apply_max_message_size_config(
4438                                max_decoding_message_size,
4439                                max_encoding_message_size,
4440                            );
4441                        let res = grpc.unary(method, req).await;
4442                        Ok(res)
4443                    };
4444                    Box::pin(fut)
4445                }
4446                "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
4447                    #[allow(non_camel_case_types)]
4448                    struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4449                    impl<
4450                        T: CampaignService,
4451                    > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4452                    for GetCampaignByShortCodeSvc<T> {
4453                        type Response = super::GetCampaignByShortCodeResponse;
4454                        type Future = BoxFuture<
4455                            tonic::Response<Self::Response>,
4456                            tonic::Status,
4457                        >;
4458                        fn call(
4459                            &mut self,
4460                            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4461                        ) -> Self::Future {
4462                            let inner = Arc::clone(&self.0);
4463                            let fut = async move {
4464                                <T as CampaignService>::get_campaign_by_short_code(
4465                                        &inner,
4466                                        request,
4467                                    )
4468                                    .await
4469                            };
4470                            Box::pin(fut)
4471                        }
4472                    }
4473                    let accept_compression_encodings = self.accept_compression_encodings;
4474                    let send_compression_encodings = self.send_compression_encodings;
4475                    let max_decoding_message_size = self.max_decoding_message_size;
4476                    let max_encoding_message_size = self.max_encoding_message_size;
4477                    let inner = self.inner.clone();
4478                    let fut = async move {
4479                        let method = GetCampaignByShortCodeSvc(inner);
4480                        let codec = tonic_prost::ProstCodec::default();
4481                        let mut grpc = tonic::server::Grpc::new(codec)
4482                            .apply_compression_config(
4483                                accept_compression_encodings,
4484                                send_compression_encodings,
4485                            )
4486                            .apply_max_message_size_config(
4487                                max_decoding_message_size,
4488                                max_encoding_message_size,
4489                            );
4490                        let res = grpc.unary(method, req).await;
4491                        Ok(res)
4492                    };
4493                    Box::pin(fut)
4494                }
4495                _ => {
4496                    Box::pin(async move {
4497                        let mut response = http::Response::new(
4498                            tonic::body::Body::default(),
4499                        );
4500                        let headers = response.headers_mut();
4501                        headers
4502                            .insert(
4503                                tonic::Status::GRPC_STATUS,
4504                                (tonic::Code::Unimplemented as i32).into(),
4505                            );
4506                        headers
4507                            .insert(
4508                                http::header::CONTENT_TYPE,
4509                                tonic::metadata::GRPC_CONTENT_TYPE,
4510                            );
4511                        Ok(response)
4512                    })
4513                }
4514            }
4515        }
4516    }
4517    impl<T> Clone for CampaignServiceServer<T> {
4518        fn clone(&self) -> Self {
4519            let inner = self.inner.clone();
4520            Self {
4521                inner,
4522                accept_compression_encodings: self.accept_compression_encodings,
4523                send_compression_encodings: self.send_compression_encodings,
4524                max_decoding_message_size: self.max_decoding_message_size,
4525                max_encoding_message_size: self.max_encoding_message_size,
4526            }
4527        }
4528    }
4529    /// Generated gRPC service name
4530    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4531    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4532        const NAME: &'static str = SERVICE_NAME;
4533    }
4534}
4535/// Generated client implementations.
4536pub mod device_service_client {
4537    #![allow(
4538        unused_variables,
4539        dead_code,
4540        missing_docs,
4541        clippy::wildcard_imports,
4542        clippy::let_unit_value,
4543    )]
4544    use tonic::codegen::*;
4545    use tonic::codegen::http::Uri;
4546    /** Manages push notification device registration.
4547 Used by the mobile app to register push tokens and manage device lifecycle.
4548*/
4549    #[derive(Debug, Clone)]
4550    pub struct DeviceServiceClient<T> {
4551        inner: tonic::client::Grpc<T>,
4552    }
4553    impl DeviceServiceClient<tonic::transport::Channel> {
4554        /// Attempt to create a new client by connecting to a given endpoint.
4555        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4556        where
4557            D: TryInto<tonic::transport::Endpoint>,
4558            D::Error: Into<StdError>,
4559        {
4560            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4561            Ok(Self::new(conn))
4562        }
4563    }
4564    impl<T> DeviceServiceClient<T>
4565    where
4566        T: tonic::client::GrpcService<tonic::body::Body>,
4567        T::Error: Into<StdError>,
4568        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4569        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4570    {
4571        pub fn new(inner: T) -> Self {
4572            let inner = tonic::client::Grpc::new(inner);
4573            Self { inner }
4574        }
4575        pub fn with_origin(inner: T, origin: Uri) -> Self {
4576            let inner = tonic::client::Grpc::with_origin(inner, origin);
4577            Self { inner }
4578        }
4579        pub fn with_interceptor<F>(
4580            inner: T,
4581            interceptor: F,
4582        ) -> DeviceServiceClient<InterceptedService<T, F>>
4583        where
4584            F: tonic::service::Interceptor,
4585            T::ResponseBody: Default,
4586            T: tonic::codegen::Service<
4587                http::Request<tonic::body::Body>,
4588                Response = http::Response<
4589                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4590                >,
4591            >,
4592            <T as tonic::codegen::Service<
4593                http::Request<tonic::body::Body>,
4594            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4595        {
4596            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4597        }
4598        /// Compress requests with the given encoding.
4599        ///
4600        /// This requires the server to support it otherwise it might respond with an
4601        /// error.
4602        #[must_use]
4603        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4604            self.inner = self.inner.send_compressed(encoding);
4605            self
4606        }
4607        /// Enable decompressing responses.
4608        #[must_use]
4609        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4610            self.inner = self.inner.accept_compressed(encoding);
4611            self
4612        }
4613        /// Limits the maximum size of a decoded message.
4614        ///
4615        /// Default: `4MB`
4616        #[must_use]
4617        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4618            self.inner = self.inner.max_decoding_message_size(limit);
4619            self
4620        }
4621        /// Limits the maximum size of an encoded message.
4622        ///
4623        /// Default: `usize::MAX`
4624        #[must_use]
4625        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4626            self.inner = self.inner.max_encoding_message_size(limit);
4627            self
4628        }
4629        /** Register a device with its push token for receiving notifications.
4630 Authorization: Authenticated user (own devices only).
4631*/
4632        pub async fn register(
4633            &mut self,
4634            request: impl tonic::IntoRequest<super::RegisterRequest>,
4635        ) -> std::result::Result<
4636            tonic::Response<super::RegisterResponse>,
4637            tonic::Status,
4638        > {
4639            self.inner
4640                .ready()
4641                .await
4642                .map_err(|e| {
4643                    tonic::Status::unknown(
4644                        format!("Service was not ready: {}", e.into()),
4645                    )
4646                })?;
4647            let codec = tonic_prost::ProstCodec::default();
4648            let path = http::uri::PathAndQuery::from_static(
4649                "/pidgr.v1.DeviceService/Register",
4650            );
4651            let mut req = request.into_request();
4652            req.extensions_mut()
4653                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4654            self.inner.unary(req, path, codec).await
4655        }
4656        /** Deactivate a device, preventing further push notifications.
4657 Authorization: Authenticated user (own devices only).
4658*/
4659        pub async fn deactivate(
4660            &mut self,
4661            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4662        ) -> std::result::Result<
4663            tonic::Response<super::DeactivateResponse>,
4664            tonic::Status,
4665        > {
4666            self.inner
4667                .ready()
4668                .await
4669                .map_err(|e| {
4670                    tonic::Status::unknown(
4671                        format!("Service was not ready: {}", e.into()),
4672                    )
4673                })?;
4674            let codec = tonic_prost::ProstCodec::default();
4675            let path = http::uri::PathAndQuery::from_static(
4676                "/pidgr.v1.DeviceService/Deactivate",
4677            );
4678            let mut req = request.into_request();
4679            req.extensions_mut()
4680                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4681            self.inner.unary(req, path, codec).await
4682        }
4683        /** List all devices registered to the authenticated user.
4684 Authorization: Authenticated user (own devices only).
4685*/
4686        pub async fn list_devices(
4687            &mut self,
4688            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4689        ) -> std::result::Result<
4690            tonic::Response<super::ListDevicesResponse>,
4691            tonic::Status,
4692        > {
4693            self.inner
4694                .ready()
4695                .await
4696                .map_err(|e| {
4697                    tonic::Status::unknown(
4698                        format!("Service was not ready: {}", e.into()),
4699                    )
4700                })?;
4701            let codec = tonic_prost::ProstCodec::default();
4702            let path = http::uri::PathAndQuery::from_static(
4703                "/pidgr.v1.DeviceService/ListDevices",
4704            );
4705            let mut req = request.into_request();
4706            req.extensions_mut()
4707                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4708            self.inner.unary(req, path, codec).await
4709        }
4710        /** List all devices for a specific organization member.
4711 Authorization: Requires MEMBERS_READ permission.
4712*/
4713        pub async fn list_member_devices(
4714            &mut self,
4715            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4716        ) -> std::result::Result<
4717            tonic::Response<super::ListMemberDevicesResponse>,
4718            tonic::Status,
4719        > {
4720            self.inner
4721                .ready()
4722                .await
4723                .map_err(|e| {
4724                    tonic::Status::unknown(
4725                        format!("Service was not ready: {}", e.into()),
4726                    )
4727                })?;
4728            let codec = tonic_prost::ProstCodec::default();
4729            let path = http::uri::PathAndQuery::from_static(
4730                "/pidgr.v1.DeviceService/ListMemberDevices",
4731            );
4732            let mut req = request.into_request();
4733            req.extensions_mut()
4734                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4735            self.inner.unary(req, path, codec).await
4736        }
4737    }
4738}
4739/// Generated server implementations.
4740pub mod device_service_server {
4741    #![allow(
4742        unused_variables,
4743        dead_code,
4744        missing_docs,
4745        clippy::wildcard_imports,
4746        clippy::let_unit_value,
4747    )]
4748    use tonic::codegen::*;
4749    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4750    #[async_trait]
4751    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4752        /** Register a device with its push token for receiving notifications.
4753 Authorization: Authenticated user (own devices only).
4754*/
4755        async fn register(
4756            &self,
4757            request: tonic::Request<super::RegisterRequest>,
4758        ) -> std::result::Result<
4759            tonic::Response<super::RegisterResponse>,
4760            tonic::Status,
4761        >;
4762        /** Deactivate a device, preventing further push notifications.
4763 Authorization: Authenticated user (own devices only).
4764*/
4765        async fn deactivate(
4766            &self,
4767            request: tonic::Request<super::DeactivateRequest>,
4768        ) -> std::result::Result<
4769            tonic::Response<super::DeactivateResponse>,
4770            tonic::Status,
4771        >;
4772        /** List all devices registered to the authenticated user.
4773 Authorization: Authenticated user (own devices only).
4774*/
4775        async fn list_devices(
4776            &self,
4777            request: tonic::Request<super::ListDevicesRequest>,
4778        ) -> std::result::Result<
4779            tonic::Response<super::ListDevicesResponse>,
4780            tonic::Status,
4781        >;
4782        /** List all devices for a specific organization member.
4783 Authorization: Requires MEMBERS_READ permission.
4784*/
4785        async fn list_member_devices(
4786            &self,
4787            request: tonic::Request<super::ListMemberDevicesRequest>,
4788        ) -> std::result::Result<
4789            tonic::Response<super::ListMemberDevicesResponse>,
4790            tonic::Status,
4791        >;
4792    }
4793    /** Manages push notification device registration.
4794 Used by the mobile app to register push tokens and manage device lifecycle.
4795*/
4796    #[derive(Debug)]
4797    pub struct DeviceServiceServer<T> {
4798        inner: Arc<T>,
4799        accept_compression_encodings: EnabledCompressionEncodings,
4800        send_compression_encodings: EnabledCompressionEncodings,
4801        max_decoding_message_size: Option<usize>,
4802        max_encoding_message_size: Option<usize>,
4803    }
4804    impl<T> DeviceServiceServer<T> {
4805        pub fn new(inner: T) -> Self {
4806            Self::from_arc(Arc::new(inner))
4807        }
4808        pub fn from_arc(inner: Arc<T>) -> Self {
4809            Self {
4810                inner,
4811                accept_compression_encodings: Default::default(),
4812                send_compression_encodings: Default::default(),
4813                max_decoding_message_size: None,
4814                max_encoding_message_size: None,
4815            }
4816        }
4817        pub fn with_interceptor<F>(
4818            inner: T,
4819            interceptor: F,
4820        ) -> InterceptedService<Self, F>
4821        where
4822            F: tonic::service::Interceptor,
4823        {
4824            InterceptedService::new(Self::new(inner), interceptor)
4825        }
4826        /// Enable decompressing requests with the given encoding.
4827        #[must_use]
4828        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4829            self.accept_compression_encodings.enable(encoding);
4830            self
4831        }
4832        /// Compress responses with the given encoding, if the client supports it.
4833        #[must_use]
4834        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4835            self.send_compression_encodings.enable(encoding);
4836            self
4837        }
4838        /// Limits the maximum size of a decoded message.
4839        ///
4840        /// Default: `4MB`
4841        #[must_use]
4842        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4843            self.max_decoding_message_size = Some(limit);
4844            self
4845        }
4846        /// Limits the maximum size of an encoded message.
4847        ///
4848        /// Default: `usize::MAX`
4849        #[must_use]
4850        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4851            self.max_encoding_message_size = Some(limit);
4852            self
4853        }
4854    }
4855    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4856    where
4857        T: DeviceService,
4858        B: Body + std::marker::Send + 'static,
4859        B::Error: Into<StdError> + std::marker::Send + 'static,
4860    {
4861        type Response = http::Response<tonic::body::Body>;
4862        type Error = std::convert::Infallible;
4863        type Future = BoxFuture<Self::Response, Self::Error>;
4864        fn poll_ready(
4865            &mut self,
4866            _cx: &mut Context<'_>,
4867        ) -> Poll<std::result::Result<(), Self::Error>> {
4868            Poll::Ready(Ok(()))
4869        }
4870        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4871            match req.uri().path() {
4872                "/pidgr.v1.DeviceService/Register" => {
4873                    #[allow(non_camel_case_types)]
4874                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4875                    impl<
4876                        T: DeviceService,
4877                    > tonic::server::UnaryService<super::RegisterRequest>
4878                    for RegisterSvc<T> {
4879                        type Response = super::RegisterResponse;
4880                        type Future = BoxFuture<
4881                            tonic::Response<Self::Response>,
4882                            tonic::Status,
4883                        >;
4884                        fn call(
4885                            &mut self,
4886                            request: tonic::Request<super::RegisterRequest>,
4887                        ) -> Self::Future {
4888                            let inner = Arc::clone(&self.0);
4889                            let fut = async move {
4890                                <T as DeviceService>::register(&inner, request).await
4891                            };
4892                            Box::pin(fut)
4893                        }
4894                    }
4895                    let accept_compression_encodings = self.accept_compression_encodings;
4896                    let send_compression_encodings = self.send_compression_encodings;
4897                    let max_decoding_message_size = self.max_decoding_message_size;
4898                    let max_encoding_message_size = self.max_encoding_message_size;
4899                    let inner = self.inner.clone();
4900                    let fut = async move {
4901                        let method = RegisterSvc(inner);
4902                        let codec = tonic_prost::ProstCodec::default();
4903                        let mut grpc = tonic::server::Grpc::new(codec)
4904                            .apply_compression_config(
4905                                accept_compression_encodings,
4906                                send_compression_encodings,
4907                            )
4908                            .apply_max_message_size_config(
4909                                max_decoding_message_size,
4910                                max_encoding_message_size,
4911                            );
4912                        let res = grpc.unary(method, req).await;
4913                        Ok(res)
4914                    };
4915                    Box::pin(fut)
4916                }
4917                "/pidgr.v1.DeviceService/Deactivate" => {
4918                    #[allow(non_camel_case_types)]
4919                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4920                    impl<
4921                        T: DeviceService,
4922                    > tonic::server::UnaryService<super::DeactivateRequest>
4923                    for DeactivateSvc<T> {
4924                        type Response = super::DeactivateResponse;
4925                        type Future = BoxFuture<
4926                            tonic::Response<Self::Response>,
4927                            tonic::Status,
4928                        >;
4929                        fn call(
4930                            &mut self,
4931                            request: tonic::Request<super::DeactivateRequest>,
4932                        ) -> Self::Future {
4933                            let inner = Arc::clone(&self.0);
4934                            let fut = async move {
4935                                <T as DeviceService>::deactivate(&inner, request).await
4936                            };
4937                            Box::pin(fut)
4938                        }
4939                    }
4940                    let accept_compression_encodings = self.accept_compression_encodings;
4941                    let send_compression_encodings = self.send_compression_encodings;
4942                    let max_decoding_message_size = self.max_decoding_message_size;
4943                    let max_encoding_message_size = self.max_encoding_message_size;
4944                    let inner = self.inner.clone();
4945                    let fut = async move {
4946                        let method = DeactivateSvc(inner);
4947                        let codec = tonic_prost::ProstCodec::default();
4948                        let mut grpc = tonic::server::Grpc::new(codec)
4949                            .apply_compression_config(
4950                                accept_compression_encodings,
4951                                send_compression_encodings,
4952                            )
4953                            .apply_max_message_size_config(
4954                                max_decoding_message_size,
4955                                max_encoding_message_size,
4956                            );
4957                        let res = grpc.unary(method, req).await;
4958                        Ok(res)
4959                    };
4960                    Box::pin(fut)
4961                }
4962                "/pidgr.v1.DeviceService/ListDevices" => {
4963                    #[allow(non_camel_case_types)]
4964                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4965                    impl<
4966                        T: DeviceService,
4967                    > tonic::server::UnaryService<super::ListDevicesRequest>
4968                    for ListDevicesSvc<T> {
4969                        type Response = super::ListDevicesResponse;
4970                        type Future = BoxFuture<
4971                            tonic::Response<Self::Response>,
4972                            tonic::Status,
4973                        >;
4974                        fn call(
4975                            &mut self,
4976                            request: tonic::Request<super::ListDevicesRequest>,
4977                        ) -> Self::Future {
4978                            let inner = Arc::clone(&self.0);
4979                            let fut = async move {
4980                                <T as DeviceService>::list_devices(&inner, request).await
4981                            };
4982                            Box::pin(fut)
4983                        }
4984                    }
4985                    let accept_compression_encodings = self.accept_compression_encodings;
4986                    let send_compression_encodings = self.send_compression_encodings;
4987                    let max_decoding_message_size = self.max_decoding_message_size;
4988                    let max_encoding_message_size = self.max_encoding_message_size;
4989                    let inner = self.inner.clone();
4990                    let fut = async move {
4991                        let method = ListDevicesSvc(inner);
4992                        let codec = tonic_prost::ProstCodec::default();
4993                        let mut grpc = tonic::server::Grpc::new(codec)
4994                            .apply_compression_config(
4995                                accept_compression_encodings,
4996                                send_compression_encodings,
4997                            )
4998                            .apply_max_message_size_config(
4999                                max_decoding_message_size,
5000                                max_encoding_message_size,
5001                            );
5002                        let res = grpc.unary(method, req).await;
5003                        Ok(res)
5004                    };
5005                    Box::pin(fut)
5006                }
5007                "/pidgr.v1.DeviceService/ListMemberDevices" => {
5008                    #[allow(non_camel_case_types)]
5009                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
5010                    impl<
5011                        T: DeviceService,
5012                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
5013                    for ListMemberDevicesSvc<T> {
5014                        type Response = super::ListMemberDevicesResponse;
5015                        type Future = BoxFuture<
5016                            tonic::Response<Self::Response>,
5017                            tonic::Status,
5018                        >;
5019                        fn call(
5020                            &mut self,
5021                            request: tonic::Request<super::ListMemberDevicesRequest>,
5022                        ) -> Self::Future {
5023                            let inner = Arc::clone(&self.0);
5024                            let fut = async move {
5025                                <T as DeviceService>::list_member_devices(&inner, request)
5026                                    .await
5027                            };
5028                            Box::pin(fut)
5029                        }
5030                    }
5031                    let accept_compression_encodings = self.accept_compression_encodings;
5032                    let send_compression_encodings = self.send_compression_encodings;
5033                    let max_decoding_message_size = self.max_decoding_message_size;
5034                    let max_encoding_message_size = self.max_encoding_message_size;
5035                    let inner = self.inner.clone();
5036                    let fut = async move {
5037                        let method = ListMemberDevicesSvc(inner);
5038                        let codec = tonic_prost::ProstCodec::default();
5039                        let mut grpc = tonic::server::Grpc::new(codec)
5040                            .apply_compression_config(
5041                                accept_compression_encodings,
5042                                send_compression_encodings,
5043                            )
5044                            .apply_max_message_size_config(
5045                                max_decoding_message_size,
5046                                max_encoding_message_size,
5047                            );
5048                        let res = grpc.unary(method, req).await;
5049                        Ok(res)
5050                    };
5051                    Box::pin(fut)
5052                }
5053                _ => {
5054                    Box::pin(async move {
5055                        let mut response = http::Response::new(
5056                            tonic::body::Body::default(),
5057                        );
5058                        let headers = response.headers_mut();
5059                        headers
5060                            .insert(
5061                                tonic::Status::GRPC_STATUS,
5062                                (tonic::Code::Unimplemented as i32).into(),
5063                            );
5064                        headers
5065                            .insert(
5066                                http::header::CONTENT_TYPE,
5067                                tonic::metadata::GRPC_CONTENT_TYPE,
5068                            );
5069                        Ok(response)
5070                    })
5071                }
5072            }
5073        }
5074    }
5075    impl<T> Clone for DeviceServiceServer<T> {
5076        fn clone(&self) -> Self {
5077            let inner = self.inner.clone();
5078            Self {
5079                inner,
5080                accept_compression_encodings: self.accept_compression_encodings,
5081                send_compression_encodings: self.send_compression_encodings,
5082                max_decoding_message_size: self.max_decoding_message_size,
5083                max_encoding_message_size: self.max_encoding_message_size,
5084            }
5085        }
5086    }
5087    /// Generated gRPC service name
5088    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
5089    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
5090        const NAME: &'static str = SERVICE_NAME;
5091    }
5092}
5093/// Generated client implementations.
5094pub mod group_service_client {
5095    #![allow(
5096        unused_variables,
5097        dead_code,
5098        missing_docs,
5099        clippy::wildcard_imports,
5100        clippy::let_unit_value,
5101    )]
5102    use tonic::codegen::*;
5103    use tonic::codegen::http::Uri;
5104    /** Manages groups and group membership within an organization.
5105 Groups are recipient collections used for campaign audience targeting.
5106 All RPCs operate within the caller's org (extracted from JWT).
5107*/
5108    #[derive(Debug, Clone)]
5109    pub struct GroupServiceClient<T> {
5110        inner: tonic::client::Grpc<T>,
5111    }
5112    impl GroupServiceClient<tonic::transport::Channel> {
5113        /// Attempt to create a new client by connecting to a given endpoint.
5114        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5115        where
5116            D: TryInto<tonic::transport::Endpoint>,
5117            D::Error: Into<StdError>,
5118        {
5119            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5120            Ok(Self::new(conn))
5121        }
5122    }
5123    impl<T> GroupServiceClient<T>
5124    where
5125        T: tonic::client::GrpcService<tonic::body::Body>,
5126        T::Error: Into<StdError>,
5127        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5128        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5129    {
5130        pub fn new(inner: T) -> Self {
5131            let inner = tonic::client::Grpc::new(inner);
5132            Self { inner }
5133        }
5134        pub fn with_origin(inner: T, origin: Uri) -> Self {
5135            let inner = tonic::client::Grpc::with_origin(inner, origin);
5136            Self { inner }
5137        }
5138        pub fn with_interceptor<F>(
5139            inner: T,
5140            interceptor: F,
5141        ) -> GroupServiceClient<InterceptedService<T, F>>
5142        where
5143            F: tonic::service::Interceptor,
5144            T::ResponseBody: Default,
5145            T: tonic::codegen::Service<
5146                http::Request<tonic::body::Body>,
5147                Response = http::Response<
5148                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5149                >,
5150            >,
5151            <T as tonic::codegen::Service<
5152                http::Request<tonic::body::Body>,
5153            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5154        {
5155            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
5156        }
5157        /// Compress requests with the given encoding.
5158        ///
5159        /// This requires the server to support it otherwise it might respond with an
5160        /// error.
5161        #[must_use]
5162        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5163            self.inner = self.inner.send_compressed(encoding);
5164            self
5165        }
5166        /// Enable decompressing responses.
5167        #[must_use]
5168        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5169            self.inner = self.inner.accept_compressed(encoding);
5170            self
5171        }
5172        /// Limits the maximum size of a decoded message.
5173        ///
5174        /// Default: `4MB`
5175        #[must_use]
5176        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5177            self.inner = self.inner.max_decoding_message_size(limit);
5178            self
5179        }
5180        /// Limits the maximum size of an encoded message.
5181        ///
5182        /// Default: `usize::MAX`
5183        #[must_use]
5184        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5185            self.inner = self.inner.max_encoding_message_size(limit);
5186            self
5187        }
5188        /** Create a new group in the organization.
5189 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5190*/
5191        pub async fn create_group(
5192            &mut self,
5193            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
5194        ) -> std::result::Result<
5195            tonic::Response<super::CreateGroupResponse>,
5196            tonic::Status,
5197        > {
5198            self.inner
5199                .ready()
5200                .await
5201                .map_err(|e| {
5202                    tonic::Status::unknown(
5203                        format!("Service was not ready: {}", e.into()),
5204                    )
5205                })?;
5206            let codec = tonic_prost::ProstCodec::default();
5207            let path = http::uri::PathAndQuery::from_static(
5208                "/pidgr.v1.GroupService/CreateGroup",
5209            );
5210            let mut req = request.into_request();
5211            req.extensions_mut()
5212                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
5213            self.inner.unary(req, path, codec).await
5214        }
5215        /** Retrieve a group by ID.
5216 Authorization: Caller must be a member of the group, or have
5217 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5218*/
5219        pub async fn get_group(
5220            &mut self,
5221            request: impl tonic::IntoRequest<super::GetGroupRequest>,
5222        ) -> std::result::Result<
5223            tonic::Response<super::GetGroupResponse>,
5224            tonic::Status,
5225        > {
5226            self.inner
5227                .ready()
5228                .await
5229                .map_err(|e| {
5230                    tonic::Status::unknown(
5231                        format!("Service was not ready: {}", e.into()),
5232                    )
5233                })?;
5234            let codec = tonic_prost::ProstCodec::default();
5235            let path = http::uri::PathAndQuery::from_static(
5236                "/pidgr.v1.GroupService/GetGroup",
5237            );
5238            let mut req = request.into_request();
5239            req.extensions_mut()
5240                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
5241            self.inner.unary(req, path, codec).await
5242        }
5243        /** List groups in the organization with pagination.
5244 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5245*/
5246        pub async fn list_groups(
5247            &mut self,
5248            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
5249        ) -> std::result::Result<
5250            tonic::Response<super::ListGroupsResponse>,
5251            tonic::Status,
5252        > {
5253            self.inner
5254                .ready()
5255                .await
5256                .map_err(|e| {
5257                    tonic::Status::unknown(
5258                        format!("Service was not ready: {}", e.into()),
5259                    )
5260                })?;
5261            let codec = tonic_prost::ProstCodec::default();
5262            let path = http::uri::PathAndQuery::from_static(
5263                "/pidgr.v1.GroupService/ListGroups",
5264            );
5265            let mut req = request.into_request();
5266            req.extensions_mut()
5267                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
5268            self.inner.unary(req, path, codec).await
5269        }
5270        /** Update a group's name and/or description.
5271 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5272*/
5273        pub async fn update_group(
5274            &mut self,
5275            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
5276        ) -> std::result::Result<
5277            tonic::Response<super::UpdateGroupResponse>,
5278            tonic::Status,
5279        > {
5280            self.inner
5281                .ready()
5282                .await
5283                .map_err(|e| {
5284                    tonic::Status::unknown(
5285                        format!("Service was not ready: {}", e.into()),
5286                    )
5287                })?;
5288            let codec = tonic_prost::ProstCodec::default();
5289            let path = http::uri::PathAndQuery::from_static(
5290                "/pidgr.v1.GroupService/UpdateGroup",
5291            );
5292            let mut req = request.into_request();
5293            req.extensions_mut()
5294                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
5295            self.inner.unary(req, path, codec).await
5296        }
5297        /** Delete a group and all its membership records. Default groups cannot be deleted.
5298 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5299*/
5300        pub async fn delete_group(
5301            &mut self,
5302            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
5303        ) -> std::result::Result<
5304            tonic::Response<super::DeleteGroupResponse>,
5305            tonic::Status,
5306        > {
5307            self.inner
5308                .ready()
5309                .await
5310                .map_err(|e| {
5311                    tonic::Status::unknown(
5312                        format!("Service was not ready: {}", e.into()),
5313                    )
5314                })?;
5315            let codec = tonic_prost::ProstCodec::default();
5316            let path = http::uri::PathAndQuery::from_static(
5317                "/pidgr.v1.GroupService/DeleteGroup",
5318            );
5319            let mut req = request.into_request();
5320            req.extensions_mut()
5321                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
5322            self.inner.unary(req, path, codec).await
5323        }
5324        /** Add one or more users to a group (idempotent).
5325 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5326*/
5327        pub async fn add_group_members(
5328            &mut self,
5329            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
5330        ) -> std::result::Result<
5331            tonic::Response<super::AddGroupMembersResponse>,
5332            tonic::Status,
5333        > {
5334            self.inner
5335                .ready()
5336                .await
5337                .map_err(|e| {
5338                    tonic::Status::unknown(
5339                        format!("Service was not ready: {}", e.into()),
5340                    )
5341                })?;
5342            let codec = tonic_prost::ProstCodec::default();
5343            let path = http::uri::PathAndQuery::from_static(
5344                "/pidgr.v1.GroupService/AddGroupMembers",
5345            );
5346            let mut req = request.into_request();
5347            req.extensions_mut()
5348                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
5349            self.inner.unary(req, path, codec).await
5350        }
5351        /** Remove one or more users from a group (idempotent).
5352 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5353*/
5354        pub async fn remove_group_members(
5355            &mut self,
5356            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
5357        ) -> std::result::Result<
5358            tonic::Response<super::RemoveGroupMembersResponse>,
5359            tonic::Status,
5360        > {
5361            self.inner
5362                .ready()
5363                .await
5364                .map_err(|e| {
5365                    tonic::Status::unknown(
5366                        format!("Service was not ready: {}", e.into()),
5367                    )
5368                })?;
5369            let codec = tonic_prost::ProstCodec::default();
5370            let path = http::uri::PathAndQuery::from_static(
5371                "/pidgr.v1.GroupService/RemoveGroupMembers",
5372            );
5373            let mut req = request.into_request();
5374            req.extensions_mut()
5375                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
5376            self.inner.unary(req, path, codec).await
5377        }
5378        /** List members of a group with pagination.
5379 Authorization: Caller must be a member of the group, or have
5380 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5381*/
5382        pub async fn list_group_members(
5383            &mut self,
5384            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
5385        ) -> std::result::Result<
5386            tonic::Response<super::ListGroupMembersResponse>,
5387            tonic::Status,
5388        > {
5389            self.inner
5390                .ready()
5391                .await
5392                .map_err(|e| {
5393                    tonic::Status::unknown(
5394                        format!("Service was not ready: {}", e.into()),
5395                    )
5396                })?;
5397            let codec = tonic_prost::ProstCodec::default();
5398            let path = http::uri::PathAndQuery::from_static(
5399                "/pidgr.v1.GroupService/ListGroupMembers",
5400            );
5401            let mut req = request.into_request();
5402            req.extensions_mut()
5403                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
5404            self.inner.unary(req, path, codec).await
5405        }
5406        /** Get group memberships for a batch of users.
5407 Used by campaign audience to show group badges.
5408 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5409*/
5410        pub async fn get_user_group_memberships(
5411            &mut self,
5412            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
5413        ) -> std::result::Result<
5414            tonic::Response<super::GetUserGroupMembershipsResponse>,
5415            tonic::Status,
5416        > {
5417            self.inner
5418                .ready()
5419                .await
5420                .map_err(|e| {
5421                    tonic::Status::unknown(
5422                        format!("Service was not ready: {}", e.into()),
5423                    )
5424                })?;
5425            let codec = tonic_prost::ProstCodec::default();
5426            let path = http::uri::PathAndQuery::from_static(
5427                "/pidgr.v1.GroupService/GetUserGroupMemberships",
5428            );
5429            let mut req = request.into_request();
5430            req.extensions_mut()
5431                .insert(
5432                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5433                );
5434            self.inner.unary(req, path, codec).await
5435        }
5436    }
5437}
5438/// Generated server implementations.
5439pub mod group_service_server {
5440    #![allow(
5441        unused_variables,
5442        dead_code,
5443        missing_docs,
5444        clippy::wildcard_imports,
5445        clippy::let_unit_value,
5446    )]
5447    use tonic::codegen::*;
5448    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
5449    #[async_trait]
5450    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5451        /** Create a new group in the organization.
5452 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5453*/
5454        async fn create_group(
5455            &self,
5456            request: tonic::Request<super::CreateGroupRequest>,
5457        ) -> std::result::Result<
5458            tonic::Response<super::CreateGroupResponse>,
5459            tonic::Status,
5460        >;
5461        /** Retrieve a group by ID.
5462 Authorization: Caller must be a member of the group, or have
5463 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5464*/
5465        async fn get_group(
5466            &self,
5467            request: tonic::Request<super::GetGroupRequest>,
5468        ) -> std::result::Result<
5469            tonic::Response<super::GetGroupResponse>,
5470            tonic::Status,
5471        >;
5472        /** List groups in the organization with pagination.
5473 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5474*/
5475        async fn list_groups(
5476            &self,
5477            request: tonic::Request<super::ListGroupsRequest>,
5478        ) -> std::result::Result<
5479            tonic::Response<super::ListGroupsResponse>,
5480            tonic::Status,
5481        >;
5482        /** Update a group's name and/or description.
5483 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5484*/
5485        async fn update_group(
5486            &self,
5487            request: tonic::Request<super::UpdateGroupRequest>,
5488        ) -> std::result::Result<
5489            tonic::Response<super::UpdateGroupResponse>,
5490            tonic::Status,
5491        >;
5492        /** Delete a group and all its membership records. Default groups cannot be deleted.
5493 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5494*/
5495        async fn delete_group(
5496            &self,
5497            request: tonic::Request<super::DeleteGroupRequest>,
5498        ) -> std::result::Result<
5499            tonic::Response<super::DeleteGroupResponse>,
5500            tonic::Status,
5501        >;
5502        /** Add one or more users to a group (idempotent).
5503 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5504*/
5505        async fn add_group_members(
5506            &self,
5507            request: tonic::Request<super::AddGroupMembersRequest>,
5508        ) -> std::result::Result<
5509            tonic::Response<super::AddGroupMembersResponse>,
5510            tonic::Status,
5511        >;
5512        /** Remove one or more users from a group (idempotent).
5513 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5514*/
5515        async fn remove_group_members(
5516            &self,
5517            request: tonic::Request<super::RemoveGroupMembersRequest>,
5518        ) -> std::result::Result<
5519            tonic::Response<super::RemoveGroupMembersResponse>,
5520            tonic::Status,
5521        >;
5522        /** List members of a group with pagination.
5523 Authorization: Caller must be a member of the group, or have
5524 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5525*/
5526        async fn list_group_members(
5527            &self,
5528            request: tonic::Request<super::ListGroupMembersRequest>,
5529        ) -> std::result::Result<
5530            tonic::Response<super::ListGroupMembersResponse>,
5531            tonic::Status,
5532        >;
5533        /** Get group memberships for a batch of users.
5534 Used by campaign audience to show group badges.
5535 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5536*/
5537        async fn get_user_group_memberships(
5538            &self,
5539            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5540        ) -> std::result::Result<
5541            tonic::Response<super::GetUserGroupMembershipsResponse>,
5542            tonic::Status,
5543        >;
5544    }
5545    /** Manages groups and group membership within an organization.
5546 Groups are recipient collections used for campaign audience targeting.
5547 All RPCs operate within the caller's org (extracted from JWT).
5548*/
5549    #[derive(Debug)]
5550    pub struct GroupServiceServer<T> {
5551        inner: Arc<T>,
5552        accept_compression_encodings: EnabledCompressionEncodings,
5553        send_compression_encodings: EnabledCompressionEncodings,
5554        max_decoding_message_size: Option<usize>,
5555        max_encoding_message_size: Option<usize>,
5556    }
5557    impl<T> GroupServiceServer<T> {
5558        pub fn new(inner: T) -> Self {
5559            Self::from_arc(Arc::new(inner))
5560        }
5561        pub fn from_arc(inner: Arc<T>) -> Self {
5562            Self {
5563                inner,
5564                accept_compression_encodings: Default::default(),
5565                send_compression_encodings: Default::default(),
5566                max_decoding_message_size: None,
5567                max_encoding_message_size: None,
5568            }
5569        }
5570        pub fn with_interceptor<F>(
5571            inner: T,
5572            interceptor: F,
5573        ) -> InterceptedService<Self, F>
5574        where
5575            F: tonic::service::Interceptor,
5576        {
5577            InterceptedService::new(Self::new(inner), interceptor)
5578        }
5579        /// Enable decompressing requests with the given encoding.
5580        #[must_use]
5581        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5582            self.accept_compression_encodings.enable(encoding);
5583            self
5584        }
5585        /// Compress responses with the given encoding, if the client supports it.
5586        #[must_use]
5587        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5588            self.send_compression_encodings.enable(encoding);
5589            self
5590        }
5591        /// Limits the maximum size of a decoded message.
5592        ///
5593        /// Default: `4MB`
5594        #[must_use]
5595        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5596            self.max_decoding_message_size = Some(limit);
5597            self
5598        }
5599        /// Limits the maximum size of an encoded message.
5600        ///
5601        /// Default: `usize::MAX`
5602        #[must_use]
5603        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5604            self.max_encoding_message_size = Some(limit);
5605            self
5606        }
5607    }
5608    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5609    where
5610        T: GroupService,
5611        B: Body + std::marker::Send + 'static,
5612        B::Error: Into<StdError> + std::marker::Send + 'static,
5613    {
5614        type Response = http::Response<tonic::body::Body>;
5615        type Error = std::convert::Infallible;
5616        type Future = BoxFuture<Self::Response, Self::Error>;
5617        fn poll_ready(
5618            &mut self,
5619            _cx: &mut Context<'_>,
5620        ) -> Poll<std::result::Result<(), Self::Error>> {
5621            Poll::Ready(Ok(()))
5622        }
5623        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5624            match req.uri().path() {
5625                "/pidgr.v1.GroupService/CreateGroup" => {
5626                    #[allow(non_camel_case_types)]
5627                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5628                    impl<
5629                        T: GroupService,
5630                    > tonic::server::UnaryService<super::CreateGroupRequest>
5631                    for CreateGroupSvc<T> {
5632                        type Response = super::CreateGroupResponse;
5633                        type Future = BoxFuture<
5634                            tonic::Response<Self::Response>,
5635                            tonic::Status,
5636                        >;
5637                        fn call(
5638                            &mut self,
5639                            request: tonic::Request<super::CreateGroupRequest>,
5640                        ) -> Self::Future {
5641                            let inner = Arc::clone(&self.0);
5642                            let fut = async move {
5643                                <T as GroupService>::create_group(&inner, request).await
5644                            };
5645                            Box::pin(fut)
5646                        }
5647                    }
5648                    let accept_compression_encodings = self.accept_compression_encodings;
5649                    let send_compression_encodings = self.send_compression_encodings;
5650                    let max_decoding_message_size = self.max_decoding_message_size;
5651                    let max_encoding_message_size = self.max_encoding_message_size;
5652                    let inner = self.inner.clone();
5653                    let fut = async move {
5654                        let method = CreateGroupSvc(inner);
5655                        let codec = tonic_prost::ProstCodec::default();
5656                        let mut grpc = tonic::server::Grpc::new(codec)
5657                            .apply_compression_config(
5658                                accept_compression_encodings,
5659                                send_compression_encodings,
5660                            )
5661                            .apply_max_message_size_config(
5662                                max_decoding_message_size,
5663                                max_encoding_message_size,
5664                            );
5665                        let res = grpc.unary(method, req).await;
5666                        Ok(res)
5667                    };
5668                    Box::pin(fut)
5669                }
5670                "/pidgr.v1.GroupService/GetGroup" => {
5671                    #[allow(non_camel_case_types)]
5672                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5673                    impl<
5674                        T: GroupService,
5675                    > tonic::server::UnaryService<super::GetGroupRequest>
5676                    for GetGroupSvc<T> {
5677                        type Response = super::GetGroupResponse;
5678                        type Future = BoxFuture<
5679                            tonic::Response<Self::Response>,
5680                            tonic::Status,
5681                        >;
5682                        fn call(
5683                            &mut self,
5684                            request: tonic::Request<super::GetGroupRequest>,
5685                        ) -> Self::Future {
5686                            let inner = Arc::clone(&self.0);
5687                            let fut = async move {
5688                                <T as GroupService>::get_group(&inner, request).await
5689                            };
5690                            Box::pin(fut)
5691                        }
5692                    }
5693                    let accept_compression_encodings = self.accept_compression_encodings;
5694                    let send_compression_encodings = self.send_compression_encodings;
5695                    let max_decoding_message_size = self.max_decoding_message_size;
5696                    let max_encoding_message_size = self.max_encoding_message_size;
5697                    let inner = self.inner.clone();
5698                    let fut = async move {
5699                        let method = GetGroupSvc(inner);
5700                        let codec = tonic_prost::ProstCodec::default();
5701                        let mut grpc = tonic::server::Grpc::new(codec)
5702                            .apply_compression_config(
5703                                accept_compression_encodings,
5704                                send_compression_encodings,
5705                            )
5706                            .apply_max_message_size_config(
5707                                max_decoding_message_size,
5708                                max_encoding_message_size,
5709                            );
5710                        let res = grpc.unary(method, req).await;
5711                        Ok(res)
5712                    };
5713                    Box::pin(fut)
5714                }
5715                "/pidgr.v1.GroupService/ListGroups" => {
5716                    #[allow(non_camel_case_types)]
5717                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5718                    impl<
5719                        T: GroupService,
5720                    > tonic::server::UnaryService<super::ListGroupsRequest>
5721                    for ListGroupsSvc<T> {
5722                        type Response = super::ListGroupsResponse;
5723                        type Future = BoxFuture<
5724                            tonic::Response<Self::Response>,
5725                            tonic::Status,
5726                        >;
5727                        fn call(
5728                            &mut self,
5729                            request: tonic::Request<super::ListGroupsRequest>,
5730                        ) -> Self::Future {
5731                            let inner = Arc::clone(&self.0);
5732                            let fut = async move {
5733                                <T as GroupService>::list_groups(&inner, request).await
5734                            };
5735                            Box::pin(fut)
5736                        }
5737                    }
5738                    let accept_compression_encodings = self.accept_compression_encodings;
5739                    let send_compression_encodings = self.send_compression_encodings;
5740                    let max_decoding_message_size = self.max_decoding_message_size;
5741                    let max_encoding_message_size = self.max_encoding_message_size;
5742                    let inner = self.inner.clone();
5743                    let fut = async move {
5744                        let method = ListGroupsSvc(inner);
5745                        let codec = tonic_prost::ProstCodec::default();
5746                        let mut grpc = tonic::server::Grpc::new(codec)
5747                            .apply_compression_config(
5748                                accept_compression_encodings,
5749                                send_compression_encodings,
5750                            )
5751                            .apply_max_message_size_config(
5752                                max_decoding_message_size,
5753                                max_encoding_message_size,
5754                            );
5755                        let res = grpc.unary(method, req).await;
5756                        Ok(res)
5757                    };
5758                    Box::pin(fut)
5759                }
5760                "/pidgr.v1.GroupService/UpdateGroup" => {
5761                    #[allow(non_camel_case_types)]
5762                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5763                    impl<
5764                        T: GroupService,
5765                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5766                    for UpdateGroupSvc<T> {
5767                        type Response = super::UpdateGroupResponse;
5768                        type Future = BoxFuture<
5769                            tonic::Response<Self::Response>,
5770                            tonic::Status,
5771                        >;
5772                        fn call(
5773                            &mut self,
5774                            request: tonic::Request<super::UpdateGroupRequest>,
5775                        ) -> Self::Future {
5776                            let inner = Arc::clone(&self.0);
5777                            let fut = async move {
5778                                <T as GroupService>::update_group(&inner, request).await
5779                            };
5780                            Box::pin(fut)
5781                        }
5782                    }
5783                    let accept_compression_encodings = self.accept_compression_encodings;
5784                    let send_compression_encodings = self.send_compression_encodings;
5785                    let max_decoding_message_size = self.max_decoding_message_size;
5786                    let max_encoding_message_size = self.max_encoding_message_size;
5787                    let inner = self.inner.clone();
5788                    let fut = async move {
5789                        let method = UpdateGroupSvc(inner);
5790                        let codec = tonic_prost::ProstCodec::default();
5791                        let mut grpc = tonic::server::Grpc::new(codec)
5792                            .apply_compression_config(
5793                                accept_compression_encodings,
5794                                send_compression_encodings,
5795                            )
5796                            .apply_max_message_size_config(
5797                                max_decoding_message_size,
5798                                max_encoding_message_size,
5799                            );
5800                        let res = grpc.unary(method, req).await;
5801                        Ok(res)
5802                    };
5803                    Box::pin(fut)
5804                }
5805                "/pidgr.v1.GroupService/DeleteGroup" => {
5806                    #[allow(non_camel_case_types)]
5807                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5808                    impl<
5809                        T: GroupService,
5810                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5811                    for DeleteGroupSvc<T> {
5812                        type Response = super::DeleteGroupResponse;
5813                        type Future = BoxFuture<
5814                            tonic::Response<Self::Response>,
5815                            tonic::Status,
5816                        >;
5817                        fn call(
5818                            &mut self,
5819                            request: tonic::Request<super::DeleteGroupRequest>,
5820                        ) -> Self::Future {
5821                            let inner = Arc::clone(&self.0);
5822                            let fut = async move {
5823                                <T as GroupService>::delete_group(&inner, request).await
5824                            };
5825                            Box::pin(fut)
5826                        }
5827                    }
5828                    let accept_compression_encodings = self.accept_compression_encodings;
5829                    let send_compression_encodings = self.send_compression_encodings;
5830                    let max_decoding_message_size = self.max_decoding_message_size;
5831                    let max_encoding_message_size = self.max_encoding_message_size;
5832                    let inner = self.inner.clone();
5833                    let fut = async move {
5834                        let method = DeleteGroupSvc(inner);
5835                        let codec = tonic_prost::ProstCodec::default();
5836                        let mut grpc = tonic::server::Grpc::new(codec)
5837                            .apply_compression_config(
5838                                accept_compression_encodings,
5839                                send_compression_encodings,
5840                            )
5841                            .apply_max_message_size_config(
5842                                max_decoding_message_size,
5843                                max_encoding_message_size,
5844                            );
5845                        let res = grpc.unary(method, req).await;
5846                        Ok(res)
5847                    };
5848                    Box::pin(fut)
5849                }
5850                "/pidgr.v1.GroupService/AddGroupMembers" => {
5851                    #[allow(non_camel_case_types)]
5852                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5853                    impl<
5854                        T: GroupService,
5855                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5856                    for AddGroupMembersSvc<T> {
5857                        type Response = super::AddGroupMembersResponse;
5858                        type Future = BoxFuture<
5859                            tonic::Response<Self::Response>,
5860                            tonic::Status,
5861                        >;
5862                        fn call(
5863                            &mut self,
5864                            request: tonic::Request<super::AddGroupMembersRequest>,
5865                        ) -> Self::Future {
5866                            let inner = Arc::clone(&self.0);
5867                            let fut = async move {
5868                                <T as GroupService>::add_group_members(&inner, request)
5869                                    .await
5870                            };
5871                            Box::pin(fut)
5872                        }
5873                    }
5874                    let accept_compression_encodings = self.accept_compression_encodings;
5875                    let send_compression_encodings = self.send_compression_encodings;
5876                    let max_decoding_message_size = self.max_decoding_message_size;
5877                    let max_encoding_message_size = self.max_encoding_message_size;
5878                    let inner = self.inner.clone();
5879                    let fut = async move {
5880                        let method = AddGroupMembersSvc(inner);
5881                        let codec = tonic_prost::ProstCodec::default();
5882                        let mut grpc = tonic::server::Grpc::new(codec)
5883                            .apply_compression_config(
5884                                accept_compression_encodings,
5885                                send_compression_encodings,
5886                            )
5887                            .apply_max_message_size_config(
5888                                max_decoding_message_size,
5889                                max_encoding_message_size,
5890                            );
5891                        let res = grpc.unary(method, req).await;
5892                        Ok(res)
5893                    };
5894                    Box::pin(fut)
5895                }
5896                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5897                    #[allow(non_camel_case_types)]
5898                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5899                    impl<
5900                        T: GroupService,
5901                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5902                    for RemoveGroupMembersSvc<T> {
5903                        type Response = super::RemoveGroupMembersResponse;
5904                        type Future = BoxFuture<
5905                            tonic::Response<Self::Response>,
5906                            tonic::Status,
5907                        >;
5908                        fn call(
5909                            &mut self,
5910                            request: tonic::Request<super::RemoveGroupMembersRequest>,
5911                        ) -> Self::Future {
5912                            let inner = Arc::clone(&self.0);
5913                            let fut = async move {
5914                                <T as GroupService>::remove_group_members(&inner, request)
5915                                    .await
5916                            };
5917                            Box::pin(fut)
5918                        }
5919                    }
5920                    let accept_compression_encodings = self.accept_compression_encodings;
5921                    let send_compression_encodings = self.send_compression_encodings;
5922                    let max_decoding_message_size = self.max_decoding_message_size;
5923                    let max_encoding_message_size = self.max_encoding_message_size;
5924                    let inner = self.inner.clone();
5925                    let fut = async move {
5926                        let method = RemoveGroupMembersSvc(inner);
5927                        let codec = tonic_prost::ProstCodec::default();
5928                        let mut grpc = tonic::server::Grpc::new(codec)
5929                            .apply_compression_config(
5930                                accept_compression_encodings,
5931                                send_compression_encodings,
5932                            )
5933                            .apply_max_message_size_config(
5934                                max_decoding_message_size,
5935                                max_encoding_message_size,
5936                            );
5937                        let res = grpc.unary(method, req).await;
5938                        Ok(res)
5939                    };
5940                    Box::pin(fut)
5941                }
5942                "/pidgr.v1.GroupService/ListGroupMembers" => {
5943                    #[allow(non_camel_case_types)]
5944                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5945                    impl<
5946                        T: GroupService,
5947                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5948                    for ListGroupMembersSvc<T> {
5949                        type Response = super::ListGroupMembersResponse;
5950                        type Future = BoxFuture<
5951                            tonic::Response<Self::Response>,
5952                            tonic::Status,
5953                        >;
5954                        fn call(
5955                            &mut self,
5956                            request: tonic::Request<super::ListGroupMembersRequest>,
5957                        ) -> Self::Future {
5958                            let inner = Arc::clone(&self.0);
5959                            let fut = async move {
5960                                <T as GroupService>::list_group_members(&inner, request)
5961                                    .await
5962                            };
5963                            Box::pin(fut)
5964                        }
5965                    }
5966                    let accept_compression_encodings = self.accept_compression_encodings;
5967                    let send_compression_encodings = self.send_compression_encodings;
5968                    let max_decoding_message_size = self.max_decoding_message_size;
5969                    let max_encoding_message_size = self.max_encoding_message_size;
5970                    let inner = self.inner.clone();
5971                    let fut = async move {
5972                        let method = ListGroupMembersSvc(inner);
5973                        let codec = tonic_prost::ProstCodec::default();
5974                        let mut grpc = tonic::server::Grpc::new(codec)
5975                            .apply_compression_config(
5976                                accept_compression_encodings,
5977                                send_compression_encodings,
5978                            )
5979                            .apply_max_message_size_config(
5980                                max_decoding_message_size,
5981                                max_encoding_message_size,
5982                            );
5983                        let res = grpc.unary(method, req).await;
5984                        Ok(res)
5985                    };
5986                    Box::pin(fut)
5987                }
5988                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5989                    #[allow(non_camel_case_types)]
5990                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5991                    impl<
5992                        T: GroupService,
5993                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5994                    for GetUserGroupMembershipsSvc<T> {
5995                        type Response = super::GetUserGroupMembershipsResponse;
5996                        type Future = BoxFuture<
5997                            tonic::Response<Self::Response>,
5998                            tonic::Status,
5999                        >;
6000                        fn call(
6001                            &mut self,
6002                            request: tonic::Request<
6003                                super::GetUserGroupMembershipsRequest,
6004                            >,
6005                        ) -> Self::Future {
6006                            let inner = Arc::clone(&self.0);
6007                            let fut = async move {
6008                                <T as GroupService>::get_user_group_memberships(
6009                                        &inner,
6010                                        request,
6011                                    )
6012                                    .await
6013                            };
6014                            Box::pin(fut)
6015                        }
6016                    }
6017                    let accept_compression_encodings = self.accept_compression_encodings;
6018                    let send_compression_encodings = self.send_compression_encodings;
6019                    let max_decoding_message_size = self.max_decoding_message_size;
6020                    let max_encoding_message_size = self.max_encoding_message_size;
6021                    let inner = self.inner.clone();
6022                    let fut = async move {
6023                        let method = GetUserGroupMembershipsSvc(inner);
6024                        let codec = tonic_prost::ProstCodec::default();
6025                        let mut grpc = tonic::server::Grpc::new(codec)
6026                            .apply_compression_config(
6027                                accept_compression_encodings,
6028                                send_compression_encodings,
6029                            )
6030                            .apply_max_message_size_config(
6031                                max_decoding_message_size,
6032                                max_encoding_message_size,
6033                            );
6034                        let res = grpc.unary(method, req).await;
6035                        Ok(res)
6036                    };
6037                    Box::pin(fut)
6038                }
6039                _ => {
6040                    Box::pin(async move {
6041                        let mut response = http::Response::new(
6042                            tonic::body::Body::default(),
6043                        );
6044                        let headers = response.headers_mut();
6045                        headers
6046                            .insert(
6047                                tonic::Status::GRPC_STATUS,
6048                                (tonic::Code::Unimplemented as i32).into(),
6049                            );
6050                        headers
6051                            .insert(
6052                                http::header::CONTENT_TYPE,
6053                                tonic::metadata::GRPC_CONTENT_TYPE,
6054                            );
6055                        Ok(response)
6056                    })
6057                }
6058            }
6059        }
6060    }
6061    impl<T> Clone for GroupServiceServer<T> {
6062        fn clone(&self) -> Self {
6063            let inner = self.inner.clone();
6064            Self {
6065                inner,
6066                accept_compression_encodings: self.accept_compression_encodings,
6067                send_compression_encodings: self.send_compression_encodings,
6068                max_decoding_message_size: self.max_decoding_message_size,
6069                max_encoding_message_size: self.max_encoding_message_size,
6070            }
6071        }
6072    }
6073    /// Generated gRPC service name
6074    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
6075    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
6076        const NAME: &'static str = SERVICE_NAME;
6077    }
6078}
6079/// Generated client implementations.
6080pub mod heatmap_service_client {
6081    #![allow(
6082        unused_variables,
6083        dead_code,
6084        missing_docs,
6085        clippy::wildcard_imports,
6086        clippy::let_unit_value,
6087    )]
6088    use tonic::codegen::*;
6089    use tonic::codegen::http::Uri;
6090    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6091 for mobile app interaction analytics.
6092*/
6093    #[derive(Debug, Clone)]
6094    pub struct HeatmapServiceClient<T> {
6095        inner: tonic::client::Grpc<T>,
6096    }
6097    impl HeatmapServiceClient<tonic::transport::Channel> {
6098        /// Attempt to create a new client by connecting to a given endpoint.
6099        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6100        where
6101            D: TryInto<tonic::transport::Endpoint>,
6102            D::Error: Into<StdError>,
6103        {
6104            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6105            Ok(Self::new(conn))
6106        }
6107    }
6108    impl<T> HeatmapServiceClient<T>
6109    where
6110        T: tonic::client::GrpcService<tonic::body::Body>,
6111        T::Error: Into<StdError>,
6112        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6113        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6114    {
6115        pub fn new(inner: T) -> Self {
6116            let inner = tonic::client::Grpc::new(inner);
6117            Self { inner }
6118        }
6119        pub fn with_origin(inner: T, origin: Uri) -> Self {
6120            let inner = tonic::client::Grpc::with_origin(inner, origin);
6121            Self { inner }
6122        }
6123        pub fn with_interceptor<F>(
6124            inner: T,
6125            interceptor: F,
6126        ) -> HeatmapServiceClient<InterceptedService<T, F>>
6127        where
6128            F: tonic::service::Interceptor,
6129            T::ResponseBody: Default,
6130            T: tonic::codegen::Service<
6131                http::Request<tonic::body::Body>,
6132                Response = http::Response<
6133                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6134                >,
6135            >,
6136            <T as tonic::codegen::Service<
6137                http::Request<tonic::body::Body>,
6138            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6139        {
6140            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
6141        }
6142        /// Compress requests with the given encoding.
6143        ///
6144        /// This requires the server to support it otherwise it might respond with an
6145        /// error.
6146        #[must_use]
6147        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6148            self.inner = self.inner.send_compressed(encoding);
6149            self
6150        }
6151        /// Enable decompressing responses.
6152        #[must_use]
6153        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6154            self.inner = self.inner.accept_compressed(encoding);
6155            self
6156        }
6157        /// Limits the maximum size of a decoded message.
6158        ///
6159        /// Default: `4MB`
6160        #[must_use]
6161        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6162            self.inner = self.inner.max_decoding_message_size(limit);
6163            self
6164        }
6165        /// Limits the maximum size of an encoded message.
6166        ///
6167        /// Default: `usize::MAX`
6168        #[must_use]
6169        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6170            self.inner = self.inner.max_encoding_message_size(limit);
6171            self
6172        }
6173        /** Ingest a batch of touch events from the mobile app.
6174 Authorization: Authenticated mobile user.
6175*/
6176        pub async fn ingest_touch_events(
6177            &mut self,
6178            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
6179        ) -> std::result::Result<
6180            tonic::Response<super::IngestTouchEventsResponse>,
6181            tonic::Status,
6182        > {
6183            self.inner
6184                .ready()
6185                .await
6186                .map_err(|e| {
6187                    tonic::Status::unknown(
6188                        format!("Service was not ready: {}", e.into()),
6189                    )
6190                })?;
6191            let codec = tonic_prost::ProstCodec::default();
6192            let path = http::uri::PathAndQuery::from_static(
6193                "/pidgr.v1.HeatmapService/IngestTouchEvents",
6194            );
6195            let mut req = request.into_request();
6196            req.extensions_mut()
6197                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
6198            self.inner.unary(req, path, codec).await
6199        }
6200        /** Query aggregated touch data for heatmap rendering.
6201 Authorization: Requires CAMPAIGNS_READ permission.
6202*/
6203        pub async fn query_heatmap_data(
6204            &mut self,
6205            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
6206        ) -> std::result::Result<
6207            tonic::Response<super::QueryHeatmapDataResponse>,
6208            tonic::Status,
6209        > {
6210            self.inner
6211                .ready()
6212                .await
6213                .map_err(|e| {
6214                    tonic::Status::unknown(
6215                        format!("Service was not ready: {}", e.into()),
6216                    )
6217                })?;
6218            let codec = tonic_prost::ProstCodec::default();
6219            let path = http::uri::PathAndQuery::from_static(
6220                "/pidgr.v1.HeatmapService/QueryHeatmapData",
6221            );
6222            let mut req = request.into_request();
6223            req.extensions_mut()
6224                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
6225            self.inner.unary(req, path, codec).await
6226        }
6227        /** List available screen screenshots for heatmap backgrounds.
6228 Authorization: Requires CAMPAIGNS_READ permission.
6229*/
6230        pub async fn list_screenshots(
6231            &mut self,
6232            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
6233        ) -> std::result::Result<
6234            tonic::Response<super::ListScreenshotsResponse>,
6235            tonic::Status,
6236        > {
6237            self.inner
6238                .ready()
6239                .await
6240                .map_err(|e| {
6241                    tonic::Status::unknown(
6242                        format!("Service was not ready: {}", e.into()),
6243                    )
6244                })?;
6245            let codec = tonic_prost::ProstCodec::default();
6246            let path = http::uri::PathAndQuery::from_static(
6247                "/pidgr.v1.HeatmapService/ListScreenshots",
6248            );
6249            let mut req = request.into_request();
6250            req.extensions_mut()
6251                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
6252            self.inner.unary(req, path, codec).await
6253        }
6254        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6255 Authorization: Authenticated mobile user.
6256*/
6257        pub async fn upload_screenshot(
6258            &mut self,
6259            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
6260        ) -> std::result::Result<
6261            tonic::Response<super::UploadScreenshotResponse>,
6262            tonic::Status,
6263        > {
6264            self.inner
6265                .ready()
6266                .await
6267                .map_err(|e| {
6268                    tonic::Status::unknown(
6269                        format!("Service was not ready: {}", e.into()),
6270                    )
6271                })?;
6272            let codec = tonic_prost::ProstCodec::default();
6273            let path = http::uri::PathAndQuery::from_static(
6274                "/pidgr.v1.HeatmapService/UploadScreenshot",
6275            );
6276            let mut req = request.into_request();
6277            req.extensions_mut()
6278                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
6279            self.inner.unary(req, path, codec).await
6280        }
6281    }
6282}
6283/// Generated server implementations.
6284pub mod heatmap_service_server {
6285    #![allow(
6286        unused_variables,
6287        dead_code,
6288        missing_docs,
6289        clippy::wildcard_imports,
6290        clippy::let_unit_value,
6291    )]
6292    use tonic::codegen::*;
6293    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
6294    #[async_trait]
6295    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
6296        /** Ingest a batch of touch events from the mobile app.
6297 Authorization: Authenticated mobile user.
6298*/
6299        async fn ingest_touch_events(
6300            &self,
6301            request: tonic::Request<super::IngestTouchEventsRequest>,
6302        ) -> std::result::Result<
6303            tonic::Response<super::IngestTouchEventsResponse>,
6304            tonic::Status,
6305        >;
6306        /** Query aggregated touch data for heatmap rendering.
6307 Authorization: Requires CAMPAIGNS_READ permission.
6308*/
6309        async fn query_heatmap_data(
6310            &self,
6311            request: tonic::Request<super::QueryHeatmapDataRequest>,
6312        ) -> std::result::Result<
6313            tonic::Response<super::QueryHeatmapDataResponse>,
6314            tonic::Status,
6315        >;
6316        /** List available screen screenshots for heatmap backgrounds.
6317 Authorization: Requires CAMPAIGNS_READ permission.
6318*/
6319        async fn list_screenshots(
6320            &self,
6321            request: tonic::Request<super::ListScreenshotsRequest>,
6322        ) -> std::result::Result<
6323            tonic::Response<super::ListScreenshotsResponse>,
6324            tonic::Status,
6325        >;
6326        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6327 Authorization: Authenticated mobile user.
6328*/
6329        async fn upload_screenshot(
6330            &self,
6331            request: tonic::Request<super::UploadScreenshotRequest>,
6332        ) -> std::result::Result<
6333            tonic::Response<super::UploadScreenshotResponse>,
6334            tonic::Status,
6335        >;
6336    }
6337    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6338 for mobile app interaction analytics.
6339*/
6340    #[derive(Debug)]
6341    pub struct HeatmapServiceServer<T> {
6342        inner: Arc<T>,
6343        accept_compression_encodings: EnabledCompressionEncodings,
6344        send_compression_encodings: EnabledCompressionEncodings,
6345        max_decoding_message_size: Option<usize>,
6346        max_encoding_message_size: Option<usize>,
6347    }
6348    impl<T> HeatmapServiceServer<T> {
6349        pub fn new(inner: T) -> Self {
6350            Self::from_arc(Arc::new(inner))
6351        }
6352        pub fn from_arc(inner: Arc<T>) -> Self {
6353            Self {
6354                inner,
6355                accept_compression_encodings: Default::default(),
6356                send_compression_encodings: Default::default(),
6357                max_decoding_message_size: None,
6358                max_encoding_message_size: None,
6359            }
6360        }
6361        pub fn with_interceptor<F>(
6362            inner: T,
6363            interceptor: F,
6364        ) -> InterceptedService<Self, F>
6365        where
6366            F: tonic::service::Interceptor,
6367        {
6368            InterceptedService::new(Self::new(inner), interceptor)
6369        }
6370        /// Enable decompressing requests with the given encoding.
6371        #[must_use]
6372        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6373            self.accept_compression_encodings.enable(encoding);
6374            self
6375        }
6376        /// Compress responses with the given encoding, if the client supports it.
6377        #[must_use]
6378        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6379            self.send_compression_encodings.enable(encoding);
6380            self
6381        }
6382        /// Limits the maximum size of a decoded message.
6383        ///
6384        /// Default: `4MB`
6385        #[must_use]
6386        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6387            self.max_decoding_message_size = Some(limit);
6388            self
6389        }
6390        /// Limits the maximum size of an encoded message.
6391        ///
6392        /// Default: `usize::MAX`
6393        #[must_use]
6394        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6395            self.max_encoding_message_size = Some(limit);
6396            self
6397        }
6398    }
6399    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
6400    where
6401        T: HeatmapService,
6402        B: Body + std::marker::Send + 'static,
6403        B::Error: Into<StdError> + std::marker::Send + 'static,
6404    {
6405        type Response = http::Response<tonic::body::Body>;
6406        type Error = std::convert::Infallible;
6407        type Future = BoxFuture<Self::Response, Self::Error>;
6408        fn poll_ready(
6409            &mut self,
6410            _cx: &mut Context<'_>,
6411        ) -> Poll<std::result::Result<(), Self::Error>> {
6412            Poll::Ready(Ok(()))
6413        }
6414        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6415            match req.uri().path() {
6416                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
6417                    #[allow(non_camel_case_types)]
6418                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6419                    impl<
6420                        T: HeatmapService,
6421                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6422                    for IngestTouchEventsSvc<T> {
6423                        type Response = super::IngestTouchEventsResponse;
6424                        type Future = BoxFuture<
6425                            tonic::Response<Self::Response>,
6426                            tonic::Status,
6427                        >;
6428                        fn call(
6429                            &mut self,
6430                            request: tonic::Request<super::IngestTouchEventsRequest>,
6431                        ) -> Self::Future {
6432                            let inner = Arc::clone(&self.0);
6433                            let fut = async move {
6434                                <T as HeatmapService>::ingest_touch_events(&inner, request)
6435                                    .await
6436                            };
6437                            Box::pin(fut)
6438                        }
6439                    }
6440                    let accept_compression_encodings = self.accept_compression_encodings;
6441                    let send_compression_encodings = self.send_compression_encodings;
6442                    let max_decoding_message_size = self.max_decoding_message_size;
6443                    let max_encoding_message_size = self.max_encoding_message_size;
6444                    let inner = self.inner.clone();
6445                    let fut = async move {
6446                        let method = IngestTouchEventsSvc(inner);
6447                        let codec = tonic_prost::ProstCodec::default();
6448                        let mut grpc = tonic::server::Grpc::new(codec)
6449                            .apply_compression_config(
6450                                accept_compression_encodings,
6451                                send_compression_encodings,
6452                            )
6453                            .apply_max_message_size_config(
6454                                max_decoding_message_size,
6455                                max_encoding_message_size,
6456                            );
6457                        let res = grpc.unary(method, req).await;
6458                        Ok(res)
6459                    };
6460                    Box::pin(fut)
6461                }
6462                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6463                    #[allow(non_camel_case_types)]
6464                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6465                    impl<
6466                        T: HeatmapService,
6467                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6468                    for QueryHeatmapDataSvc<T> {
6469                        type Response = super::QueryHeatmapDataResponse;
6470                        type Future = BoxFuture<
6471                            tonic::Response<Self::Response>,
6472                            tonic::Status,
6473                        >;
6474                        fn call(
6475                            &mut self,
6476                            request: tonic::Request<super::QueryHeatmapDataRequest>,
6477                        ) -> Self::Future {
6478                            let inner = Arc::clone(&self.0);
6479                            let fut = async move {
6480                                <T as HeatmapService>::query_heatmap_data(&inner, request)
6481                                    .await
6482                            };
6483                            Box::pin(fut)
6484                        }
6485                    }
6486                    let accept_compression_encodings = self.accept_compression_encodings;
6487                    let send_compression_encodings = self.send_compression_encodings;
6488                    let max_decoding_message_size = self.max_decoding_message_size;
6489                    let max_encoding_message_size = self.max_encoding_message_size;
6490                    let inner = self.inner.clone();
6491                    let fut = async move {
6492                        let method = QueryHeatmapDataSvc(inner);
6493                        let codec = tonic_prost::ProstCodec::default();
6494                        let mut grpc = tonic::server::Grpc::new(codec)
6495                            .apply_compression_config(
6496                                accept_compression_encodings,
6497                                send_compression_encodings,
6498                            )
6499                            .apply_max_message_size_config(
6500                                max_decoding_message_size,
6501                                max_encoding_message_size,
6502                            );
6503                        let res = grpc.unary(method, req).await;
6504                        Ok(res)
6505                    };
6506                    Box::pin(fut)
6507                }
6508                "/pidgr.v1.HeatmapService/ListScreenshots" => {
6509                    #[allow(non_camel_case_types)]
6510                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6511                    impl<
6512                        T: HeatmapService,
6513                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
6514                    for ListScreenshotsSvc<T> {
6515                        type Response = super::ListScreenshotsResponse;
6516                        type Future = BoxFuture<
6517                            tonic::Response<Self::Response>,
6518                            tonic::Status,
6519                        >;
6520                        fn call(
6521                            &mut self,
6522                            request: tonic::Request<super::ListScreenshotsRequest>,
6523                        ) -> Self::Future {
6524                            let inner = Arc::clone(&self.0);
6525                            let fut = async move {
6526                                <T as HeatmapService>::list_screenshots(&inner, request)
6527                                    .await
6528                            };
6529                            Box::pin(fut)
6530                        }
6531                    }
6532                    let accept_compression_encodings = self.accept_compression_encodings;
6533                    let send_compression_encodings = self.send_compression_encodings;
6534                    let max_decoding_message_size = self.max_decoding_message_size;
6535                    let max_encoding_message_size = self.max_encoding_message_size;
6536                    let inner = self.inner.clone();
6537                    let fut = async move {
6538                        let method = ListScreenshotsSvc(inner);
6539                        let codec = tonic_prost::ProstCodec::default();
6540                        let mut grpc = tonic::server::Grpc::new(codec)
6541                            .apply_compression_config(
6542                                accept_compression_encodings,
6543                                send_compression_encodings,
6544                            )
6545                            .apply_max_message_size_config(
6546                                max_decoding_message_size,
6547                                max_encoding_message_size,
6548                            );
6549                        let res = grpc.unary(method, req).await;
6550                        Ok(res)
6551                    };
6552                    Box::pin(fut)
6553                }
6554                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6555                    #[allow(non_camel_case_types)]
6556                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6557                    impl<
6558                        T: HeatmapService,
6559                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
6560                    for UploadScreenshotSvc<T> {
6561                        type Response = super::UploadScreenshotResponse;
6562                        type Future = BoxFuture<
6563                            tonic::Response<Self::Response>,
6564                            tonic::Status,
6565                        >;
6566                        fn call(
6567                            &mut self,
6568                            request: tonic::Request<super::UploadScreenshotRequest>,
6569                        ) -> Self::Future {
6570                            let inner = Arc::clone(&self.0);
6571                            let fut = async move {
6572                                <T as HeatmapService>::upload_screenshot(&inner, request)
6573                                    .await
6574                            };
6575                            Box::pin(fut)
6576                        }
6577                    }
6578                    let accept_compression_encodings = self.accept_compression_encodings;
6579                    let send_compression_encodings = self.send_compression_encodings;
6580                    let max_decoding_message_size = self.max_decoding_message_size;
6581                    let max_encoding_message_size = self.max_encoding_message_size;
6582                    let inner = self.inner.clone();
6583                    let fut = async move {
6584                        let method = UploadScreenshotSvc(inner);
6585                        let codec = tonic_prost::ProstCodec::default();
6586                        let mut grpc = tonic::server::Grpc::new(codec)
6587                            .apply_compression_config(
6588                                accept_compression_encodings,
6589                                send_compression_encodings,
6590                            )
6591                            .apply_max_message_size_config(
6592                                max_decoding_message_size,
6593                                max_encoding_message_size,
6594                            );
6595                        let res = grpc.unary(method, req).await;
6596                        Ok(res)
6597                    };
6598                    Box::pin(fut)
6599                }
6600                _ => {
6601                    Box::pin(async move {
6602                        let mut response = http::Response::new(
6603                            tonic::body::Body::default(),
6604                        );
6605                        let headers = response.headers_mut();
6606                        headers
6607                            .insert(
6608                                tonic::Status::GRPC_STATUS,
6609                                (tonic::Code::Unimplemented as i32).into(),
6610                            );
6611                        headers
6612                            .insert(
6613                                http::header::CONTENT_TYPE,
6614                                tonic::metadata::GRPC_CONTENT_TYPE,
6615                            );
6616                        Ok(response)
6617                    })
6618                }
6619            }
6620        }
6621    }
6622    impl<T> Clone for HeatmapServiceServer<T> {
6623        fn clone(&self) -> Self {
6624            let inner = self.inner.clone();
6625            Self {
6626                inner,
6627                accept_compression_encodings: self.accept_compression_encodings,
6628                send_compression_encodings: self.send_compression_encodings,
6629                max_decoding_message_size: self.max_decoding_message_size,
6630                max_encoding_message_size: self.max_encoding_message_size,
6631            }
6632        }
6633    }
6634    /// Generated gRPC service name
6635    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6636    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6637        const NAME: &'static str = SERVICE_NAME;
6638    }
6639}
6640/// Generated client implementations.
6641pub mod inbox_service_client {
6642    #![allow(
6643        unused_variables,
6644        dead_code,
6645        missing_docs,
6646        clippy::wildcard_imports,
6647        clippy::let_unit_value,
6648    )]
6649    use tonic::codegen::*;
6650    use tonic::codegen::http::Uri;
6651    /** Provides the mobile app's inbox experience — syncing messages,
6652 tracking read status, and retrieving individual entries.
6653*/
6654    #[derive(Debug, Clone)]
6655    pub struct InboxServiceClient<T> {
6656        inner: tonic::client::Grpc<T>,
6657    }
6658    impl InboxServiceClient<tonic::transport::Channel> {
6659        /// Attempt to create a new client by connecting to a given endpoint.
6660        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6661        where
6662            D: TryInto<tonic::transport::Endpoint>,
6663            D::Error: Into<StdError>,
6664        {
6665            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6666            Ok(Self::new(conn))
6667        }
6668    }
6669    impl<T> InboxServiceClient<T>
6670    where
6671        T: tonic::client::GrpcService<tonic::body::Body>,
6672        T::Error: Into<StdError>,
6673        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6674        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6675    {
6676        pub fn new(inner: T) -> Self {
6677            let inner = tonic::client::Grpc::new(inner);
6678            Self { inner }
6679        }
6680        pub fn with_origin(inner: T, origin: Uri) -> Self {
6681            let inner = tonic::client::Grpc::with_origin(inner, origin);
6682            Self { inner }
6683        }
6684        pub fn with_interceptor<F>(
6685            inner: T,
6686            interceptor: F,
6687        ) -> InboxServiceClient<InterceptedService<T, F>>
6688        where
6689            F: tonic::service::Interceptor,
6690            T::ResponseBody: Default,
6691            T: tonic::codegen::Service<
6692                http::Request<tonic::body::Body>,
6693                Response = http::Response<
6694                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6695                >,
6696            >,
6697            <T as tonic::codegen::Service<
6698                http::Request<tonic::body::Body>,
6699            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6700        {
6701            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6702        }
6703        /// Compress requests with the given encoding.
6704        ///
6705        /// This requires the server to support it otherwise it might respond with an
6706        /// error.
6707        #[must_use]
6708        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6709            self.inner = self.inner.send_compressed(encoding);
6710            self
6711        }
6712        /// Enable decompressing responses.
6713        #[must_use]
6714        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6715            self.inner = self.inner.accept_compressed(encoding);
6716            self
6717        }
6718        /// Limits the maximum size of a decoded message.
6719        ///
6720        /// Default: `4MB`
6721        #[must_use]
6722        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6723            self.inner = self.inner.max_decoding_message_size(limit);
6724            self
6725        }
6726        /// Limits the maximum size of an encoded message.
6727        ///
6728        /// Default: `usize::MAX`
6729        #[must_use]
6730        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6731            self.inner = self.inner.max_encoding_message_size(limit);
6732            self
6733        }
6734        /** Sync inbox entries since a given timestamp for incremental updates.
6735 Authorization: Authenticated user (own inbox only).
6736*/
6737        pub async fn sync(
6738            &mut self,
6739            request: impl tonic::IntoRequest<super::SyncRequest>,
6740        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6741            self.inner
6742                .ready()
6743                .await
6744                .map_err(|e| {
6745                    tonic::Status::unknown(
6746                        format!("Service was not ready: {}", e.into()),
6747                    )
6748                })?;
6749            let codec = tonic_prost::ProstCodec::default();
6750            let path = http::uri::PathAndQuery::from_static(
6751                "/pidgr.v1.InboxService/Sync",
6752            );
6753            let mut req = request.into_request();
6754            req.extensions_mut()
6755                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6756            self.inner.unary(req, path, codec).await
6757        }
6758        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6759 Authorization: Authenticated user (own inbox only).
6760*/
6761        pub async fn mark_read(
6762            &mut self,
6763            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6764        ) -> std::result::Result<
6765            tonic::Response<super::MarkReadResponse>,
6766            tonic::Status,
6767        > {
6768            self.inner
6769                .ready()
6770                .await
6771                .map_err(|e| {
6772                    tonic::Status::unknown(
6773                        format!("Service was not ready: {}", e.into()),
6774                    )
6775                })?;
6776            let codec = tonic_prost::ProstCodec::default();
6777            let path = http::uri::PathAndQuery::from_static(
6778                "/pidgr.v1.InboxService/MarkRead",
6779            );
6780            let mut req = request.into_request();
6781            req.extensions_mut()
6782                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6783            self.inner.unary(req, path, codec).await
6784        }
6785        /** Retrieve a single inbox entry by delivery ID.
6786 Authorization: Authenticated user (own inbox only).
6787*/
6788        pub async fn get_message(
6789            &mut self,
6790            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6791        ) -> std::result::Result<
6792            tonic::Response<super::GetMessageResponse>,
6793            tonic::Status,
6794        > {
6795            self.inner
6796                .ready()
6797                .await
6798                .map_err(|e| {
6799                    tonic::Status::unknown(
6800                        format!("Service was not ready: {}", e.into()),
6801                    )
6802                })?;
6803            let codec = tonic_prost::ProstCodec::default();
6804            let path = http::uri::PathAndQuery::from_static(
6805                "/pidgr.v1.InboxService/GetMessage",
6806            );
6807            let mut req = request.into_request();
6808            req.extensions_mut()
6809                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6810            self.inner.unary(req, path, codec).await
6811        }
6812    }
6813}
6814/// Generated server implementations.
6815pub mod inbox_service_server {
6816    #![allow(
6817        unused_variables,
6818        dead_code,
6819        missing_docs,
6820        clippy::wildcard_imports,
6821        clippy::let_unit_value,
6822    )]
6823    use tonic::codegen::*;
6824    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6825    #[async_trait]
6826    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6827        /** Sync inbox entries since a given timestamp for incremental updates.
6828 Authorization: Authenticated user (own inbox only).
6829*/
6830        async fn sync(
6831            &self,
6832            request: tonic::Request<super::SyncRequest>,
6833        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6834        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6835 Authorization: Authenticated user (own inbox only).
6836*/
6837        async fn mark_read(
6838            &self,
6839            request: tonic::Request<super::MarkReadRequest>,
6840        ) -> std::result::Result<
6841            tonic::Response<super::MarkReadResponse>,
6842            tonic::Status,
6843        >;
6844        /** Retrieve a single inbox entry by delivery ID.
6845 Authorization: Authenticated user (own inbox only).
6846*/
6847        async fn get_message(
6848            &self,
6849            request: tonic::Request<super::GetMessageRequest>,
6850        ) -> std::result::Result<
6851            tonic::Response<super::GetMessageResponse>,
6852            tonic::Status,
6853        >;
6854    }
6855    /** Provides the mobile app's inbox experience — syncing messages,
6856 tracking read status, and retrieving individual entries.
6857*/
6858    #[derive(Debug)]
6859    pub struct InboxServiceServer<T> {
6860        inner: Arc<T>,
6861        accept_compression_encodings: EnabledCompressionEncodings,
6862        send_compression_encodings: EnabledCompressionEncodings,
6863        max_decoding_message_size: Option<usize>,
6864        max_encoding_message_size: Option<usize>,
6865    }
6866    impl<T> InboxServiceServer<T> {
6867        pub fn new(inner: T) -> Self {
6868            Self::from_arc(Arc::new(inner))
6869        }
6870        pub fn from_arc(inner: Arc<T>) -> Self {
6871            Self {
6872                inner,
6873                accept_compression_encodings: Default::default(),
6874                send_compression_encodings: Default::default(),
6875                max_decoding_message_size: None,
6876                max_encoding_message_size: None,
6877            }
6878        }
6879        pub fn with_interceptor<F>(
6880            inner: T,
6881            interceptor: F,
6882        ) -> InterceptedService<Self, F>
6883        where
6884            F: tonic::service::Interceptor,
6885        {
6886            InterceptedService::new(Self::new(inner), interceptor)
6887        }
6888        /// Enable decompressing requests with the given encoding.
6889        #[must_use]
6890        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6891            self.accept_compression_encodings.enable(encoding);
6892            self
6893        }
6894        /// Compress responses with the given encoding, if the client supports it.
6895        #[must_use]
6896        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6897            self.send_compression_encodings.enable(encoding);
6898            self
6899        }
6900        /// Limits the maximum size of a decoded message.
6901        ///
6902        /// Default: `4MB`
6903        #[must_use]
6904        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6905            self.max_decoding_message_size = Some(limit);
6906            self
6907        }
6908        /// Limits the maximum size of an encoded message.
6909        ///
6910        /// Default: `usize::MAX`
6911        #[must_use]
6912        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6913            self.max_encoding_message_size = Some(limit);
6914            self
6915        }
6916    }
6917    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6918    where
6919        T: InboxService,
6920        B: Body + std::marker::Send + 'static,
6921        B::Error: Into<StdError> + std::marker::Send + 'static,
6922    {
6923        type Response = http::Response<tonic::body::Body>;
6924        type Error = std::convert::Infallible;
6925        type Future = BoxFuture<Self::Response, Self::Error>;
6926        fn poll_ready(
6927            &mut self,
6928            _cx: &mut Context<'_>,
6929        ) -> Poll<std::result::Result<(), Self::Error>> {
6930            Poll::Ready(Ok(()))
6931        }
6932        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6933            match req.uri().path() {
6934                "/pidgr.v1.InboxService/Sync" => {
6935                    #[allow(non_camel_case_types)]
6936                    struct SyncSvc<T: InboxService>(pub Arc<T>);
6937                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6938                    for SyncSvc<T> {
6939                        type Response = super::SyncResponse;
6940                        type Future = BoxFuture<
6941                            tonic::Response<Self::Response>,
6942                            tonic::Status,
6943                        >;
6944                        fn call(
6945                            &mut self,
6946                            request: tonic::Request<super::SyncRequest>,
6947                        ) -> Self::Future {
6948                            let inner = Arc::clone(&self.0);
6949                            let fut = async move {
6950                                <T as InboxService>::sync(&inner, request).await
6951                            };
6952                            Box::pin(fut)
6953                        }
6954                    }
6955                    let accept_compression_encodings = self.accept_compression_encodings;
6956                    let send_compression_encodings = self.send_compression_encodings;
6957                    let max_decoding_message_size = self.max_decoding_message_size;
6958                    let max_encoding_message_size = self.max_encoding_message_size;
6959                    let inner = self.inner.clone();
6960                    let fut = async move {
6961                        let method = SyncSvc(inner);
6962                        let codec = tonic_prost::ProstCodec::default();
6963                        let mut grpc = tonic::server::Grpc::new(codec)
6964                            .apply_compression_config(
6965                                accept_compression_encodings,
6966                                send_compression_encodings,
6967                            )
6968                            .apply_max_message_size_config(
6969                                max_decoding_message_size,
6970                                max_encoding_message_size,
6971                            );
6972                        let res = grpc.unary(method, req).await;
6973                        Ok(res)
6974                    };
6975                    Box::pin(fut)
6976                }
6977                "/pidgr.v1.InboxService/MarkRead" => {
6978                    #[allow(non_camel_case_types)]
6979                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6980                    impl<
6981                        T: InboxService,
6982                    > tonic::server::UnaryService<super::MarkReadRequest>
6983                    for MarkReadSvc<T> {
6984                        type Response = super::MarkReadResponse;
6985                        type Future = BoxFuture<
6986                            tonic::Response<Self::Response>,
6987                            tonic::Status,
6988                        >;
6989                        fn call(
6990                            &mut self,
6991                            request: tonic::Request<super::MarkReadRequest>,
6992                        ) -> Self::Future {
6993                            let inner = Arc::clone(&self.0);
6994                            let fut = async move {
6995                                <T as InboxService>::mark_read(&inner, request).await
6996                            };
6997                            Box::pin(fut)
6998                        }
6999                    }
7000                    let accept_compression_encodings = self.accept_compression_encodings;
7001                    let send_compression_encodings = self.send_compression_encodings;
7002                    let max_decoding_message_size = self.max_decoding_message_size;
7003                    let max_encoding_message_size = self.max_encoding_message_size;
7004                    let inner = self.inner.clone();
7005                    let fut = async move {
7006                        let method = MarkReadSvc(inner);
7007                        let codec = tonic_prost::ProstCodec::default();
7008                        let mut grpc = tonic::server::Grpc::new(codec)
7009                            .apply_compression_config(
7010                                accept_compression_encodings,
7011                                send_compression_encodings,
7012                            )
7013                            .apply_max_message_size_config(
7014                                max_decoding_message_size,
7015                                max_encoding_message_size,
7016                            );
7017                        let res = grpc.unary(method, req).await;
7018                        Ok(res)
7019                    };
7020                    Box::pin(fut)
7021                }
7022                "/pidgr.v1.InboxService/GetMessage" => {
7023                    #[allow(non_camel_case_types)]
7024                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
7025                    impl<
7026                        T: InboxService,
7027                    > tonic::server::UnaryService<super::GetMessageRequest>
7028                    for GetMessageSvc<T> {
7029                        type Response = super::GetMessageResponse;
7030                        type Future = BoxFuture<
7031                            tonic::Response<Self::Response>,
7032                            tonic::Status,
7033                        >;
7034                        fn call(
7035                            &mut self,
7036                            request: tonic::Request<super::GetMessageRequest>,
7037                        ) -> Self::Future {
7038                            let inner = Arc::clone(&self.0);
7039                            let fut = async move {
7040                                <T as InboxService>::get_message(&inner, request).await
7041                            };
7042                            Box::pin(fut)
7043                        }
7044                    }
7045                    let accept_compression_encodings = self.accept_compression_encodings;
7046                    let send_compression_encodings = self.send_compression_encodings;
7047                    let max_decoding_message_size = self.max_decoding_message_size;
7048                    let max_encoding_message_size = self.max_encoding_message_size;
7049                    let inner = self.inner.clone();
7050                    let fut = async move {
7051                        let method = GetMessageSvc(inner);
7052                        let codec = tonic_prost::ProstCodec::default();
7053                        let mut grpc = tonic::server::Grpc::new(codec)
7054                            .apply_compression_config(
7055                                accept_compression_encodings,
7056                                send_compression_encodings,
7057                            )
7058                            .apply_max_message_size_config(
7059                                max_decoding_message_size,
7060                                max_encoding_message_size,
7061                            );
7062                        let res = grpc.unary(method, req).await;
7063                        Ok(res)
7064                    };
7065                    Box::pin(fut)
7066                }
7067                _ => {
7068                    Box::pin(async move {
7069                        let mut response = http::Response::new(
7070                            tonic::body::Body::default(),
7071                        );
7072                        let headers = response.headers_mut();
7073                        headers
7074                            .insert(
7075                                tonic::Status::GRPC_STATUS,
7076                                (tonic::Code::Unimplemented as i32).into(),
7077                            );
7078                        headers
7079                            .insert(
7080                                http::header::CONTENT_TYPE,
7081                                tonic::metadata::GRPC_CONTENT_TYPE,
7082                            );
7083                        Ok(response)
7084                    })
7085                }
7086            }
7087        }
7088    }
7089    impl<T> Clone for InboxServiceServer<T> {
7090        fn clone(&self) -> Self {
7091            let inner = self.inner.clone();
7092            Self {
7093                inner,
7094                accept_compression_encodings: self.accept_compression_encodings,
7095                send_compression_encodings: self.send_compression_encodings,
7096                max_decoding_message_size: self.max_decoding_message_size,
7097                max_encoding_message_size: self.max_encoding_message_size,
7098            }
7099        }
7100    }
7101    /// Generated gRPC service name
7102    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
7103    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
7104        const NAME: &'static str = SERVICE_NAME;
7105    }
7106}
7107/// Generated client implementations.
7108pub mod insights_service_client {
7109    #![allow(
7110        unused_variables,
7111        dead_code,
7112        missing_docs,
7113        clippy::wildcard_imports,
7114        clippy::let_unit_value,
7115    )]
7116    use tonic::codegen::*;
7117    use tonic::codegen::http::Uri;
7118    /** Provides cohort-level AI insights for campaign planning and optimization.
7119 All predictions are aggregate — no individual-level profiling.
7120 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7121 All RPCs operate within the caller's org (extracted from JWT).
7122*/
7123    #[derive(Debug, Clone)]
7124    pub struct InsightsServiceClient<T> {
7125        inner: tonic::client::Grpc<T>,
7126    }
7127    impl InsightsServiceClient<tonic::transport::Channel> {
7128        /// Attempt to create a new client by connecting to a given endpoint.
7129        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7130        where
7131            D: TryInto<tonic::transport::Endpoint>,
7132            D::Error: Into<StdError>,
7133        {
7134            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7135            Ok(Self::new(conn))
7136        }
7137    }
7138    impl<T> InsightsServiceClient<T>
7139    where
7140        T: tonic::client::GrpcService<tonic::body::Body>,
7141        T::Error: Into<StdError>,
7142        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7143        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7144    {
7145        pub fn new(inner: T) -> Self {
7146            let inner = tonic::client::Grpc::new(inner);
7147            Self { inner }
7148        }
7149        pub fn with_origin(inner: T, origin: Uri) -> Self {
7150            let inner = tonic::client::Grpc::with_origin(inner, origin);
7151            Self { inner }
7152        }
7153        pub fn with_interceptor<F>(
7154            inner: T,
7155            interceptor: F,
7156        ) -> InsightsServiceClient<InterceptedService<T, F>>
7157        where
7158            F: tonic::service::Interceptor,
7159            T::ResponseBody: Default,
7160            T: tonic::codegen::Service<
7161                http::Request<tonic::body::Body>,
7162                Response = http::Response<
7163                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7164                >,
7165            >,
7166            <T as tonic::codegen::Service<
7167                http::Request<tonic::body::Body>,
7168            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7169        {
7170            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
7171        }
7172        /// Compress requests with the given encoding.
7173        ///
7174        /// This requires the server to support it otherwise it might respond with an
7175        /// error.
7176        #[must_use]
7177        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7178            self.inner = self.inner.send_compressed(encoding);
7179            self
7180        }
7181        /// Enable decompressing responses.
7182        #[must_use]
7183        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7184            self.inner = self.inner.accept_compressed(encoding);
7185            self
7186        }
7187        /// Limits the maximum size of a decoded message.
7188        ///
7189        /// Default: `4MB`
7190        #[must_use]
7191        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7192            self.inner = self.inner.max_decoding_message_size(limit);
7193            self
7194        }
7195        /// Limits the maximum size of an encoded message.
7196        ///
7197        /// Default: `usize::MAX`
7198        #[must_use]
7199        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7200            self.inner = self.inner.max_encoding_message_size(limit);
7201            self
7202        }
7203        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7204 Returns empty archetypes if insufficient data (cold start).
7205 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7206*/
7207        pub async fn get_group_archetypes(
7208            &mut self,
7209            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
7210        ) -> std::result::Result<
7211            tonic::Response<super::GetGroupArchetypesResponse>,
7212            tonic::Status,
7213        > {
7214            self.inner
7215                .ready()
7216                .await
7217                .map_err(|e| {
7218                    tonic::Status::unknown(
7219                        format!("Service was not ready: {}", e.into()),
7220                    )
7221                })?;
7222            let codec = tonic_prost::ProstCodec::default();
7223            let path = http::uri::PathAndQuery::from_static(
7224                "/pidgr.v1.InsightsService/GetGroupArchetypes",
7225            );
7226            let mut req = request.into_request();
7227            req.extensions_mut()
7228                .insert(
7229                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
7230                );
7231            self.inner.unary(req, path, codec).await
7232        }
7233        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7234 Returns a confidence interval that narrows as more campaign data accumulates.
7235 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7236*/
7237        pub async fn predict_campaign_ack(
7238            &mut self,
7239            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
7240        ) -> std::result::Result<
7241            tonic::Response<super::PredictCampaignAckResponse>,
7242            tonic::Status,
7243        > {
7244            self.inner
7245                .ready()
7246                .await
7247                .map_err(|e| {
7248                    tonic::Status::unknown(
7249                        format!("Service was not ready: {}", e.into()),
7250                    )
7251                })?;
7252            let codec = tonic_prost::ProstCodec::default();
7253            let path = http::uri::PathAndQuery::from_static(
7254                "/pidgr.v1.InsightsService/PredictCampaignACK",
7255            );
7256            let mut req = request.into_request();
7257            req.extensions_mut()
7258                .insert(
7259                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
7260                );
7261            self.inner.unary(req, path, codec).await
7262        }
7263        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7264 Advisory is informational only — never drives automated decisions.
7265 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7266*/
7267        pub async fn get_campaign_advisory(
7268            &mut self,
7269            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
7270        ) -> std::result::Result<
7271            tonic::Response<super::GetCampaignAdvisoryResponse>,
7272            tonic::Status,
7273        > {
7274            self.inner
7275                .ready()
7276                .await
7277                .map_err(|e| {
7278                    tonic::Status::unknown(
7279                        format!("Service was not ready: {}", e.into()),
7280                    )
7281                })?;
7282            let codec = tonic_prost::ProstCodec::default();
7283            let path = http::uri::PathAndQuery::from_static(
7284                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
7285            );
7286            let mut req = request.into_request();
7287            req.extensions_mut()
7288                .insert(
7289                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
7290                );
7291            self.inner.unary(req, path, codec).await
7292        }
7293        /** Generate an AI-powered narrative summary of a group's insights.
7294 Combines archetype, prediction, and campaign data into human-readable analysis.
7295 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7296*/
7297        pub async fn get_insight_narrative(
7298            &mut self,
7299            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
7300        ) -> std::result::Result<
7301            tonic::Response<super::GetInsightNarrativeResponse>,
7302            tonic::Status,
7303        > {
7304            self.inner
7305                .ready()
7306                .await
7307                .map_err(|e| {
7308                    tonic::Status::unknown(
7309                        format!("Service was not ready: {}", e.into()),
7310                    )
7311                })?;
7312            let codec = tonic_prost::ProstCodec::default();
7313            let path = http::uri::PathAndQuery::from_static(
7314                "/pidgr.v1.InsightsService/GetInsightNarrative",
7315            );
7316            let mut req = request.into_request();
7317            req.extensions_mut()
7318                .insert(
7319                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
7320                );
7321            self.inner.unary(req, path, codec).await
7322        }
7323        /** Manually trigger the ML training pipeline for the caller's organization.
7324 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7325 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7326*/
7327        pub async fn trigger_ml_pipeline(
7328            &mut self,
7329            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
7330        ) -> std::result::Result<
7331            tonic::Response<super::TriggerMlPipelineResponse>,
7332            tonic::Status,
7333        > {
7334            self.inner
7335                .ready()
7336                .await
7337                .map_err(|e| {
7338                    tonic::Status::unknown(
7339                        format!("Service was not ready: {}", e.into()),
7340                    )
7341                })?;
7342            let codec = tonic_prost::ProstCodec::default();
7343            let path = http::uri::PathAndQuery::from_static(
7344                "/pidgr.v1.InsightsService/TriggerMLPipeline",
7345            );
7346            let mut req = request.into_request();
7347            req.extensions_mut()
7348                .insert(
7349                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
7350                );
7351            self.inner.unary(req, path, codec).await
7352        }
7353        /** Manually retrigger archetype clustering for a single group, reusing
7354 the already-deployed SageMaker clustering model. Cheaper than a
7355 full TriggerMLPipeline run because no training happens. Shares the
7356 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7357 get N manual retrains per month across both RPCs.
7358 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7359*/
7360        pub async fn trigger_archetype_clustering(
7361            &mut self,
7362            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7363        ) -> std::result::Result<
7364            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7365            tonic::Status,
7366        > {
7367            self.inner
7368                .ready()
7369                .await
7370                .map_err(|e| {
7371                    tonic::Status::unknown(
7372                        format!("Service was not ready: {}", e.into()),
7373                    )
7374                })?;
7375            let codec = tonic_prost::ProstCodec::default();
7376            let path = http::uri::PathAndQuery::from_static(
7377                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7378            );
7379            let mut req = request.into_request();
7380            req.extensions_mut()
7381                .insert(
7382                    GrpcMethod::new(
7383                        "pidgr.v1.InsightsService",
7384                        "TriggerArchetypeClustering",
7385                    ),
7386                );
7387            self.inner.unary(req, path, codec).await
7388        }
7389        /** Draft a campaign body for the given archetype using Bedrock with the
7390 campaign-for-archetype prompt template. Used by the Compass
7391 "Target this archetype" CTA to pre-fill the wizard's body field.
7392 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7393 returns NOT_FOUND.
7394 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7395*/
7396        pub async fn generate_campaign_body_draft(
7397            &mut self,
7398            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7399        ) -> std::result::Result<
7400            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7401            tonic::Status,
7402        > {
7403            self.inner
7404                .ready()
7405                .await
7406                .map_err(|e| {
7407                    tonic::Status::unknown(
7408                        format!("Service was not ready: {}", e.into()),
7409                    )
7410                })?;
7411            let codec = tonic_prost::ProstCodec::default();
7412            let path = http::uri::PathAndQuery::from_static(
7413                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7414            );
7415            let mut req = request.into_request();
7416            req.extensions_mut()
7417                .insert(
7418                    GrpcMethod::new(
7419                        "pidgr.v1.InsightsService",
7420                        "GenerateCampaignBodyDraft",
7421                    ),
7422                );
7423            self.inner.unary(req, path, codec).await
7424        }
7425    }
7426}
7427/// Generated server implementations.
7428pub mod insights_service_server {
7429    #![allow(
7430        unused_variables,
7431        dead_code,
7432        missing_docs,
7433        clippy::wildcard_imports,
7434        clippy::let_unit_value,
7435    )]
7436    use tonic::codegen::*;
7437    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7438    #[async_trait]
7439    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7440        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7441 Returns empty archetypes if insufficient data (cold start).
7442 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7443*/
7444        async fn get_group_archetypes(
7445            &self,
7446            request: tonic::Request<super::GetGroupArchetypesRequest>,
7447        ) -> std::result::Result<
7448            tonic::Response<super::GetGroupArchetypesResponse>,
7449            tonic::Status,
7450        >;
7451        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7452 Returns a confidence interval that narrows as more campaign data accumulates.
7453 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7454*/
7455        async fn predict_campaign_ack(
7456            &self,
7457            request: tonic::Request<super::PredictCampaignAckRequest>,
7458        ) -> std::result::Result<
7459            tonic::Response<super::PredictCampaignAckResponse>,
7460            tonic::Status,
7461        >;
7462        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7463 Advisory is informational only — never drives automated decisions.
7464 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7465*/
7466        async fn get_campaign_advisory(
7467            &self,
7468            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7469        ) -> std::result::Result<
7470            tonic::Response<super::GetCampaignAdvisoryResponse>,
7471            tonic::Status,
7472        >;
7473        /** Generate an AI-powered narrative summary of a group's insights.
7474 Combines archetype, prediction, and campaign data into human-readable analysis.
7475 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7476*/
7477        async fn get_insight_narrative(
7478            &self,
7479            request: tonic::Request<super::GetInsightNarrativeRequest>,
7480        ) -> std::result::Result<
7481            tonic::Response<super::GetInsightNarrativeResponse>,
7482            tonic::Status,
7483        >;
7484        /** Manually trigger the ML training pipeline for the caller's organization.
7485 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7486 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7487*/
7488        async fn trigger_ml_pipeline(
7489            &self,
7490            request: tonic::Request<super::TriggerMlPipelineRequest>,
7491        ) -> std::result::Result<
7492            tonic::Response<super::TriggerMlPipelineResponse>,
7493            tonic::Status,
7494        >;
7495        /** Manually retrigger archetype clustering for a single group, reusing
7496 the already-deployed SageMaker clustering model. Cheaper than a
7497 full TriggerMLPipeline run because no training happens. Shares the
7498 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7499 get N manual retrains per month across both RPCs.
7500 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7501*/
7502        async fn trigger_archetype_clustering(
7503            &self,
7504            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7505        ) -> std::result::Result<
7506            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7507            tonic::Status,
7508        >;
7509        /** Draft a campaign body for the given archetype using Bedrock with the
7510 campaign-for-archetype prompt template. Used by the Compass
7511 "Target this archetype" CTA to pre-fill the wizard's body field.
7512 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7513 returns NOT_FOUND.
7514 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7515*/
7516        async fn generate_campaign_body_draft(
7517            &self,
7518            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7519        ) -> std::result::Result<
7520            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7521            tonic::Status,
7522        >;
7523    }
7524    /** Provides cohort-level AI insights for campaign planning and optimization.
7525 All predictions are aggregate — no individual-level profiling.
7526 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7527 All RPCs operate within the caller's org (extracted from JWT).
7528*/
7529    #[derive(Debug)]
7530    pub struct InsightsServiceServer<T> {
7531        inner: Arc<T>,
7532        accept_compression_encodings: EnabledCompressionEncodings,
7533        send_compression_encodings: EnabledCompressionEncodings,
7534        max_decoding_message_size: Option<usize>,
7535        max_encoding_message_size: Option<usize>,
7536    }
7537    impl<T> InsightsServiceServer<T> {
7538        pub fn new(inner: T) -> Self {
7539            Self::from_arc(Arc::new(inner))
7540        }
7541        pub fn from_arc(inner: Arc<T>) -> Self {
7542            Self {
7543                inner,
7544                accept_compression_encodings: Default::default(),
7545                send_compression_encodings: Default::default(),
7546                max_decoding_message_size: None,
7547                max_encoding_message_size: None,
7548            }
7549        }
7550        pub fn with_interceptor<F>(
7551            inner: T,
7552            interceptor: F,
7553        ) -> InterceptedService<Self, F>
7554        where
7555            F: tonic::service::Interceptor,
7556        {
7557            InterceptedService::new(Self::new(inner), interceptor)
7558        }
7559        /// Enable decompressing requests with the given encoding.
7560        #[must_use]
7561        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7562            self.accept_compression_encodings.enable(encoding);
7563            self
7564        }
7565        /// Compress responses with the given encoding, if the client supports it.
7566        #[must_use]
7567        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7568            self.send_compression_encodings.enable(encoding);
7569            self
7570        }
7571        /// Limits the maximum size of a decoded message.
7572        ///
7573        /// Default: `4MB`
7574        #[must_use]
7575        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7576            self.max_decoding_message_size = Some(limit);
7577            self
7578        }
7579        /// Limits the maximum size of an encoded message.
7580        ///
7581        /// Default: `usize::MAX`
7582        #[must_use]
7583        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7584            self.max_encoding_message_size = Some(limit);
7585            self
7586        }
7587    }
7588    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7589    where
7590        T: InsightsService,
7591        B: Body + std::marker::Send + 'static,
7592        B::Error: Into<StdError> + std::marker::Send + 'static,
7593    {
7594        type Response = http::Response<tonic::body::Body>;
7595        type Error = std::convert::Infallible;
7596        type Future = BoxFuture<Self::Response, Self::Error>;
7597        fn poll_ready(
7598            &mut self,
7599            _cx: &mut Context<'_>,
7600        ) -> Poll<std::result::Result<(), Self::Error>> {
7601            Poll::Ready(Ok(()))
7602        }
7603        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7604            match req.uri().path() {
7605                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7606                    #[allow(non_camel_case_types)]
7607                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7608                    impl<
7609                        T: InsightsService,
7610                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7611                    for GetGroupArchetypesSvc<T> {
7612                        type Response = super::GetGroupArchetypesResponse;
7613                        type Future = BoxFuture<
7614                            tonic::Response<Self::Response>,
7615                            tonic::Status,
7616                        >;
7617                        fn call(
7618                            &mut self,
7619                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7620                        ) -> Self::Future {
7621                            let inner = Arc::clone(&self.0);
7622                            let fut = async move {
7623                                <T as InsightsService>::get_group_archetypes(
7624                                        &inner,
7625                                        request,
7626                                    )
7627                                    .await
7628                            };
7629                            Box::pin(fut)
7630                        }
7631                    }
7632                    let accept_compression_encodings = self.accept_compression_encodings;
7633                    let send_compression_encodings = self.send_compression_encodings;
7634                    let max_decoding_message_size = self.max_decoding_message_size;
7635                    let max_encoding_message_size = self.max_encoding_message_size;
7636                    let inner = self.inner.clone();
7637                    let fut = async move {
7638                        let method = GetGroupArchetypesSvc(inner);
7639                        let codec = tonic_prost::ProstCodec::default();
7640                        let mut grpc = tonic::server::Grpc::new(codec)
7641                            .apply_compression_config(
7642                                accept_compression_encodings,
7643                                send_compression_encodings,
7644                            )
7645                            .apply_max_message_size_config(
7646                                max_decoding_message_size,
7647                                max_encoding_message_size,
7648                            );
7649                        let res = grpc.unary(method, req).await;
7650                        Ok(res)
7651                    };
7652                    Box::pin(fut)
7653                }
7654                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7655                    #[allow(non_camel_case_types)]
7656                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7657                    impl<
7658                        T: InsightsService,
7659                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7660                    for PredictCampaignACKSvc<T> {
7661                        type Response = super::PredictCampaignAckResponse;
7662                        type Future = BoxFuture<
7663                            tonic::Response<Self::Response>,
7664                            tonic::Status,
7665                        >;
7666                        fn call(
7667                            &mut self,
7668                            request: tonic::Request<super::PredictCampaignAckRequest>,
7669                        ) -> Self::Future {
7670                            let inner = Arc::clone(&self.0);
7671                            let fut = async move {
7672                                <T as InsightsService>::predict_campaign_ack(
7673                                        &inner,
7674                                        request,
7675                                    )
7676                                    .await
7677                            };
7678                            Box::pin(fut)
7679                        }
7680                    }
7681                    let accept_compression_encodings = self.accept_compression_encodings;
7682                    let send_compression_encodings = self.send_compression_encodings;
7683                    let max_decoding_message_size = self.max_decoding_message_size;
7684                    let max_encoding_message_size = self.max_encoding_message_size;
7685                    let inner = self.inner.clone();
7686                    let fut = async move {
7687                        let method = PredictCampaignACKSvc(inner);
7688                        let codec = tonic_prost::ProstCodec::default();
7689                        let mut grpc = tonic::server::Grpc::new(codec)
7690                            .apply_compression_config(
7691                                accept_compression_encodings,
7692                                send_compression_encodings,
7693                            )
7694                            .apply_max_message_size_config(
7695                                max_decoding_message_size,
7696                                max_encoding_message_size,
7697                            );
7698                        let res = grpc.unary(method, req).await;
7699                        Ok(res)
7700                    };
7701                    Box::pin(fut)
7702                }
7703                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7704                    #[allow(non_camel_case_types)]
7705                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7706                    impl<
7707                        T: InsightsService,
7708                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7709                    for GetCampaignAdvisorySvc<T> {
7710                        type Response = super::GetCampaignAdvisoryResponse;
7711                        type Future = BoxFuture<
7712                            tonic::Response<Self::Response>,
7713                            tonic::Status,
7714                        >;
7715                        fn call(
7716                            &mut self,
7717                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7718                        ) -> Self::Future {
7719                            let inner = Arc::clone(&self.0);
7720                            let fut = async move {
7721                                <T as InsightsService>::get_campaign_advisory(
7722                                        &inner,
7723                                        request,
7724                                    )
7725                                    .await
7726                            };
7727                            Box::pin(fut)
7728                        }
7729                    }
7730                    let accept_compression_encodings = self.accept_compression_encodings;
7731                    let send_compression_encodings = self.send_compression_encodings;
7732                    let max_decoding_message_size = self.max_decoding_message_size;
7733                    let max_encoding_message_size = self.max_encoding_message_size;
7734                    let inner = self.inner.clone();
7735                    let fut = async move {
7736                        let method = GetCampaignAdvisorySvc(inner);
7737                        let codec = tonic_prost::ProstCodec::default();
7738                        let mut grpc = tonic::server::Grpc::new(codec)
7739                            .apply_compression_config(
7740                                accept_compression_encodings,
7741                                send_compression_encodings,
7742                            )
7743                            .apply_max_message_size_config(
7744                                max_decoding_message_size,
7745                                max_encoding_message_size,
7746                            );
7747                        let res = grpc.unary(method, req).await;
7748                        Ok(res)
7749                    };
7750                    Box::pin(fut)
7751                }
7752                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7753                    #[allow(non_camel_case_types)]
7754                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7755                    impl<
7756                        T: InsightsService,
7757                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7758                    for GetInsightNarrativeSvc<T> {
7759                        type Response = super::GetInsightNarrativeResponse;
7760                        type Future = BoxFuture<
7761                            tonic::Response<Self::Response>,
7762                            tonic::Status,
7763                        >;
7764                        fn call(
7765                            &mut self,
7766                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7767                        ) -> Self::Future {
7768                            let inner = Arc::clone(&self.0);
7769                            let fut = async move {
7770                                <T as InsightsService>::get_insight_narrative(
7771                                        &inner,
7772                                        request,
7773                                    )
7774                                    .await
7775                            };
7776                            Box::pin(fut)
7777                        }
7778                    }
7779                    let accept_compression_encodings = self.accept_compression_encodings;
7780                    let send_compression_encodings = self.send_compression_encodings;
7781                    let max_decoding_message_size = self.max_decoding_message_size;
7782                    let max_encoding_message_size = self.max_encoding_message_size;
7783                    let inner = self.inner.clone();
7784                    let fut = async move {
7785                        let method = GetInsightNarrativeSvc(inner);
7786                        let codec = tonic_prost::ProstCodec::default();
7787                        let mut grpc = tonic::server::Grpc::new(codec)
7788                            .apply_compression_config(
7789                                accept_compression_encodings,
7790                                send_compression_encodings,
7791                            )
7792                            .apply_max_message_size_config(
7793                                max_decoding_message_size,
7794                                max_encoding_message_size,
7795                            );
7796                        let res = grpc.unary(method, req).await;
7797                        Ok(res)
7798                    };
7799                    Box::pin(fut)
7800                }
7801                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7802                    #[allow(non_camel_case_types)]
7803                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7804                    impl<
7805                        T: InsightsService,
7806                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7807                    for TriggerMLPipelineSvc<T> {
7808                        type Response = super::TriggerMlPipelineResponse;
7809                        type Future = BoxFuture<
7810                            tonic::Response<Self::Response>,
7811                            tonic::Status,
7812                        >;
7813                        fn call(
7814                            &mut self,
7815                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7816                        ) -> Self::Future {
7817                            let inner = Arc::clone(&self.0);
7818                            let fut = async move {
7819                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7820                                    .await
7821                            };
7822                            Box::pin(fut)
7823                        }
7824                    }
7825                    let accept_compression_encodings = self.accept_compression_encodings;
7826                    let send_compression_encodings = self.send_compression_encodings;
7827                    let max_decoding_message_size = self.max_decoding_message_size;
7828                    let max_encoding_message_size = self.max_encoding_message_size;
7829                    let inner = self.inner.clone();
7830                    let fut = async move {
7831                        let method = TriggerMLPipelineSvc(inner);
7832                        let codec = tonic_prost::ProstCodec::default();
7833                        let mut grpc = tonic::server::Grpc::new(codec)
7834                            .apply_compression_config(
7835                                accept_compression_encodings,
7836                                send_compression_encodings,
7837                            )
7838                            .apply_max_message_size_config(
7839                                max_decoding_message_size,
7840                                max_encoding_message_size,
7841                            );
7842                        let res = grpc.unary(method, req).await;
7843                        Ok(res)
7844                    };
7845                    Box::pin(fut)
7846                }
7847                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7848                    #[allow(non_camel_case_types)]
7849                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7850                    impl<
7851                        T: InsightsService,
7852                    > tonic::server::UnaryService<
7853                        super::TriggerArchetypeClusteringRequest,
7854                    > for TriggerArchetypeClusteringSvc<T> {
7855                        type Response = super::TriggerArchetypeClusteringResponse;
7856                        type Future = BoxFuture<
7857                            tonic::Response<Self::Response>,
7858                            tonic::Status,
7859                        >;
7860                        fn call(
7861                            &mut self,
7862                            request: tonic::Request<
7863                                super::TriggerArchetypeClusteringRequest,
7864                            >,
7865                        ) -> Self::Future {
7866                            let inner = Arc::clone(&self.0);
7867                            let fut = async move {
7868                                <T as InsightsService>::trigger_archetype_clustering(
7869                                        &inner,
7870                                        request,
7871                                    )
7872                                    .await
7873                            };
7874                            Box::pin(fut)
7875                        }
7876                    }
7877                    let accept_compression_encodings = self.accept_compression_encodings;
7878                    let send_compression_encodings = self.send_compression_encodings;
7879                    let max_decoding_message_size = self.max_decoding_message_size;
7880                    let max_encoding_message_size = self.max_encoding_message_size;
7881                    let inner = self.inner.clone();
7882                    let fut = async move {
7883                        let method = TriggerArchetypeClusteringSvc(inner);
7884                        let codec = tonic_prost::ProstCodec::default();
7885                        let mut grpc = tonic::server::Grpc::new(codec)
7886                            .apply_compression_config(
7887                                accept_compression_encodings,
7888                                send_compression_encodings,
7889                            )
7890                            .apply_max_message_size_config(
7891                                max_decoding_message_size,
7892                                max_encoding_message_size,
7893                            );
7894                        let res = grpc.unary(method, req).await;
7895                        Ok(res)
7896                    };
7897                    Box::pin(fut)
7898                }
7899                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7900                    #[allow(non_camel_case_types)]
7901                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7902                    impl<
7903                        T: InsightsService,
7904                    > tonic::server::UnaryService<
7905                        super::GenerateCampaignBodyDraftRequest,
7906                    > for GenerateCampaignBodyDraftSvc<T> {
7907                        type Response = super::GenerateCampaignBodyDraftResponse;
7908                        type Future = BoxFuture<
7909                            tonic::Response<Self::Response>,
7910                            tonic::Status,
7911                        >;
7912                        fn call(
7913                            &mut self,
7914                            request: tonic::Request<
7915                                super::GenerateCampaignBodyDraftRequest,
7916                            >,
7917                        ) -> Self::Future {
7918                            let inner = Arc::clone(&self.0);
7919                            let fut = async move {
7920                                <T as InsightsService>::generate_campaign_body_draft(
7921                                        &inner,
7922                                        request,
7923                                    )
7924                                    .await
7925                            };
7926                            Box::pin(fut)
7927                        }
7928                    }
7929                    let accept_compression_encodings = self.accept_compression_encodings;
7930                    let send_compression_encodings = self.send_compression_encodings;
7931                    let max_decoding_message_size = self.max_decoding_message_size;
7932                    let max_encoding_message_size = self.max_encoding_message_size;
7933                    let inner = self.inner.clone();
7934                    let fut = async move {
7935                        let method = GenerateCampaignBodyDraftSvc(inner);
7936                        let codec = tonic_prost::ProstCodec::default();
7937                        let mut grpc = tonic::server::Grpc::new(codec)
7938                            .apply_compression_config(
7939                                accept_compression_encodings,
7940                                send_compression_encodings,
7941                            )
7942                            .apply_max_message_size_config(
7943                                max_decoding_message_size,
7944                                max_encoding_message_size,
7945                            );
7946                        let res = grpc.unary(method, req).await;
7947                        Ok(res)
7948                    };
7949                    Box::pin(fut)
7950                }
7951                _ => {
7952                    Box::pin(async move {
7953                        let mut response = http::Response::new(
7954                            tonic::body::Body::default(),
7955                        );
7956                        let headers = response.headers_mut();
7957                        headers
7958                            .insert(
7959                                tonic::Status::GRPC_STATUS,
7960                                (tonic::Code::Unimplemented as i32).into(),
7961                            );
7962                        headers
7963                            .insert(
7964                                http::header::CONTENT_TYPE,
7965                                tonic::metadata::GRPC_CONTENT_TYPE,
7966                            );
7967                        Ok(response)
7968                    })
7969                }
7970            }
7971        }
7972    }
7973    impl<T> Clone for InsightsServiceServer<T> {
7974        fn clone(&self) -> Self {
7975            let inner = self.inner.clone();
7976            Self {
7977                inner,
7978                accept_compression_encodings: self.accept_compression_encodings,
7979                send_compression_encodings: self.send_compression_encodings,
7980                max_decoding_message_size: self.max_decoding_message_size,
7981                max_encoding_message_size: self.max_encoding_message_size,
7982            }
7983        }
7984    }
7985    /// Generated gRPC service name
7986    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7987    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7988        const NAME: &'static str = SERVICE_NAME;
7989    }
7990}
7991/// Generated client implementations.
7992pub mod integrations_service_client {
7993    #![allow(
7994        unused_variables,
7995        dead_code,
7996        missing_docs,
7997        clippy::wildcard_imports,
7998        clippy::let_unit_value,
7999    )]
8000    use tonic::codegen::*;
8001    use tonic::codegen::http::Uri;
8002    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8003
8004 Auth model:
8005   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8006     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8007   - UpsertReachability / RemoveReachability / GetReachability /
8008     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8009     caller's `custom:org_id` claim).
8010   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8011     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8012     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8013
8014 Cross-org access is denied with `permission_denied`.
8015*/
8016    #[derive(Debug, Clone)]
8017    pub struct IntegrationsServiceClient<T> {
8018        inner: tonic::client::Grpc<T>,
8019    }
8020    impl IntegrationsServiceClient<tonic::transport::Channel> {
8021        /// Attempt to create a new client by connecting to a given endpoint.
8022        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8023        where
8024            D: TryInto<tonic::transport::Endpoint>,
8025            D::Error: Into<StdError>,
8026        {
8027            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8028            Ok(Self::new(conn))
8029        }
8030    }
8031    impl<T> IntegrationsServiceClient<T>
8032    where
8033        T: tonic::client::GrpcService<tonic::body::Body>,
8034        T::Error: Into<StdError>,
8035        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8036        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8037    {
8038        pub fn new(inner: T) -> Self {
8039            let inner = tonic::client::Grpc::new(inner);
8040            Self { inner }
8041        }
8042        pub fn with_origin(inner: T, origin: Uri) -> Self {
8043            let inner = tonic::client::Grpc::with_origin(inner, origin);
8044            Self { inner }
8045        }
8046        pub fn with_interceptor<F>(
8047            inner: T,
8048            interceptor: F,
8049        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
8050        where
8051            F: tonic::service::Interceptor,
8052            T::ResponseBody: Default,
8053            T: tonic::codegen::Service<
8054                http::Request<tonic::body::Body>,
8055                Response = http::Response<
8056                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8057                >,
8058            >,
8059            <T as tonic::codegen::Service<
8060                http::Request<tonic::body::Body>,
8061            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8062        {
8063            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
8064        }
8065        /// Compress requests with the given encoding.
8066        ///
8067        /// This requires the server to support it otherwise it might respond with an
8068        /// error.
8069        #[must_use]
8070        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8071            self.inner = self.inner.send_compressed(encoding);
8072            self
8073        }
8074        /// Enable decompressing responses.
8075        #[must_use]
8076        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8077            self.inner = self.inner.accept_compressed(encoding);
8078            self
8079        }
8080        /// Limits the maximum size of a decoded message.
8081        ///
8082        /// Default: `4MB`
8083        #[must_use]
8084        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8085            self.inner = self.inner.max_decoding_message_size(limit);
8086            self
8087        }
8088        /// Limits the maximum size of an encoded message.
8089        ///
8090        /// Default: `usize::MAX`
8091        #[must_use]
8092        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8093            self.inner = self.inner.max_encoding_message_size(limit);
8094            self
8095        }
8096        /** Dispatch a single rendered message to one channel. Idempotent on
8097 `dispatch_id`. Internal-mTLS only.
8098*/
8099        pub async fn dispatch_to_channel(
8100            &mut self,
8101            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8102        ) -> std::result::Result<
8103            tonic::Response<super::DispatchToChannelResponse>,
8104            tonic::Status,
8105        > {
8106            self.inner
8107                .ready()
8108                .await
8109                .map_err(|e| {
8110                    tonic::Status::unknown(
8111                        format!("Service was not ready: {}", e.into()),
8112                    )
8113                })?;
8114            let codec = tonic_prost::ProstCodec::default();
8115            let path = http::uri::PathAndQuery::from_static(
8116                "/pidgr.v1.IntegrationsService/DispatchToChannel",
8117            );
8118            let mut req = request.into_request();
8119            req.extensions_mut()
8120                .insert(
8121                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8122                );
8123            self.inner.unary(req, path, codec).await
8124        }
8125        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8126 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8127 audit row BEFORE the registry commit.
8128*/
8129        pub async fn upsert_reachability(
8130            &mut self,
8131            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8132        ) -> std::result::Result<
8133            tonic::Response<super::UpsertReachabilityResponse>,
8134            tonic::Status,
8135        > {
8136            self.inner
8137                .ready()
8138                .await
8139                .map_err(|e| {
8140                    tonic::Status::unknown(
8141                        format!("Service was not ready: {}", e.into()),
8142                    )
8143                })?;
8144            let codec = tonic_prost::ProstCodec::default();
8145            let path = http::uri::PathAndQuery::from_static(
8146                "/pidgr.v1.IntegrationsService/UpsertReachability",
8147            );
8148            let mut req = request.into_request();
8149            req.extensions_mut()
8150                .insert(
8151                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8152                );
8153            self.inner.unary(req, path, codec).await
8154        }
8155        /** Remove a reachability identifier. Idempotent. Emits a
8156 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8157*/
8158        pub async fn remove_reachability(
8159            &mut self,
8160            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8161        ) -> std::result::Result<
8162            tonic::Response<super::RemoveReachabilityResponse>,
8163            tonic::Status,
8164        > {
8165            self.inner
8166                .ready()
8167                .await
8168                .map_err(|e| {
8169                    tonic::Status::unknown(
8170                        format!("Service was not ready: {}", e.into()),
8171                    )
8172                })?;
8173            let codec = tonic_prost::ProstCodec::default();
8174            let path = http::uri::PathAndQuery::from_static(
8175                "/pidgr.v1.IntegrationsService/RemoveReachability",
8176            );
8177            let mut req = request.into_request();
8178            req.extensions_mut()
8179                .insert(
8180                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8181                );
8182            self.inner.unary(req, path, codec).await
8183        }
8184        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8185 Does not return plaintext or envelope ciphertext.
8186*/
8187        pub async fn get_reachability(
8188            &mut self,
8189            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8190        ) -> std::result::Result<
8191            tonic::Response<super::GetReachabilityResponse>,
8192            tonic::Status,
8193        > {
8194            self.inner
8195                .ready()
8196                .await
8197                .map_err(|e| {
8198                    tonic::Status::unknown(
8199                        format!("Service was not ready: {}", e.into()),
8200                    )
8201                })?;
8202            let codec = tonic_prost::ProstCodec::default();
8203            let path = http::uri::PathAndQuery::from_static(
8204                "/pidgr.v1.IntegrationsService/GetReachability",
8205            );
8206            let mut req = request.into_request();
8207            req.extensions_mut()
8208                .insert(
8209                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8210                );
8211            self.inner.unary(req, path, codec).await
8212        }
8213        /** List per-channel reachability metadata for a single user. Used by the
8214 admin per-user matrix view. Does not return plaintext or ciphertext.
8215*/
8216        pub async fn list_reachability_for_user(
8217            &mut self,
8218            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8219        ) -> std::result::Result<
8220            tonic::Response<super::ListReachabilityForUserResponse>,
8221            tonic::Status,
8222        > {
8223            self.inner
8224                .ready()
8225                .await
8226                .map_err(|e| {
8227                    tonic::Status::unknown(
8228                        format!("Service was not ready: {}", e.into()),
8229                    )
8230                })?;
8231            let codec = tonic_prost::ProstCodec::default();
8232            let path = http::uri::PathAndQuery::from_static(
8233                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8234            );
8235            let mut req = request.into_request();
8236            req.extensions_mut()
8237                .insert(
8238                    GrpcMethod::new(
8239                        "pidgr.v1.IntegrationsService",
8240                        "ListReachabilityForUser",
8241                    ),
8242                );
8243            self.inner.unary(req, path, codec).await
8244        }
8245        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8246 no policy is configured — NOT a NOT_FOUND.
8247*/
8248        pub async fn get_region_policy(
8249            &mut self,
8250            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8251        ) -> std::result::Result<
8252            tonic::Response<super::GetRegionPolicyResponse>,
8253            tonic::Status,
8254        > {
8255            self.inner
8256                .ready()
8257                .await
8258                .map_err(|e| {
8259                    tonic::Status::unknown(
8260                        format!("Service was not ready: {}", e.into()),
8261                    )
8262                })?;
8263            let codec = tonic_prost::ProstCodec::default();
8264            let path = http::uri::PathAndQuery::from_static(
8265                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8266            );
8267            let mut req = request.into_request();
8268            req.extensions_mut()
8269                .insert(
8270                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8271                );
8272            self.inner.unary(req, path, codec).await
8273        }
8274        /** Admin-only upsert of the per-(org, channel) region allowlist.
8275*/
8276        pub async fn set_region_policy(
8277            &mut self,
8278            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8279        ) -> std::result::Result<
8280            tonic::Response<super::SetRegionPolicyResponse>,
8281            tonic::Status,
8282        > {
8283            self.inner
8284                .ready()
8285                .await
8286                .map_err(|e| {
8287                    tonic::Status::unknown(
8288                        format!("Service was not ready: {}", e.into()),
8289                    )
8290                })?;
8291            let codec = tonic_prost::ProstCodec::default();
8292            let path = http::uri::PathAndQuery::from_static(
8293                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8294            );
8295            let mut req = request.into_request();
8296            req.extensions_mut()
8297                .insert(
8298                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8299                );
8300            self.inner.unary(req, path, codec).await
8301        }
8302        /** Read the current calendar-month cost-cap state. Returns the channel
8303 default cap when no row exists; never NOT_FOUND.
8304*/
8305        pub async fn get_cost_cap_policy(
8306            &mut self,
8307            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8308        ) -> std::result::Result<
8309            tonic::Response<super::GetCostCapPolicyResponse>,
8310            tonic::Status,
8311        > {
8312            self.inner
8313                .ready()
8314                .await
8315                .map_err(|e| {
8316                    tonic::Status::unknown(
8317                        format!("Service was not ready: {}", e.into()),
8318                    )
8319                })?;
8320            let codec = tonic_prost::ProstCodec::default();
8321            let path = http::uri::PathAndQuery::from_static(
8322                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8323            );
8324            let mut req = request.into_request();
8325            req.extensions_mut()
8326                .insert(
8327                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8328                );
8329            self.inner.unary(req, path, codec).await
8330        }
8331        /** Admin-only upsert of the current calendar-month cost cap.
8332*/
8333        pub async fn set_cost_cap_policy(
8334            &mut self,
8335            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8336        ) -> std::result::Result<
8337            tonic::Response<super::SetCostCapPolicyResponse>,
8338            tonic::Status,
8339        > {
8340            self.inner
8341                .ready()
8342                .await
8343                .map_err(|e| {
8344                    tonic::Status::unknown(
8345                        format!("Service was not ready: {}", e.into()),
8346                    )
8347                })?;
8348            let codec = tonic_prost::ProstCodec::default();
8349            let path = http::uri::PathAndQuery::from_static(
8350                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8351            );
8352            let mut req = request.into_request();
8353            req.extensions_mut()
8354                .insert(
8355                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8356                );
8357            self.inner.unary(req, path, codec).await
8358        }
8359        /** Read the org's generic-webhook channel configuration. The signing secret
8360 is never returned. Returns an empty-url config when none exists — NOT a
8361 NOT_FOUND.
8362*/
8363        pub async fn get_org_webhook_config(
8364            &mut self,
8365            request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8366        ) -> std::result::Result<
8367            tonic::Response<super::GetOrgWebhookConfigResponse>,
8368            tonic::Status,
8369        > {
8370            self.inner
8371                .ready()
8372                .await
8373                .map_err(|e| {
8374                    tonic::Status::unknown(
8375                        format!("Service was not ready: {}", e.into()),
8376                    )
8377                })?;
8378            let codec = tonic_prost::ProstCodec::default();
8379            let path = http::uri::PathAndQuery::from_static(
8380                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8381            );
8382            let mut req = request.into_request();
8383            req.extensions_mut()
8384                .insert(
8385                    GrpcMethod::new(
8386                        "pidgr.v1.IntegrationsService",
8387                        "GetOrgWebhookConfig",
8388                    ),
8389                );
8390            self.inner.unary(req, path, codec).await
8391        }
8392        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8393 the destination URL (https-only, public hosts) and envelope-encrypts the
8394 secret at rest.
8395*/
8396        pub async fn set_org_webhook_config(
8397            &mut self,
8398            request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8399        ) -> std::result::Result<
8400            tonic::Response<super::SetOrgWebhookConfigResponse>,
8401            tonic::Status,
8402        > {
8403            self.inner
8404                .ready()
8405                .await
8406                .map_err(|e| {
8407                    tonic::Status::unknown(
8408                        format!("Service was not ready: {}", e.into()),
8409                    )
8410                })?;
8411            let codec = tonic_prost::ProstCodec::default();
8412            let path = http::uri::PathAndQuery::from_static(
8413                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8414            );
8415            let mut req = request.into_request();
8416            req.extensions_mut()
8417                .insert(
8418                    GrpcMethod::new(
8419                        "pidgr.v1.IntegrationsService",
8420                        "SetOrgWebhookConfig",
8421                    ),
8422                );
8423            self.inner.unary(req, path, codec).await
8424        }
8425        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8426 user follows to bind a third-party channel (Telegram bot-follow, Slack
8427 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8428 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8429 are rejected with `invalid_argument`.
8430*/
8431        pub async fn create_channel_connect_link(
8432            &mut self,
8433            request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8434        ) -> std::result::Result<
8435            tonic::Response<super::CreateChannelConnectLinkResponse>,
8436            tonic::Status,
8437        > {
8438            self.inner
8439                .ready()
8440                .await
8441                .map_err(|e| {
8442                    tonic::Status::unknown(
8443                        format!("Service was not ready: {}", e.into()),
8444                    )
8445                })?;
8446            let codec = tonic_prost::ProstCodec::default();
8447            let path = http::uri::PathAndQuery::from_static(
8448                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8449            );
8450            let mut req = request.into_request();
8451            req.extensions_mut()
8452                .insert(
8453                    GrpcMethod::new(
8454                        "pidgr.v1.IntegrationsService",
8455                        "CreateChannelConnectLink",
8456                    ),
8457                );
8458            self.inner.unary(req, path, codec).await
8459        }
8460    }
8461}
8462/// Generated server implementations.
8463pub mod integrations_service_server {
8464    #![allow(
8465        unused_variables,
8466        dead_code,
8467        missing_docs,
8468        clippy::wildcard_imports,
8469        clippy::let_unit_value,
8470    )]
8471    use tonic::codegen::*;
8472    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8473    #[async_trait]
8474    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8475        /** Dispatch a single rendered message to one channel. Idempotent on
8476 `dispatch_id`. Internal-mTLS only.
8477*/
8478        async fn dispatch_to_channel(
8479            &self,
8480            request: tonic::Request<super::DispatchToChannelRequest>,
8481        ) -> std::result::Result<
8482            tonic::Response<super::DispatchToChannelResponse>,
8483            tonic::Status,
8484        >;
8485        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8486 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8487 audit row BEFORE the registry commit.
8488*/
8489        async fn upsert_reachability(
8490            &self,
8491            request: tonic::Request<super::UpsertReachabilityRequest>,
8492        ) -> std::result::Result<
8493            tonic::Response<super::UpsertReachabilityResponse>,
8494            tonic::Status,
8495        >;
8496        /** Remove a reachability identifier. Idempotent. Emits a
8497 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8498*/
8499        async fn remove_reachability(
8500            &self,
8501            request: tonic::Request<super::RemoveReachabilityRequest>,
8502        ) -> std::result::Result<
8503            tonic::Response<super::RemoveReachabilityResponse>,
8504            tonic::Status,
8505        >;
8506        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8507 Does not return plaintext or envelope ciphertext.
8508*/
8509        async fn get_reachability(
8510            &self,
8511            request: tonic::Request<super::GetReachabilityRequest>,
8512        ) -> std::result::Result<
8513            tonic::Response<super::GetReachabilityResponse>,
8514            tonic::Status,
8515        >;
8516        /** List per-channel reachability metadata for a single user. Used by the
8517 admin per-user matrix view. Does not return plaintext or ciphertext.
8518*/
8519        async fn list_reachability_for_user(
8520            &self,
8521            request: tonic::Request<super::ListReachabilityForUserRequest>,
8522        ) -> std::result::Result<
8523            tonic::Response<super::ListReachabilityForUserResponse>,
8524            tonic::Status,
8525        >;
8526        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8527 no policy is configured — NOT a NOT_FOUND.
8528*/
8529        async fn get_region_policy(
8530            &self,
8531            request: tonic::Request<super::GetRegionPolicyRequest>,
8532        ) -> std::result::Result<
8533            tonic::Response<super::GetRegionPolicyResponse>,
8534            tonic::Status,
8535        >;
8536        /** Admin-only upsert of the per-(org, channel) region allowlist.
8537*/
8538        async fn set_region_policy(
8539            &self,
8540            request: tonic::Request<super::SetRegionPolicyRequest>,
8541        ) -> std::result::Result<
8542            tonic::Response<super::SetRegionPolicyResponse>,
8543            tonic::Status,
8544        >;
8545        /** Read the current calendar-month cost-cap state. Returns the channel
8546 default cap when no row exists; never NOT_FOUND.
8547*/
8548        async fn get_cost_cap_policy(
8549            &self,
8550            request: tonic::Request<super::GetCostCapPolicyRequest>,
8551        ) -> std::result::Result<
8552            tonic::Response<super::GetCostCapPolicyResponse>,
8553            tonic::Status,
8554        >;
8555        /** Admin-only upsert of the current calendar-month cost cap.
8556*/
8557        async fn set_cost_cap_policy(
8558            &self,
8559            request: tonic::Request<super::SetCostCapPolicyRequest>,
8560        ) -> std::result::Result<
8561            tonic::Response<super::SetCostCapPolicyResponse>,
8562            tonic::Status,
8563        >;
8564        /** Read the org's generic-webhook channel configuration. The signing secret
8565 is never returned. Returns an empty-url config when none exists — NOT a
8566 NOT_FOUND.
8567*/
8568        async fn get_org_webhook_config(
8569            &self,
8570            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8571        ) -> std::result::Result<
8572            tonic::Response<super::GetOrgWebhookConfigResponse>,
8573            tonic::Status,
8574        >;
8575        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8576 the destination URL (https-only, public hosts) and envelope-encrypts the
8577 secret at rest.
8578*/
8579        async fn set_org_webhook_config(
8580            &self,
8581            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8582        ) -> std::result::Result<
8583            tonic::Response<super::SetOrgWebhookConfigResponse>,
8584            tonic::Status,
8585        >;
8586        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8587 user follows to bind a third-party channel (Telegram bot-follow, Slack
8588 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8589 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8590 are rejected with `invalid_argument`.
8591*/
8592        async fn create_channel_connect_link(
8593            &self,
8594            request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8595        ) -> std::result::Result<
8596            tonic::Response<super::CreateChannelConnectLinkResponse>,
8597            tonic::Status,
8598        >;
8599    }
8600    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8601
8602 Auth model:
8603   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8604     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8605   - UpsertReachability / RemoveReachability / GetReachability /
8606     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8607     caller's `custom:org_id` claim).
8608   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8609     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8610     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8611
8612 Cross-org access is denied with `permission_denied`.
8613*/
8614    #[derive(Debug)]
8615    pub struct IntegrationsServiceServer<T> {
8616        inner: Arc<T>,
8617        accept_compression_encodings: EnabledCompressionEncodings,
8618        send_compression_encodings: EnabledCompressionEncodings,
8619        max_decoding_message_size: Option<usize>,
8620        max_encoding_message_size: Option<usize>,
8621    }
8622    impl<T> IntegrationsServiceServer<T> {
8623        pub fn new(inner: T) -> Self {
8624            Self::from_arc(Arc::new(inner))
8625        }
8626        pub fn from_arc(inner: Arc<T>) -> Self {
8627            Self {
8628                inner,
8629                accept_compression_encodings: Default::default(),
8630                send_compression_encodings: Default::default(),
8631                max_decoding_message_size: None,
8632                max_encoding_message_size: None,
8633            }
8634        }
8635        pub fn with_interceptor<F>(
8636            inner: T,
8637            interceptor: F,
8638        ) -> InterceptedService<Self, F>
8639        where
8640            F: tonic::service::Interceptor,
8641        {
8642            InterceptedService::new(Self::new(inner), interceptor)
8643        }
8644        /// Enable decompressing requests with the given encoding.
8645        #[must_use]
8646        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8647            self.accept_compression_encodings.enable(encoding);
8648            self
8649        }
8650        /// Compress responses with the given encoding, if the client supports it.
8651        #[must_use]
8652        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8653            self.send_compression_encodings.enable(encoding);
8654            self
8655        }
8656        /// Limits the maximum size of a decoded message.
8657        ///
8658        /// Default: `4MB`
8659        #[must_use]
8660        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8661            self.max_decoding_message_size = Some(limit);
8662            self
8663        }
8664        /// Limits the maximum size of an encoded message.
8665        ///
8666        /// Default: `usize::MAX`
8667        #[must_use]
8668        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8669            self.max_encoding_message_size = Some(limit);
8670            self
8671        }
8672    }
8673    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8674    where
8675        T: IntegrationsService,
8676        B: Body + std::marker::Send + 'static,
8677        B::Error: Into<StdError> + std::marker::Send + 'static,
8678    {
8679        type Response = http::Response<tonic::body::Body>;
8680        type Error = std::convert::Infallible;
8681        type Future = BoxFuture<Self::Response, Self::Error>;
8682        fn poll_ready(
8683            &mut self,
8684            _cx: &mut Context<'_>,
8685        ) -> Poll<std::result::Result<(), Self::Error>> {
8686            Poll::Ready(Ok(()))
8687        }
8688        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8689            match req.uri().path() {
8690                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8691                    #[allow(non_camel_case_types)]
8692                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8693                    impl<
8694                        T: IntegrationsService,
8695                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
8696                    for DispatchToChannelSvc<T> {
8697                        type Response = super::DispatchToChannelResponse;
8698                        type Future = BoxFuture<
8699                            tonic::Response<Self::Response>,
8700                            tonic::Status,
8701                        >;
8702                        fn call(
8703                            &mut self,
8704                            request: tonic::Request<super::DispatchToChannelRequest>,
8705                        ) -> Self::Future {
8706                            let inner = Arc::clone(&self.0);
8707                            let fut = async move {
8708                                <T as IntegrationsService>::dispatch_to_channel(
8709                                        &inner,
8710                                        request,
8711                                    )
8712                                    .await
8713                            };
8714                            Box::pin(fut)
8715                        }
8716                    }
8717                    let accept_compression_encodings = self.accept_compression_encodings;
8718                    let send_compression_encodings = self.send_compression_encodings;
8719                    let max_decoding_message_size = self.max_decoding_message_size;
8720                    let max_encoding_message_size = self.max_encoding_message_size;
8721                    let inner = self.inner.clone();
8722                    let fut = async move {
8723                        let method = DispatchToChannelSvc(inner);
8724                        let codec = tonic_prost::ProstCodec::default();
8725                        let mut grpc = tonic::server::Grpc::new(codec)
8726                            .apply_compression_config(
8727                                accept_compression_encodings,
8728                                send_compression_encodings,
8729                            )
8730                            .apply_max_message_size_config(
8731                                max_decoding_message_size,
8732                                max_encoding_message_size,
8733                            );
8734                        let res = grpc.unary(method, req).await;
8735                        Ok(res)
8736                    };
8737                    Box::pin(fut)
8738                }
8739                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8740                    #[allow(non_camel_case_types)]
8741                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8742                    impl<
8743                        T: IntegrationsService,
8744                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8745                    for UpsertReachabilitySvc<T> {
8746                        type Response = super::UpsertReachabilityResponse;
8747                        type Future = BoxFuture<
8748                            tonic::Response<Self::Response>,
8749                            tonic::Status,
8750                        >;
8751                        fn call(
8752                            &mut self,
8753                            request: tonic::Request<super::UpsertReachabilityRequest>,
8754                        ) -> Self::Future {
8755                            let inner = Arc::clone(&self.0);
8756                            let fut = async move {
8757                                <T as IntegrationsService>::upsert_reachability(
8758                                        &inner,
8759                                        request,
8760                                    )
8761                                    .await
8762                            };
8763                            Box::pin(fut)
8764                        }
8765                    }
8766                    let accept_compression_encodings = self.accept_compression_encodings;
8767                    let send_compression_encodings = self.send_compression_encodings;
8768                    let max_decoding_message_size = self.max_decoding_message_size;
8769                    let max_encoding_message_size = self.max_encoding_message_size;
8770                    let inner = self.inner.clone();
8771                    let fut = async move {
8772                        let method = UpsertReachabilitySvc(inner);
8773                        let codec = tonic_prost::ProstCodec::default();
8774                        let mut grpc = tonic::server::Grpc::new(codec)
8775                            .apply_compression_config(
8776                                accept_compression_encodings,
8777                                send_compression_encodings,
8778                            )
8779                            .apply_max_message_size_config(
8780                                max_decoding_message_size,
8781                                max_encoding_message_size,
8782                            );
8783                        let res = grpc.unary(method, req).await;
8784                        Ok(res)
8785                    };
8786                    Box::pin(fut)
8787                }
8788                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8789                    #[allow(non_camel_case_types)]
8790                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8791                    impl<
8792                        T: IntegrationsService,
8793                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8794                    for RemoveReachabilitySvc<T> {
8795                        type Response = super::RemoveReachabilityResponse;
8796                        type Future = BoxFuture<
8797                            tonic::Response<Self::Response>,
8798                            tonic::Status,
8799                        >;
8800                        fn call(
8801                            &mut self,
8802                            request: tonic::Request<super::RemoveReachabilityRequest>,
8803                        ) -> Self::Future {
8804                            let inner = Arc::clone(&self.0);
8805                            let fut = async move {
8806                                <T as IntegrationsService>::remove_reachability(
8807                                        &inner,
8808                                        request,
8809                                    )
8810                                    .await
8811                            };
8812                            Box::pin(fut)
8813                        }
8814                    }
8815                    let accept_compression_encodings = self.accept_compression_encodings;
8816                    let send_compression_encodings = self.send_compression_encodings;
8817                    let max_decoding_message_size = self.max_decoding_message_size;
8818                    let max_encoding_message_size = self.max_encoding_message_size;
8819                    let inner = self.inner.clone();
8820                    let fut = async move {
8821                        let method = RemoveReachabilitySvc(inner);
8822                        let codec = tonic_prost::ProstCodec::default();
8823                        let mut grpc = tonic::server::Grpc::new(codec)
8824                            .apply_compression_config(
8825                                accept_compression_encodings,
8826                                send_compression_encodings,
8827                            )
8828                            .apply_max_message_size_config(
8829                                max_decoding_message_size,
8830                                max_encoding_message_size,
8831                            );
8832                        let res = grpc.unary(method, req).await;
8833                        Ok(res)
8834                    };
8835                    Box::pin(fut)
8836                }
8837                "/pidgr.v1.IntegrationsService/GetReachability" => {
8838                    #[allow(non_camel_case_types)]
8839                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8840                    impl<
8841                        T: IntegrationsService,
8842                    > tonic::server::UnaryService<super::GetReachabilityRequest>
8843                    for GetReachabilitySvc<T> {
8844                        type Response = super::GetReachabilityResponse;
8845                        type Future = BoxFuture<
8846                            tonic::Response<Self::Response>,
8847                            tonic::Status,
8848                        >;
8849                        fn call(
8850                            &mut self,
8851                            request: tonic::Request<super::GetReachabilityRequest>,
8852                        ) -> Self::Future {
8853                            let inner = Arc::clone(&self.0);
8854                            let fut = async move {
8855                                <T as IntegrationsService>::get_reachability(
8856                                        &inner,
8857                                        request,
8858                                    )
8859                                    .await
8860                            };
8861                            Box::pin(fut)
8862                        }
8863                    }
8864                    let accept_compression_encodings = self.accept_compression_encodings;
8865                    let send_compression_encodings = self.send_compression_encodings;
8866                    let max_decoding_message_size = self.max_decoding_message_size;
8867                    let max_encoding_message_size = self.max_encoding_message_size;
8868                    let inner = self.inner.clone();
8869                    let fut = async move {
8870                        let method = GetReachabilitySvc(inner);
8871                        let codec = tonic_prost::ProstCodec::default();
8872                        let mut grpc = tonic::server::Grpc::new(codec)
8873                            .apply_compression_config(
8874                                accept_compression_encodings,
8875                                send_compression_encodings,
8876                            )
8877                            .apply_max_message_size_config(
8878                                max_decoding_message_size,
8879                                max_encoding_message_size,
8880                            );
8881                        let res = grpc.unary(method, req).await;
8882                        Ok(res)
8883                    };
8884                    Box::pin(fut)
8885                }
8886                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8887                    #[allow(non_camel_case_types)]
8888                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
8889                        pub Arc<T>,
8890                    );
8891                    impl<
8892                        T: IntegrationsService,
8893                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8894                    for ListReachabilityForUserSvc<T> {
8895                        type Response = super::ListReachabilityForUserResponse;
8896                        type Future = BoxFuture<
8897                            tonic::Response<Self::Response>,
8898                            tonic::Status,
8899                        >;
8900                        fn call(
8901                            &mut self,
8902                            request: tonic::Request<
8903                                super::ListReachabilityForUserRequest,
8904                            >,
8905                        ) -> Self::Future {
8906                            let inner = Arc::clone(&self.0);
8907                            let fut = async move {
8908                                <T as IntegrationsService>::list_reachability_for_user(
8909                                        &inner,
8910                                        request,
8911                                    )
8912                                    .await
8913                            };
8914                            Box::pin(fut)
8915                        }
8916                    }
8917                    let accept_compression_encodings = self.accept_compression_encodings;
8918                    let send_compression_encodings = self.send_compression_encodings;
8919                    let max_decoding_message_size = self.max_decoding_message_size;
8920                    let max_encoding_message_size = self.max_encoding_message_size;
8921                    let inner = self.inner.clone();
8922                    let fut = async move {
8923                        let method = ListReachabilityForUserSvc(inner);
8924                        let codec = tonic_prost::ProstCodec::default();
8925                        let mut grpc = tonic::server::Grpc::new(codec)
8926                            .apply_compression_config(
8927                                accept_compression_encodings,
8928                                send_compression_encodings,
8929                            )
8930                            .apply_max_message_size_config(
8931                                max_decoding_message_size,
8932                                max_encoding_message_size,
8933                            );
8934                        let res = grpc.unary(method, req).await;
8935                        Ok(res)
8936                    };
8937                    Box::pin(fut)
8938                }
8939                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
8940                    #[allow(non_camel_case_types)]
8941                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8942                    impl<
8943                        T: IntegrationsService,
8944                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
8945                    for GetRegionPolicySvc<T> {
8946                        type Response = super::GetRegionPolicyResponse;
8947                        type Future = BoxFuture<
8948                            tonic::Response<Self::Response>,
8949                            tonic::Status,
8950                        >;
8951                        fn call(
8952                            &mut self,
8953                            request: tonic::Request<super::GetRegionPolicyRequest>,
8954                        ) -> Self::Future {
8955                            let inner = Arc::clone(&self.0);
8956                            let fut = async move {
8957                                <T as IntegrationsService>::get_region_policy(
8958                                        &inner,
8959                                        request,
8960                                    )
8961                                    .await
8962                            };
8963                            Box::pin(fut)
8964                        }
8965                    }
8966                    let accept_compression_encodings = self.accept_compression_encodings;
8967                    let send_compression_encodings = self.send_compression_encodings;
8968                    let max_decoding_message_size = self.max_decoding_message_size;
8969                    let max_encoding_message_size = self.max_encoding_message_size;
8970                    let inner = self.inner.clone();
8971                    let fut = async move {
8972                        let method = GetRegionPolicySvc(inner);
8973                        let codec = tonic_prost::ProstCodec::default();
8974                        let mut grpc = tonic::server::Grpc::new(codec)
8975                            .apply_compression_config(
8976                                accept_compression_encodings,
8977                                send_compression_encodings,
8978                            )
8979                            .apply_max_message_size_config(
8980                                max_decoding_message_size,
8981                                max_encoding_message_size,
8982                            );
8983                        let res = grpc.unary(method, req).await;
8984                        Ok(res)
8985                    };
8986                    Box::pin(fut)
8987                }
8988                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
8989                    #[allow(non_camel_case_types)]
8990                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8991                    impl<
8992                        T: IntegrationsService,
8993                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
8994                    for SetRegionPolicySvc<T> {
8995                        type Response = super::SetRegionPolicyResponse;
8996                        type Future = BoxFuture<
8997                            tonic::Response<Self::Response>,
8998                            tonic::Status,
8999                        >;
9000                        fn call(
9001                            &mut self,
9002                            request: tonic::Request<super::SetRegionPolicyRequest>,
9003                        ) -> Self::Future {
9004                            let inner = Arc::clone(&self.0);
9005                            let fut = async move {
9006                                <T as IntegrationsService>::set_region_policy(
9007                                        &inner,
9008                                        request,
9009                                    )
9010                                    .await
9011                            };
9012                            Box::pin(fut)
9013                        }
9014                    }
9015                    let accept_compression_encodings = self.accept_compression_encodings;
9016                    let send_compression_encodings = self.send_compression_encodings;
9017                    let max_decoding_message_size = self.max_decoding_message_size;
9018                    let max_encoding_message_size = self.max_encoding_message_size;
9019                    let inner = self.inner.clone();
9020                    let fut = async move {
9021                        let method = SetRegionPolicySvc(inner);
9022                        let codec = tonic_prost::ProstCodec::default();
9023                        let mut grpc = tonic::server::Grpc::new(codec)
9024                            .apply_compression_config(
9025                                accept_compression_encodings,
9026                                send_compression_encodings,
9027                            )
9028                            .apply_max_message_size_config(
9029                                max_decoding_message_size,
9030                                max_encoding_message_size,
9031                            );
9032                        let res = grpc.unary(method, req).await;
9033                        Ok(res)
9034                    };
9035                    Box::pin(fut)
9036                }
9037                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
9038                    #[allow(non_camel_case_types)]
9039                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9040                    impl<
9041                        T: IntegrationsService,
9042                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
9043                    for GetCostCapPolicySvc<T> {
9044                        type Response = super::GetCostCapPolicyResponse;
9045                        type Future = BoxFuture<
9046                            tonic::Response<Self::Response>,
9047                            tonic::Status,
9048                        >;
9049                        fn call(
9050                            &mut self,
9051                            request: tonic::Request<super::GetCostCapPolicyRequest>,
9052                        ) -> Self::Future {
9053                            let inner = Arc::clone(&self.0);
9054                            let fut = async move {
9055                                <T as IntegrationsService>::get_cost_cap_policy(
9056                                        &inner,
9057                                        request,
9058                                    )
9059                                    .await
9060                            };
9061                            Box::pin(fut)
9062                        }
9063                    }
9064                    let accept_compression_encodings = self.accept_compression_encodings;
9065                    let send_compression_encodings = self.send_compression_encodings;
9066                    let max_decoding_message_size = self.max_decoding_message_size;
9067                    let max_encoding_message_size = self.max_encoding_message_size;
9068                    let inner = self.inner.clone();
9069                    let fut = async move {
9070                        let method = GetCostCapPolicySvc(inner);
9071                        let codec = tonic_prost::ProstCodec::default();
9072                        let mut grpc = tonic::server::Grpc::new(codec)
9073                            .apply_compression_config(
9074                                accept_compression_encodings,
9075                                send_compression_encodings,
9076                            )
9077                            .apply_max_message_size_config(
9078                                max_decoding_message_size,
9079                                max_encoding_message_size,
9080                            );
9081                        let res = grpc.unary(method, req).await;
9082                        Ok(res)
9083                    };
9084                    Box::pin(fut)
9085                }
9086                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
9087                    #[allow(non_camel_case_types)]
9088                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9089                    impl<
9090                        T: IntegrationsService,
9091                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9092                    for SetCostCapPolicySvc<T> {
9093                        type Response = super::SetCostCapPolicyResponse;
9094                        type Future = BoxFuture<
9095                            tonic::Response<Self::Response>,
9096                            tonic::Status,
9097                        >;
9098                        fn call(
9099                            &mut self,
9100                            request: tonic::Request<super::SetCostCapPolicyRequest>,
9101                        ) -> Self::Future {
9102                            let inner = Arc::clone(&self.0);
9103                            let fut = async move {
9104                                <T as IntegrationsService>::set_cost_cap_policy(
9105                                        &inner,
9106                                        request,
9107                                    )
9108                                    .await
9109                            };
9110                            Box::pin(fut)
9111                        }
9112                    }
9113                    let accept_compression_encodings = self.accept_compression_encodings;
9114                    let send_compression_encodings = self.send_compression_encodings;
9115                    let max_decoding_message_size = self.max_decoding_message_size;
9116                    let max_encoding_message_size = self.max_encoding_message_size;
9117                    let inner = self.inner.clone();
9118                    let fut = async move {
9119                        let method = SetCostCapPolicySvc(inner);
9120                        let codec = tonic_prost::ProstCodec::default();
9121                        let mut grpc = tonic::server::Grpc::new(codec)
9122                            .apply_compression_config(
9123                                accept_compression_encodings,
9124                                send_compression_encodings,
9125                            )
9126                            .apply_max_message_size_config(
9127                                max_decoding_message_size,
9128                                max_encoding_message_size,
9129                            );
9130                        let res = grpc.unary(method, req).await;
9131                        Ok(res)
9132                    };
9133                    Box::pin(fut)
9134                }
9135                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9136                    #[allow(non_camel_case_types)]
9137                    struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9138                    impl<
9139                        T: IntegrationsService,
9140                    > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9141                    for GetOrgWebhookConfigSvc<T> {
9142                        type Response = super::GetOrgWebhookConfigResponse;
9143                        type Future = BoxFuture<
9144                            tonic::Response<Self::Response>,
9145                            tonic::Status,
9146                        >;
9147                        fn call(
9148                            &mut self,
9149                            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9150                        ) -> Self::Future {
9151                            let inner = Arc::clone(&self.0);
9152                            let fut = async move {
9153                                <T as IntegrationsService>::get_org_webhook_config(
9154                                        &inner,
9155                                        request,
9156                                    )
9157                                    .await
9158                            };
9159                            Box::pin(fut)
9160                        }
9161                    }
9162                    let accept_compression_encodings = self.accept_compression_encodings;
9163                    let send_compression_encodings = self.send_compression_encodings;
9164                    let max_decoding_message_size = self.max_decoding_message_size;
9165                    let max_encoding_message_size = self.max_encoding_message_size;
9166                    let inner = self.inner.clone();
9167                    let fut = async move {
9168                        let method = GetOrgWebhookConfigSvc(inner);
9169                        let codec = tonic_prost::ProstCodec::default();
9170                        let mut grpc = tonic::server::Grpc::new(codec)
9171                            .apply_compression_config(
9172                                accept_compression_encodings,
9173                                send_compression_encodings,
9174                            )
9175                            .apply_max_message_size_config(
9176                                max_decoding_message_size,
9177                                max_encoding_message_size,
9178                            );
9179                        let res = grpc.unary(method, req).await;
9180                        Ok(res)
9181                    };
9182                    Box::pin(fut)
9183                }
9184                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9185                    #[allow(non_camel_case_types)]
9186                    struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9187                    impl<
9188                        T: IntegrationsService,
9189                    > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9190                    for SetOrgWebhookConfigSvc<T> {
9191                        type Response = super::SetOrgWebhookConfigResponse;
9192                        type Future = BoxFuture<
9193                            tonic::Response<Self::Response>,
9194                            tonic::Status,
9195                        >;
9196                        fn call(
9197                            &mut self,
9198                            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9199                        ) -> Self::Future {
9200                            let inner = Arc::clone(&self.0);
9201                            let fut = async move {
9202                                <T as IntegrationsService>::set_org_webhook_config(
9203                                        &inner,
9204                                        request,
9205                                    )
9206                                    .await
9207                            };
9208                            Box::pin(fut)
9209                        }
9210                    }
9211                    let accept_compression_encodings = self.accept_compression_encodings;
9212                    let send_compression_encodings = self.send_compression_encodings;
9213                    let max_decoding_message_size = self.max_decoding_message_size;
9214                    let max_encoding_message_size = self.max_encoding_message_size;
9215                    let inner = self.inner.clone();
9216                    let fut = async move {
9217                        let method = SetOrgWebhookConfigSvc(inner);
9218                        let codec = tonic_prost::ProstCodec::default();
9219                        let mut grpc = tonic::server::Grpc::new(codec)
9220                            .apply_compression_config(
9221                                accept_compression_encodings,
9222                                send_compression_encodings,
9223                            )
9224                            .apply_max_message_size_config(
9225                                max_decoding_message_size,
9226                                max_encoding_message_size,
9227                            );
9228                        let res = grpc.unary(method, req).await;
9229                        Ok(res)
9230                    };
9231                    Box::pin(fut)
9232                }
9233                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9234                    #[allow(non_camel_case_types)]
9235                    struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9236                        pub Arc<T>,
9237                    );
9238                    impl<
9239                        T: IntegrationsService,
9240                    > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9241                    for CreateChannelConnectLinkSvc<T> {
9242                        type Response = super::CreateChannelConnectLinkResponse;
9243                        type Future = BoxFuture<
9244                            tonic::Response<Self::Response>,
9245                            tonic::Status,
9246                        >;
9247                        fn call(
9248                            &mut self,
9249                            request: tonic::Request<
9250                                super::CreateChannelConnectLinkRequest,
9251                            >,
9252                        ) -> Self::Future {
9253                            let inner = Arc::clone(&self.0);
9254                            let fut = async move {
9255                                <T as IntegrationsService>::create_channel_connect_link(
9256                                        &inner,
9257                                        request,
9258                                    )
9259                                    .await
9260                            };
9261                            Box::pin(fut)
9262                        }
9263                    }
9264                    let accept_compression_encodings = self.accept_compression_encodings;
9265                    let send_compression_encodings = self.send_compression_encodings;
9266                    let max_decoding_message_size = self.max_decoding_message_size;
9267                    let max_encoding_message_size = self.max_encoding_message_size;
9268                    let inner = self.inner.clone();
9269                    let fut = async move {
9270                        let method = CreateChannelConnectLinkSvc(inner);
9271                        let codec = tonic_prost::ProstCodec::default();
9272                        let mut grpc = tonic::server::Grpc::new(codec)
9273                            .apply_compression_config(
9274                                accept_compression_encodings,
9275                                send_compression_encodings,
9276                            )
9277                            .apply_max_message_size_config(
9278                                max_decoding_message_size,
9279                                max_encoding_message_size,
9280                            );
9281                        let res = grpc.unary(method, req).await;
9282                        Ok(res)
9283                    };
9284                    Box::pin(fut)
9285                }
9286                _ => {
9287                    Box::pin(async move {
9288                        let mut response = http::Response::new(
9289                            tonic::body::Body::default(),
9290                        );
9291                        let headers = response.headers_mut();
9292                        headers
9293                            .insert(
9294                                tonic::Status::GRPC_STATUS,
9295                                (tonic::Code::Unimplemented as i32).into(),
9296                            );
9297                        headers
9298                            .insert(
9299                                http::header::CONTENT_TYPE,
9300                                tonic::metadata::GRPC_CONTENT_TYPE,
9301                            );
9302                        Ok(response)
9303                    })
9304                }
9305            }
9306        }
9307    }
9308    impl<T> Clone for IntegrationsServiceServer<T> {
9309        fn clone(&self) -> Self {
9310            let inner = self.inner.clone();
9311            Self {
9312                inner,
9313                accept_compression_encodings: self.accept_compression_encodings,
9314                send_compression_encodings: self.send_compression_encodings,
9315                max_decoding_message_size: self.max_decoding_message_size,
9316                max_encoding_message_size: self.max_encoding_message_size,
9317            }
9318        }
9319    }
9320    /// Generated gRPC service name
9321    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9322    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9323        const NAME: &'static str = SERVICE_NAME;
9324    }
9325}
9326/// Generated client implementations.
9327pub mod invite_link_service_client {
9328    #![allow(
9329        unused_variables,
9330        dead_code,
9331        missing_docs,
9332        clippy::wildcard_imports,
9333        clippy::let_unit_value,
9334    )]
9335    use tonic::codegen::*;
9336    use tonic::codegen::http::Uri;
9337    /** Manages shareable invite links for organization self-join.
9338 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9339 ValidateInviteLink is unauthenticated — the token IS the authorization.
9340 RedeemInviteLink requires a valid JWT.
9341*/
9342    #[derive(Debug, Clone)]
9343    pub struct InviteLinkServiceClient<T> {
9344        inner: tonic::client::Grpc<T>,
9345    }
9346    impl InviteLinkServiceClient<tonic::transport::Channel> {
9347        /// Attempt to create a new client by connecting to a given endpoint.
9348        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9349        where
9350            D: TryInto<tonic::transport::Endpoint>,
9351            D::Error: Into<StdError>,
9352        {
9353            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9354            Ok(Self::new(conn))
9355        }
9356    }
9357    impl<T> InviteLinkServiceClient<T>
9358    where
9359        T: tonic::client::GrpcService<tonic::body::Body>,
9360        T::Error: Into<StdError>,
9361        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9362        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9363    {
9364        pub fn new(inner: T) -> Self {
9365            let inner = tonic::client::Grpc::new(inner);
9366            Self { inner }
9367        }
9368        pub fn with_origin(inner: T, origin: Uri) -> Self {
9369            let inner = tonic::client::Grpc::with_origin(inner, origin);
9370            Self { inner }
9371        }
9372        pub fn with_interceptor<F>(
9373            inner: T,
9374            interceptor: F,
9375        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9376        where
9377            F: tonic::service::Interceptor,
9378            T::ResponseBody: Default,
9379            T: tonic::codegen::Service<
9380                http::Request<tonic::body::Body>,
9381                Response = http::Response<
9382                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9383                >,
9384            >,
9385            <T as tonic::codegen::Service<
9386                http::Request<tonic::body::Body>,
9387            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9388        {
9389            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9390        }
9391        /// Compress requests with the given encoding.
9392        ///
9393        /// This requires the server to support it otherwise it might respond with an
9394        /// error.
9395        #[must_use]
9396        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9397            self.inner = self.inner.send_compressed(encoding);
9398            self
9399        }
9400        /// Enable decompressing responses.
9401        #[must_use]
9402        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9403            self.inner = self.inner.accept_compressed(encoding);
9404            self
9405        }
9406        /// Limits the maximum size of a decoded message.
9407        ///
9408        /// Default: `4MB`
9409        #[must_use]
9410        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9411            self.inner = self.inner.max_decoding_message_size(limit);
9412            self
9413        }
9414        /// Limits the maximum size of an encoded message.
9415        ///
9416        /// Default: `usize::MAX`
9417        #[must_use]
9418        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9419            self.inner = self.inner.max_encoding_message_size(limit);
9420            self
9421        }
9422        /** Create a new shareable invite link for the organization.
9423 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9424*/
9425        pub async fn create_invite_link(
9426            &mut self,
9427            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9428        ) -> std::result::Result<
9429            tonic::Response<super::CreateInviteLinkResponse>,
9430            tonic::Status,
9431        > {
9432            self.inner
9433                .ready()
9434                .await
9435                .map_err(|e| {
9436                    tonic::Status::unknown(
9437                        format!("Service was not ready: {}", e.into()),
9438                    )
9439                })?;
9440            let codec = tonic_prost::ProstCodec::default();
9441            let path = http::uri::PathAndQuery::from_static(
9442                "/pidgr.v1.InviteLinkService/CreateInviteLink",
9443            );
9444            let mut req = request.into_request();
9445            req.extensions_mut()
9446                .insert(
9447                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9448                );
9449            self.inner.unary(req, path, codec).await
9450        }
9451        /** List all invite links for the organization.
9452 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9453*/
9454        pub async fn list_invite_links(
9455            &mut self,
9456            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9457        ) -> std::result::Result<
9458            tonic::Response<super::ListInviteLinksResponse>,
9459            tonic::Status,
9460        > {
9461            self.inner
9462                .ready()
9463                .await
9464                .map_err(|e| {
9465                    tonic::Status::unknown(
9466                        format!("Service was not ready: {}", e.into()),
9467                    )
9468                })?;
9469            let codec = tonic_prost::ProstCodec::default();
9470            let path = http::uri::PathAndQuery::from_static(
9471                "/pidgr.v1.InviteLinkService/ListInviteLinks",
9472            );
9473            let mut req = request.into_request();
9474            req.extensions_mut()
9475                .insert(
9476                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9477                );
9478            self.inner.unary(req, path, codec).await
9479        }
9480        /** Revoke an invite link, making it immediately unusable. Idempotent.
9481 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9482*/
9483        pub async fn revoke_invite_link(
9484            &mut self,
9485            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9486        ) -> std::result::Result<
9487            tonic::Response<super::RevokeInviteLinkResponse>,
9488            tonic::Status,
9489        > {
9490            self.inner
9491                .ready()
9492                .await
9493                .map_err(|e| {
9494                    tonic::Status::unknown(
9495                        format!("Service was not ready: {}", e.into()),
9496                    )
9497                })?;
9498            let codec = tonic_prost::ProstCodec::default();
9499            let path = http::uri::PathAndQuery::from_static(
9500                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9501            );
9502            let mut req = request.into_request();
9503            req.extensions_mut()
9504                .insert(
9505                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9506                );
9507            self.inner.unary(req, path, codec).await
9508        }
9509        /** Validate an invite link and provision a user account if needed.
9510 This is a pre-authentication endpoint — no JWT required.
9511 Rate limited to 10 requests per minute per IP.
9512 Authorization: None (token-based).
9513*/
9514        pub async fn validate_invite_link(
9515            &mut self,
9516            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9517        ) -> std::result::Result<
9518            tonic::Response<super::ValidateInviteLinkResponse>,
9519            tonic::Status,
9520        > {
9521            self.inner
9522                .ready()
9523                .await
9524                .map_err(|e| {
9525                    tonic::Status::unknown(
9526                        format!("Service was not ready: {}", e.into()),
9527                    )
9528                })?;
9529            let codec = tonic_prost::ProstCodec::default();
9530            let path = http::uri::PathAndQuery::from_static(
9531                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9532            );
9533            let mut req = request.into_request();
9534            req.extensions_mut()
9535                .insert(
9536                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9537                );
9538            self.inner.unary(req, path, codec).await
9539        }
9540        /** Redeem an invite link to join an organization.
9541 Requires a valid JWT — the email is extracted from the token.
9542 Authorization: JWT required.
9543*/
9544        pub async fn redeem_invite_link(
9545            &mut self,
9546            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9547        ) -> std::result::Result<
9548            tonic::Response<super::RedeemInviteLinkResponse>,
9549            tonic::Status,
9550        > {
9551            self.inner
9552                .ready()
9553                .await
9554                .map_err(|e| {
9555                    tonic::Status::unknown(
9556                        format!("Service was not ready: {}", e.into()),
9557                    )
9558                })?;
9559            let codec = tonic_prost::ProstCodec::default();
9560            let path = http::uri::PathAndQuery::from_static(
9561                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9562            );
9563            let mut req = request.into_request();
9564            req.extensions_mut()
9565                .insert(
9566                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9567                );
9568            self.inner.unary(req, path, codec).await
9569        }
9570    }
9571}
9572/// Generated server implementations.
9573pub mod invite_link_service_server {
9574    #![allow(
9575        unused_variables,
9576        dead_code,
9577        missing_docs,
9578        clippy::wildcard_imports,
9579        clippy::let_unit_value,
9580    )]
9581    use tonic::codegen::*;
9582    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
9583    #[async_trait]
9584    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9585        /** Create a new shareable invite link for the organization.
9586 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9587*/
9588        async fn create_invite_link(
9589            &self,
9590            request: tonic::Request<super::CreateInviteLinkRequest>,
9591        ) -> std::result::Result<
9592            tonic::Response<super::CreateInviteLinkResponse>,
9593            tonic::Status,
9594        >;
9595        /** List all invite links for the organization.
9596 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9597*/
9598        async fn list_invite_links(
9599            &self,
9600            request: tonic::Request<super::ListInviteLinksRequest>,
9601        ) -> std::result::Result<
9602            tonic::Response<super::ListInviteLinksResponse>,
9603            tonic::Status,
9604        >;
9605        /** Revoke an invite link, making it immediately unusable. Idempotent.
9606 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9607*/
9608        async fn revoke_invite_link(
9609            &self,
9610            request: tonic::Request<super::RevokeInviteLinkRequest>,
9611        ) -> std::result::Result<
9612            tonic::Response<super::RevokeInviteLinkResponse>,
9613            tonic::Status,
9614        >;
9615        /** Validate an invite link and provision a user account if needed.
9616 This is a pre-authentication endpoint — no JWT required.
9617 Rate limited to 10 requests per minute per IP.
9618 Authorization: None (token-based).
9619*/
9620        async fn validate_invite_link(
9621            &self,
9622            request: tonic::Request<super::ValidateInviteLinkRequest>,
9623        ) -> std::result::Result<
9624            tonic::Response<super::ValidateInviteLinkResponse>,
9625            tonic::Status,
9626        >;
9627        /** Redeem an invite link to join an organization.
9628 Requires a valid JWT — the email is extracted from the token.
9629 Authorization: JWT required.
9630*/
9631        async fn redeem_invite_link(
9632            &self,
9633            request: tonic::Request<super::RedeemInviteLinkRequest>,
9634        ) -> std::result::Result<
9635            tonic::Response<super::RedeemInviteLinkResponse>,
9636            tonic::Status,
9637        >;
9638    }
9639    /** Manages shareable invite links for organization self-join.
9640 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9641 ValidateInviteLink is unauthenticated — the token IS the authorization.
9642 RedeemInviteLink requires a valid JWT.
9643*/
9644    #[derive(Debug)]
9645    pub struct InviteLinkServiceServer<T> {
9646        inner: Arc<T>,
9647        accept_compression_encodings: EnabledCompressionEncodings,
9648        send_compression_encodings: EnabledCompressionEncodings,
9649        max_decoding_message_size: Option<usize>,
9650        max_encoding_message_size: Option<usize>,
9651    }
9652    impl<T> InviteLinkServiceServer<T> {
9653        pub fn new(inner: T) -> Self {
9654            Self::from_arc(Arc::new(inner))
9655        }
9656        pub fn from_arc(inner: Arc<T>) -> Self {
9657            Self {
9658                inner,
9659                accept_compression_encodings: Default::default(),
9660                send_compression_encodings: Default::default(),
9661                max_decoding_message_size: None,
9662                max_encoding_message_size: None,
9663            }
9664        }
9665        pub fn with_interceptor<F>(
9666            inner: T,
9667            interceptor: F,
9668        ) -> InterceptedService<Self, F>
9669        where
9670            F: tonic::service::Interceptor,
9671        {
9672            InterceptedService::new(Self::new(inner), interceptor)
9673        }
9674        /// Enable decompressing requests with the given encoding.
9675        #[must_use]
9676        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9677            self.accept_compression_encodings.enable(encoding);
9678            self
9679        }
9680        /// Compress responses with the given encoding, if the client supports it.
9681        #[must_use]
9682        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9683            self.send_compression_encodings.enable(encoding);
9684            self
9685        }
9686        /// Limits the maximum size of a decoded message.
9687        ///
9688        /// Default: `4MB`
9689        #[must_use]
9690        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9691            self.max_decoding_message_size = Some(limit);
9692            self
9693        }
9694        /// Limits the maximum size of an encoded message.
9695        ///
9696        /// Default: `usize::MAX`
9697        #[must_use]
9698        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9699            self.max_encoding_message_size = Some(limit);
9700            self
9701        }
9702    }
9703    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9704    where
9705        T: InviteLinkService,
9706        B: Body + std::marker::Send + 'static,
9707        B::Error: Into<StdError> + std::marker::Send + 'static,
9708    {
9709        type Response = http::Response<tonic::body::Body>;
9710        type Error = std::convert::Infallible;
9711        type Future = BoxFuture<Self::Response, Self::Error>;
9712        fn poll_ready(
9713            &mut self,
9714            _cx: &mut Context<'_>,
9715        ) -> Poll<std::result::Result<(), Self::Error>> {
9716            Poll::Ready(Ok(()))
9717        }
9718        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9719            match req.uri().path() {
9720                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9721                    #[allow(non_camel_case_types)]
9722                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9723                    impl<
9724                        T: InviteLinkService,
9725                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9726                    for CreateInviteLinkSvc<T> {
9727                        type Response = super::CreateInviteLinkResponse;
9728                        type Future = BoxFuture<
9729                            tonic::Response<Self::Response>,
9730                            tonic::Status,
9731                        >;
9732                        fn call(
9733                            &mut self,
9734                            request: tonic::Request<super::CreateInviteLinkRequest>,
9735                        ) -> Self::Future {
9736                            let inner = Arc::clone(&self.0);
9737                            let fut = async move {
9738                                <T as InviteLinkService>::create_invite_link(
9739                                        &inner,
9740                                        request,
9741                                    )
9742                                    .await
9743                            };
9744                            Box::pin(fut)
9745                        }
9746                    }
9747                    let accept_compression_encodings = self.accept_compression_encodings;
9748                    let send_compression_encodings = self.send_compression_encodings;
9749                    let max_decoding_message_size = self.max_decoding_message_size;
9750                    let max_encoding_message_size = self.max_encoding_message_size;
9751                    let inner = self.inner.clone();
9752                    let fut = async move {
9753                        let method = CreateInviteLinkSvc(inner);
9754                        let codec = tonic_prost::ProstCodec::default();
9755                        let mut grpc = tonic::server::Grpc::new(codec)
9756                            .apply_compression_config(
9757                                accept_compression_encodings,
9758                                send_compression_encodings,
9759                            )
9760                            .apply_max_message_size_config(
9761                                max_decoding_message_size,
9762                                max_encoding_message_size,
9763                            );
9764                        let res = grpc.unary(method, req).await;
9765                        Ok(res)
9766                    };
9767                    Box::pin(fut)
9768                }
9769                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9770                    #[allow(non_camel_case_types)]
9771                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9772                    impl<
9773                        T: InviteLinkService,
9774                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
9775                    for ListInviteLinksSvc<T> {
9776                        type Response = super::ListInviteLinksResponse;
9777                        type Future = BoxFuture<
9778                            tonic::Response<Self::Response>,
9779                            tonic::Status,
9780                        >;
9781                        fn call(
9782                            &mut self,
9783                            request: tonic::Request<super::ListInviteLinksRequest>,
9784                        ) -> Self::Future {
9785                            let inner = Arc::clone(&self.0);
9786                            let fut = async move {
9787                                <T as InviteLinkService>::list_invite_links(&inner, request)
9788                                    .await
9789                            };
9790                            Box::pin(fut)
9791                        }
9792                    }
9793                    let accept_compression_encodings = self.accept_compression_encodings;
9794                    let send_compression_encodings = self.send_compression_encodings;
9795                    let max_decoding_message_size = self.max_decoding_message_size;
9796                    let max_encoding_message_size = self.max_encoding_message_size;
9797                    let inner = self.inner.clone();
9798                    let fut = async move {
9799                        let method = ListInviteLinksSvc(inner);
9800                        let codec = tonic_prost::ProstCodec::default();
9801                        let mut grpc = tonic::server::Grpc::new(codec)
9802                            .apply_compression_config(
9803                                accept_compression_encodings,
9804                                send_compression_encodings,
9805                            )
9806                            .apply_max_message_size_config(
9807                                max_decoding_message_size,
9808                                max_encoding_message_size,
9809                            );
9810                        let res = grpc.unary(method, req).await;
9811                        Ok(res)
9812                    };
9813                    Box::pin(fut)
9814                }
9815                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
9816                    #[allow(non_camel_case_types)]
9817                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9818                    impl<
9819                        T: InviteLinkService,
9820                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
9821                    for RevokeInviteLinkSvc<T> {
9822                        type Response = super::RevokeInviteLinkResponse;
9823                        type Future = BoxFuture<
9824                            tonic::Response<Self::Response>,
9825                            tonic::Status,
9826                        >;
9827                        fn call(
9828                            &mut self,
9829                            request: tonic::Request<super::RevokeInviteLinkRequest>,
9830                        ) -> Self::Future {
9831                            let inner = Arc::clone(&self.0);
9832                            let fut = async move {
9833                                <T as InviteLinkService>::revoke_invite_link(
9834                                        &inner,
9835                                        request,
9836                                    )
9837                                    .await
9838                            };
9839                            Box::pin(fut)
9840                        }
9841                    }
9842                    let accept_compression_encodings = self.accept_compression_encodings;
9843                    let send_compression_encodings = self.send_compression_encodings;
9844                    let max_decoding_message_size = self.max_decoding_message_size;
9845                    let max_encoding_message_size = self.max_encoding_message_size;
9846                    let inner = self.inner.clone();
9847                    let fut = async move {
9848                        let method = RevokeInviteLinkSvc(inner);
9849                        let codec = tonic_prost::ProstCodec::default();
9850                        let mut grpc = tonic::server::Grpc::new(codec)
9851                            .apply_compression_config(
9852                                accept_compression_encodings,
9853                                send_compression_encodings,
9854                            )
9855                            .apply_max_message_size_config(
9856                                max_decoding_message_size,
9857                                max_encoding_message_size,
9858                            );
9859                        let res = grpc.unary(method, req).await;
9860                        Ok(res)
9861                    };
9862                    Box::pin(fut)
9863                }
9864                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
9865                    #[allow(non_camel_case_types)]
9866                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9867                    impl<
9868                        T: InviteLinkService,
9869                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
9870                    for ValidateInviteLinkSvc<T> {
9871                        type Response = super::ValidateInviteLinkResponse;
9872                        type Future = BoxFuture<
9873                            tonic::Response<Self::Response>,
9874                            tonic::Status,
9875                        >;
9876                        fn call(
9877                            &mut self,
9878                            request: tonic::Request<super::ValidateInviteLinkRequest>,
9879                        ) -> Self::Future {
9880                            let inner = Arc::clone(&self.0);
9881                            let fut = async move {
9882                                <T as InviteLinkService>::validate_invite_link(
9883                                        &inner,
9884                                        request,
9885                                    )
9886                                    .await
9887                            };
9888                            Box::pin(fut)
9889                        }
9890                    }
9891                    let accept_compression_encodings = self.accept_compression_encodings;
9892                    let send_compression_encodings = self.send_compression_encodings;
9893                    let max_decoding_message_size = self.max_decoding_message_size;
9894                    let max_encoding_message_size = self.max_encoding_message_size;
9895                    let inner = self.inner.clone();
9896                    let fut = async move {
9897                        let method = ValidateInviteLinkSvc(inner);
9898                        let codec = tonic_prost::ProstCodec::default();
9899                        let mut grpc = tonic::server::Grpc::new(codec)
9900                            .apply_compression_config(
9901                                accept_compression_encodings,
9902                                send_compression_encodings,
9903                            )
9904                            .apply_max_message_size_config(
9905                                max_decoding_message_size,
9906                                max_encoding_message_size,
9907                            );
9908                        let res = grpc.unary(method, req).await;
9909                        Ok(res)
9910                    };
9911                    Box::pin(fut)
9912                }
9913                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
9914                    #[allow(non_camel_case_types)]
9915                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9916                    impl<
9917                        T: InviteLinkService,
9918                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
9919                    for RedeemInviteLinkSvc<T> {
9920                        type Response = super::RedeemInviteLinkResponse;
9921                        type Future = BoxFuture<
9922                            tonic::Response<Self::Response>,
9923                            tonic::Status,
9924                        >;
9925                        fn call(
9926                            &mut self,
9927                            request: tonic::Request<super::RedeemInviteLinkRequest>,
9928                        ) -> Self::Future {
9929                            let inner = Arc::clone(&self.0);
9930                            let fut = async move {
9931                                <T as InviteLinkService>::redeem_invite_link(
9932                                        &inner,
9933                                        request,
9934                                    )
9935                                    .await
9936                            };
9937                            Box::pin(fut)
9938                        }
9939                    }
9940                    let accept_compression_encodings = self.accept_compression_encodings;
9941                    let send_compression_encodings = self.send_compression_encodings;
9942                    let max_decoding_message_size = self.max_decoding_message_size;
9943                    let max_encoding_message_size = self.max_encoding_message_size;
9944                    let inner = self.inner.clone();
9945                    let fut = async move {
9946                        let method = RedeemInviteLinkSvc(inner);
9947                        let codec = tonic_prost::ProstCodec::default();
9948                        let mut grpc = tonic::server::Grpc::new(codec)
9949                            .apply_compression_config(
9950                                accept_compression_encodings,
9951                                send_compression_encodings,
9952                            )
9953                            .apply_max_message_size_config(
9954                                max_decoding_message_size,
9955                                max_encoding_message_size,
9956                            );
9957                        let res = grpc.unary(method, req).await;
9958                        Ok(res)
9959                    };
9960                    Box::pin(fut)
9961                }
9962                _ => {
9963                    Box::pin(async move {
9964                        let mut response = http::Response::new(
9965                            tonic::body::Body::default(),
9966                        );
9967                        let headers = response.headers_mut();
9968                        headers
9969                            .insert(
9970                                tonic::Status::GRPC_STATUS,
9971                                (tonic::Code::Unimplemented as i32).into(),
9972                            );
9973                        headers
9974                            .insert(
9975                                http::header::CONTENT_TYPE,
9976                                tonic::metadata::GRPC_CONTENT_TYPE,
9977                            );
9978                        Ok(response)
9979                    })
9980                }
9981            }
9982        }
9983    }
9984    impl<T> Clone for InviteLinkServiceServer<T> {
9985        fn clone(&self) -> Self {
9986            let inner = self.inner.clone();
9987            Self {
9988                inner,
9989                accept_compression_encodings: self.accept_compression_encodings,
9990                send_compression_encodings: self.send_compression_encodings,
9991                max_decoding_message_size: self.max_decoding_message_size,
9992                max_encoding_message_size: self.max_encoding_message_size,
9993            }
9994        }
9995    }
9996    /// Generated gRPC service name
9997    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
9998    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
9999        const NAME: &'static str = SERVICE_NAME;
10000    }
10001}
10002/// Generated client implementations.
10003pub mod member_service_client {
10004    #![allow(
10005        unused_variables,
10006        dead_code,
10007        missing_docs,
10008        clippy::wildcard_imports,
10009        clippy::let_unit_value,
10010    )]
10011    use tonic::codegen::*;
10012    use tonic::codegen::http::Uri;
10013    /** Manages members (users) within an organization.
10014 All RPCs operate within the caller's org (extracted from JWT).
10015*/
10016    #[derive(Debug, Clone)]
10017    pub struct MemberServiceClient<T> {
10018        inner: tonic::client::Grpc<T>,
10019    }
10020    impl MemberServiceClient<tonic::transport::Channel> {
10021        /// Attempt to create a new client by connecting to a given endpoint.
10022        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10023        where
10024            D: TryInto<tonic::transport::Endpoint>,
10025            D::Error: Into<StdError>,
10026        {
10027            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10028            Ok(Self::new(conn))
10029        }
10030    }
10031    impl<T> MemberServiceClient<T>
10032    where
10033        T: tonic::client::GrpcService<tonic::body::Body>,
10034        T::Error: Into<StdError>,
10035        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10036        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10037    {
10038        pub fn new(inner: T) -> Self {
10039            let inner = tonic::client::Grpc::new(inner);
10040            Self { inner }
10041        }
10042        pub fn with_origin(inner: T, origin: Uri) -> Self {
10043            let inner = tonic::client::Grpc::with_origin(inner, origin);
10044            Self { inner }
10045        }
10046        pub fn with_interceptor<F>(
10047            inner: T,
10048            interceptor: F,
10049        ) -> MemberServiceClient<InterceptedService<T, F>>
10050        where
10051            F: tonic::service::Interceptor,
10052            T::ResponseBody: Default,
10053            T: tonic::codegen::Service<
10054                http::Request<tonic::body::Body>,
10055                Response = http::Response<
10056                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10057                >,
10058            >,
10059            <T as tonic::codegen::Service<
10060                http::Request<tonic::body::Body>,
10061            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10062        {
10063            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
10064        }
10065        /// Compress requests with the given encoding.
10066        ///
10067        /// This requires the server to support it otherwise it might respond with an
10068        /// error.
10069        #[must_use]
10070        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10071            self.inner = self.inner.send_compressed(encoding);
10072            self
10073        }
10074        /// Enable decompressing responses.
10075        #[must_use]
10076        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10077            self.inner = self.inner.accept_compressed(encoding);
10078            self
10079        }
10080        /// Limits the maximum size of a decoded message.
10081        ///
10082        /// Default: `4MB`
10083        #[must_use]
10084        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10085            self.inner = self.inner.max_decoding_message_size(limit);
10086            self
10087        }
10088        /// Limits the maximum size of an encoded message.
10089        ///
10090        /// Default: `usize::MAX`
10091        #[must_use]
10092        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10093            self.inner = self.inner.max_encoding_message_size(limit);
10094            self
10095        }
10096        /** Invite a new user to the organization via email.
10097 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10098*/
10099        pub async fn invite_user(
10100            &mut self,
10101            request: impl tonic::IntoRequest<super::InviteUserRequest>,
10102        ) -> std::result::Result<
10103            tonic::Response<super::InviteUserResponse>,
10104            tonic::Status,
10105        > {
10106            self.inner
10107                .ready()
10108                .await
10109                .map_err(|e| {
10110                    tonic::Status::unknown(
10111                        format!("Service was not ready: {}", e.into()),
10112                    )
10113                })?;
10114            let codec = tonic_prost::ProstCodec::default();
10115            let path = http::uri::PathAndQuery::from_static(
10116                "/pidgr.v1.MemberService/InviteUser",
10117            );
10118            let mut req = request.into_request();
10119            req.extensions_mut()
10120                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10121            self.inner.unary(req, path, codec).await
10122        }
10123        /** Retrieve a user by ID within the organization.
10124 Self-lookup (empty user_id) is allowed for any authenticated user.
10125 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10126*/
10127        pub async fn get_user(
10128            &mut self,
10129            request: impl tonic::IntoRequest<super::GetUserRequest>,
10130        ) -> std::result::Result<
10131            tonic::Response<super::GetUserResponse>,
10132            tonic::Status,
10133        > {
10134            self.inner
10135                .ready()
10136                .await
10137                .map_err(|e| {
10138                    tonic::Status::unknown(
10139                        format!("Service was not ready: {}", e.into()),
10140                    )
10141                })?;
10142            let codec = tonic_prost::ProstCodec::default();
10143            let path = http::uri::PathAndQuery::from_static(
10144                "/pidgr.v1.MemberService/GetUser",
10145            );
10146            let mut req = request.into_request();
10147            req.extensions_mut()
10148                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10149            self.inner.unary(req, path, codec).await
10150        }
10151        /** List all users in the organization with pagination.
10152 Authorization: Requires PERMISSION_MEMBERS_READ.
10153*/
10154        pub async fn list_users(
10155            &mut self,
10156            request: impl tonic::IntoRequest<super::ListUsersRequest>,
10157        ) -> std::result::Result<
10158            tonic::Response<super::ListUsersResponse>,
10159            tonic::Status,
10160        > {
10161            self.inner
10162                .ready()
10163                .await
10164                .map_err(|e| {
10165                    tonic::Status::unknown(
10166                        format!("Service was not ready: {}", e.into()),
10167                    )
10168                })?;
10169            let codec = tonic_prost::ProstCodec::default();
10170            let path = http::uri::PathAndQuery::from_static(
10171                "/pidgr.v1.MemberService/ListUsers",
10172            );
10173            let mut req = request.into_request();
10174            req.extensions_mut()
10175                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10176            self.inner.unary(req, path, codec).await
10177        }
10178        /** Change a user's role within the organization.
10179 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10180*/
10181        pub async fn update_user_role(
10182            &mut self,
10183            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10184        ) -> std::result::Result<
10185            tonic::Response<super::UpdateUserRoleResponse>,
10186            tonic::Status,
10187        > {
10188            self.inner
10189                .ready()
10190                .await
10191                .map_err(|e| {
10192                    tonic::Status::unknown(
10193                        format!("Service was not ready: {}", e.into()),
10194                    )
10195                })?;
10196            let codec = tonic_prost::ProstCodec::default();
10197            let path = http::uri::PathAndQuery::from_static(
10198                "/pidgr.v1.MemberService/UpdateUserRole",
10199            );
10200            let mut req = request.into_request();
10201            req.extensions_mut()
10202                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10203            self.inner.unary(req, path, codec).await
10204        }
10205        /** Deactivate a user within the organization.
10206 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10207*/
10208        pub async fn deactivate_user(
10209            &mut self,
10210            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10211        ) -> std::result::Result<
10212            tonic::Response<super::DeactivateUserResponse>,
10213            tonic::Status,
10214        > {
10215            self.inner
10216                .ready()
10217                .await
10218                .map_err(|e| {
10219                    tonic::Status::unknown(
10220                        format!("Service was not ready: {}", e.into()),
10221                    )
10222                })?;
10223            let codec = tonic_prost::ProstCodec::default();
10224            let path = http::uri::PathAndQuery::from_static(
10225                "/pidgr.v1.MemberService/DeactivateUser",
10226            );
10227            let mut req = request.into_request();
10228            req.extensions_mut()
10229                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10230            self.inner.unary(req, path, codec).await
10231        }
10232        /** Reactivate a deactivated user, restoring their status to INVITED.
10233 The user must complete the invite link flow again to become ACTIVE.
10234 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10235*/
10236        pub async fn reactivate_user(
10237            &mut self,
10238            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10239        ) -> std::result::Result<
10240            tonic::Response<super::ReactivateUserResponse>,
10241            tonic::Status,
10242        > {
10243            self.inner
10244                .ready()
10245                .await
10246                .map_err(|e| {
10247                    tonic::Status::unknown(
10248                        format!("Service was not ready: {}", e.into()),
10249                    )
10250                })?;
10251            let codec = tonic_prost::ProstCodec::default();
10252            let path = http::uri::PathAndQuery::from_static(
10253                "/pidgr.v1.MemberService/ReactivateUser",
10254            );
10255            let mut req = request.into_request();
10256            req.extensions_mut()
10257                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10258            self.inner.unary(req, path, codec).await
10259        }
10260        /** Revoke an invitation for a user who has not yet completed registration.
10261 Hard-deletes the user record (INVITED users have no data to preserve).
10262 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10263*/
10264        pub async fn revoke_invite(
10265            &mut self,
10266            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10267        ) -> std::result::Result<
10268            tonic::Response<super::RevokeInviteResponse>,
10269            tonic::Status,
10270        > {
10271            self.inner
10272                .ready()
10273                .await
10274                .map_err(|e| {
10275                    tonic::Status::unknown(
10276                        format!("Service was not ready: {}", e.into()),
10277                    )
10278                })?;
10279            let codec = tonic_prost::ProstCodec::default();
10280            let path = http::uri::PathAndQuery::from_static(
10281                "/pidgr.v1.MemberService/RevokeInvite",
10282            );
10283            let mut req = request.into_request();
10284            req.extensions_mut()
10285                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10286            self.inner.unary(req, path, codec).await
10287        }
10288        /** Update a user's profile attributes (department, title, etc.).
10289 Self-update (empty user_id or matching JWT sub) requires no special permission.
10290 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10291*/
10292        pub async fn update_user_profile(
10293            &mut self,
10294            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10295        ) -> std::result::Result<
10296            tonic::Response<super::UpdateUserProfileResponse>,
10297            tonic::Status,
10298        > {
10299            self.inner
10300                .ready()
10301                .await
10302                .map_err(|e| {
10303                    tonic::Status::unknown(
10304                        format!("Service was not ready: {}", e.into()),
10305                    )
10306                })?;
10307            let codec = tonic_prost::ProstCodec::default();
10308            let path = http::uri::PathAndQuery::from_static(
10309                "/pidgr.v1.MemberService/UpdateUserProfile",
10310            );
10311            let mut req = request.into_request();
10312            req.extensions_mut()
10313                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10314            self.inner.unary(req, path, codec).await
10315        }
10316        /** Retrieve the caller's platform settings (theme, etc.).
10317 Authorization: Any authenticated user (self-only).
10318*/
10319        pub async fn get_user_settings(
10320            &mut self,
10321            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10322        ) -> std::result::Result<
10323            tonic::Response<super::GetUserSettingsResponse>,
10324            tonic::Status,
10325        > {
10326            self.inner
10327                .ready()
10328                .await
10329                .map_err(|e| {
10330                    tonic::Status::unknown(
10331                        format!("Service was not ready: {}", e.into()),
10332                    )
10333                })?;
10334            let codec = tonic_prost::ProstCodec::default();
10335            let path = http::uri::PathAndQuery::from_static(
10336                "/pidgr.v1.MemberService/GetUserSettings",
10337            );
10338            let mut req = request.into_request();
10339            req.extensions_mut()
10340                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10341            self.inner.unary(req, path, codec).await
10342        }
10343        /** Update the caller's platform settings.
10344 Only fields with non-default values are applied; others are left unchanged.
10345 Authorization: Any authenticated user (self-only).
10346*/
10347        pub async fn update_user_settings(
10348            &mut self,
10349            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10350        ) -> std::result::Result<
10351            tonic::Response<super::UpdateUserSettingsResponse>,
10352            tonic::Status,
10353        > {
10354            self.inner
10355                .ready()
10356                .await
10357                .map_err(|e| {
10358                    tonic::Status::unknown(
10359                        format!("Service was not ready: {}", e.into()),
10360                    )
10361                })?;
10362            let codec = tonic_prost::ProstCodec::default();
10363            let path = http::uri::PathAndQuery::from_static(
10364                "/pidgr.v1.MemberService/UpdateUserSettings",
10365            );
10366            let mut req = request.into_request();
10367            req.extensions_mut()
10368                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10369            self.inner.unary(req, path, codec).await
10370        }
10371        /** Invite multiple users to the organization in a single call.
10372 Emails are deduplicated. Each email is processed independently — individual
10373 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10374 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10375*/
10376        pub async fn bulk_invite_users(
10377            &mut self,
10378            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10379        ) -> std::result::Result<
10380            tonic::Response<super::BulkInviteUsersResponse>,
10381            tonic::Status,
10382        > {
10383            self.inner
10384                .ready()
10385                .await
10386                .map_err(|e| {
10387                    tonic::Status::unknown(
10388                        format!("Service was not ready: {}", e.into()),
10389                    )
10390                })?;
10391            let codec = tonic_prost::ProstCodec::default();
10392            let path = http::uri::PathAndQuery::from_static(
10393                "/pidgr.v1.MemberService/BulkInviteUsers",
10394            );
10395            let mut req = request.into_request();
10396            req.extensions_mut()
10397                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10398            self.inner.unary(req, path, codec).await
10399        }
10400        /** Confirm passkey enrollment after client-side WebAuthn registration.
10401 Verifies the caller has at least one registered credential server-side,
10402 then marks the user as passkey-enrolled in the identity provider.
10403 Authorization: Any authenticated user (self-only, no permission required).
10404*/
10405        pub async fn confirm_passkey_enrollment(
10406            &mut self,
10407            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10408        ) -> std::result::Result<
10409            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10410            tonic::Status,
10411        > {
10412            self.inner
10413                .ready()
10414                .await
10415                .map_err(|e| {
10416                    tonic::Status::unknown(
10417                        format!("Service was not ready: {}", e.into()),
10418                    )
10419                })?;
10420            let codec = tonic_prost::ProstCodec::default();
10421            let path = http::uri::PathAndQuery::from_static(
10422                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10423            );
10424            let mut req = request.into_request();
10425            req.extensions_mut()
10426                .insert(
10427                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10428                );
10429            self.inner.unary(req, path, codec).await
10430        }
10431        /** Update the data governance region for a user. Triggers a data migration
10432 workflow if the region changed. Admin-only operation.
10433 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10434*/
10435        pub async fn update_user_region(
10436            &mut self,
10437            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10438        ) -> std::result::Result<
10439            tonic::Response<super::UpdateUserRegionResponse>,
10440            tonic::Status,
10441        > {
10442            self.inner
10443                .ready()
10444                .await
10445                .map_err(|e| {
10446                    tonic::Status::unknown(
10447                        format!("Service was not ready: {}", e.into()),
10448                    )
10449                })?;
10450            let codec = tonic_prost::ProstCodec::default();
10451            let path = http::uri::PathAndQuery::from_static(
10452                "/pidgr.v1.MemberService/UpdateUserRegion",
10453            );
10454            let mut req = request.into_request();
10455            req.extensions_mut()
10456                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10457            self.inner.unary(req, path, codec).await
10458        }
10459    }
10460}
10461/// Generated server implementations.
10462pub mod member_service_server {
10463    #![allow(
10464        unused_variables,
10465        dead_code,
10466        missing_docs,
10467        clippy::wildcard_imports,
10468        clippy::let_unit_value,
10469    )]
10470    use tonic::codegen::*;
10471    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
10472    #[async_trait]
10473    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10474        /** Invite a new user to the organization via email.
10475 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10476*/
10477        async fn invite_user(
10478            &self,
10479            request: tonic::Request<super::InviteUserRequest>,
10480        ) -> std::result::Result<
10481            tonic::Response<super::InviteUserResponse>,
10482            tonic::Status,
10483        >;
10484        /** Retrieve a user by ID within the organization.
10485 Self-lookup (empty user_id) is allowed for any authenticated user.
10486 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10487*/
10488        async fn get_user(
10489            &self,
10490            request: tonic::Request<super::GetUserRequest>,
10491        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10492        /** List all users in the organization with pagination.
10493 Authorization: Requires PERMISSION_MEMBERS_READ.
10494*/
10495        async fn list_users(
10496            &self,
10497            request: tonic::Request<super::ListUsersRequest>,
10498        ) -> std::result::Result<
10499            tonic::Response<super::ListUsersResponse>,
10500            tonic::Status,
10501        >;
10502        /** Change a user's role within the organization.
10503 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10504*/
10505        async fn update_user_role(
10506            &self,
10507            request: tonic::Request<super::UpdateUserRoleRequest>,
10508        ) -> std::result::Result<
10509            tonic::Response<super::UpdateUserRoleResponse>,
10510            tonic::Status,
10511        >;
10512        /** Deactivate a user within the organization.
10513 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10514*/
10515        async fn deactivate_user(
10516            &self,
10517            request: tonic::Request<super::DeactivateUserRequest>,
10518        ) -> std::result::Result<
10519            tonic::Response<super::DeactivateUserResponse>,
10520            tonic::Status,
10521        >;
10522        /** Reactivate a deactivated user, restoring their status to INVITED.
10523 The user must complete the invite link flow again to become ACTIVE.
10524 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10525*/
10526        async fn reactivate_user(
10527            &self,
10528            request: tonic::Request<super::ReactivateUserRequest>,
10529        ) -> std::result::Result<
10530            tonic::Response<super::ReactivateUserResponse>,
10531            tonic::Status,
10532        >;
10533        /** Revoke an invitation for a user who has not yet completed registration.
10534 Hard-deletes the user record (INVITED users have no data to preserve).
10535 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10536*/
10537        async fn revoke_invite(
10538            &self,
10539            request: tonic::Request<super::RevokeInviteRequest>,
10540        ) -> std::result::Result<
10541            tonic::Response<super::RevokeInviteResponse>,
10542            tonic::Status,
10543        >;
10544        /** Update a user's profile attributes (department, title, etc.).
10545 Self-update (empty user_id or matching JWT sub) requires no special permission.
10546 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10547*/
10548        async fn update_user_profile(
10549            &self,
10550            request: tonic::Request<super::UpdateUserProfileRequest>,
10551        ) -> std::result::Result<
10552            tonic::Response<super::UpdateUserProfileResponse>,
10553            tonic::Status,
10554        >;
10555        /** Retrieve the caller's platform settings (theme, etc.).
10556 Authorization: Any authenticated user (self-only).
10557*/
10558        async fn get_user_settings(
10559            &self,
10560            request: tonic::Request<super::GetUserSettingsRequest>,
10561        ) -> std::result::Result<
10562            tonic::Response<super::GetUserSettingsResponse>,
10563            tonic::Status,
10564        >;
10565        /** Update the caller's platform settings.
10566 Only fields with non-default values are applied; others are left unchanged.
10567 Authorization: Any authenticated user (self-only).
10568*/
10569        async fn update_user_settings(
10570            &self,
10571            request: tonic::Request<super::UpdateUserSettingsRequest>,
10572        ) -> std::result::Result<
10573            tonic::Response<super::UpdateUserSettingsResponse>,
10574            tonic::Status,
10575        >;
10576        /** Invite multiple users to the organization in a single call.
10577 Emails are deduplicated. Each email is processed independently — individual
10578 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10579 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10580*/
10581        async fn bulk_invite_users(
10582            &self,
10583            request: tonic::Request<super::BulkInviteUsersRequest>,
10584        ) -> std::result::Result<
10585            tonic::Response<super::BulkInviteUsersResponse>,
10586            tonic::Status,
10587        >;
10588        /** Confirm passkey enrollment after client-side WebAuthn registration.
10589 Verifies the caller has at least one registered credential server-side,
10590 then marks the user as passkey-enrolled in the identity provider.
10591 Authorization: Any authenticated user (self-only, no permission required).
10592*/
10593        async fn confirm_passkey_enrollment(
10594            &self,
10595            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10596        ) -> std::result::Result<
10597            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10598            tonic::Status,
10599        >;
10600        /** Update the data governance region for a user. Triggers a data migration
10601 workflow if the region changed. Admin-only operation.
10602 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10603*/
10604        async fn update_user_region(
10605            &self,
10606            request: tonic::Request<super::UpdateUserRegionRequest>,
10607        ) -> std::result::Result<
10608            tonic::Response<super::UpdateUserRegionResponse>,
10609            tonic::Status,
10610        >;
10611    }
10612    /** Manages members (users) within an organization.
10613 All RPCs operate within the caller's org (extracted from JWT).
10614*/
10615    #[derive(Debug)]
10616    pub struct MemberServiceServer<T> {
10617        inner: Arc<T>,
10618        accept_compression_encodings: EnabledCompressionEncodings,
10619        send_compression_encodings: EnabledCompressionEncodings,
10620        max_decoding_message_size: Option<usize>,
10621        max_encoding_message_size: Option<usize>,
10622    }
10623    impl<T> MemberServiceServer<T> {
10624        pub fn new(inner: T) -> Self {
10625            Self::from_arc(Arc::new(inner))
10626        }
10627        pub fn from_arc(inner: Arc<T>) -> Self {
10628            Self {
10629                inner,
10630                accept_compression_encodings: Default::default(),
10631                send_compression_encodings: Default::default(),
10632                max_decoding_message_size: None,
10633                max_encoding_message_size: None,
10634            }
10635        }
10636        pub fn with_interceptor<F>(
10637            inner: T,
10638            interceptor: F,
10639        ) -> InterceptedService<Self, F>
10640        where
10641            F: tonic::service::Interceptor,
10642        {
10643            InterceptedService::new(Self::new(inner), interceptor)
10644        }
10645        /// Enable decompressing requests with the given encoding.
10646        #[must_use]
10647        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10648            self.accept_compression_encodings.enable(encoding);
10649            self
10650        }
10651        /// Compress responses with the given encoding, if the client supports it.
10652        #[must_use]
10653        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10654            self.send_compression_encodings.enable(encoding);
10655            self
10656        }
10657        /// Limits the maximum size of a decoded message.
10658        ///
10659        /// Default: `4MB`
10660        #[must_use]
10661        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10662            self.max_decoding_message_size = Some(limit);
10663            self
10664        }
10665        /// Limits the maximum size of an encoded message.
10666        ///
10667        /// Default: `usize::MAX`
10668        #[must_use]
10669        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10670            self.max_encoding_message_size = Some(limit);
10671            self
10672        }
10673    }
10674    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10675    where
10676        T: MemberService,
10677        B: Body + std::marker::Send + 'static,
10678        B::Error: Into<StdError> + std::marker::Send + 'static,
10679    {
10680        type Response = http::Response<tonic::body::Body>;
10681        type Error = std::convert::Infallible;
10682        type Future = BoxFuture<Self::Response, Self::Error>;
10683        fn poll_ready(
10684            &mut self,
10685            _cx: &mut Context<'_>,
10686        ) -> Poll<std::result::Result<(), Self::Error>> {
10687            Poll::Ready(Ok(()))
10688        }
10689        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10690            match req.uri().path() {
10691                "/pidgr.v1.MemberService/InviteUser" => {
10692                    #[allow(non_camel_case_types)]
10693                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10694                    impl<
10695                        T: MemberService,
10696                    > tonic::server::UnaryService<super::InviteUserRequest>
10697                    for InviteUserSvc<T> {
10698                        type Response = super::InviteUserResponse;
10699                        type Future = BoxFuture<
10700                            tonic::Response<Self::Response>,
10701                            tonic::Status,
10702                        >;
10703                        fn call(
10704                            &mut self,
10705                            request: tonic::Request<super::InviteUserRequest>,
10706                        ) -> Self::Future {
10707                            let inner = Arc::clone(&self.0);
10708                            let fut = async move {
10709                                <T as MemberService>::invite_user(&inner, request).await
10710                            };
10711                            Box::pin(fut)
10712                        }
10713                    }
10714                    let accept_compression_encodings = self.accept_compression_encodings;
10715                    let send_compression_encodings = self.send_compression_encodings;
10716                    let max_decoding_message_size = self.max_decoding_message_size;
10717                    let max_encoding_message_size = self.max_encoding_message_size;
10718                    let inner = self.inner.clone();
10719                    let fut = async move {
10720                        let method = InviteUserSvc(inner);
10721                        let codec = tonic_prost::ProstCodec::default();
10722                        let mut grpc = tonic::server::Grpc::new(codec)
10723                            .apply_compression_config(
10724                                accept_compression_encodings,
10725                                send_compression_encodings,
10726                            )
10727                            .apply_max_message_size_config(
10728                                max_decoding_message_size,
10729                                max_encoding_message_size,
10730                            );
10731                        let res = grpc.unary(method, req).await;
10732                        Ok(res)
10733                    };
10734                    Box::pin(fut)
10735                }
10736                "/pidgr.v1.MemberService/GetUser" => {
10737                    #[allow(non_camel_case_types)]
10738                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
10739                    impl<
10740                        T: MemberService,
10741                    > tonic::server::UnaryService<super::GetUserRequest>
10742                    for GetUserSvc<T> {
10743                        type Response = super::GetUserResponse;
10744                        type Future = BoxFuture<
10745                            tonic::Response<Self::Response>,
10746                            tonic::Status,
10747                        >;
10748                        fn call(
10749                            &mut self,
10750                            request: tonic::Request<super::GetUserRequest>,
10751                        ) -> Self::Future {
10752                            let inner = Arc::clone(&self.0);
10753                            let fut = async move {
10754                                <T as MemberService>::get_user(&inner, request).await
10755                            };
10756                            Box::pin(fut)
10757                        }
10758                    }
10759                    let accept_compression_encodings = self.accept_compression_encodings;
10760                    let send_compression_encodings = self.send_compression_encodings;
10761                    let max_decoding_message_size = self.max_decoding_message_size;
10762                    let max_encoding_message_size = self.max_encoding_message_size;
10763                    let inner = self.inner.clone();
10764                    let fut = async move {
10765                        let method = GetUserSvc(inner);
10766                        let codec = tonic_prost::ProstCodec::default();
10767                        let mut grpc = tonic::server::Grpc::new(codec)
10768                            .apply_compression_config(
10769                                accept_compression_encodings,
10770                                send_compression_encodings,
10771                            )
10772                            .apply_max_message_size_config(
10773                                max_decoding_message_size,
10774                                max_encoding_message_size,
10775                            );
10776                        let res = grpc.unary(method, req).await;
10777                        Ok(res)
10778                    };
10779                    Box::pin(fut)
10780                }
10781                "/pidgr.v1.MemberService/ListUsers" => {
10782                    #[allow(non_camel_case_types)]
10783                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10784                    impl<
10785                        T: MemberService,
10786                    > tonic::server::UnaryService<super::ListUsersRequest>
10787                    for ListUsersSvc<T> {
10788                        type Response = super::ListUsersResponse;
10789                        type Future = BoxFuture<
10790                            tonic::Response<Self::Response>,
10791                            tonic::Status,
10792                        >;
10793                        fn call(
10794                            &mut self,
10795                            request: tonic::Request<super::ListUsersRequest>,
10796                        ) -> Self::Future {
10797                            let inner = Arc::clone(&self.0);
10798                            let fut = async move {
10799                                <T as MemberService>::list_users(&inner, request).await
10800                            };
10801                            Box::pin(fut)
10802                        }
10803                    }
10804                    let accept_compression_encodings = self.accept_compression_encodings;
10805                    let send_compression_encodings = self.send_compression_encodings;
10806                    let max_decoding_message_size = self.max_decoding_message_size;
10807                    let max_encoding_message_size = self.max_encoding_message_size;
10808                    let inner = self.inner.clone();
10809                    let fut = async move {
10810                        let method = ListUsersSvc(inner);
10811                        let codec = tonic_prost::ProstCodec::default();
10812                        let mut grpc = tonic::server::Grpc::new(codec)
10813                            .apply_compression_config(
10814                                accept_compression_encodings,
10815                                send_compression_encodings,
10816                            )
10817                            .apply_max_message_size_config(
10818                                max_decoding_message_size,
10819                                max_encoding_message_size,
10820                            );
10821                        let res = grpc.unary(method, req).await;
10822                        Ok(res)
10823                    };
10824                    Box::pin(fut)
10825                }
10826                "/pidgr.v1.MemberService/UpdateUserRole" => {
10827                    #[allow(non_camel_case_types)]
10828                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
10829                    impl<
10830                        T: MemberService,
10831                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
10832                    for UpdateUserRoleSvc<T> {
10833                        type Response = super::UpdateUserRoleResponse;
10834                        type Future = BoxFuture<
10835                            tonic::Response<Self::Response>,
10836                            tonic::Status,
10837                        >;
10838                        fn call(
10839                            &mut self,
10840                            request: tonic::Request<super::UpdateUserRoleRequest>,
10841                        ) -> Self::Future {
10842                            let inner = Arc::clone(&self.0);
10843                            let fut = async move {
10844                                <T as MemberService>::update_user_role(&inner, request)
10845                                    .await
10846                            };
10847                            Box::pin(fut)
10848                        }
10849                    }
10850                    let accept_compression_encodings = self.accept_compression_encodings;
10851                    let send_compression_encodings = self.send_compression_encodings;
10852                    let max_decoding_message_size = self.max_decoding_message_size;
10853                    let max_encoding_message_size = self.max_encoding_message_size;
10854                    let inner = self.inner.clone();
10855                    let fut = async move {
10856                        let method = UpdateUserRoleSvc(inner);
10857                        let codec = tonic_prost::ProstCodec::default();
10858                        let mut grpc = tonic::server::Grpc::new(codec)
10859                            .apply_compression_config(
10860                                accept_compression_encodings,
10861                                send_compression_encodings,
10862                            )
10863                            .apply_max_message_size_config(
10864                                max_decoding_message_size,
10865                                max_encoding_message_size,
10866                            );
10867                        let res = grpc.unary(method, req).await;
10868                        Ok(res)
10869                    };
10870                    Box::pin(fut)
10871                }
10872                "/pidgr.v1.MemberService/DeactivateUser" => {
10873                    #[allow(non_camel_case_types)]
10874                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
10875                    impl<
10876                        T: MemberService,
10877                    > tonic::server::UnaryService<super::DeactivateUserRequest>
10878                    for DeactivateUserSvc<T> {
10879                        type Response = super::DeactivateUserResponse;
10880                        type Future = BoxFuture<
10881                            tonic::Response<Self::Response>,
10882                            tonic::Status,
10883                        >;
10884                        fn call(
10885                            &mut self,
10886                            request: tonic::Request<super::DeactivateUserRequest>,
10887                        ) -> Self::Future {
10888                            let inner = Arc::clone(&self.0);
10889                            let fut = async move {
10890                                <T as MemberService>::deactivate_user(&inner, request).await
10891                            };
10892                            Box::pin(fut)
10893                        }
10894                    }
10895                    let accept_compression_encodings = self.accept_compression_encodings;
10896                    let send_compression_encodings = self.send_compression_encodings;
10897                    let max_decoding_message_size = self.max_decoding_message_size;
10898                    let max_encoding_message_size = self.max_encoding_message_size;
10899                    let inner = self.inner.clone();
10900                    let fut = async move {
10901                        let method = DeactivateUserSvc(inner);
10902                        let codec = tonic_prost::ProstCodec::default();
10903                        let mut grpc = tonic::server::Grpc::new(codec)
10904                            .apply_compression_config(
10905                                accept_compression_encodings,
10906                                send_compression_encodings,
10907                            )
10908                            .apply_max_message_size_config(
10909                                max_decoding_message_size,
10910                                max_encoding_message_size,
10911                            );
10912                        let res = grpc.unary(method, req).await;
10913                        Ok(res)
10914                    };
10915                    Box::pin(fut)
10916                }
10917                "/pidgr.v1.MemberService/ReactivateUser" => {
10918                    #[allow(non_camel_case_types)]
10919                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
10920                    impl<
10921                        T: MemberService,
10922                    > tonic::server::UnaryService<super::ReactivateUserRequest>
10923                    for ReactivateUserSvc<T> {
10924                        type Response = super::ReactivateUserResponse;
10925                        type Future = BoxFuture<
10926                            tonic::Response<Self::Response>,
10927                            tonic::Status,
10928                        >;
10929                        fn call(
10930                            &mut self,
10931                            request: tonic::Request<super::ReactivateUserRequest>,
10932                        ) -> Self::Future {
10933                            let inner = Arc::clone(&self.0);
10934                            let fut = async move {
10935                                <T as MemberService>::reactivate_user(&inner, request).await
10936                            };
10937                            Box::pin(fut)
10938                        }
10939                    }
10940                    let accept_compression_encodings = self.accept_compression_encodings;
10941                    let send_compression_encodings = self.send_compression_encodings;
10942                    let max_decoding_message_size = self.max_decoding_message_size;
10943                    let max_encoding_message_size = self.max_encoding_message_size;
10944                    let inner = self.inner.clone();
10945                    let fut = async move {
10946                        let method = ReactivateUserSvc(inner);
10947                        let codec = tonic_prost::ProstCodec::default();
10948                        let mut grpc = tonic::server::Grpc::new(codec)
10949                            .apply_compression_config(
10950                                accept_compression_encodings,
10951                                send_compression_encodings,
10952                            )
10953                            .apply_max_message_size_config(
10954                                max_decoding_message_size,
10955                                max_encoding_message_size,
10956                            );
10957                        let res = grpc.unary(method, req).await;
10958                        Ok(res)
10959                    };
10960                    Box::pin(fut)
10961                }
10962                "/pidgr.v1.MemberService/RevokeInvite" => {
10963                    #[allow(non_camel_case_types)]
10964                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
10965                    impl<
10966                        T: MemberService,
10967                    > tonic::server::UnaryService<super::RevokeInviteRequest>
10968                    for RevokeInviteSvc<T> {
10969                        type Response = super::RevokeInviteResponse;
10970                        type Future = BoxFuture<
10971                            tonic::Response<Self::Response>,
10972                            tonic::Status,
10973                        >;
10974                        fn call(
10975                            &mut self,
10976                            request: tonic::Request<super::RevokeInviteRequest>,
10977                        ) -> Self::Future {
10978                            let inner = Arc::clone(&self.0);
10979                            let fut = async move {
10980                                <T as MemberService>::revoke_invite(&inner, request).await
10981                            };
10982                            Box::pin(fut)
10983                        }
10984                    }
10985                    let accept_compression_encodings = self.accept_compression_encodings;
10986                    let send_compression_encodings = self.send_compression_encodings;
10987                    let max_decoding_message_size = self.max_decoding_message_size;
10988                    let max_encoding_message_size = self.max_encoding_message_size;
10989                    let inner = self.inner.clone();
10990                    let fut = async move {
10991                        let method = RevokeInviteSvc(inner);
10992                        let codec = tonic_prost::ProstCodec::default();
10993                        let mut grpc = tonic::server::Grpc::new(codec)
10994                            .apply_compression_config(
10995                                accept_compression_encodings,
10996                                send_compression_encodings,
10997                            )
10998                            .apply_max_message_size_config(
10999                                max_decoding_message_size,
11000                                max_encoding_message_size,
11001                            );
11002                        let res = grpc.unary(method, req).await;
11003                        Ok(res)
11004                    };
11005                    Box::pin(fut)
11006                }
11007                "/pidgr.v1.MemberService/UpdateUserProfile" => {
11008                    #[allow(non_camel_case_types)]
11009                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
11010                    impl<
11011                        T: MemberService,
11012                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
11013                    for UpdateUserProfileSvc<T> {
11014                        type Response = super::UpdateUserProfileResponse;
11015                        type Future = BoxFuture<
11016                            tonic::Response<Self::Response>,
11017                            tonic::Status,
11018                        >;
11019                        fn call(
11020                            &mut self,
11021                            request: tonic::Request<super::UpdateUserProfileRequest>,
11022                        ) -> Self::Future {
11023                            let inner = Arc::clone(&self.0);
11024                            let fut = async move {
11025                                <T as MemberService>::update_user_profile(&inner, request)
11026                                    .await
11027                            };
11028                            Box::pin(fut)
11029                        }
11030                    }
11031                    let accept_compression_encodings = self.accept_compression_encodings;
11032                    let send_compression_encodings = self.send_compression_encodings;
11033                    let max_decoding_message_size = self.max_decoding_message_size;
11034                    let max_encoding_message_size = self.max_encoding_message_size;
11035                    let inner = self.inner.clone();
11036                    let fut = async move {
11037                        let method = UpdateUserProfileSvc(inner);
11038                        let codec = tonic_prost::ProstCodec::default();
11039                        let mut grpc = tonic::server::Grpc::new(codec)
11040                            .apply_compression_config(
11041                                accept_compression_encodings,
11042                                send_compression_encodings,
11043                            )
11044                            .apply_max_message_size_config(
11045                                max_decoding_message_size,
11046                                max_encoding_message_size,
11047                            );
11048                        let res = grpc.unary(method, req).await;
11049                        Ok(res)
11050                    };
11051                    Box::pin(fut)
11052                }
11053                "/pidgr.v1.MemberService/GetUserSettings" => {
11054                    #[allow(non_camel_case_types)]
11055                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
11056                    impl<
11057                        T: MemberService,
11058                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
11059                    for GetUserSettingsSvc<T> {
11060                        type Response = super::GetUserSettingsResponse;
11061                        type Future = BoxFuture<
11062                            tonic::Response<Self::Response>,
11063                            tonic::Status,
11064                        >;
11065                        fn call(
11066                            &mut self,
11067                            request: tonic::Request<super::GetUserSettingsRequest>,
11068                        ) -> Self::Future {
11069                            let inner = Arc::clone(&self.0);
11070                            let fut = async move {
11071                                <T as MemberService>::get_user_settings(&inner, request)
11072                                    .await
11073                            };
11074                            Box::pin(fut)
11075                        }
11076                    }
11077                    let accept_compression_encodings = self.accept_compression_encodings;
11078                    let send_compression_encodings = self.send_compression_encodings;
11079                    let max_decoding_message_size = self.max_decoding_message_size;
11080                    let max_encoding_message_size = self.max_encoding_message_size;
11081                    let inner = self.inner.clone();
11082                    let fut = async move {
11083                        let method = GetUserSettingsSvc(inner);
11084                        let codec = tonic_prost::ProstCodec::default();
11085                        let mut grpc = tonic::server::Grpc::new(codec)
11086                            .apply_compression_config(
11087                                accept_compression_encodings,
11088                                send_compression_encodings,
11089                            )
11090                            .apply_max_message_size_config(
11091                                max_decoding_message_size,
11092                                max_encoding_message_size,
11093                            );
11094                        let res = grpc.unary(method, req).await;
11095                        Ok(res)
11096                    };
11097                    Box::pin(fut)
11098                }
11099                "/pidgr.v1.MemberService/UpdateUserSettings" => {
11100                    #[allow(non_camel_case_types)]
11101                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11102                    impl<
11103                        T: MemberService,
11104                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11105                    for UpdateUserSettingsSvc<T> {
11106                        type Response = super::UpdateUserSettingsResponse;
11107                        type Future = BoxFuture<
11108                            tonic::Response<Self::Response>,
11109                            tonic::Status,
11110                        >;
11111                        fn call(
11112                            &mut self,
11113                            request: tonic::Request<super::UpdateUserSettingsRequest>,
11114                        ) -> Self::Future {
11115                            let inner = Arc::clone(&self.0);
11116                            let fut = async move {
11117                                <T as MemberService>::update_user_settings(&inner, request)
11118                                    .await
11119                            };
11120                            Box::pin(fut)
11121                        }
11122                    }
11123                    let accept_compression_encodings = self.accept_compression_encodings;
11124                    let send_compression_encodings = self.send_compression_encodings;
11125                    let max_decoding_message_size = self.max_decoding_message_size;
11126                    let max_encoding_message_size = self.max_encoding_message_size;
11127                    let inner = self.inner.clone();
11128                    let fut = async move {
11129                        let method = UpdateUserSettingsSvc(inner);
11130                        let codec = tonic_prost::ProstCodec::default();
11131                        let mut grpc = tonic::server::Grpc::new(codec)
11132                            .apply_compression_config(
11133                                accept_compression_encodings,
11134                                send_compression_encodings,
11135                            )
11136                            .apply_max_message_size_config(
11137                                max_decoding_message_size,
11138                                max_encoding_message_size,
11139                            );
11140                        let res = grpc.unary(method, req).await;
11141                        Ok(res)
11142                    };
11143                    Box::pin(fut)
11144                }
11145                "/pidgr.v1.MemberService/BulkInviteUsers" => {
11146                    #[allow(non_camel_case_types)]
11147                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11148                    impl<
11149                        T: MemberService,
11150                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11151                    for BulkInviteUsersSvc<T> {
11152                        type Response = super::BulkInviteUsersResponse;
11153                        type Future = BoxFuture<
11154                            tonic::Response<Self::Response>,
11155                            tonic::Status,
11156                        >;
11157                        fn call(
11158                            &mut self,
11159                            request: tonic::Request<super::BulkInviteUsersRequest>,
11160                        ) -> Self::Future {
11161                            let inner = Arc::clone(&self.0);
11162                            let fut = async move {
11163                                <T as MemberService>::bulk_invite_users(&inner, request)
11164                                    .await
11165                            };
11166                            Box::pin(fut)
11167                        }
11168                    }
11169                    let accept_compression_encodings = self.accept_compression_encodings;
11170                    let send_compression_encodings = self.send_compression_encodings;
11171                    let max_decoding_message_size = self.max_decoding_message_size;
11172                    let max_encoding_message_size = self.max_encoding_message_size;
11173                    let inner = self.inner.clone();
11174                    let fut = async move {
11175                        let method = BulkInviteUsersSvc(inner);
11176                        let codec = tonic_prost::ProstCodec::default();
11177                        let mut grpc = tonic::server::Grpc::new(codec)
11178                            .apply_compression_config(
11179                                accept_compression_encodings,
11180                                send_compression_encodings,
11181                            )
11182                            .apply_max_message_size_config(
11183                                max_decoding_message_size,
11184                                max_encoding_message_size,
11185                            );
11186                        let res = grpc.unary(method, req).await;
11187                        Ok(res)
11188                    };
11189                    Box::pin(fut)
11190                }
11191                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11192                    #[allow(non_camel_case_types)]
11193                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11194                    impl<
11195                        T: MemberService,
11196                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11197                    for ConfirmPasskeyEnrollmentSvc<T> {
11198                        type Response = super::ConfirmPasskeyEnrollmentResponse;
11199                        type Future = BoxFuture<
11200                            tonic::Response<Self::Response>,
11201                            tonic::Status,
11202                        >;
11203                        fn call(
11204                            &mut self,
11205                            request: tonic::Request<
11206                                super::ConfirmPasskeyEnrollmentRequest,
11207                            >,
11208                        ) -> Self::Future {
11209                            let inner = Arc::clone(&self.0);
11210                            let fut = async move {
11211                                <T as MemberService>::confirm_passkey_enrollment(
11212                                        &inner,
11213                                        request,
11214                                    )
11215                                    .await
11216                            };
11217                            Box::pin(fut)
11218                        }
11219                    }
11220                    let accept_compression_encodings = self.accept_compression_encodings;
11221                    let send_compression_encodings = self.send_compression_encodings;
11222                    let max_decoding_message_size = self.max_decoding_message_size;
11223                    let max_encoding_message_size = self.max_encoding_message_size;
11224                    let inner = self.inner.clone();
11225                    let fut = async move {
11226                        let method = ConfirmPasskeyEnrollmentSvc(inner);
11227                        let codec = tonic_prost::ProstCodec::default();
11228                        let mut grpc = tonic::server::Grpc::new(codec)
11229                            .apply_compression_config(
11230                                accept_compression_encodings,
11231                                send_compression_encodings,
11232                            )
11233                            .apply_max_message_size_config(
11234                                max_decoding_message_size,
11235                                max_encoding_message_size,
11236                            );
11237                        let res = grpc.unary(method, req).await;
11238                        Ok(res)
11239                    };
11240                    Box::pin(fut)
11241                }
11242                "/pidgr.v1.MemberService/UpdateUserRegion" => {
11243                    #[allow(non_camel_case_types)]
11244                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11245                    impl<
11246                        T: MemberService,
11247                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11248                    for UpdateUserRegionSvc<T> {
11249                        type Response = super::UpdateUserRegionResponse;
11250                        type Future = BoxFuture<
11251                            tonic::Response<Self::Response>,
11252                            tonic::Status,
11253                        >;
11254                        fn call(
11255                            &mut self,
11256                            request: tonic::Request<super::UpdateUserRegionRequest>,
11257                        ) -> Self::Future {
11258                            let inner = Arc::clone(&self.0);
11259                            let fut = async move {
11260                                <T as MemberService>::update_user_region(&inner, request)
11261                                    .await
11262                            };
11263                            Box::pin(fut)
11264                        }
11265                    }
11266                    let accept_compression_encodings = self.accept_compression_encodings;
11267                    let send_compression_encodings = self.send_compression_encodings;
11268                    let max_decoding_message_size = self.max_decoding_message_size;
11269                    let max_encoding_message_size = self.max_encoding_message_size;
11270                    let inner = self.inner.clone();
11271                    let fut = async move {
11272                        let method = UpdateUserRegionSvc(inner);
11273                        let codec = tonic_prost::ProstCodec::default();
11274                        let mut grpc = tonic::server::Grpc::new(codec)
11275                            .apply_compression_config(
11276                                accept_compression_encodings,
11277                                send_compression_encodings,
11278                            )
11279                            .apply_max_message_size_config(
11280                                max_decoding_message_size,
11281                                max_encoding_message_size,
11282                            );
11283                        let res = grpc.unary(method, req).await;
11284                        Ok(res)
11285                    };
11286                    Box::pin(fut)
11287                }
11288                _ => {
11289                    Box::pin(async move {
11290                        let mut response = http::Response::new(
11291                            tonic::body::Body::default(),
11292                        );
11293                        let headers = response.headers_mut();
11294                        headers
11295                            .insert(
11296                                tonic::Status::GRPC_STATUS,
11297                                (tonic::Code::Unimplemented as i32).into(),
11298                            );
11299                        headers
11300                            .insert(
11301                                http::header::CONTENT_TYPE,
11302                                tonic::metadata::GRPC_CONTENT_TYPE,
11303                            );
11304                        Ok(response)
11305                    })
11306                }
11307            }
11308        }
11309    }
11310    impl<T> Clone for MemberServiceServer<T> {
11311        fn clone(&self) -> Self {
11312            let inner = self.inner.clone();
11313            Self {
11314                inner,
11315                accept_compression_encodings: self.accept_compression_encodings,
11316                send_compression_encodings: self.send_compression_encodings,
11317                max_decoding_message_size: self.max_decoding_message_size,
11318                max_encoding_message_size: self.max_encoding_message_size,
11319            }
11320        }
11321    }
11322    /// Generated gRPC service name
11323    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11324    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11325        const NAME: &'static str = SERVICE_NAME;
11326    }
11327}
11328/// Generated client implementations.
11329pub mod org_security_keys_service_client {
11330    #![allow(
11331        unused_variables,
11332        dead_code,
11333        missing_docs,
11334        clippy::wildcard_imports,
11335        clippy::let_unit_value,
11336    )]
11337    use tonic::codegen::*;
11338    use tonic::codegen::http::Uri;
11339    /** OrgSecurityKeysService exposes per-org secret key material to internal
11340 services that need it for HMAC computation, signature verification, or
11341 envelope-key derivation.
11342
11343 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11344 material. The server MUST require a client certificate from a known
11345 internal service (allowlisted by subject DN) and MUST reject any request
11346 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11347
11348 Callers (today: pidgr-integrations) cache returned peppers in-process
11349 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11350 keep dispatch hot-path latency bounded.
11351*/
11352    #[derive(Debug, Clone)]
11353    pub struct OrgSecurityKeysServiceClient<T> {
11354        inner: tonic::client::Grpc<T>,
11355    }
11356    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
11357        /// Attempt to create a new client by connecting to a given endpoint.
11358        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11359        where
11360            D: TryInto<tonic::transport::Endpoint>,
11361            D::Error: Into<StdError>,
11362        {
11363            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11364            Ok(Self::new(conn))
11365        }
11366    }
11367    impl<T> OrgSecurityKeysServiceClient<T>
11368    where
11369        T: tonic::client::GrpcService<tonic::body::Body>,
11370        T::Error: Into<StdError>,
11371        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11372        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11373    {
11374        pub fn new(inner: T) -> Self {
11375            let inner = tonic::client::Grpc::new(inner);
11376            Self { inner }
11377        }
11378        pub fn with_origin(inner: T, origin: Uri) -> Self {
11379            let inner = tonic::client::Grpc::with_origin(inner, origin);
11380            Self { inner }
11381        }
11382        pub fn with_interceptor<F>(
11383            inner: T,
11384            interceptor: F,
11385        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
11386        where
11387            F: tonic::service::Interceptor,
11388            T::ResponseBody: Default,
11389            T: tonic::codegen::Service<
11390                http::Request<tonic::body::Body>,
11391                Response = http::Response<
11392                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11393                >,
11394            >,
11395            <T as tonic::codegen::Service<
11396                http::Request<tonic::body::Body>,
11397            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11398        {
11399            OrgSecurityKeysServiceClient::new(
11400                InterceptedService::new(inner, interceptor),
11401            )
11402        }
11403        /// Compress requests with the given encoding.
11404        ///
11405        /// This requires the server to support it otherwise it might respond with an
11406        /// error.
11407        #[must_use]
11408        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11409            self.inner = self.inner.send_compressed(encoding);
11410            self
11411        }
11412        /// Enable decompressing responses.
11413        #[must_use]
11414        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11415            self.inner = self.inner.accept_compressed(encoding);
11416            self
11417        }
11418        /// Limits the maximum size of a decoded message.
11419        ///
11420        /// Default: `4MB`
11421        #[must_use]
11422        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11423            self.inner = self.inner.max_decoding_message_size(limit);
11424            self
11425        }
11426        /// Limits the maximum size of an encoded message.
11427        ///
11428        /// Default: `usize::MAX`
11429        #[must_use]
11430        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11431            self.inner = self.inner.max_encoding_message_size(limit);
11432            self
11433        }
11434        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11435 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11436 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11437*/
11438        pub async fn get_peppers(
11439            &mut self,
11440            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11441        ) -> std::result::Result<
11442            tonic::Response<super::GetPeppersResponse>,
11443            tonic::Status,
11444        > {
11445            self.inner
11446                .ready()
11447                .await
11448                .map_err(|e| {
11449                    tonic::Status::unknown(
11450                        format!("Service was not ready: {}", e.into()),
11451                    )
11452                })?;
11453            let codec = tonic_prost::ProstCodec::default();
11454            let path = http::uri::PathAndQuery::from_static(
11455                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11456            );
11457            let mut req = request.into_request();
11458            req.extensions_mut()
11459                .insert(
11460                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11461                );
11462            self.inner.unary(req, path, codec).await
11463        }
11464    }
11465}
11466/// Generated server implementations.
11467pub mod org_security_keys_service_server {
11468    #![allow(
11469        unused_variables,
11470        dead_code,
11471        missing_docs,
11472        clippy::wildcard_imports,
11473        clippy::let_unit_value,
11474    )]
11475    use tonic::codegen::*;
11476    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
11477    #[async_trait]
11478    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11479        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11480 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11481 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11482*/
11483        async fn get_peppers(
11484            &self,
11485            request: tonic::Request<super::GetPeppersRequest>,
11486        ) -> std::result::Result<
11487            tonic::Response<super::GetPeppersResponse>,
11488            tonic::Status,
11489        >;
11490    }
11491    /** OrgSecurityKeysService exposes per-org secret key material to internal
11492 services that need it for HMAC computation, signature verification, or
11493 envelope-key derivation.
11494
11495 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11496 material. The server MUST require a client certificate from a known
11497 internal service (allowlisted by subject DN) and MUST reject any request
11498 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11499
11500 Callers (today: pidgr-integrations) cache returned peppers in-process
11501 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11502 keep dispatch hot-path latency bounded.
11503*/
11504    #[derive(Debug)]
11505    pub struct OrgSecurityKeysServiceServer<T> {
11506        inner: Arc<T>,
11507        accept_compression_encodings: EnabledCompressionEncodings,
11508        send_compression_encodings: EnabledCompressionEncodings,
11509        max_decoding_message_size: Option<usize>,
11510        max_encoding_message_size: Option<usize>,
11511    }
11512    impl<T> OrgSecurityKeysServiceServer<T> {
11513        pub fn new(inner: T) -> Self {
11514            Self::from_arc(Arc::new(inner))
11515        }
11516        pub fn from_arc(inner: Arc<T>) -> Self {
11517            Self {
11518                inner,
11519                accept_compression_encodings: Default::default(),
11520                send_compression_encodings: Default::default(),
11521                max_decoding_message_size: None,
11522                max_encoding_message_size: None,
11523            }
11524        }
11525        pub fn with_interceptor<F>(
11526            inner: T,
11527            interceptor: F,
11528        ) -> InterceptedService<Self, F>
11529        where
11530            F: tonic::service::Interceptor,
11531        {
11532            InterceptedService::new(Self::new(inner), interceptor)
11533        }
11534        /// Enable decompressing requests with the given encoding.
11535        #[must_use]
11536        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11537            self.accept_compression_encodings.enable(encoding);
11538            self
11539        }
11540        /// Compress responses with the given encoding, if the client supports it.
11541        #[must_use]
11542        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11543            self.send_compression_encodings.enable(encoding);
11544            self
11545        }
11546        /// Limits the maximum size of a decoded message.
11547        ///
11548        /// Default: `4MB`
11549        #[must_use]
11550        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11551            self.max_decoding_message_size = Some(limit);
11552            self
11553        }
11554        /// Limits the maximum size of an encoded message.
11555        ///
11556        /// Default: `usize::MAX`
11557        #[must_use]
11558        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11559            self.max_encoding_message_size = Some(limit);
11560            self
11561        }
11562    }
11563    impl<T, B> tonic::codegen::Service<http::Request<B>>
11564    for OrgSecurityKeysServiceServer<T>
11565    where
11566        T: OrgSecurityKeysService,
11567        B: Body + std::marker::Send + 'static,
11568        B::Error: Into<StdError> + std::marker::Send + 'static,
11569    {
11570        type Response = http::Response<tonic::body::Body>;
11571        type Error = std::convert::Infallible;
11572        type Future = BoxFuture<Self::Response, Self::Error>;
11573        fn poll_ready(
11574            &mut self,
11575            _cx: &mut Context<'_>,
11576        ) -> Poll<std::result::Result<(), Self::Error>> {
11577            Poll::Ready(Ok(()))
11578        }
11579        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11580            match req.uri().path() {
11581                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11582                    #[allow(non_camel_case_types)]
11583                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11584                    impl<
11585                        T: OrgSecurityKeysService,
11586                    > tonic::server::UnaryService<super::GetPeppersRequest>
11587                    for GetPeppersSvc<T> {
11588                        type Response = super::GetPeppersResponse;
11589                        type Future = BoxFuture<
11590                            tonic::Response<Self::Response>,
11591                            tonic::Status,
11592                        >;
11593                        fn call(
11594                            &mut self,
11595                            request: tonic::Request<super::GetPeppersRequest>,
11596                        ) -> Self::Future {
11597                            let inner = Arc::clone(&self.0);
11598                            let fut = async move {
11599                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11600                                    .await
11601                            };
11602                            Box::pin(fut)
11603                        }
11604                    }
11605                    let accept_compression_encodings = self.accept_compression_encodings;
11606                    let send_compression_encodings = self.send_compression_encodings;
11607                    let max_decoding_message_size = self.max_decoding_message_size;
11608                    let max_encoding_message_size = self.max_encoding_message_size;
11609                    let inner = self.inner.clone();
11610                    let fut = async move {
11611                        let method = GetPeppersSvc(inner);
11612                        let codec = tonic_prost::ProstCodec::default();
11613                        let mut grpc = tonic::server::Grpc::new(codec)
11614                            .apply_compression_config(
11615                                accept_compression_encodings,
11616                                send_compression_encodings,
11617                            )
11618                            .apply_max_message_size_config(
11619                                max_decoding_message_size,
11620                                max_encoding_message_size,
11621                            );
11622                        let res = grpc.unary(method, req).await;
11623                        Ok(res)
11624                    };
11625                    Box::pin(fut)
11626                }
11627                _ => {
11628                    Box::pin(async move {
11629                        let mut response = http::Response::new(
11630                            tonic::body::Body::default(),
11631                        );
11632                        let headers = response.headers_mut();
11633                        headers
11634                            .insert(
11635                                tonic::Status::GRPC_STATUS,
11636                                (tonic::Code::Unimplemented as i32).into(),
11637                            );
11638                        headers
11639                            .insert(
11640                                http::header::CONTENT_TYPE,
11641                                tonic::metadata::GRPC_CONTENT_TYPE,
11642                            );
11643                        Ok(response)
11644                    })
11645                }
11646            }
11647        }
11648    }
11649    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11650        fn clone(&self) -> Self {
11651            let inner = self.inner.clone();
11652            Self {
11653                inner,
11654                accept_compression_encodings: self.accept_compression_encodings,
11655                send_compression_encodings: self.send_compression_encodings,
11656                max_decoding_message_size: self.max_decoding_message_size,
11657                max_encoding_message_size: self.max_encoding_message_size,
11658            }
11659        }
11660    }
11661    /// Generated gRPC service name
11662    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11663    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11664        const NAME: &'static str = SERVICE_NAME;
11665    }
11666}
11667/// Generated client implementations.
11668pub mod organization_service_client {
11669    #![allow(
11670        unused_variables,
11671        dead_code,
11672        missing_docs,
11673        clippy::wildcard_imports,
11674        clippy::let_unit_value,
11675    )]
11676    use tonic::codegen::*;
11677    use tonic::codegen::http::Uri;
11678    /** Manages organizations (tenants) in the Pidgr platform.
11679 Most RPCs operate within the caller's org (extracted from JWT).
11680 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11681*/
11682    #[derive(Debug, Clone)]
11683    pub struct OrganizationServiceClient<T> {
11684        inner: tonic::client::Grpc<T>,
11685    }
11686    impl OrganizationServiceClient<tonic::transport::Channel> {
11687        /// Attempt to create a new client by connecting to a given endpoint.
11688        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11689        where
11690            D: TryInto<tonic::transport::Endpoint>,
11691            D::Error: Into<StdError>,
11692        {
11693            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11694            Ok(Self::new(conn))
11695        }
11696    }
11697    impl<T> OrganizationServiceClient<T>
11698    where
11699        T: tonic::client::GrpcService<tonic::body::Body>,
11700        T::Error: Into<StdError>,
11701        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11702        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11703    {
11704        pub fn new(inner: T) -> Self {
11705            let inner = tonic::client::Grpc::new(inner);
11706            Self { inner }
11707        }
11708        pub fn with_origin(inner: T, origin: Uri) -> Self {
11709            let inner = tonic::client::Grpc::with_origin(inner, origin);
11710            Self { inner }
11711        }
11712        pub fn with_interceptor<F>(
11713            inner: T,
11714            interceptor: F,
11715        ) -> OrganizationServiceClient<InterceptedService<T, F>>
11716        where
11717            F: tonic::service::Interceptor,
11718            T::ResponseBody: Default,
11719            T: tonic::codegen::Service<
11720                http::Request<tonic::body::Body>,
11721                Response = http::Response<
11722                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11723                >,
11724            >,
11725            <T as tonic::codegen::Service<
11726                http::Request<tonic::body::Body>,
11727            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11728        {
11729            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11730        }
11731        /// Compress requests with the given encoding.
11732        ///
11733        /// This requires the server to support it otherwise it might respond with an
11734        /// error.
11735        #[must_use]
11736        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11737            self.inner = self.inner.send_compressed(encoding);
11738            self
11739        }
11740        /// Enable decompressing responses.
11741        #[must_use]
11742        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11743            self.inner = self.inner.accept_compressed(encoding);
11744            self
11745        }
11746        /// Limits the maximum size of a decoded message.
11747        ///
11748        /// Default: `4MB`
11749        #[must_use]
11750        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11751            self.inner = self.inner.max_decoding_message_size(limit);
11752            self
11753        }
11754        /// Limits the maximum size of an encoded message.
11755        ///
11756        /// Default: `usize::MAX`
11757        #[must_use]
11758        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11759            self.inner = self.inner.max_encoding_message_size(limit);
11760            self
11761        }
11762        /** Create a new organization. JWT auth only — the caller becomes the initial
11763 admin. Add further admins via CreateInviteLink.
11764 Authorization: Authenticated user (no specific permission required).
11765*/
11766        pub async fn create_organization(
11767            &mut self,
11768            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11769        ) -> std::result::Result<
11770            tonic::Response<super::CreateOrganizationResponse>,
11771            tonic::Status,
11772        > {
11773            self.inner
11774                .ready()
11775                .await
11776                .map_err(|e| {
11777                    tonic::Status::unknown(
11778                        format!("Service was not ready: {}", e.into()),
11779                    )
11780                })?;
11781            let codec = tonic_prost::ProstCodec::default();
11782            let path = http::uri::PathAndQuery::from_static(
11783                "/pidgr.v1.OrganizationService/CreateOrganization",
11784            );
11785            let mut req = request.into_request();
11786            req.extensions_mut()
11787                .insert(
11788                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11789                );
11790            self.inner.unary(req, path, codec).await
11791        }
11792        /** Retrieve the organization for the authenticated user.
11793 Authorization: Requires PERMISSION_ORG_READ.
11794*/
11795        pub async fn get_organization(
11796            &mut self,
11797            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11798        ) -> std::result::Result<
11799            tonic::Response<super::GetOrganizationResponse>,
11800            tonic::Status,
11801        > {
11802            self.inner
11803                .ready()
11804                .await
11805                .map_err(|e| {
11806                    tonic::Status::unknown(
11807                        format!("Service was not ready: {}", e.into()),
11808                    )
11809                })?;
11810            let codec = tonic_prost::ProstCodec::default();
11811            let path = http::uri::PathAndQuery::from_static(
11812                "/pidgr.v1.OrganizationService/GetOrganization",
11813            );
11814            let mut req = request.into_request();
11815            req.extensions_mut()
11816                .insert(
11817                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
11818                );
11819            self.inner.unary(req, path, codec).await
11820        }
11821        /** Update organization settings (name, default workflow, industry, company size).
11822 Authorization: Requires PERMISSION_ORG_WRITE.
11823*/
11824        pub async fn update_organization(
11825            &mut self,
11826            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
11827        ) -> std::result::Result<
11828            tonic::Response<super::UpdateOrganizationResponse>,
11829            tonic::Status,
11830        > {
11831            self.inner
11832                .ready()
11833                .await
11834                .map_err(|e| {
11835                    tonic::Status::unknown(
11836                        format!("Service was not ready: {}", e.into()),
11837                    )
11838                })?;
11839            let codec = tonic_prost::ProstCodec::default();
11840            let path = http::uri::PathAndQuery::from_static(
11841                "/pidgr.v1.OrganizationService/UpdateOrganization",
11842            );
11843            let mut req = request.into_request();
11844            req.extensions_mut()
11845                .insert(
11846                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
11847                );
11848            self.inner.unary(req, path, codec).await
11849        }
11850        /** Replace all SSO attribute mappings for the organization.
11851 Authorization: Requires PERMISSION_ORG_WRITE.
11852*/
11853        pub async fn update_sso_attribute_mappings(
11854            &mut self,
11855            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
11856        ) -> std::result::Result<
11857            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11858            tonic::Status,
11859        > {
11860            self.inner
11861                .ready()
11862                .await
11863                .map_err(|e| {
11864                    tonic::Status::unknown(
11865                        format!("Service was not ready: {}", e.into()),
11866                    )
11867                })?;
11868            let codec = tonic_prost::ProstCodec::default();
11869            let path = http::uri::PathAndQuery::from_static(
11870                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
11871            );
11872            let mut req = request.into_request();
11873            req.extensions_mut()
11874                .insert(
11875                    GrpcMethod::new(
11876                        "pidgr.v1.OrganizationService",
11877                        "UpdateSsoAttributeMappings",
11878                    ),
11879                );
11880            self.inner.unary(req, path, codec).await
11881        }
11882        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11883 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11884*/
11885        pub async fn rotate_analytics_salt(
11886            &mut self,
11887            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
11888        ) -> std::result::Result<
11889            tonic::Response<super::RotateAnalyticsSaltResponse>,
11890            tonic::Status,
11891        > {
11892            self.inner
11893                .ready()
11894                .await
11895                .map_err(|e| {
11896                    tonic::Status::unknown(
11897                        format!("Service was not ready: {}", e.into()),
11898                    )
11899                })?;
11900            let codec = tonic_prost::ProstCodec::default();
11901            let path = http::uri::PathAndQuery::from_static(
11902                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11903            );
11904            let mut req = request.into_request();
11905            req.extensions_mut()
11906                .insert(
11907                    GrpcMethod::new(
11908                        "pidgr.v1.OrganizationService",
11909                        "RotateAnalyticsSalt",
11910                    ),
11911                );
11912            self.inner.unary(req, path, codec).await
11913        }
11914        /** Update the differential privacy epsilon parameter.
11915 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11916*/
11917        pub async fn update_analytics_epsilon(
11918            &mut self,
11919            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
11920        ) -> std::result::Result<
11921            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11922            tonic::Status,
11923        > {
11924            self.inner
11925                .ready()
11926                .await
11927                .map_err(|e| {
11928                    tonic::Status::unknown(
11929                        format!("Service was not ready: {}", e.into()),
11930                    )
11931                })?;
11932            let codec = tonic_prost::ProstCodec::default();
11933            let path = http::uri::PathAndQuery::from_static(
11934                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
11935            );
11936            let mut req = request.into_request();
11937            req.extensions_mut()
11938                .insert(
11939                    GrpcMethod::new(
11940                        "pidgr.v1.OrganizationService",
11941                        "UpdateAnalyticsEpsilon",
11942                    ),
11943                );
11944            self.inner.unary(req, path, codec).await
11945        }
11946        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
11947 analytics, third-party channels) with last-changed-by/at metadata for
11948 the consent-trace UI.
11949 Authorization: Requires PERMISSION_PRIVACY_READ.
11950*/
11951        pub async fn get_org_privacy_settings(
11952            &mut self,
11953            request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
11954        ) -> std::result::Result<
11955            tonic::Response<super::GetOrgPrivacySettingsResponse>,
11956            tonic::Status,
11957        > {
11958            self.inner
11959                .ready()
11960                .await
11961                .map_err(|e| {
11962                    tonic::Status::unknown(
11963                        format!("Service was not ready: {}", e.into()),
11964                    )
11965                })?;
11966            let codec = tonic_prost::ProstCodec::default();
11967            let path = http::uri::PathAndQuery::from_static(
11968                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
11969            );
11970            let mut req = request.into_request();
11971            req.extensions_mut()
11972                .insert(
11973                    GrpcMethod::new(
11974                        "pidgr.v1.OrganizationService",
11975                        "GetOrgPrivacySettings",
11976                    ),
11977                );
11978            self.inner.unary(req, path, codec).await
11979        }
11980        /** Update org-level data-processing toggles. Only provided fields change;
11981 each change is recorded with the acting admin and timestamp.
11982 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11983*/
11984        pub async fn update_org_privacy_settings(
11985            &mut self,
11986            request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
11987        ) -> std::result::Result<
11988            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
11989            tonic::Status,
11990        > {
11991            self.inner
11992                .ready()
11993                .await
11994                .map_err(|e| {
11995                    tonic::Status::unknown(
11996                        format!("Service was not ready: {}", e.into()),
11997                    )
11998                })?;
11999            let codec = tonic_prost::ProstCodec::default();
12000            let path = http::uri::PathAndQuery::from_static(
12001                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
12002            );
12003            let mut req = request.into_request();
12004            req.extensions_mut()
12005                .insert(
12006                    GrpcMethod::new(
12007                        "pidgr.v1.OrganizationService",
12008                        "UpdateOrgPrivacySettings",
12009                    ),
12010                );
12011            self.inner.unary(req, path, codec).await
12012        }
12013        /** Create a sandbox organization for testing configurations.
12014 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12015 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12016 per user to prevent abuse.
12017*/
12018        pub async fn create_sandbox_organization(
12019            &mut self,
12020            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
12021        ) -> std::result::Result<
12022            tonic::Response<super::CreateSandboxOrganizationResponse>,
12023            tonic::Status,
12024        > {
12025            self.inner
12026                .ready()
12027                .await
12028                .map_err(|e| {
12029                    tonic::Status::unknown(
12030                        format!("Service was not ready: {}", e.into()),
12031                    )
12032                })?;
12033            let codec = tonic_prost::ProstCodec::default();
12034            let path = http::uri::PathAndQuery::from_static(
12035                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
12036            );
12037            let mut req = request.into_request();
12038            req.extensions_mut()
12039                .insert(
12040                    GrpcMethod::new(
12041                        "pidgr.v1.OrganizationService",
12042                        "CreateSandboxOrganization",
12043                    ),
12044                );
12045            self.inner.unary(req, path, codec).await
12046        }
12047        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12048 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12049 content stores.
12050 Authorization: Super admin of the target sandbox OR its creator.
12051*/
12052        pub async fn delete_sandbox_organization(
12053            &mut self,
12054            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
12055        ) -> std::result::Result<
12056            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12057            tonic::Status,
12058        > {
12059            self.inner
12060                .ready()
12061                .await
12062                .map_err(|e| {
12063                    tonic::Status::unknown(
12064                        format!("Service was not ready: {}", e.into()),
12065                    )
12066                })?;
12067            let codec = tonic_prost::ProstCodec::default();
12068            let path = http::uri::PathAndQuery::from_static(
12069                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
12070            );
12071            let mut req = request.into_request();
12072            req.extensions_mut()
12073                .insert(
12074                    GrpcMethod::new(
12075                        "pidgr.v1.OrganizationService",
12076                        "DeleteSandboxOrganization",
12077                    ),
12078                );
12079            self.inner.unary(req, path, codec).await
12080        }
12081        /** List bootstrap fixtures available for seeding new organizations. The
12082 catalog is backend-owned; admin UI populates the "seed initial data"
12083 control or dropdown from this response.
12084 Authorization: Any authenticated user.
12085*/
12086        pub async fn list_sandbox_fixtures(
12087            &mut self,
12088            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
12089        ) -> std::result::Result<
12090            tonic::Response<super::ListSandboxFixturesResponse>,
12091            tonic::Status,
12092        > {
12093            self.inner
12094                .ready()
12095                .await
12096                .map_err(|e| {
12097                    tonic::Status::unknown(
12098                        format!("Service was not ready: {}", e.into()),
12099                    )
12100                })?;
12101            let codec = tonic_prost::ProstCodec::default();
12102            let path = http::uri::PathAndQuery::from_static(
12103                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
12104            );
12105            let mut req = request.into_request();
12106            req.extensions_mut()
12107                .insert(
12108                    GrpcMethod::new(
12109                        "pidgr.v1.OrganizationService",
12110                        "ListSandboxFixtures",
12111                    ),
12112                );
12113            self.inner.unary(req, path, codec).await
12114        }
12115        /** List all organizations the authenticated user belongs to.
12116 Org-exempt: callable without org context (only requires valid JWT).
12117 Used by the admin org switcher to discover available orgs.
12118 Excludes expired sandbox organizations.
12119 Authorization: Authenticated user (no specific permission required).
12120*/
12121        pub async fn list_user_organizations(
12122            &mut self,
12123            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
12124        ) -> std::result::Result<
12125            tonic::Response<super::ListUserOrganizationsResponse>,
12126            tonic::Status,
12127        > {
12128            self.inner
12129                .ready()
12130                .await
12131                .map_err(|e| {
12132                    tonic::Status::unknown(
12133                        format!("Service was not ready: {}", e.into()),
12134                    )
12135                })?;
12136            let codec = tonic_prost::ProstCodec::default();
12137            let path = http::uri::PathAndQuery::from_static(
12138                "/pidgr.v1.OrganizationService/ListUserOrganizations",
12139            );
12140            let mut req = request.into_request();
12141            req.extensions_mut()
12142                .insert(
12143                    GrpcMethod::new(
12144                        "pidgr.v1.OrganizationService",
12145                        "ListUserOrganizations",
12146                    ),
12147                );
12148            self.inner.unary(req, path, codec).await
12149        }
12150        /** List only the sandbox organizations the authenticated user belongs to.
12151 Org-exempt: callable without org context. The admin UI's /sandboxes
12152 management page is the primary consumer — it's a user-level surface
12153 rather than org-scoped, so this RPC is user-scoped too.
12154 Excludes already-expired sandboxes (pending cleanup).
12155 Authorization: Authenticated user (no specific permission required).
12156*/
12157        pub async fn list_user_sandboxes(
12158            &mut self,
12159            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
12160        ) -> std::result::Result<
12161            tonic::Response<super::ListUserSandboxesResponse>,
12162            tonic::Status,
12163        > {
12164            self.inner
12165                .ready()
12166                .await
12167                .map_err(|e| {
12168                    tonic::Status::unknown(
12169                        format!("Service was not ready: {}", e.into()),
12170                    )
12171                })?;
12172            let codec = tonic_prost::ProstCodec::default();
12173            let path = http::uri::PathAndQuery::from_static(
12174                "/pidgr.v1.OrganizationService/ListUserSandboxes",
12175            );
12176            let mut req = request.into_request();
12177            req.extensions_mut()
12178                .insert(
12179                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
12180                );
12181            self.inner.unary(req, path, codec).await
12182        }
12183    }
12184}
12185/// Generated server implementations.
12186pub mod organization_service_server {
12187    #![allow(
12188        unused_variables,
12189        dead_code,
12190        missing_docs,
12191        clippy::wildcard_imports,
12192        clippy::let_unit_value,
12193    )]
12194    use tonic::codegen::*;
12195    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
12196    #[async_trait]
12197    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
12198        /** Create a new organization. JWT auth only — the caller becomes the initial
12199 admin. Add further admins via CreateInviteLink.
12200 Authorization: Authenticated user (no specific permission required).
12201*/
12202        async fn create_organization(
12203            &self,
12204            request: tonic::Request<super::CreateOrganizationRequest>,
12205        ) -> std::result::Result<
12206            tonic::Response<super::CreateOrganizationResponse>,
12207            tonic::Status,
12208        >;
12209        /** Retrieve the organization for the authenticated user.
12210 Authorization: Requires PERMISSION_ORG_READ.
12211*/
12212        async fn get_organization(
12213            &self,
12214            request: tonic::Request<super::GetOrganizationRequest>,
12215        ) -> std::result::Result<
12216            tonic::Response<super::GetOrganizationResponse>,
12217            tonic::Status,
12218        >;
12219        /** Update organization settings (name, default workflow, industry, company size).
12220 Authorization: Requires PERMISSION_ORG_WRITE.
12221*/
12222        async fn update_organization(
12223            &self,
12224            request: tonic::Request<super::UpdateOrganizationRequest>,
12225        ) -> std::result::Result<
12226            tonic::Response<super::UpdateOrganizationResponse>,
12227            tonic::Status,
12228        >;
12229        /** Replace all SSO attribute mappings for the organization.
12230 Authorization: Requires PERMISSION_ORG_WRITE.
12231*/
12232        async fn update_sso_attribute_mappings(
12233            &self,
12234            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
12235        ) -> std::result::Result<
12236            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12237            tonic::Status,
12238        >;
12239        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
12240 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12241*/
12242        async fn rotate_analytics_salt(
12243            &self,
12244            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12245        ) -> std::result::Result<
12246            tonic::Response<super::RotateAnalyticsSaltResponse>,
12247            tonic::Status,
12248        >;
12249        /** Update the differential privacy epsilon parameter.
12250 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12251*/
12252        async fn update_analytics_epsilon(
12253            &self,
12254            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12255        ) -> std::result::Result<
12256            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12257            tonic::Status,
12258        >;
12259        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12260 analytics, third-party channels) with last-changed-by/at metadata for
12261 the consent-trace UI.
12262 Authorization: Requires PERMISSION_PRIVACY_READ.
12263*/
12264        async fn get_org_privacy_settings(
12265            &self,
12266            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12267        ) -> std::result::Result<
12268            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12269            tonic::Status,
12270        >;
12271        /** Update org-level data-processing toggles. Only provided fields change;
12272 each change is recorded with the acting admin and timestamp.
12273 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12274*/
12275        async fn update_org_privacy_settings(
12276            &self,
12277            request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
12278        ) -> std::result::Result<
12279            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12280            tonic::Status,
12281        >;
12282        /** Create a sandbox organization for testing configurations.
12283 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12284 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12285 per user to prevent abuse.
12286*/
12287        async fn create_sandbox_organization(
12288            &self,
12289            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
12290        ) -> std::result::Result<
12291            tonic::Response<super::CreateSandboxOrganizationResponse>,
12292            tonic::Status,
12293        >;
12294        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12295 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12296 content stores.
12297 Authorization: Super admin of the target sandbox OR its creator.
12298*/
12299        async fn delete_sandbox_organization(
12300            &self,
12301            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
12302        ) -> std::result::Result<
12303            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12304            tonic::Status,
12305        >;
12306        /** List bootstrap fixtures available for seeding new organizations. The
12307 catalog is backend-owned; admin UI populates the "seed initial data"
12308 control or dropdown from this response.
12309 Authorization: Any authenticated user.
12310*/
12311        async fn list_sandbox_fixtures(
12312            &self,
12313            request: tonic::Request<super::ListSandboxFixturesRequest>,
12314        ) -> std::result::Result<
12315            tonic::Response<super::ListSandboxFixturesResponse>,
12316            tonic::Status,
12317        >;
12318        /** List all organizations the authenticated user belongs to.
12319 Org-exempt: callable without org context (only requires valid JWT).
12320 Used by the admin org switcher to discover available orgs.
12321 Excludes expired sandbox organizations.
12322 Authorization: Authenticated user (no specific permission required).
12323*/
12324        async fn list_user_organizations(
12325            &self,
12326            request: tonic::Request<super::ListUserOrganizationsRequest>,
12327        ) -> std::result::Result<
12328            tonic::Response<super::ListUserOrganizationsResponse>,
12329            tonic::Status,
12330        >;
12331        /** List only the sandbox organizations the authenticated user belongs to.
12332 Org-exempt: callable without org context. The admin UI's /sandboxes
12333 management page is the primary consumer — it's a user-level surface
12334 rather than org-scoped, so this RPC is user-scoped too.
12335 Excludes already-expired sandboxes (pending cleanup).
12336 Authorization: Authenticated user (no specific permission required).
12337*/
12338        async fn list_user_sandboxes(
12339            &self,
12340            request: tonic::Request<super::ListUserSandboxesRequest>,
12341        ) -> std::result::Result<
12342            tonic::Response<super::ListUserSandboxesResponse>,
12343            tonic::Status,
12344        >;
12345    }
12346    /** Manages organizations (tenants) in the Pidgr platform.
12347 Most RPCs operate within the caller's org (extracted from JWT).
12348 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
12349*/
12350    #[derive(Debug)]
12351    pub struct OrganizationServiceServer<T> {
12352        inner: Arc<T>,
12353        accept_compression_encodings: EnabledCompressionEncodings,
12354        send_compression_encodings: EnabledCompressionEncodings,
12355        max_decoding_message_size: Option<usize>,
12356        max_encoding_message_size: Option<usize>,
12357    }
12358    impl<T> OrganizationServiceServer<T> {
12359        pub fn new(inner: T) -> Self {
12360            Self::from_arc(Arc::new(inner))
12361        }
12362        pub fn from_arc(inner: Arc<T>) -> Self {
12363            Self {
12364                inner,
12365                accept_compression_encodings: Default::default(),
12366                send_compression_encodings: Default::default(),
12367                max_decoding_message_size: None,
12368                max_encoding_message_size: None,
12369            }
12370        }
12371        pub fn with_interceptor<F>(
12372            inner: T,
12373            interceptor: F,
12374        ) -> InterceptedService<Self, F>
12375        where
12376            F: tonic::service::Interceptor,
12377        {
12378            InterceptedService::new(Self::new(inner), interceptor)
12379        }
12380        /// Enable decompressing requests with the given encoding.
12381        #[must_use]
12382        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12383            self.accept_compression_encodings.enable(encoding);
12384            self
12385        }
12386        /// Compress responses with the given encoding, if the client supports it.
12387        #[must_use]
12388        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12389            self.send_compression_encodings.enable(encoding);
12390            self
12391        }
12392        /// Limits the maximum size of a decoded message.
12393        ///
12394        /// Default: `4MB`
12395        #[must_use]
12396        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12397            self.max_decoding_message_size = Some(limit);
12398            self
12399        }
12400        /// Limits the maximum size of an encoded message.
12401        ///
12402        /// Default: `usize::MAX`
12403        #[must_use]
12404        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12405            self.max_encoding_message_size = Some(limit);
12406            self
12407        }
12408    }
12409    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
12410    where
12411        T: OrganizationService,
12412        B: Body + std::marker::Send + 'static,
12413        B::Error: Into<StdError> + std::marker::Send + 'static,
12414    {
12415        type Response = http::Response<tonic::body::Body>;
12416        type Error = std::convert::Infallible;
12417        type Future = BoxFuture<Self::Response, Self::Error>;
12418        fn poll_ready(
12419            &mut self,
12420            _cx: &mut Context<'_>,
12421        ) -> Poll<std::result::Result<(), Self::Error>> {
12422            Poll::Ready(Ok(()))
12423        }
12424        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12425            match req.uri().path() {
12426                "/pidgr.v1.OrganizationService/CreateOrganization" => {
12427                    #[allow(non_camel_case_types)]
12428                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12429                    impl<
12430                        T: OrganizationService,
12431                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
12432                    for CreateOrganizationSvc<T> {
12433                        type Response = super::CreateOrganizationResponse;
12434                        type Future = BoxFuture<
12435                            tonic::Response<Self::Response>,
12436                            tonic::Status,
12437                        >;
12438                        fn call(
12439                            &mut self,
12440                            request: tonic::Request<super::CreateOrganizationRequest>,
12441                        ) -> Self::Future {
12442                            let inner = Arc::clone(&self.0);
12443                            let fut = async move {
12444                                <T as OrganizationService>::create_organization(
12445                                        &inner,
12446                                        request,
12447                                    )
12448                                    .await
12449                            };
12450                            Box::pin(fut)
12451                        }
12452                    }
12453                    let accept_compression_encodings = self.accept_compression_encodings;
12454                    let send_compression_encodings = self.send_compression_encodings;
12455                    let max_decoding_message_size = self.max_decoding_message_size;
12456                    let max_encoding_message_size = self.max_encoding_message_size;
12457                    let inner = self.inner.clone();
12458                    let fut = async move {
12459                        let method = CreateOrganizationSvc(inner);
12460                        let codec = tonic_prost::ProstCodec::default();
12461                        let mut grpc = tonic::server::Grpc::new(codec)
12462                            .apply_compression_config(
12463                                accept_compression_encodings,
12464                                send_compression_encodings,
12465                            )
12466                            .apply_max_message_size_config(
12467                                max_decoding_message_size,
12468                                max_encoding_message_size,
12469                            );
12470                        let res = grpc.unary(method, req).await;
12471                        Ok(res)
12472                    };
12473                    Box::pin(fut)
12474                }
12475                "/pidgr.v1.OrganizationService/GetOrganization" => {
12476                    #[allow(non_camel_case_types)]
12477                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12478                    impl<
12479                        T: OrganizationService,
12480                    > tonic::server::UnaryService<super::GetOrganizationRequest>
12481                    for GetOrganizationSvc<T> {
12482                        type Response = super::GetOrganizationResponse;
12483                        type Future = BoxFuture<
12484                            tonic::Response<Self::Response>,
12485                            tonic::Status,
12486                        >;
12487                        fn call(
12488                            &mut self,
12489                            request: tonic::Request<super::GetOrganizationRequest>,
12490                        ) -> Self::Future {
12491                            let inner = Arc::clone(&self.0);
12492                            let fut = async move {
12493                                <T as OrganizationService>::get_organization(
12494                                        &inner,
12495                                        request,
12496                                    )
12497                                    .await
12498                            };
12499                            Box::pin(fut)
12500                        }
12501                    }
12502                    let accept_compression_encodings = self.accept_compression_encodings;
12503                    let send_compression_encodings = self.send_compression_encodings;
12504                    let max_decoding_message_size = self.max_decoding_message_size;
12505                    let max_encoding_message_size = self.max_encoding_message_size;
12506                    let inner = self.inner.clone();
12507                    let fut = async move {
12508                        let method = GetOrganizationSvc(inner);
12509                        let codec = tonic_prost::ProstCodec::default();
12510                        let mut grpc = tonic::server::Grpc::new(codec)
12511                            .apply_compression_config(
12512                                accept_compression_encodings,
12513                                send_compression_encodings,
12514                            )
12515                            .apply_max_message_size_config(
12516                                max_decoding_message_size,
12517                                max_encoding_message_size,
12518                            );
12519                        let res = grpc.unary(method, req).await;
12520                        Ok(res)
12521                    };
12522                    Box::pin(fut)
12523                }
12524                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12525                    #[allow(non_camel_case_types)]
12526                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12527                    impl<
12528                        T: OrganizationService,
12529                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12530                    for UpdateOrganizationSvc<T> {
12531                        type Response = super::UpdateOrganizationResponse;
12532                        type Future = BoxFuture<
12533                            tonic::Response<Self::Response>,
12534                            tonic::Status,
12535                        >;
12536                        fn call(
12537                            &mut self,
12538                            request: tonic::Request<super::UpdateOrganizationRequest>,
12539                        ) -> Self::Future {
12540                            let inner = Arc::clone(&self.0);
12541                            let fut = async move {
12542                                <T as OrganizationService>::update_organization(
12543                                        &inner,
12544                                        request,
12545                                    )
12546                                    .await
12547                            };
12548                            Box::pin(fut)
12549                        }
12550                    }
12551                    let accept_compression_encodings = self.accept_compression_encodings;
12552                    let send_compression_encodings = self.send_compression_encodings;
12553                    let max_decoding_message_size = self.max_decoding_message_size;
12554                    let max_encoding_message_size = self.max_encoding_message_size;
12555                    let inner = self.inner.clone();
12556                    let fut = async move {
12557                        let method = UpdateOrganizationSvc(inner);
12558                        let codec = tonic_prost::ProstCodec::default();
12559                        let mut grpc = tonic::server::Grpc::new(codec)
12560                            .apply_compression_config(
12561                                accept_compression_encodings,
12562                                send_compression_encodings,
12563                            )
12564                            .apply_max_message_size_config(
12565                                max_decoding_message_size,
12566                                max_encoding_message_size,
12567                            );
12568                        let res = grpc.unary(method, req).await;
12569                        Ok(res)
12570                    };
12571                    Box::pin(fut)
12572                }
12573                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12574                    #[allow(non_camel_case_types)]
12575                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12576                        pub Arc<T>,
12577                    );
12578                    impl<
12579                        T: OrganizationService,
12580                    > tonic::server::UnaryService<
12581                        super::UpdateSsoAttributeMappingsRequest,
12582                    > for UpdateSsoAttributeMappingsSvc<T> {
12583                        type Response = super::UpdateSsoAttributeMappingsResponse;
12584                        type Future = BoxFuture<
12585                            tonic::Response<Self::Response>,
12586                            tonic::Status,
12587                        >;
12588                        fn call(
12589                            &mut self,
12590                            request: tonic::Request<
12591                                super::UpdateSsoAttributeMappingsRequest,
12592                            >,
12593                        ) -> Self::Future {
12594                            let inner = Arc::clone(&self.0);
12595                            let fut = async move {
12596                                <T as OrganizationService>::update_sso_attribute_mappings(
12597                                        &inner,
12598                                        request,
12599                                    )
12600                                    .await
12601                            };
12602                            Box::pin(fut)
12603                        }
12604                    }
12605                    let accept_compression_encodings = self.accept_compression_encodings;
12606                    let send_compression_encodings = self.send_compression_encodings;
12607                    let max_decoding_message_size = self.max_decoding_message_size;
12608                    let max_encoding_message_size = self.max_encoding_message_size;
12609                    let inner = self.inner.clone();
12610                    let fut = async move {
12611                        let method = UpdateSsoAttributeMappingsSvc(inner);
12612                        let codec = tonic_prost::ProstCodec::default();
12613                        let mut grpc = tonic::server::Grpc::new(codec)
12614                            .apply_compression_config(
12615                                accept_compression_encodings,
12616                                send_compression_encodings,
12617                            )
12618                            .apply_max_message_size_config(
12619                                max_decoding_message_size,
12620                                max_encoding_message_size,
12621                            );
12622                        let res = grpc.unary(method, req).await;
12623                        Ok(res)
12624                    };
12625                    Box::pin(fut)
12626                }
12627                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12628                    #[allow(non_camel_case_types)]
12629                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12630                    impl<
12631                        T: OrganizationService,
12632                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12633                    for RotateAnalyticsSaltSvc<T> {
12634                        type Response = super::RotateAnalyticsSaltResponse;
12635                        type Future = BoxFuture<
12636                            tonic::Response<Self::Response>,
12637                            tonic::Status,
12638                        >;
12639                        fn call(
12640                            &mut self,
12641                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12642                        ) -> Self::Future {
12643                            let inner = Arc::clone(&self.0);
12644                            let fut = async move {
12645                                <T as OrganizationService>::rotate_analytics_salt(
12646                                        &inner,
12647                                        request,
12648                                    )
12649                                    .await
12650                            };
12651                            Box::pin(fut)
12652                        }
12653                    }
12654                    let accept_compression_encodings = self.accept_compression_encodings;
12655                    let send_compression_encodings = self.send_compression_encodings;
12656                    let max_decoding_message_size = self.max_decoding_message_size;
12657                    let max_encoding_message_size = self.max_encoding_message_size;
12658                    let inner = self.inner.clone();
12659                    let fut = async move {
12660                        let method = RotateAnalyticsSaltSvc(inner);
12661                        let codec = tonic_prost::ProstCodec::default();
12662                        let mut grpc = tonic::server::Grpc::new(codec)
12663                            .apply_compression_config(
12664                                accept_compression_encodings,
12665                                send_compression_encodings,
12666                            )
12667                            .apply_max_message_size_config(
12668                                max_decoding_message_size,
12669                                max_encoding_message_size,
12670                            );
12671                        let res = grpc.unary(method, req).await;
12672                        Ok(res)
12673                    };
12674                    Box::pin(fut)
12675                }
12676                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12677                    #[allow(non_camel_case_types)]
12678                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12679                    impl<
12680                        T: OrganizationService,
12681                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12682                    for UpdateAnalyticsEpsilonSvc<T> {
12683                        type Response = super::UpdateAnalyticsEpsilonResponse;
12684                        type Future = BoxFuture<
12685                            tonic::Response<Self::Response>,
12686                            tonic::Status,
12687                        >;
12688                        fn call(
12689                            &mut self,
12690                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12691                        ) -> Self::Future {
12692                            let inner = Arc::clone(&self.0);
12693                            let fut = async move {
12694                                <T as OrganizationService>::update_analytics_epsilon(
12695                                        &inner,
12696                                        request,
12697                                    )
12698                                    .await
12699                            };
12700                            Box::pin(fut)
12701                        }
12702                    }
12703                    let accept_compression_encodings = self.accept_compression_encodings;
12704                    let send_compression_encodings = self.send_compression_encodings;
12705                    let max_decoding_message_size = self.max_decoding_message_size;
12706                    let max_encoding_message_size = self.max_encoding_message_size;
12707                    let inner = self.inner.clone();
12708                    let fut = async move {
12709                        let method = UpdateAnalyticsEpsilonSvc(inner);
12710                        let codec = tonic_prost::ProstCodec::default();
12711                        let mut grpc = tonic::server::Grpc::new(codec)
12712                            .apply_compression_config(
12713                                accept_compression_encodings,
12714                                send_compression_encodings,
12715                            )
12716                            .apply_max_message_size_config(
12717                                max_decoding_message_size,
12718                                max_encoding_message_size,
12719                            );
12720                        let res = grpc.unary(method, req).await;
12721                        Ok(res)
12722                    };
12723                    Box::pin(fut)
12724                }
12725                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
12726                    #[allow(non_camel_case_types)]
12727                    struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
12728                    impl<
12729                        T: OrganizationService,
12730                    > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
12731                    for GetOrgPrivacySettingsSvc<T> {
12732                        type Response = super::GetOrgPrivacySettingsResponse;
12733                        type Future = BoxFuture<
12734                            tonic::Response<Self::Response>,
12735                            tonic::Status,
12736                        >;
12737                        fn call(
12738                            &mut self,
12739                            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12740                        ) -> Self::Future {
12741                            let inner = Arc::clone(&self.0);
12742                            let fut = async move {
12743                                <T as OrganizationService>::get_org_privacy_settings(
12744                                        &inner,
12745                                        request,
12746                                    )
12747                                    .await
12748                            };
12749                            Box::pin(fut)
12750                        }
12751                    }
12752                    let accept_compression_encodings = self.accept_compression_encodings;
12753                    let send_compression_encodings = self.send_compression_encodings;
12754                    let max_decoding_message_size = self.max_decoding_message_size;
12755                    let max_encoding_message_size = self.max_encoding_message_size;
12756                    let inner = self.inner.clone();
12757                    let fut = async move {
12758                        let method = GetOrgPrivacySettingsSvc(inner);
12759                        let codec = tonic_prost::ProstCodec::default();
12760                        let mut grpc = tonic::server::Grpc::new(codec)
12761                            .apply_compression_config(
12762                                accept_compression_encodings,
12763                                send_compression_encodings,
12764                            )
12765                            .apply_max_message_size_config(
12766                                max_decoding_message_size,
12767                                max_encoding_message_size,
12768                            );
12769                        let res = grpc.unary(method, req).await;
12770                        Ok(res)
12771                    };
12772                    Box::pin(fut)
12773                }
12774                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
12775                    #[allow(non_camel_case_types)]
12776                    struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
12777                        pub Arc<T>,
12778                    );
12779                    impl<
12780                        T: OrganizationService,
12781                    > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
12782                    for UpdateOrgPrivacySettingsSvc<T> {
12783                        type Response = super::UpdateOrgPrivacySettingsResponse;
12784                        type Future = BoxFuture<
12785                            tonic::Response<Self::Response>,
12786                            tonic::Status,
12787                        >;
12788                        fn call(
12789                            &mut self,
12790                            request: tonic::Request<
12791                                super::UpdateOrgPrivacySettingsRequest,
12792                            >,
12793                        ) -> Self::Future {
12794                            let inner = Arc::clone(&self.0);
12795                            let fut = async move {
12796                                <T as OrganizationService>::update_org_privacy_settings(
12797                                        &inner,
12798                                        request,
12799                                    )
12800                                    .await
12801                            };
12802                            Box::pin(fut)
12803                        }
12804                    }
12805                    let accept_compression_encodings = self.accept_compression_encodings;
12806                    let send_compression_encodings = self.send_compression_encodings;
12807                    let max_decoding_message_size = self.max_decoding_message_size;
12808                    let max_encoding_message_size = self.max_encoding_message_size;
12809                    let inner = self.inner.clone();
12810                    let fut = async move {
12811                        let method = UpdateOrgPrivacySettingsSvc(inner);
12812                        let codec = tonic_prost::ProstCodec::default();
12813                        let mut grpc = tonic::server::Grpc::new(codec)
12814                            .apply_compression_config(
12815                                accept_compression_encodings,
12816                                send_compression_encodings,
12817                            )
12818                            .apply_max_message_size_config(
12819                                max_decoding_message_size,
12820                                max_encoding_message_size,
12821                            );
12822                        let res = grpc.unary(method, req).await;
12823                        Ok(res)
12824                    };
12825                    Box::pin(fut)
12826                }
12827                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
12828                    #[allow(non_camel_case_types)]
12829                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
12830                        pub Arc<T>,
12831                    );
12832                    impl<
12833                        T: OrganizationService,
12834                    > tonic::server::UnaryService<
12835                        super::CreateSandboxOrganizationRequest,
12836                    > for CreateSandboxOrganizationSvc<T> {
12837                        type Response = super::CreateSandboxOrganizationResponse;
12838                        type Future = BoxFuture<
12839                            tonic::Response<Self::Response>,
12840                            tonic::Status,
12841                        >;
12842                        fn call(
12843                            &mut self,
12844                            request: tonic::Request<
12845                                super::CreateSandboxOrganizationRequest,
12846                            >,
12847                        ) -> Self::Future {
12848                            let inner = Arc::clone(&self.0);
12849                            let fut = async move {
12850                                <T as OrganizationService>::create_sandbox_organization(
12851                                        &inner,
12852                                        request,
12853                                    )
12854                                    .await
12855                            };
12856                            Box::pin(fut)
12857                        }
12858                    }
12859                    let accept_compression_encodings = self.accept_compression_encodings;
12860                    let send_compression_encodings = self.send_compression_encodings;
12861                    let max_decoding_message_size = self.max_decoding_message_size;
12862                    let max_encoding_message_size = self.max_encoding_message_size;
12863                    let inner = self.inner.clone();
12864                    let fut = async move {
12865                        let method = CreateSandboxOrganizationSvc(inner);
12866                        let codec = tonic_prost::ProstCodec::default();
12867                        let mut grpc = tonic::server::Grpc::new(codec)
12868                            .apply_compression_config(
12869                                accept_compression_encodings,
12870                                send_compression_encodings,
12871                            )
12872                            .apply_max_message_size_config(
12873                                max_decoding_message_size,
12874                                max_encoding_message_size,
12875                            );
12876                        let res = grpc.unary(method, req).await;
12877                        Ok(res)
12878                    };
12879                    Box::pin(fut)
12880                }
12881                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
12882                    #[allow(non_camel_case_types)]
12883                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
12884                        pub Arc<T>,
12885                    );
12886                    impl<
12887                        T: OrganizationService,
12888                    > tonic::server::UnaryService<
12889                        super::DeleteSandboxOrganizationRequest,
12890                    > for DeleteSandboxOrganizationSvc<T> {
12891                        type Response = super::DeleteSandboxOrganizationResponse;
12892                        type Future = BoxFuture<
12893                            tonic::Response<Self::Response>,
12894                            tonic::Status,
12895                        >;
12896                        fn call(
12897                            &mut self,
12898                            request: tonic::Request<
12899                                super::DeleteSandboxOrganizationRequest,
12900                            >,
12901                        ) -> Self::Future {
12902                            let inner = Arc::clone(&self.0);
12903                            let fut = async move {
12904                                <T as OrganizationService>::delete_sandbox_organization(
12905                                        &inner,
12906                                        request,
12907                                    )
12908                                    .await
12909                            };
12910                            Box::pin(fut)
12911                        }
12912                    }
12913                    let accept_compression_encodings = self.accept_compression_encodings;
12914                    let send_compression_encodings = self.send_compression_encodings;
12915                    let max_decoding_message_size = self.max_decoding_message_size;
12916                    let max_encoding_message_size = self.max_encoding_message_size;
12917                    let inner = self.inner.clone();
12918                    let fut = async move {
12919                        let method = DeleteSandboxOrganizationSvc(inner);
12920                        let codec = tonic_prost::ProstCodec::default();
12921                        let mut grpc = tonic::server::Grpc::new(codec)
12922                            .apply_compression_config(
12923                                accept_compression_encodings,
12924                                send_compression_encodings,
12925                            )
12926                            .apply_max_message_size_config(
12927                                max_decoding_message_size,
12928                                max_encoding_message_size,
12929                            );
12930                        let res = grpc.unary(method, req).await;
12931                        Ok(res)
12932                    };
12933                    Box::pin(fut)
12934                }
12935                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
12936                    #[allow(non_camel_case_types)]
12937                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
12938                    impl<
12939                        T: OrganizationService,
12940                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
12941                    for ListSandboxFixturesSvc<T> {
12942                        type Response = super::ListSandboxFixturesResponse;
12943                        type Future = BoxFuture<
12944                            tonic::Response<Self::Response>,
12945                            tonic::Status,
12946                        >;
12947                        fn call(
12948                            &mut self,
12949                            request: tonic::Request<super::ListSandboxFixturesRequest>,
12950                        ) -> Self::Future {
12951                            let inner = Arc::clone(&self.0);
12952                            let fut = async move {
12953                                <T as OrganizationService>::list_sandbox_fixtures(
12954                                        &inner,
12955                                        request,
12956                                    )
12957                                    .await
12958                            };
12959                            Box::pin(fut)
12960                        }
12961                    }
12962                    let accept_compression_encodings = self.accept_compression_encodings;
12963                    let send_compression_encodings = self.send_compression_encodings;
12964                    let max_decoding_message_size = self.max_decoding_message_size;
12965                    let max_encoding_message_size = self.max_encoding_message_size;
12966                    let inner = self.inner.clone();
12967                    let fut = async move {
12968                        let method = ListSandboxFixturesSvc(inner);
12969                        let codec = tonic_prost::ProstCodec::default();
12970                        let mut grpc = tonic::server::Grpc::new(codec)
12971                            .apply_compression_config(
12972                                accept_compression_encodings,
12973                                send_compression_encodings,
12974                            )
12975                            .apply_max_message_size_config(
12976                                max_decoding_message_size,
12977                                max_encoding_message_size,
12978                            );
12979                        let res = grpc.unary(method, req).await;
12980                        Ok(res)
12981                    };
12982                    Box::pin(fut)
12983                }
12984                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
12985                    #[allow(non_camel_case_types)]
12986                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
12987                    impl<
12988                        T: OrganizationService,
12989                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
12990                    for ListUserOrganizationsSvc<T> {
12991                        type Response = super::ListUserOrganizationsResponse;
12992                        type Future = BoxFuture<
12993                            tonic::Response<Self::Response>,
12994                            tonic::Status,
12995                        >;
12996                        fn call(
12997                            &mut self,
12998                            request: tonic::Request<super::ListUserOrganizationsRequest>,
12999                        ) -> Self::Future {
13000                            let inner = Arc::clone(&self.0);
13001                            let fut = async move {
13002                                <T as OrganizationService>::list_user_organizations(
13003                                        &inner,
13004                                        request,
13005                                    )
13006                                    .await
13007                            };
13008                            Box::pin(fut)
13009                        }
13010                    }
13011                    let accept_compression_encodings = self.accept_compression_encodings;
13012                    let send_compression_encodings = self.send_compression_encodings;
13013                    let max_decoding_message_size = self.max_decoding_message_size;
13014                    let max_encoding_message_size = self.max_encoding_message_size;
13015                    let inner = self.inner.clone();
13016                    let fut = async move {
13017                        let method = ListUserOrganizationsSvc(inner);
13018                        let codec = tonic_prost::ProstCodec::default();
13019                        let mut grpc = tonic::server::Grpc::new(codec)
13020                            .apply_compression_config(
13021                                accept_compression_encodings,
13022                                send_compression_encodings,
13023                            )
13024                            .apply_max_message_size_config(
13025                                max_decoding_message_size,
13026                                max_encoding_message_size,
13027                            );
13028                        let res = grpc.unary(method, req).await;
13029                        Ok(res)
13030                    };
13031                    Box::pin(fut)
13032                }
13033                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
13034                    #[allow(non_camel_case_types)]
13035                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
13036                    impl<
13037                        T: OrganizationService,
13038                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
13039                    for ListUserSandboxesSvc<T> {
13040                        type Response = super::ListUserSandboxesResponse;
13041                        type Future = BoxFuture<
13042                            tonic::Response<Self::Response>,
13043                            tonic::Status,
13044                        >;
13045                        fn call(
13046                            &mut self,
13047                            request: tonic::Request<super::ListUserSandboxesRequest>,
13048                        ) -> Self::Future {
13049                            let inner = Arc::clone(&self.0);
13050                            let fut = async move {
13051                                <T as OrganizationService>::list_user_sandboxes(
13052                                        &inner,
13053                                        request,
13054                                    )
13055                                    .await
13056                            };
13057                            Box::pin(fut)
13058                        }
13059                    }
13060                    let accept_compression_encodings = self.accept_compression_encodings;
13061                    let send_compression_encodings = self.send_compression_encodings;
13062                    let max_decoding_message_size = self.max_decoding_message_size;
13063                    let max_encoding_message_size = self.max_encoding_message_size;
13064                    let inner = self.inner.clone();
13065                    let fut = async move {
13066                        let method = ListUserSandboxesSvc(inner);
13067                        let codec = tonic_prost::ProstCodec::default();
13068                        let mut grpc = tonic::server::Grpc::new(codec)
13069                            .apply_compression_config(
13070                                accept_compression_encodings,
13071                                send_compression_encodings,
13072                            )
13073                            .apply_max_message_size_config(
13074                                max_decoding_message_size,
13075                                max_encoding_message_size,
13076                            );
13077                        let res = grpc.unary(method, req).await;
13078                        Ok(res)
13079                    };
13080                    Box::pin(fut)
13081                }
13082                _ => {
13083                    Box::pin(async move {
13084                        let mut response = http::Response::new(
13085                            tonic::body::Body::default(),
13086                        );
13087                        let headers = response.headers_mut();
13088                        headers
13089                            .insert(
13090                                tonic::Status::GRPC_STATUS,
13091                                (tonic::Code::Unimplemented as i32).into(),
13092                            );
13093                        headers
13094                            .insert(
13095                                http::header::CONTENT_TYPE,
13096                                tonic::metadata::GRPC_CONTENT_TYPE,
13097                            );
13098                        Ok(response)
13099                    })
13100                }
13101            }
13102        }
13103    }
13104    impl<T> Clone for OrganizationServiceServer<T> {
13105        fn clone(&self) -> Self {
13106            let inner = self.inner.clone();
13107            Self {
13108                inner,
13109                accept_compression_encodings: self.accept_compression_encodings,
13110                send_compression_encodings: self.send_compression_encodings,
13111                max_decoding_message_size: self.max_decoding_message_size,
13112                max_encoding_message_size: self.max_encoding_message_size,
13113            }
13114        }
13115    }
13116    /// Generated gRPC service name
13117    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
13118    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
13119        const NAME: &'static str = SERVICE_NAME;
13120    }
13121}
13122/// Generated client implementations.
13123pub mod render_service_client {
13124    #![allow(
13125        unused_variables,
13126        dead_code,
13127        missing_docs,
13128        clippy::wildcard_imports,
13129        clippy::let_unit_value,
13130    )]
13131    use tonic::codegen::*;
13132    use tonic::codegen::http::Uri;
13133    /** Internal service for batch template rendering.
13134*/
13135    #[derive(Debug, Clone)]
13136    pub struct RenderServiceClient<T> {
13137        inner: tonic::client::Grpc<T>,
13138    }
13139    impl RenderServiceClient<tonic::transport::Channel> {
13140        /// Attempt to create a new client by connecting to a given endpoint.
13141        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13142        where
13143            D: TryInto<tonic::transport::Endpoint>,
13144            D::Error: Into<StdError>,
13145        {
13146            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13147            Ok(Self::new(conn))
13148        }
13149    }
13150    impl<T> RenderServiceClient<T>
13151    where
13152        T: tonic::client::GrpcService<tonic::body::Body>,
13153        T::Error: Into<StdError>,
13154        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13155        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13156    {
13157        pub fn new(inner: T) -> Self {
13158            let inner = tonic::client::Grpc::new(inner);
13159            Self { inner }
13160        }
13161        pub fn with_origin(inner: T, origin: Uri) -> Self {
13162            let inner = tonic::client::Grpc::with_origin(inner, origin);
13163            Self { inner }
13164        }
13165        pub fn with_interceptor<F>(
13166            inner: T,
13167            interceptor: F,
13168        ) -> RenderServiceClient<InterceptedService<T, F>>
13169        where
13170            F: tonic::service::Interceptor,
13171            T::ResponseBody: Default,
13172            T: tonic::codegen::Service<
13173                http::Request<tonic::body::Body>,
13174                Response = http::Response<
13175                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13176                >,
13177            >,
13178            <T as tonic::codegen::Service<
13179                http::Request<tonic::body::Body>,
13180            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13181        {
13182            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
13183        }
13184        /// Compress requests with the given encoding.
13185        ///
13186        /// This requires the server to support it otherwise it might respond with an
13187        /// error.
13188        #[must_use]
13189        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13190            self.inner = self.inner.send_compressed(encoding);
13191            self
13192        }
13193        /// Enable decompressing responses.
13194        #[must_use]
13195        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13196            self.inner = self.inner.accept_compressed(encoding);
13197            self
13198        }
13199        /// Limits the maximum size of a decoded message.
13200        ///
13201        /// Default: `4MB`
13202        #[must_use]
13203        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13204            self.inner = self.inner.max_decoding_message_size(limit);
13205            self
13206        }
13207        /// Limits the maximum size of an encoded message.
13208        ///
13209        /// Default: `usize::MAX`
13210        #[must_use]
13211        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13212            self.inner = self.inner.max_encoding_message_size(limit);
13213            self
13214        }
13215        /** Render a template for multiple users, streaming results as each completes.
13216 Authorization: Internal server-to-server only. Not exposed to external clients.
13217*/
13218        pub async fn render_batch(
13219            &mut self,
13220            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
13221        ) -> std::result::Result<
13222            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
13223            tonic::Status,
13224        > {
13225            self.inner
13226                .ready()
13227                .await
13228                .map_err(|e| {
13229                    tonic::Status::unknown(
13230                        format!("Service was not ready: {}", e.into()),
13231                    )
13232                })?;
13233            let codec = tonic_prost::ProstCodec::default();
13234            let path = http::uri::PathAndQuery::from_static(
13235                "/pidgr.v1.RenderService/RenderBatch",
13236            );
13237            let mut req = request.into_request();
13238            req.extensions_mut()
13239                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
13240            self.inner.server_streaming(req, path, codec).await
13241        }
13242    }
13243}
13244/// Generated server implementations.
13245pub mod render_service_server {
13246    #![allow(
13247        unused_variables,
13248        dead_code,
13249        missing_docs,
13250        clippy::wildcard_imports,
13251        clippy::let_unit_value,
13252    )]
13253    use tonic::codegen::*;
13254    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
13255    #[async_trait]
13256    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
13257        /// Server streaming response type for the RenderBatch method.
13258        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
13259                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
13260            >
13261            + std::marker::Send
13262            + 'static;
13263        /** Render a template for multiple users, streaming results as each completes.
13264 Authorization: Internal server-to-server only. Not exposed to external clients.
13265*/
13266        async fn render_batch(
13267            &self,
13268            request: tonic::Request<super::RenderBatchRequest>,
13269        ) -> std::result::Result<
13270            tonic::Response<Self::RenderBatchStream>,
13271            tonic::Status,
13272        >;
13273    }
13274    /** Internal service for batch template rendering.
13275*/
13276    #[derive(Debug)]
13277    pub struct RenderServiceServer<T> {
13278        inner: Arc<T>,
13279        accept_compression_encodings: EnabledCompressionEncodings,
13280        send_compression_encodings: EnabledCompressionEncodings,
13281        max_decoding_message_size: Option<usize>,
13282        max_encoding_message_size: Option<usize>,
13283    }
13284    impl<T> RenderServiceServer<T> {
13285        pub fn new(inner: T) -> Self {
13286            Self::from_arc(Arc::new(inner))
13287        }
13288        pub fn from_arc(inner: Arc<T>) -> Self {
13289            Self {
13290                inner,
13291                accept_compression_encodings: Default::default(),
13292                send_compression_encodings: Default::default(),
13293                max_decoding_message_size: None,
13294                max_encoding_message_size: None,
13295            }
13296        }
13297        pub fn with_interceptor<F>(
13298            inner: T,
13299            interceptor: F,
13300        ) -> InterceptedService<Self, F>
13301        where
13302            F: tonic::service::Interceptor,
13303        {
13304            InterceptedService::new(Self::new(inner), interceptor)
13305        }
13306        /// Enable decompressing requests with the given encoding.
13307        #[must_use]
13308        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13309            self.accept_compression_encodings.enable(encoding);
13310            self
13311        }
13312        /// Compress responses with the given encoding, if the client supports it.
13313        #[must_use]
13314        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13315            self.send_compression_encodings.enable(encoding);
13316            self
13317        }
13318        /// Limits the maximum size of a decoded message.
13319        ///
13320        /// Default: `4MB`
13321        #[must_use]
13322        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13323            self.max_decoding_message_size = Some(limit);
13324            self
13325        }
13326        /// Limits the maximum size of an encoded message.
13327        ///
13328        /// Default: `usize::MAX`
13329        #[must_use]
13330        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13331            self.max_encoding_message_size = Some(limit);
13332            self
13333        }
13334    }
13335    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
13336    where
13337        T: RenderService,
13338        B: Body + std::marker::Send + 'static,
13339        B::Error: Into<StdError> + std::marker::Send + 'static,
13340    {
13341        type Response = http::Response<tonic::body::Body>;
13342        type Error = std::convert::Infallible;
13343        type Future = BoxFuture<Self::Response, Self::Error>;
13344        fn poll_ready(
13345            &mut self,
13346            _cx: &mut Context<'_>,
13347        ) -> Poll<std::result::Result<(), Self::Error>> {
13348            Poll::Ready(Ok(()))
13349        }
13350        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13351            match req.uri().path() {
13352                "/pidgr.v1.RenderService/RenderBatch" => {
13353                    #[allow(non_camel_case_types)]
13354                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
13355                    impl<
13356                        T: RenderService,
13357                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
13358                    for RenderBatchSvc<T> {
13359                        type Response = super::RenderBatchResponse;
13360                        type ResponseStream = T::RenderBatchStream;
13361                        type Future = BoxFuture<
13362                            tonic::Response<Self::ResponseStream>,
13363                            tonic::Status,
13364                        >;
13365                        fn call(
13366                            &mut self,
13367                            request: tonic::Request<super::RenderBatchRequest>,
13368                        ) -> Self::Future {
13369                            let inner = Arc::clone(&self.0);
13370                            let fut = async move {
13371                                <T as RenderService>::render_batch(&inner, request).await
13372                            };
13373                            Box::pin(fut)
13374                        }
13375                    }
13376                    let accept_compression_encodings = self.accept_compression_encodings;
13377                    let send_compression_encodings = self.send_compression_encodings;
13378                    let max_decoding_message_size = self.max_decoding_message_size;
13379                    let max_encoding_message_size = self.max_encoding_message_size;
13380                    let inner = self.inner.clone();
13381                    let fut = async move {
13382                        let method = RenderBatchSvc(inner);
13383                        let codec = tonic_prost::ProstCodec::default();
13384                        let mut grpc = tonic::server::Grpc::new(codec)
13385                            .apply_compression_config(
13386                                accept_compression_encodings,
13387                                send_compression_encodings,
13388                            )
13389                            .apply_max_message_size_config(
13390                                max_decoding_message_size,
13391                                max_encoding_message_size,
13392                            );
13393                        let res = grpc.server_streaming(method, req).await;
13394                        Ok(res)
13395                    };
13396                    Box::pin(fut)
13397                }
13398                _ => {
13399                    Box::pin(async move {
13400                        let mut response = http::Response::new(
13401                            tonic::body::Body::default(),
13402                        );
13403                        let headers = response.headers_mut();
13404                        headers
13405                            .insert(
13406                                tonic::Status::GRPC_STATUS,
13407                                (tonic::Code::Unimplemented as i32).into(),
13408                            );
13409                        headers
13410                            .insert(
13411                                http::header::CONTENT_TYPE,
13412                                tonic::metadata::GRPC_CONTENT_TYPE,
13413                            );
13414                        Ok(response)
13415                    })
13416                }
13417            }
13418        }
13419    }
13420    impl<T> Clone for RenderServiceServer<T> {
13421        fn clone(&self) -> Self {
13422            let inner = self.inner.clone();
13423            Self {
13424                inner,
13425                accept_compression_encodings: self.accept_compression_encodings,
13426                send_compression_encodings: self.send_compression_encodings,
13427                max_decoding_message_size: self.max_decoding_message_size,
13428                max_encoding_message_size: self.max_encoding_message_size,
13429            }
13430        }
13431    }
13432    /// Generated gRPC service name
13433    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13434    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13435        const NAME: &'static str = SERVICE_NAME;
13436    }
13437}
13438/// Generated client implementations.
13439pub mod replay_service_client {
13440    #![allow(
13441        unused_variables,
13442        dead_code,
13443        missing_docs,
13444        clippy::wildcard_imports,
13445        clippy::let_unit_value,
13446    )]
13447    use tonic::codegen::*;
13448    use tonic::codegen::http::Uri;
13449    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13450 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13451*/
13452    #[derive(Debug, Clone)]
13453    pub struct ReplayServiceClient<T> {
13454        inner: tonic::client::Grpc<T>,
13455    }
13456    impl ReplayServiceClient<tonic::transport::Channel> {
13457        /// Attempt to create a new client by connecting to a given endpoint.
13458        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13459        where
13460            D: TryInto<tonic::transport::Endpoint>,
13461            D::Error: Into<StdError>,
13462        {
13463            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13464            Ok(Self::new(conn))
13465        }
13466    }
13467    impl<T> ReplayServiceClient<T>
13468    where
13469        T: tonic::client::GrpcService<tonic::body::Body>,
13470        T::Error: Into<StdError>,
13471        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13472        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13473    {
13474        pub fn new(inner: T) -> Self {
13475            let inner = tonic::client::Grpc::new(inner);
13476            Self { inner }
13477        }
13478        pub fn with_origin(inner: T, origin: Uri) -> Self {
13479            let inner = tonic::client::Grpc::with_origin(inner, origin);
13480            Self { inner }
13481        }
13482        pub fn with_interceptor<F>(
13483            inner: T,
13484            interceptor: F,
13485        ) -> ReplayServiceClient<InterceptedService<T, F>>
13486        where
13487            F: tonic::service::Interceptor,
13488            T::ResponseBody: Default,
13489            T: tonic::codegen::Service<
13490                http::Request<tonic::body::Body>,
13491                Response = http::Response<
13492                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13493                >,
13494            >,
13495            <T as tonic::codegen::Service<
13496                http::Request<tonic::body::Body>,
13497            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13498        {
13499            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13500        }
13501        /// Compress requests with the given encoding.
13502        ///
13503        /// This requires the server to support it otherwise it might respond with an
13504        /// error.
13505        #[must_use]
13506        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13507            self.inner = self.inner.send_compressed(encoding);
13508            self
13509        }
13510        /// Enable decompressing responses.
13511        #[must_use]
13512        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13513            self.inner = self.inner.accept_compressed(encoding);
13514            self
13515        }
13516        /// Limits the maximum size of a decoded message.
13517        ///
13518        /// Default: `4MB`
13519        #[must_use]
13520        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13521            self.inner = self.inner.max_decoding_message_size(limit);
13522            self
13523        }
13524        /// Limits the maximum size of an encoded message.
13525        ///
13526        /// Default: `usize::MAX`
13527        #[must_use]
13528        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13529            self.inner = self.inner.max_encoding_message_size(limit);
13530            self
13531        }
13532        /** List recent session recordings with optional campaign and time range filters.
13533 Authorization: Requires CAMPAIGNS_READ permission.
13534*/
13535        pub async fn list_session_recordings(
13536            &mut self,
13537            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13538        ) -> std::result::Result<
13539            tonic::Response<super::ListSessionRecordingsResponse>,
13540            tonic::Status,
13541        > {
13542            self.inner
13543                .ready()
13544                .await
13545                .map_err(|e| {
13546                    tonic::Status::unknown(
13547                        format!("Service was not ready: {}", e.into()),
13548                    )
13549                })?;
13550            let codec = tonic_prost::ProstCodec::default();
13551            let path = http::uri::PathAndQuery::from_static(
13552                "/pidgr.v1.ReplayService/ListSessionRecordings",
13553            );
13554            let mut req = request.into_request();
13555            req.extensions_mut()
13556                .insert(
13557                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13558                );
13559            self.inner.unary(req, path, codec).await
13560        }
13561        /** Fetch the full rrweb snapshot data for a single recording.
13562 Authorization: Requires CAMPAIGNS_READ permission.
13563*/
13564        pub async fn get_session_snapshots(
13565            &mut self,
13566            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13567        ) -> std::result::Result<
13568            tonic::Response<super::GetSessionSnapshotsResponse>,
13569            tonic::Status,
13570        > {
13571            self.inner
13572                .ready()
13573                .await
13574                .map_err(|e| {
13575                    tonic::Status::unknown(
13576                        format!("Service was not ready: {}", e.into()),
13577                    )
13578                })?;
13579            let codec = tonic_prost::ProstCodec::default();
13580            let path = http::uri::PathAndQuery::from_static(
13581                "/pidgr.v1.ReplayService/GetSessionSnapshots",
13582            );
13583            let mut req = request.into_request();
13584            req.extensions_mut()
13585                .insert(
13586                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13587                );
13588            self.inner.unary(req, path, codec).await
13589        }
13590    }
13591}
13592/// Generated server implementations.
13593pub mod replay_service_server {
13594    #![allow(
13595        unused_variables,
13596        dead_code,
13597        missing_docs,
13598        clippy::wildcard_imports,
13599        clippy::let_unit_value,
13600    )]
13601    use tonic::codegen::*;
13602    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
13603    #[async_trait]
13604    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13605        /** List recent session recordings with optional campaign and time range filters.
13606 Authorization: Requires CAMPAIGNS_READ permission.
13607*/
13608        async fn list_session_recordings(
13609            &self,
13610            request: tonic::Request<super::ListSessionRecordingsRequest>,
13611        ) -> std::result::Result<
13612            tonic::Response<super::ListSessionRecordingsResponse>,
13613            tonic::Status,
13614        >;
13615        /** Fetch the full rrweb snapshot data for a single recording.
13616 Authorization: Requires CAMPAIGNS_READ permission.
13617*/
13618        async fn get_session_snapshots(
13619            &self,
13620            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13621        ) -> std::result::Result<
13622            tonic::Response<super::GetSessionSnapshotsResponse>,
13623            tonic::Status,
13624        >;
13625    }
13626    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13627 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13628*/
13629    #[derive(Debug)]
13630    pub struct ReplayServiceServer<T> {
13631        inner: Arc<T>,
13632        accept_compression_encodings: EnabledCompressionEncodings,
13633        send_compression_encodings: EnabledCompressionEncodings,
13634        max_decoding_message_size: Option<usize>,
13635        max_encoding_message_size: Option<usize>,
13636    }
13637    impl<T> ReplayServiceServer<T> {
13638        pub fn new(inner: T) -> Self {
13639            Self::from_arc(Arc::new(inner))
13640        }
13641        pub fn from_arc(inner: Arc<T>) -> Self {
13642            Self {
13643                inner,
13644                accept_compression_encodings: Default::default(),
13645                send_compression_encodings: Default::default(),
13646                max_decoding_message_size: None,
13647                max_encoding_message_size: None,
13648            }
13649        }
13650        pub fn with_interceptor<F>(
13651            inner: T,
13652            interceptor: F,
13653        ) -> InterceptedService<Self, F>
13654        where
13655            F: tonic::service::Interceptor,
13656        {
13657            InterceptedService::new(Self::new(inner), interceptor)
13658        }
13659        /// Enable decompressing requests with the given encoding.
13660        #[must_use]
13661        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13662            self.accept_compression_encodings.enable(encoding);
13663            self
13664        }
13665        /// Compress responses with the given encoding, if the client supports it.
13666        #[must_use]
13667        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13668            self.send_compression_encodings.enable(encoding);
13669            self
13670        }
13671        /// Limits the maximum size of a decoded message.
13672        ///
13673        /// Default: `4MB`
13674        #[must_use]
13675        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13676            self.max_decoding_message_size = Some(limit);
13677            self
13678        }
13679        /// Limits the maximum size of an encoded message.
13680        ///
13681        /// Default: `usize::MAX`
13682        #[must_use]
13683        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13684            self.max_encoding_message_size = Some(limit);
13685            self
13686        }
13687    }
13688    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13689    where
13690        T: ReplayService,
13691        B: Body + std::marker::Send + 'static,
13692        B::Error: Into<StdError> + std::marker::Send + 'static,
13693    {
13694        type Response = http::Response<tonic::body::Body>;
13695        type Error = std::convert::Infallible;
13696        type Future = BoxFuture<Self::Response, Self::Error>;
13697        fn poll_ready(
13698            &mut self,
13699            _cx: &mut Context<'_>,
13700        ) -> Poll<std::result::Result<(), Self::Error>> {
13701            Poll::Ready(Ok(()))
13702        }
13703        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13704            match req.uri().path() {
13705                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13706                    #[allow(non_camel_case_types)]
13707                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13708                    impl<
13709                        T: ReplayService,
13710                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13711                    for ListSessionRecordingsSvc<T> {
13712                        type Response = super::ListSessionRecordingsResponse;
13713                        type Future = BoxFuture<
13714                            tonic::Response<Self::Response>,
13715                            tonic::Status,
13716                        >;
13717                        fn call(
13718                            &mut self,
13719                            request: tonic::Request<super::ListSessionRecordingsRequest>,
13720                        ) -> Self::Future {
13721                            let inner = Arc::clone(&self.0);
13722                            let fut = async move {
13723                                <T as ReplayService>::list_session_recordings(
13724                                        &inner,
13725                                        request,
13726                                    )
13727                                    .await
13728                            };
13729                            Box::pin(fut)
13730                        }
13731                    }
13732                    let accept_compression_encodings = self.accept_compression_encodings;
13733                    let send_compression_encodings = self.send_compression_encodings;
13734                    let max_decoding_message_size = self.max_decoding_message_size;
13735                    let max_encoding_message_size = self.max_encoding_message_size;
13736                    let inner = self.inner.clone();
13737                    let fut = async move {
13738                        let method = ListSessionRecordingsSvc(inner);
13739                        let codec = tonic_prost::ProstCodec::default();
13740                        let mut grpc = tonic::server::Grpc::new(codec)
13741                            .apply_compression_config(
13742                                accept_compression_encodings,
13743                                send_compression_encodings,
13744                            )
13745                            .apply_max_message_size_config(
13746                                max_decoding_message_size,
13747                                max_encoding_message_size,
13748                            );
13749                        let res = grpc.unary(method, req).await;
13750                        Ok(res)
13751                    };
13752                    Box::pin(fut)
13753                }
13754                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13755                    #[allow(non_camel_case_types)]
13756                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13757                    impl<
13758                        T: ReplayService,
13759                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13760                    for GetSessionSnapshotsSvc<T> {
13761                        type Response = super::GetSessionSnapshotsResponse;
13762                        type Future = BoxFuture<
13763                            tonic::Response<Self::Response>,
13764                            tonic::Status,
13765                        >;
13766                        fn call(
13767                            &mut self,
13768                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13769                        ) -> Self::Future {
13770                            let inner = Arc::clone(&self.0);
13771                            let fut = async move {
13772                                <T as ReplayService>::get_session_snapshots(&inner, request)
13773                                    .await
13774                            };
13775                            Box::pin(fut)
13776                        }
13777                    }
13778                    let accept_compression_encodings = self.accept_compression_encodings;
13779                    let send_compression_encodings = self.send_compression_encodings;
13780                    let max_decoding_message_size = self.max_decoding_message_size;
13781                    let max_encoding_message_size = self.max_encoding_message_size;
13782                    let inner = self.inner.clone();
13783                    let fut = async move {
13784                        let method = GetSessionSnapshotsSvc(inner);
13785                        let codec = tonic_prost::ProstCodec::default();
13786                        let mut grpc = tonic::server::Grpc::new(codec)
13787                            .apply_compression_config(
13788                                accept_compression_encodings,
13789                                send_compression_encodings,
13790                            )
13791                            .apply_max_message_size_config(
13792                                max_decoding_message_size,
13793                                max_encoding_message_size,
13794                            );
13795                        let res = grpc.unary(method, req).await;
13796                        Ok(res)
13797                    };
13798                    Box::pin(fut)
13799                }
13800                _ => {
13801                    Box::pin(async move {
13802                        let mut response = http::Response::new(
13803                            tonic::body::Body::default(),
13804                        );
13805                        let headers = response.headers_mut();
13806                        headers
13807                            .insert(
13808                                tonic::Status::GRPC_STATUS,
13809                                (tonic::Code::Unimplemented as i32).into(),
13810                            );
13811                        headers
13812                            .insert(
13813                                http::header::CONTENT_TYPE,
13814                                tonic::metadata::GRPC_CONTENT_TYPE,
13815                            );
13816                        Ok(response)
13817                    })
13818                }
13819            }
13820        }
13821    }
13822    impl<T> Clone for ReplayServiceServer<T> {
13823        fn clone(&self) -> Self {
13824            let inner = self.inner.clone();
13825            Self {
13826                inner,
13827                accept_compression_encodings: self.accept_compression_encodings,
13828                send_compression_encodings: self.send_compression_encodings,
13829                max_decoding_message_size: self.max_decoding_message_size,
13830                max_encoding_message_size: self.max_encoding_message_size,
13831            }
13832        }
13833    }
13834    /// Generated gRPC service name
13835    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
13836    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
13837        const NAME: &'static str = SERVICE_NAME;
13838    }
13839}
13840/// Generated client implementations.
13841pub mod role_service_client {
13842    #![allow(
13843        unused_variables,
13844        dead_code,
13845        missing_docs,
13846        clippy::wildcard_imports,
13847        clippy::let_unit_value,
13848    )]
13849    use tonic::codegen::*;
13850    use tonic::codegen::http::Uri;
13851    /** Manages roles and their permissions within an organization.
13852 All RPCs operate within the caller's org (extracted from JWT).
13853*/
13854    #[derive(Debug, Clone)]
13855    pub struct RoleServiceClient<T> {
13856        inner: tonic::client::Grpc<T>,
13857    }
13858    impl RoleServiceClient<tonic::transport::Channel> {
13859        /// Attempt to create a new client by connecting to a given endpoint.
13860        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13861        where
13862            D: TryInto<tonic::transport::Endpoint>,
13863            D::Error: Into<StdError>,
13864        {
13865            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13866            Ok(Self::new(conn))
13867        }
13868    }
13869    impl<T> RoleServiceClient<T>
13870    where
13871        T: tonic::client::GrpcService<tonic::body::Body>,
13872        T::Error: Into<StdError>,
13873        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13874        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13875    {
13876        pub fn new(inner: T) -> Self {
13877            let inner = tonic::client::Grpc::new(inner);
13878            Self { inner }
13879        }
13880        pub fn with_origin(inner: T, origin: Uri) -> Self {
13881            let inner = tonic::client::Grpc::with_origin(inner, origin);
13882            Self { inner }
13883        }
13884        pub fn with_interceptor<F>(
13885            inner: T,
13886            interceptor: F,
13887        ) -> RoleServiceClient<InterceptedService<T, F>>
13888        where
13889            F: tonic::service::Interceptor,
13890            T::ResponseBody: Default,
13891            T: tonic::codegen::Service<
13892                http::Request<tonic::body::Body>,
13893                Response = http::Response<
13894                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13895                >,
13896            >,
13897            <T as tonic::codegen::Service<
13898                http::Request<tonic::body::Body>,
13899            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13900        {
13901            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
13902        }
13903        /// Compress requests with the given encoding.
13904        ///
13905        /// This requires the server to support it otherwise it might respond with an
13906        /// error.
13907        #[must_use]
13908        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13909            self.inner = self.inner.send_compressed(encoding);
13910            self
13911        }
13912        /// Enable decompressing responses.
13913        #[must_use]
13914        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13915            self.inner = self.inner.accept_compressed(encoding);
13916            self
13917        }
13918        /// Limits the maximum size of a decoded message.
13919        ///
13920        /// Default: `4MB`
13921        #[must_use]
13922        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13923            self.inner = self.inner.max_decoding_message_size(limit);
13924            self
13925        }
13926        /// Limits the maximum size of an encoded message.
13927        ///
13928        /// Default: `usize::MAX`
13929        #[must_use]
13930        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13931            self.inner = self.inner.max_encoding_message_size(limit);
13932            self
13933        }
13934        /** List all roles in the organization with their permission sets.
13935 Authorization: Requires PERMISSION_ORG_READ.
13936*/
13937        pub async fn list_roles(
13938            &mut self,
13939            request: impl tonic::IntoRequest<super::ListRolesRequest>,
13940        ) -> std::result::Result<
13941            tonic::Response<super::ListRolesResponse>,
13942            tonic::Status,
13943        > {
13944            self.inner
13945                .ready()
13946                .await
13947                .map_err(|e| {
13948                    tonic::Status::unknown(
13949                        format!("Service was not ready: {}", e.into()),
13950                    )
13951                })?;
13952            let codec = tonic_prost::ProstCodec::default();
13953            let path = http::uri::PathAndQuery::from_static(
13954                "/pidgr.v1.RoleService/ListRoles",
13955            );
13956            let mut req = request.into_request();
13957            req.extensions_mut()
13958                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
13959            self.inner.unary(req, path, codec).await
13960        }
13961        /** Create a new custom role with a name and initial permissions.
13962 Slug is auto-generated from the name and immutable after creation.
13963 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13964*/
13965        pub async fn create_role(
13966            &mut self,
13967            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
13968        ) -> std::result::Result<
13969            tonic::Response<super::CreateRoleResponse>,
13970            tonic::Status,
13971        > {
13972            self.inner
13973                .ready()
13974                .await
13975                .map_err(|e| {
13976                    tonic::Status::unknown(
13977                        format!("Service was not ready: {}", e.into()),
13978                    )
13979                })?;
13980            let codec = tonic_prost::ProstCodec::default();
13981            let path = http::uri::PathAndQuery::from_static(
13982                "/pidgr.v1.RoleService/CreateRole",
13983            );
13984            let mut req = request.into_request();
13985            req.extensions_mut()
13986                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
13987            self.inner.unary(req, path, codec).await
13988        }
13989        /** Update a role's name and/or permissions.
13990 System roles (is_system=true) cannot be updated.
13991 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13992*/
13993        pub async fn update_role(
13994            &mut self,
13995            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
13996        ) -> std::result::Result<
13997            tonic::Response<super::UpdateRoleResponse>,
13998            tonic::Status,
13999        > {
14000            self.inner
14001                .ready()
14002                .await
14003                .map_err(|e| {
14004                    tonic::Status::unknown(
14005                        format!("Service was not ready: {}", e.into()),
14006                    )
14007                })?;
14008            let codec = tonic_prost::ProstCodec::default();
14009            let path = http::uri::PathAndQuery::from_static(
14010                "/pidgr.v1.RoleService/UpdateRole",
14011            );
14012            let mut req = request.into_request();
14013            req.extensions_mut()
14014                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
14015            self.inner.unary(req, path, codec).await
14016        }
14017        /** Delete a role. Fails if any users are assigned to it.
14018 System roles (is_system=true) cannot be deleted.
14019 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14020*/
14021        pub async fn delete_role(
14022            &mut self,
14023            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
14024        ) -> std::result::Result<
14025            tonic::Response<super::DeleteRoleResponse>,
14026            tonic::Status,
14027        > {
14028            self.inner
14029                .ready()
14030                .await
14031                .map_err(|e| {
14032                    tonic::Status::unknown(
14033                        format!("Service was not ready: {}", e.into()),
14034                    )
14035                })?;
14036            let codec = tonic_prost::ProstCodec::default();
14037            let path = http::uri::PathAndQuery::from_static(
14038                "/pidgr.v1.RoleService/DeleteRole",
14039            );
14040            let mut req = request.into_request();
14041            req.extensions_mut()
14042                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
14043            self.inner.unary(req, path, codec).await
14044        }
14045    }
14046}
14047/// Generated server implementations.
14048pub mod role_service_server {
14049    #![allow(
14050        unused_variables,
14051        dead_code,
14052        missing_docs,
14053        clippy::wildcard_imports,
14054        clippy::let_unit_value,
14055    )]
14056    use tonic::codegen::*;
14057    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
14058    #[async_trait]
14059    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
14060        /** List all roles in the organization with their permission sets.
14061 Authorization: Requires PERMISSION_ORG_READ.
14062*/
14063        async fn list_roles(
14064            &self,
14065            request: tonic::Request<super::ListRolesRequest>,
14066        ) -> std::result::Result<
14067            tonic::Response<super::ListRolesResponse>,
14068            tonic::Status,
14069        >;
14070        /** Create a new custom role with a name and initial permissions.
14071 Slug is auto-generated from the name and immutable after creation.
14072 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14073*/
14074        async fn create_role(
14075            &self,
14076            request: tonic::Request<super::CreateRoleRequest>,
14077        ) -> std::result::Result<
14078            tonic::Response<super::CreateRoleResponse>,
14079            tonic::Status,
14080        >;
14081        /** Update a role's name and/or permissions.
14082 System roles (is_system=true) cannot be updated.
14083 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14084*/
14085        async fn update_role(
14086            &self,
14087            request: tonic::Request<super::UpdateRoleRequest>,
14088        ) -> std::result::Result<
14089            tonic::Response<super::UpdateRoleResponse>,
14090            tonic::Status,
14091        >;
14092        /** Delete a role. Fails if any users are assigned to it.
14093 System roles (is_system=true) cannot be deleted.
14094 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14095*/
14096        async fn delete_role(
14097            &self,
14098            request: tonic::Request<super::DeleteRoleRequest>,
14099        ) -> std::result::Result<
14100            tonic::Response<super::DeleteRoleResponse>,
14101            tonic::Status,
14102        >;
14103    }
14104    /** Manages roles and their permissions within an organization.
14105 All RPCs operate within the caller's org (extracted from JWT).
14106*/
14107    #[derive(Debug)]
14108    pub struct RoleServiceServer<T> {
14109        inner: Arc<T>,
14110        accept_compression_encodings: EnabledCompressionEncodings,
14111        send_compression_encodings: EnabledCompressionEncodings,
14112        max_decoding_message_size: Option<usize>,
14113        max_encoding_message_size: Option<usize>,
14114    }
14115    impl<T> RoleServiceServer<T> {
14116        pub fn new(inner: T) -> Self {
14117            Self::from_arc(Arc::new(inner))
14118        }
14119        pub fn from_arc(inner: Arc<T>) -> Self {
14120            Self {
14121                inner,
14122                accept_compression_encodings: Default::default(),
14123                send_compression_encodings: Default::default(),
14124                max_decoding_message_size: None,
14125                max_encoding_message_size: None,
14126            }
14127        }
14128        pub fn with_interceptor<F>(
14129            inner: T,
14130            interceptor: F,
14131        ) -> InterceptedService<Self, F>
14132        where
14133            F: tonic::service::Interceptor,
14134        {
14135            InterceptedService::new(Self::new(inner), interceptor)
14136        }
14137        /// Enable decompressing requests with the given encoding.
14138        #[must_use]
14139        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14140            self.accept_compression_encodings.enable(encoding);
14141            self
14142        }
14143        /// Compress responses with the given encoding, if the client supports it.
14144        #[must_use]
14145        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14146            self.send_compression_encodings.enable(encoding);
14147            self
14148        }
14149        /// Limits the maximum size of a decoded message.
14150        ///
14151        /// Default: `4MB`
14152        #[must_use]
14153        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14154            self.max_decoding_message_size = Some(limit);
14155            self
14156        }
14157        /// Limits the maximum size of an encoded message.
14158        ///
14159        /// Default: `usize::MAX`
14160        #[must_use]
14161        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14162            self.max_encoding_message_size = Some(limit);
14163            self
14164        }
14165    }
14166    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
14167    where
14168        T: RoleService,
14169        B: Body + std::marker::Send + 'static,
14170        B::Error: Into<StdError> + std::marker::Send + 'static,
14171    {
14172        type Response = http::Response<tonic::body::Body>;
14173        type Error = std::convert::Infallible;
14174        type Future = BoxFuture<Self::Response, Self::Error>;
14175        fn poll_ready(
14176            &mut self,
14177            _cx: &mut Context<'_>,
14178        ) -> Poll<std::result::Result<(), Self::Error>> {
14179            Poll::Ready(Ok(()))
14180        }
14181        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14182            match req.uri().path() {
14183                "/pidgr.v1.RoleService/ListRoles" => {
14184                    #[allow(non_camel_case_types)]
14185                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
14186                    impl<
14187                        T: RoleService,
14188                    > tonic::server::UnaryService<super::ListRolesRequest>
14189                    for ListRolesSvc<T> {
14190                        type Response = super::ListRolesResponse;
14191                        type Future = BoxFuture<
14192                            tonic::Response<Self::Response>,
14193                            tonic::Status,
14194                        >;
14195                        fn call(
14196                            &mut self,
14197                            request: tonic::Request<super::ListRolesRequest>,
14198                        ) -> Self::Future {
14199                            let inner = Arc::clone(&self.0);
14200                            let fut = async move {
14201                                <T as RoleService>::list_roles(&inner, request).await
14202                            };
14203                            Box::pin(fut)
14204                        }
14205                    }
14206                    let accept_compression_encodings = self.accept_compression_encodings;
14207                    let send_compression_encodings = self.send_compression_encodings;
14208                    let max_decoding_message_size = self.max_decoding_message_size;
14209                    let max_encoding_message_size = self.max_encoding_message_size;
14210                    let inner = self.inner.clone();
14211                    let fut = async move {
14212                        let method = ListRolesSvc(inner);
14213                        let codec = tonic_prost::ProstCodec::default();
14214                        let mut grpc = tonic::server::Grpc::new(codec)
14215                            .apply_compression_config(
14216                                accept_compression_encodings,
14217                                send_compression_encodings,
14218                            )
14219                            .apply_max_message_size_config(
14220                                max_decoding_message_size,
14221                                max_encoding_message_size,
14222                            );
14223                        let res = grpc.unary(method, req).await;
14224                        Ok(res)
14225                    };
14226                    Box::pin(fut)
14227                }
14228                "/pidgr.v1.RoleService/CreateRole" => {
14229                    #[allow(non_camel_case_types)]
14230                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
14231                    impl<
14232                        T: RoleService,
14233                    > tonic::server::UnaryService<super::CreateRoleRequest>
14234                    for CreateRoleSvc<T> {
14235                        type Response = super::CreateRoleResponse;
14236                        type Future = BoxFuture<
14237                            tonic::Response<Self::Response>,
14238                            tonic::Status,
14239                        >;
14240                        fn call(
14241                            &mut self,
14242                            request: tonic::Request<super::CreateRoleRequest>,
14243                        ) -> Self::Future {
14244                            let inner = Arc::clone(&self.0);
14245                            let fut = async move {
14246                                <T as RoleService>::create_role(&inner, request).await
14247                            };
14248                            Box::pin(fut)
14249                        }
14250                    }
14251                    let accept_compression_encodings = self.accept_compression_encodings;
14252                    let send_compression_encodings = self.send_compression_encodings;
14253                    let max_decoding_message_size = self.max_decoding_message_size;
14254                    let max_encoding_message_size = self.max_encoding_message_size;
14255                    let inner = self.inner.clone();
14256                    let fut = async move {
14257                        let method = CreateRoleSvc(inner);
14258                        let codec = tonic_prost::ProstCodec::default();
14259                        let mut grpc = tonic::server::Grpc::new(codec)
14260                            .apply_compression_config(
14261                                accept_compression_encodings,
14262                                send_compression_encodings,
14263                            )
14264                            .apply_max_message_size_config(
14265                                max_decoding_message_size,
14266                                max_encoding_message_size,
14267                            );
14268                        let res = grpc.unary(method, req).await;
14269                        Ok(res)
14270                    };
14271                    Box::pin(fut)
14272                }
14273                "/pidgr.v1.RoleService/UpdateRole" => {
14274                    #[allow(non_camel_case_types)]
14275                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
14276                    impl<
14277                        T: RoleService,
14278                    > tonic::server::UnaryService<super::UpdateRoleRequest>
14279                    for UpdateRoleSvc<T> {
14280                        type Response = super::UpdateRoleResponse;
14281                        type Future = BoxFuture<
14282                            tonic::Response<Self::Response>,
14283                            tonic::Status,
14284                        >;
14285                        fn call(
14286                            &mut self,
14287                            request: tonic::Request<super::UpdateRoleRequest>,
14288                        ) -> Self::Future {
14289                            let inner = Arc::clone(&self.0);
14290                            let fut = async move {
14291                                <T as RoleService>::update_role(&inner, request).await
14292                            };
14293                            Box::pin(fut)
14294                        }
14295                    }
14296                    let accept_compression_encodings = self.accept_compression_encodings;
14297                    let send_compression_encodings = self.send_compression_encodings;
14298                    let max_decoding_message_size = self.max_decoding_message_size;
14299                    let max_encoding_message_size = self.max_encoding_message_size;
14300                    let inner = self.inner.clone();
14301                    let fut = async move {
14302                        let method = UpdateRoleSvc(inner);
14303                        let codec = tonic_prost::ProstCodec::default();
14304                        let mut grpc = tonic::server::Grpc::new(codec)
14305                            .apply_compression_config(
14306                                accept_compression_encodings,
14307                                send_compression_encodings,
14308                            )
14309                            .apply_max_message_size_config(
14310                                max_decoding_message_size,
14311                                max_encoding_message_size,
14312                            );
14313                        let res = grpc.unary(method, req).await;
14314                        Ok(res)
14315                    };
14316                    Box::pin(fut)
14317                }
14318                "/pidgr.v1.RoleService/DeleteRole" => {
14319                    #[allow(non_camel_case_types)]
14320                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
14321                    impl<
14322                        T: RoleService,
14323                    > tonic::server::UnaryService<super::DeleteRoleRequest>
14324                    for DeleteRoleSvc<T> {
14325                        type Response = super::DeleteRoleResponse;
14326                        type Future = BoxFuture<
14327                            tonic::Response<Self::Response>,
14328                            tonic::Status,
14329                        >;
14330                        fn call(
14331                            &mut self,
14332                            request: tonic::Request<super::DeleteRoleRequest>,
14333                        ) -> Self::Future {
14334                            let inner = Arc::clone(&self.0);
14335                            let fut = async move {
14336                                <T as RoleService>::delete_role(&inner, request).await
14337                            };
14338                            Box::pin(fut)
14339                        }
14340                    }
14341                    let accept_compression_encodings = self.accept_compression_encodings;
14342                    let send_compression_encodings = self.send_compression_encodings;
14343                    let max_decoding_message_size = self.max_decoding_message_size;
14344                    let max_encoding_message_size = self.max_encoding_message_size;
14345                    let inner = self.inner.clone();
14346                    let fut = async move {
14347                        let method = DeleteRoleSvc(inner);
14348                        let codec = tonic_prost::ProstCodec::default();
14349                        let mut grpc = tonic::server::Grpc::new(codec)
14350                            .apply_compression_config(
14351                                accept_compression_encodings,
14352                                send_compression_encodings,
14353                            )
14354                            .apply_max_message_size_config(
14355                                max_decoding_message_size,
14356                                max_encoding_message_size,
14357                            );
14358                        let res = grpc.unary(method, req).await;
14359                        Ok(res)
14360                    };
14361                    Box::pin(fut)
14362                }
14363                _ => {
14364                    Box::pin(async move {
14365                        let mut response = http::Response::new(
14366                            tonic::body::Body::default(),
14367                        );
14368                        let headers = response.headers_mut();
14369                        headers
14370                            .insert(
14371                                tonic::Status::GRPC_STATUS,
14372                                (tonic::Code::Unimplemented as i32).into(),
14373                            );
14374                        headers
14375                            .insert(
14376                                http::header::CONTENT_TYPE,
14377                                tonic::metadata::GRPC_CONTENT_TYPE,
14378                            );
14379                        Ok(response)
14380                    })
14381                }
14382            }
14383        }
14384    }
14385    impl<T> Clone for RoleServiceServer<T> {
14386        fn clone(&self) -> Self {
14387            let inner = self.inner.clone();
14388            Self {
14389                inner,
14390                accept_compression_encodings: self.accept_compression_encodings,
14391                send_compression_encodings: self.send_compression_encodings,
14392                max_decoding_message_size: self.max_decoding_message_size,
14393                max_encoding_message_size: self.max_encoding_message_size,
14394            }
14395        }
14396    }
14397    /// Generated gRPC service name
14398    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
14399    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
14400        const NAME: &'static str = SERVICE_NAME;
14401    }
14402}
14403/// Generated client implementations.
14404pub mod sso_service_client {
14405    #![allow(
14406        unused_variables,
14407        dead_code,
14408        missing_docs,
14409        clippy::wildcard_imports,
14410        clippy::let_unit_value,
14411    )]
14412    use tonic::codegen::*;
14413    use tonic::codegen::http::Uri;
14414    /** Manages SSO identity provider configuration for organizations.
14415*/
14416    #[derive(Debug, Clone)]
14417    pub struct SsoServiceClient<T> {
14418        inner: tonic::client::Grpc<T>,
14419    }
14420    impl SsoServiceClient<tonic::transport::Channel> {
14421        /// Attempt to create a new client by connecting to a given endpoint.
14422        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14423        where
14424            D: TryInto<tonic::transport::Endpoint>,
14425            D::Error: Into<StdError>,
14426        {
14427            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14428            Ok(Self::new(conn))
14429        }
14430    }
14431    impl<T> SsoServiceClient<T>
14432    where
14433        T: tonic::client::GrpcService<tonic::body::Body>,
14434        T::Error: Into<StdError>,
14435        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14436        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14437    {
14438        pub fn new(inner: T) -> Self {
14439            let inner = tonic::client::Grpc::new(inner);
14440            Self { inner }
14441        }
14442        pub fn with_origin(inner: T, origin: Uri) -> Self {
14443            let inner = tonic::client::Grpc::with_origin(inner, origin);
14444            Self { inner }
14445        }
14446        pub fn with_interceptor<F>(
14447            inner: T,
14448            interceptor: F,
14449        ) -> SsoServiceClient<InterceptedService<T, F>>
14450        where
14451            F: tonic::service::Interceptor,
14452            T::ResponseBody: Default,
14453            T: tonic::codegen::Service<
14454                http::Request<tonic::body::Body>,
14455                Response = http::Response<
14456                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14457                >,
14458            >,
14459            <T as tonic::codegen::Service<
14460                http::Request<tonic::body::Body>,
14461            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14462        {
14463            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14464        }
14465        /// Compress requests with the given encoding.
14466        ///
14467        /// This requires the server to support it otherwise it might respond with an
14468        /// error.
14469        #[must_use]
14470        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14471            self.inner = self.inner.send_compressed(encoding);
14472            self
14473        }
14474        /// Enable decompressing responses.
14475        #[must_use]
14476        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14477            self.inner = self.inner.accept_compressed(encoding);
14478            self
14479        }
14480        /// Limits the maximum size of a decoded message.
14481        ///
14482        /// Default: `4MB`
14483        #[must_use]
14484        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14485            self.inner = self.inner.max_decoding_message_size(limit);
14486            self
14487        }
14488        /// Limits the maximum size of an encoded message.
14489        ///
14490        /// Default: `usize::MAX`
14491        #[must_use]
14492        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14493            self.inner = self.inner.max_encoding_message_size(limit);
14494            self
14495        }
14496        /** Check if an email domain has SSO configured.
14497 This is a pre-authentication endpoint — no JWT required.
14498 Authorization: None (public).
14499*/
14500        pub async fn check_sso_by_domain(
14501            &mut self,
14502            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14503        ) -> std::result::Result<
14504            tonic::Response<super::CheckSsoByDomainResponse>,
14505            tonic::Status,
14506        > {
14507            self.inner
14508                .ready()
14509                .await
14510                .map_err(|e| {
14511                    tonic::Status::unknown(
14512                        format!("Service was not ready: {}", e.into()),
14513                    )
14514                })?;
14515            let codec = tonic_prost::ProstCodec::default();
14516            let path = http::uri::PathAndQuery::from_static(
14517                "/pidgr.v1.SSOService/CheckSSOByDomain",
14518            );
14519            let mut req = request.into_request();
14520            req.extensions_mut()
14521                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14522            self.inner.unary(req, path, codec).await
14523        }
14524        /** Create an SSO provider for the organization.
14525 Validates the metadata URL before saving.
14526 Creates the corresponding identity provider in the auth service.
14527 Authorization: Requires PERMISSION_ORG_WRITE.
14528*/
14529        pub async fn create_sso_provider(
14530            &mut self,
14531            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14532        ) -> std::result::Result<
14533            tonic::Response<super::CreateSsoProviderResponse>,
14534            tonic::Status,
14535        > {
14536            self.inner
14537                .ready()
14538                .await
14539                .map_err(|e| {
14540                    tonic::Status::unknown(
14541                        format!("Service was not ready: {}", e.into()),
14542                    )
14543                })?;
14544            let codec = tonic_prost::ProstCodec::default();
14545            let path = http::uri::PathAndQuery::from_static(
14546                "/pidgr.v1.SSOService/CreateSSOProvider",
14547            );
14548            let mut req = request.into_request();
14549            req.extensions_mut()
14550                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14551            self.inner.unary(req, path, codec).await
14552        }
14553        /** Get the organization's SSO provider configuration.
14554 Authorization: Requires PERMISSION_ORG_READ.
14555*/
14556        pub async fn get_sso_provider(
14557            &mut self,
14558            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14559        ) -> std::result::Result<
14560            tonic::Response<super::GetSsoProviderResponse>,
14561            tonic::Status,
14562        > {
14563            self.inner
14564                .ready()
14565                .await
14566                .map_err(|e| {
14567                    tonic::Status::unknown(
14568                        format!("Service was not ready: {}", e.into()),
14569                    )
14570                })?;
14571            let codec = tonic_prost::ProstCodec::default();
14572            let path = http::uri::PathAndQuery::from_static(
14573                "/pidgr.v1.SSOService/GetSSOProvider",
14574            );
14575            let mut req = request.into_request();
14576            req.extensions_mut()
14577                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14578            self.inner.unary(req, path, codec).await
14579        }
14580        /** Delete the organization's SSO provider.
14581 Deletes the corresponding identity provider from the auth service.
14582 Users with that domain fall back to passkey/OTP.
14583 Authorization: Requires PERMISSION_ORG_WRITE.
14584*/
14585        pub async fn delete_sso_provider(
14586            &mut self,
14587            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14588        ) -> std::result::Result<
14589            tonic::Response<super::DeleteSsoProviderResponse>,
14590            tonic::Status,
14591        > {
14592            self.inner
14593                .ready()
14594                .await
14595                .map_err(|e| {
14596                    tonic::Status::unknown(
14597                        format!("Service was not ready: {}", e.into()),
14598                    )
14599                })?;
14600            let codec = tonic_prost::ProstCodec::default();
14601            let path = http::uri::PathAndQuery::from_static(
14602                "/pidgr.v1.SSOService/DeleteSSOProvider",
14603            );
14604            let mut req = request.into_request();
14605            req.extensions_mut()
14606                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14607            self.inner.unary(req, path, codec).await
14608        }
14609    }
14610}
14611/// Generated server implementations.
14612pub mod sso_service_server {
14613    #![allow(
14614        unused_variables,
14615        dead_code,
14616        missing_docs,
14617        clippy::wildcard_imports,
14618        clippy::let_unit_value,
14619    )]
14620    use tonic::codegen::*;
14621    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
14622    #[async_trait]
14623    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14624        /** Check if an email domain has SSO configured.
14625 This is a pre-authentication endpoint — no JWT required.
14626 Authorization: None (public).
14627*/
14628        async fn check_sso_by_domain(
14629            &self,
14630            request: tonic::Request<super::CheckSsoByDomainRequest>,
14631        ) -> std::result::Result<
14632            tonic::Response<super::CheckSsoByDomainResponse>,
14633            tonic::Status,
14634        >;
14635        /** Create an SSO provider for the organization.
14636 Validates the metadata URL before saving.
14637 Creates the corresponding identity provider in the auth service.
14638 Authorization: Requires PERMISSION_ORG_WRITE.
14639*/
14640        async fn create_sso_provider(
14641            &self,
14642            request: tonic::Request<super::CreateSsoProviderRequest>,
14643        ) -> std::result::Result<
14644            tonic::Response<super::CreateSsoProviderResponse>,
14645            tonic::Status,
14646        >;
14647        /** Get the organization's SSO provider configuration.
14648 Authorization: Requires PERMISSION_ORG_READ.
14649*/
14650        async fn get_sso_provider(
14651            &self,
14652            request: tonic::Request<super::GetSsoProviderRequest>,
14653        ) -> std::result::Result<
14654            tonic::Response<super::GetSsoProviderResponse>,
14655            tonic::Status,
14656        >;
14657        /** Delete the organization's SSO provider.
14658 Deletes the corresponding identity provider from the auth service.
14659 Users with that domain fall back to passkey/OTP.
14660 Authorization: Requires PERMISSION_ORG_WRITE.
14661*/
14662        async fn delete_sso_provider(
14663            &self,
14664            request: tonic::Request<super::DeleteSsoProviderRequest>,
14665        ) -> std::result::Result<
14666            tonic::Response<super::DeleteSsoProviderResponse>,
14667            tonic::Status,
14668        >;
14669    }
14670    /** Manages SSO identity provider configuration for organizations.
14671*/
14672    #[derive(Debug)]
14673    pub struct SsoServiceServer<T> {
14674        inner: Arc<T>,
14675        accept_compression_encodings: EnabledCompressionEncodings,
14676        send_compression_encodings: EnabledCompressionEncodings,
14677        max_decoding_message_size: Option<usize>,
14678        max_encoding_message_size: Option<usize>,
14679    }
14680    impl<T> SsoServiceServer<T> {
14681        pub fn new(inner: T) -> Self {
14682            Self::from_arc(Arc::new(inner))
14683        }
14684        pub fn from_arc(inner: Arc<T>) -> Self {
14685            Self {
14686                inner,
14687                accept_compression_encodings: Default::default(),
14688                send_compression_encodings: Default::default(),
14689                max_decoding_message_size: None,
14690                max_encoding_message_size: None,
14691            }
14692        }
14693        pub fn with_interceptor<F>(
14694            inner: T,
14695            interceptor: F,
14696        ) -> InterceptedService<Self, F>
14697        where
14698            F: tonic::service::Interceptor,
14699        {
14700            InterceptedService::new(Self::new(inner), interceptor)
14701        }
14702        /// Enable decompressing requests with the given encoding.
14703        #[must_use]
14704        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14705            self.accept_compression_encodings.enable(encoding);
14706            self
14707        }
14708        /// Compress responses with the given encoding, if the client supports it.
14709        #[must_use]
14710        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14711            self.send_compression_encodings.enable(encoding);
14712            self
14713        }
14714        /// Limits the maximum size of a decoded message.
14715        ///
14716        /// Default: `4MB`
14717        #[must_use]
14718        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14719            self.max_decoding_message_size = Some(limit);
14720            self
14721        }
14722        /// Limits the maximum size of an encoded message.
14723        ///
14724        /// Default: `usize::MAX`
14725        #[must_use]
14726        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14727            self.max_encoding_message_size = Some(limit);
14728            self
14729        }
14730    }
14731    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14732    where
14733        T: SsoService,
14734        B: Body + std::marker::Send + 'static,
14735        B::Error: Into<StdError> + std::marker::Send + 'static,
14736    {
14737        type Response = http::Response<tonic::body::Body>;
14738        type Error = std::convert::Infallible;
14739        type Future = BoxFuture<Self::Response, Self::Error>;
14740        fn poll_ready(
14741            &mut self,
14742            _cx: &mut Context<'_>,
14743        ) -> Poll<std::result::Result<(), Self::Error>> {
14744            Poll::Ready(Ok(()))
14745        }
14746        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14747            match req.uri().path() {
14748                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14749                    #[allow(non_camel_case_types)]
14750                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14751                    impl<
14752                        T: SsoService,
14753                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14754                    for CheckSSOByDomainSvc<T> {
14755                        type Response = super::CheckSsoByDomainResponse;
14756                        type Future = BoxFuture<
14757                            tonic::Response<Self::Response>,
14758                            tonic::Status,
14759                        >;
14760                        fn call(
14761                            &mut self,
14762                            request: tonic::Request<super::CheckSsoByDomainRequest>,
14763                        ) -> Self::Future {
14764                            let inner = Arc::clone(&self.0);
14765                            let fut = async move {
14766                                <T as SsoService>::check_sso_by_domain(&inner, request)
14767                                    .await
14768                            };
14769                            Box::pin(fut)
14770                        }
14771                    }
14772                    let accept_compression_encodings = self.accept_compression_encodings;
14773                    let send_compression_encodings = self.send_compression_encodings;
14774                    let max_decoding_message_size = self.max_decoding_message_size;
14775                    let max_encoding_message_size = self.max_encoding_message_size;
14776                    let inner = self.inner.clone();
14777                    let fut = async move {
14778                        let method = CheckSSOByDomainSvc(inner);
14779                        let codec = tonic_prost::ProstCodec::default();
14780                        let mut grpc = tonic::server::Grpc::new(codec)
14781                            .apply_compression_config(
14782                                accept_compression_encodings,
14783                                send_compression_encodings,
14784                            )
14785                            .apply_max_message_size_config(
14786                                max_decoding_message_size,
14787                                max_encoding_message_size,
14788                            );
14789                        let res = grpc.unary(method, req).await;
14790                        Ok(res)
14791                    };
14792                    Box::pin(fut)
14793                }
14794                "/pidgr.v1.SSOService/CreateSSOProvider" => {
14795                    #[allow(non_camel_case_types)]
14796                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14797                    impl<
14798                        T: SsoService,
14799                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
14800                    for CreateSSOProviderSvc<T> {
14801                        type Response = super::CreateSsoProviderResponse;
14802                        type Future = BoxFuture<
14803                            tonic::Response<Self::Response>,
14804                            tonic::Status,
14805                        >;
14806                        fn call(
14807                            &mut self,
14808                            request: tonic::Request<super::CreateSsoProviderRequest>,
14809                        ) -> Self::Future {
14810                            let inner = Arc::clone(&self.0);
14811                            let fut = async move {
14812                                <T as SsoService>::create_sso_provider(&inner, request)
14813                                    .await
14814                            };
14815                            Box::pin(fut)
14816                        }
14817                    }
14818                    let accept_compression_encodings = self.accept_compression_encodings;
14819                    let send_compression_encodings = self.send_compression_encodings;
14820                    let max_decoding_message_size = self.max_decoding_message_size;
14821                    let max_encoding_message_size = self.max_encoding_message_size;
14822                    let inner = self.inner.clone();
14823                    let fut = async move {
14824                        let method = CreateSSOProviderSvc(inner);
14825                        let codec = tonic_prost::ProstCodec::default();
14826                        let mut grpc = tonic::server::Grpc::new(codec)
14827                            .apply_compression_config(
14828                                accept_compression_encodings,
14829                                send_compression_encodings,
14830                            )
14831                            .apply_max_message_size_config(
14832                                max_decoding_message_size,
14833                                max_encoding_message_size,
14834                            );
14835                        let res = grpc.unary(method, req).await;
14836                        Ok(res)
14837                    };
14838                    Box::pin(fut)
14839                }
14840                "/pidgr.v1.SSOService/GetSSOProvider" => {
14841                    #[allow(non_camel_case_types)]
14842                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
14843                    impl<
14844                        T: SsoService,
14845                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
14846                    for GetSSOProviderSvc<T> {
14847                        type Response = super::GetSsoProviderResponse;
14848                        type Future = BoxFuture<
14849                            tonic::Response<Self::Response>,
14850                            tonic::Status,
14851                        >;
14852                        fn call(
14853                            &mut self,
14854                            request: tonic::Request<super::GetSsoProviderRequest>,
14855                        ) -> Self::Future {
14856                            let inner = Arc::clone(&self.0);
14857                            let fut = async move {
14858                                <T as SsoService>::get_sso_provider(&inner, request).await
14859                            };
14860                            Box::pin(fut)
14861                        }
14862                    }
14863                    let accept_compression_encodings = self.accept_compression_encodings;
14864                    let send_compression_encodings = self.send_compression_encodings;
14865                    let max_decoding_message_size = self.max_decoding_message_size;
14866                    let max_encoding_message_size = self.max_encoding_message_size;
14867                    let inner = self.inner.clone();
14868                    let fut = async move {
14869                        let method = GetSSOProviderSvc(inner);
14870                        let codec = tonic_prost::ProstCodec::default();
14871                        let mut grpc = tonic::server::Grpc::new(codec)
14872                            .apply_compression_config(
14873                                accept_compression_encodings,
14874                                send_compression_encodings,
14875                            )
14876                            .apply_max_message_size_config(
14877                                max_decoding_message_size,
14878                                max_encoding_message_size,
14879                            );
14880                        let res = grpc.unary(method, req).await;
14881                        Ok(res)
14882                    };
14883                    Box::pin(fut)
14884                }
14885                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
14886                    #[allow(non_camel_case_types)]
14887                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
14888                    impl<
14889                        T: SsoService,
14890                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
14891                    for DeleteSSOProviderSvc<T> {
14892                        type Response = super::DeleteSsoProviderResponse;
14893                        type Future = BoxFuture<
14894                            tonic::Response<Self::Response>,
14895                            tonic::Status,
14896                        >;
14897                        fn call(
14898                            &mut self,
14899                            request: tonic::Request<super::DeleteSsoProviderRequest>,
14900                        ) -> Self::Future {
14901                            let inner = Arc::clone(&self.0);
14902                            let fut = async move {
14903                                <T as SsoService>::delete_sso_provider(&inner, request)
14904                                    .await
14905                            };
14906                            Box::pin(fut)
14907                        }
14908                    }
14909                    let accept_compression_encodings = self.accept_compression_encodings;
14910                    let send_compression_encodings = self.send_compression_encodings;
14911                    let max_decoding_message_size = self.max_decoding_message_size;
14912                    let max_encoding_message_size = self.max_encoding_message_size;
14913                    let inner = self.inner.clone();
14914                    let fut = async move {
14915                        let method = DeleteSSOProviderSvc(inner);
14916                        let codec = tonic_prost::ProstCodec::default();
14917                        let mut grpc = tonic::server::Grpc::new(codec)
14918                            .apply_compression_config(
14919                                accept_compression_encodings,
14920                                send_compression_encodings,
14921                            )
14922                            .apply_max_message_size_config(
14923                                max_decoding_message_size,
14924                                max_encoding_message_size,
14925                            );
14926                        let res = grpc.unary(method, req).await;
14927                        Ok(res)
14928                    };
14929                    Box::pin(fut)
14930                }
14931                _ => {
14932                    Box::pin(async move {
14933                        let mut response = http::Response::new(
14934                            tonic::body::Body::default(),
14935                        );
14936                        let headers = response.headers_mut();
14937                        headers
14938                            .insert(
14939                                tonic::Status::GRPC_STATUS,
14940                                (tonic::Code::Unimplemented as i32).into(),
14941                            );
14942                        headers
14943                            .insert(
14944                                http::header::CONTENT_TYPE,
14945                                tonic::metadata::GRPC_CONTENT_TYPE,
14946                            );
14947                        Ok(response)
14948                    })
14949                }
14950            }
14951        }
14952    }
14953    impl<T> Clone for SsoServiceServer<T> {
14954        fn clone(&self) -> Self {
14955            let inner = self.inner.clone();
14956            Self {
14957                inner,
14958                accept_compression_encodings: self.accept_compression_encodings,
14959                send_compression_encodings: self.send_compression_encodings,
14960                max_decoding_message_size: self.max_decoding_message_size,
14961                max_encoding_message_size: self.max_encoding_message_size,
14962            }
14963        }
14964    }
14965    /// Generated gRPC service name
14966    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
14967    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
14968        const NAME: &'static str = SERVICE_NAME;
14969    }
14970}
14971/// Generated client implementations.
14972pub mod team_service_client {
14973    #![allow(
14974        unused_variables,
14975        dead_code,
14976        missing_docs,
14977        clippy::wildcard_imports,
14978        clippy::let_unit_value,
14979    )]
14980    use tonic::codegen::*;
14981    use tonic::codegen::http::Uri;
14982    /** Manages organizational teams (departments, divisions) within an organization.
14983 Teams represent the organizational structure and can serve as sender identity.
14984 All RPCs operate within the caller's org (extracted from JWT).
14985*/
14986    #[derive(Debug, Clone)]
14987    pub struct TeamServiceClient<T> {
14988        inner: tonic::client::Grpc<T>,
14989    }
14990    impl TeamServiceClient<tonic::transport::Channel> {
14991        /// Attempt to create a new client by connecting to a given endpoint.
14992        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14993        where
14994            D: TryInto<tonic::transport::Endpoint>,
14995            D::Error: Into<StdError>,
14996        {
14997            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14998            Ok(Self::new(conn))
14999        }
15000    }
15001    impl<T> TeamServiceClient<T>
15002    where
15003        T: tonic::client::GrpcService<tonic::body::Body>,
15004        T::Error: Into<StdError>,
15005        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15006        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15007    {
15008        pub fn new(inner: T) -> Self {
15009            let inner = tonic::client::Grpc::new(inner);
15010            Self { inner }
15011        }
15012        pub fn with_origin(inner: T, origin: Uri) -> Self {
15013            let inner = tonic::client::Grpc::with_origin(inner, origin);
15014            Self { inner }
15015        }
15016        pub fn with_interceptor<F>(
15017            inner: T,
15018            interceptor: F,
15019        ) -> TeamServiceClient<InterceptedService<T, F>>
15020        where
15021            F: tonic::service::Interceptor,
15022            T::ResponseBody: Default,
15023            T: tonic::codegen::Service<
15024                http::Request<tonic::body::Body>,
15025                Response = http::Response<
15026                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15027                >,
15028            >,
15029            <T as tonic::codegen::Service<
15030                http::Request<tonic::body::Body>,
15031            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15032        {
15033            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
15034        }
15035        /// Compress requests with the given encoding.
15036        ///
15037        /// This requires the server to support it otherwise it might respond with an
15038        /// error.
15039        #[must_use]
15040        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15041            self.inner = self.inner.send_compressed(encoding);
15042            self
15043        }
15044        /// Enable decompressing responses.
15045        #[must_use]
15046        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15047            self.inner = self.inner.accept_compressed(encoding);
15048            self
15049        }
15050        /// Limits the maximum size of a decoded message.
15051        ///
15052        /// Default: `4MB`
15053        #[must_use]
15054        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15055            self.inner = self.inner.max_decoding_message_size(limit);
15056            self
15057        }
15058        /// Limits the maximum size of an encoded message.
15059        ///
15060        /// Default: `usize::MAX`
15061        #[must_use]
15062        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15063            self.inner = self.inner.max_encoding_message_size(limit);
15064            self
15065        }
15066        /** Create a new team in the organization.
15067 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15068*/
15069        pub async fn create_team(
15070            &mut self,
15071            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
15072        ) -> std::result::Result<
15073            tonic::Response<super::CreateTeamResponse>,
15074            tonic::Status,
15075        > {
15076            self.inner
15077                .ready()
15078                .await
15079                .map_err(|e| {
15080                    tonic::Status::unknown(
15081                        format!("Service was not ready: {}", e.into()),
15082                    )
15083                })?;
15084            let codec = tonic_prost::ProstCodec::default();
15085            let path = http::uri::PathAndQuery::from_static(
15086                "/pidgr.v1.TeamService/CreateTeam",
15087            );
15088            let mut req = request.into_request();
15089            req.extensions_mut()
15090                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
15091            self.inner.unary(req, path, codec).await
15092        }
15093        /** Retrieve a team by ID.
15094 Authorization: Caller must be a member of the team, or have
15095 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15096*/
15097        pub async fn get_team(
15098            &mut self,
15099            request: impl tonic::IntoRequest<super::GetTeamRequest>,
15100        ) -> std::result::Result<
15101            tonic::Response<super::GetTeamResponse>,
15102            tonic::Status,
15103        > {
15104            self.inner
15105                .ready()
15106                .await
15107                .map_err(|e| {
15108                    tonic::Status::unknown(
15109                        format!("Service was not ready: {}", e.into()),
15110                    )
15111                })?;
15112            let codec = tonic_prost::ProstCodec::default();
15113            let path = http::uri::PathAndQuery::from_static(
15114                "/pidgr.v1.TeamService/GetTeam",
15115            );
15116            let mut req = request.into_request();
15117            req.extensions_mut()
15118                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
15119            self.inner.unary(req, path, codec).await
15120        }
15121        /** List teams in the organization with pagination.
15122 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15123*/
15124        pub async fn list_teams(
15125            &mut self,
15126            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
15127        ) -> std::result::Result<
15128            tonic::Response<super::ListTeamsResponse>,
15129            tonic::Status,
15130        > {
15131            self.inner
15132                .ready()
15133                .await
15134                .map_err(|e| {
15135                    tonic::Status::unknown(
15136                        format!("Service was not ready: {}", e.into()),
15137                    )
15138                })?;
15139            let codec = tonic_prost::ProstCodec::default();
15140            let path = http::uri::PathAndQuery::from_static(
15141                "/pidgr.v1.TeamService/ListTeams",
15142            );
15143            let mut req = request.into_request();
15144            req.extensions_mut()
15145                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
15146            self.inner.unary(req, path, codec).await
15147        }
15148        /** Update a team's name and/or description.
15149 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15150*/
15151        pub async fn update_team(
15152            &mut self,
15153            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
15154        ) -> std::result::Result<
15155            tonic::Response<super::UpdateTeamResponse>,
15156            tonic::Status,
15157        > {
15158            self.inner
15159                .ready()
15160                .await
15161                .map_err(|e| {
15162                    tonic::Status::unknown(
15163                        format!("Service was not ready: {}", e.into()),
15164                    )
15165                })?;
15166            let codec = tonic_prost::ProstCodec::default();
15167            let path = http::uri::PathAndQuery::from_static(
15168                "/pidgr.v1.TeamService/UpdateTeam",
15169            );
15170            let mut req = request.into_request();
15171            req.extensions_mut()
15172                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
15173            self.inner.unary(req, path, codec).await
15174        }
15175        /** Delete a team and all its membership records. Default teams cannot be deleted.
15176 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15177*/
15178        pub async fn delete_team(
15179            &mut self,
15180            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
15181        ) -> std::result::Result<
15182            tonic::Response<super::DeleteTeamResponse>,
15183            tonic::Status,
15184        > {
15185            self.inner
15186                .ready()
15187                .await
15188                .map_err(|e| {
15189                    tonic::Status::unknown(
15190                        format!("Service was not ready: {}", e.into()),
15191                    )
15192                })?;
15193            let codec = tonic_prost::ProstCodec::default();
15194            let path = http::uri::PathAndQuery::from_static(
15195                "/pidgr.v1.TeamService/DeleteTeam",
15196            );
15197            let mut req = request.into_request();
15198            req.extensions_mut()
15199                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
15200            self.inner.unary(req, path, codec).await
15201        }
15202        /** Add one or more users to a team (idempotent).
15203 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15204*/
15205        pub async fn add_team_members(
15206            &mut self,
15207            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
15208        ) -> std::result::Result<
15209            tonic::Response<super::AddTeamMembersResponse>,
15210            tonic::Status,
15211        > {
15212            self.inner
15213                .ready()
15214                .await
15215                .map_err(|e| {
15216                    tonic::Status::unknown(
15217                        format!("Service was not ready: {}", e.into()),
15218                    )
15219                })?;
15220            let codec = tonic_prost::ProstCodec::default();
15221            let path = http::uri::PathAndQuery::from_static(
15222                "/pidgr.v1.TeamService/AddTeamMembers",
15223            );
15224            let mut req = request.into_request();
15225            req.extensions_mut()
15226                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
15227            self.inner.unary(req, path, codec).await
15228        }
15229        /** Remove one or more users from a team (idempotent).
15230 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15231*/
15232        pub async fn remove_team_members(
15233            &mut self,
15234            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
15235        ) -> std::result::Result<
15236            tonic::Response<super::RemoveTeamMembersResponse>,
15237            tonic::Status,
15238        > {
15239            self.inner
15240                .ready()
15241                .await
15242                .map_err(|e| {
15243                    tonic::Status::unknown(
15244                        format!("Service was not ready: {}", e.into()),
15245                    )
15246                })?;
15247            let codec = tonic_prost::ProstCodec::default();
15248            let path = http::uri::PathAndQuery::from_static(
15249                "/pidgr.v1.TeamService/RemoveTeamMembers",
15250            );
15251            let mut req = request.into_request();
15252            req.extensions_mut()
15253                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
15254            self.inner.unary(req, path, codec).await
15255        }
15256        /** List members of a team with pagination.
15257 Authorization: Caller must be a member of the team, or have
15258 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15259*/
15260        pub async fn list_team_members(
15261            &mut self,
15262            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
15263        ) -> std::result::Result<
15264            tonic::Response<super::ListTeamMembersResponse>,
15265            tonic::Status,
15266        > {
15267            self.inner
15268                .ready()
15269                .await
15270                .map_err(|e| {
15271                    tonic::Status::unknown(
15272                        format!("Service was not ready: {}", e.into()),
15273                    )
15274                })?;
15275            let codec = tonic_prost::ProstCodec::default();
15276            let path = http::uri::PathAndQuery::from_static(
15277                "/pidgr.v1.TeamService/ListTeamMembers",
15278            );
15279            let mut req = request.into_request();
15280            req.extensions_mut()
15281                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
15282            self.inner.unary(req, path, codec).await
15283        }
15284    }
15285}
15286/// Generated server implementations.
15287pub mod team_service_server {
15288    #![allow(
15289        unused_variables,
15290        dead_code,
15291        missing_docs,
15292        clippy::wildcard_imports,
15293        clippy::let_unit_value,
15294    )]
15295    use tonic::codegen::*;
15296    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
15297    #[async_trait]
15298    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
15299        /** Create a new team in the organization.
15300 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15301*/
15302        async fn create_team(
15303            &self,
15304            request: tonic::Request<super::CreateTeamRequest>,
15305        ) -> std::result::Result<
15306            tonic::Response<super::CreateTeamResponse>,
15307            tonic::Status,
15308        >;
15309        /** Retrieve a team by ID.
15310 Authorization: Caller must be a member of the team, or have
15311 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15312*/
15313        async fn get_team(
15314            &self,
15315            request: tonic::Request<super::GetTeamRequest>,
15316        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
15317        /** List teams in the organization with pagination.
15318 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15319*/
15320        async fn list_teams(
15321            &self,
15322            request: tonic::Request<super::ListTeamsRequest>,
15323        ) -> std::result::Result<
15324            tonic::Response<super::ListTeamsResponse>,
15325            tonic::Status,
15326        >;
15327        /** Update a team's name and/or description.
15328 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15329*/
15330        async fn update_team(
15331            &self,
15332            request: tonic::Request<super::UpdateTeamRequest>,
15333        ) -> std::result::Result<
15334            tonic::Response<super::UpdateTeamResponse>,
15335            tonic::Status,
15336        >;
15337        /** Delete a team and all its membership records. Default teams cannot be deleted.
15338 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15339*/
15340        async fn delete_team(
15341            &self,
15342            request: tonic::Request<super::DeleteTeamRequest>,
15343        ) -> std::result::Result<
15344            tonic::Response<super::DeleteTeamResponse>,
15345            tonic::Status,
15346        >;
15347        /** Add one or more users to a team (idempotent).
15348 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15349*/
15350        async fn add_team_members(
15351            &self,
15352            request: tonic::Request<super::AddTeamMembersRequest>,
15353        ) -> std::result::Result<
15354            tonic::Response<super::AddTeamMembersResponse>,
15355            tonic::Status,
15356        >;
15357        /** Remove one or more users from a team (idempotent).
15358 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15359*/
15360        async fn remove_team_members(
15361            &self,
15362            request: tonic::Request<super::RemoveTeamMembersRequest>,
15363        ) -> std::result::Result<
15364            tonic::Response<super::RemoveTeamMembersResponse>,
15365            tonic::Status,
15366        >;
15367        /** List members of a team with pagination.
15368 Authorization: Caller must be a member of the team, or have
15369 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15370*/
15371        async fn list_team_members(
15372            &self,
15373            request: tonic::Request<super::ListTeamMembersRequest>,
15374        ) -> std::result::Result<
15375            tonic::Response<super::ListTeamMembersResponse>,
15376            tonic::Status,
15377        >;
15378    }
15379    /** Manages organizational teams (departments, divisions) within an organization.
15380 Teams represent the organizational structure and can serve as sender identity.
15381 All RPCs operate within the caller's org (extracted from JWT).
15382*/
15383    #[derive(Debug)]
15384    pub struct TeamServiceServer<T> {
15385        inner: Arc<T>,
15386        accept_compression_encodings: EnabledCompressionEncodings,
15387        send_compression_encodings: EnabledCompressionEncodings,
15388        max_decoding_message_size: Option<usize>,
15389        max_encoding_message_size: Option<usize>,
15390    }
15391    impl<T> TeamServiceServer<T> {
15392        pub fn new(inner: T) -> Self {
15393            Self::from_arc(Arc::new(inner))
15394        }
15395        pub fn from_arc(inner: Arc<T>) -> Self {
15396            Self {
15397                inner,
15398                accept_compression_encodings: Default::default(),
15399                send_compression_encodings: Default::default(),
15400                max_decoding_message_size: None,
15401                max_encoding_message_size: None,
15402            }
15403        }
15404        pub fn with_interceptor<F>(
15405            inner: T,
15406            interceptor: F,
15407        ) -> InterceptedService<Self, F>
15408        where
15409            F: tonic::service::Interceptor,
15410        {
15411            InterceptedService::new(Self::new(inner), interceptor)
15412        }
15413        /// Enable decompressing requests with the given encoding.
15414        #[must_use]
15415        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15416            self.accept_compression_encodings.enable(encoding);
15417            self
15418        }
15419        /// Compress responses with the given encoding, if the client supports it.
15420        #[must_use]
15421        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15422            self.send_compression_encodings.enable(encoding);
15423            self
15424        }
15425        /// Limits the maximum size of a decoded message.
15426        ///
15427        /// Default: `4MB`
15428        #[must_use]
15429        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15430            self.max_decoding_message_size = Some(limit);
15431            self
15432        }
15433        /// Limits the maximum size of an encoded message.
15434        ///
15435        /// Default: `usize::MAX`
15436        #[must_use]
15437        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15438            self.max_encoding_message_size = Some(limit);
15439            self
15440        }
15441    }
15442    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15443    where
15444        T: TeamService,
15445        B: Body + std::marker::Send + 'static,
15446        B::Error: Into<StdError> + std::marker::Send + 'static,
15447    {
15448        type Response = http::Response<tonic::body::Body>;
15449        type Error = std::convert::Infallible;
15450        type Future = BoxFuture<Self::Response, Self::Error>;
15451        fn poll_ready(
15452            &mut self,
15453            _cx: &mut Context<'_>,
15454        ) -> Poll<std::result::Result<(), Self::Error>> {
15455            Poll::Ready(Ok(()))
15456        }
15457        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15458            match req.uri().path() {
15459                "/pidgr.v1.TeamService/CreateTeam" => {
15460                    #[allow(non_camel_case_types)]
15461                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15462                    impl<
15463                        T: TeamService,
15464                    > tonic::server::UnaryService<super::CreateTeamRequest>
15465                    for CreateTeamSvc<T> {
15466                        type Response = super::CreateTeamResponse;
15467                        type Future = BoxFuture<
15468                            tonic::Response<Self::Response>,
15469                            tonic::Status,
15470                        >;
15471                        fn call(
15472                            &mut self,
15473                            request: tonic::Request<super::CreateTeamRequest>,
15474                        ) -> Self::Future {
15475                            let inner = Arc::clone(&self.0);
15476                            let fut = async move {
15477                                <T as TeamService>::create_team(&inner, request).await
15478                            };
15479                            Box::pin(fut)
15480                        }
15481                    }
15482                    let accept_compression_encodings = self.accept_compression_encodings;
15483                    let send_compression_encodings = self.send_compression_encodings;
15484                    let max_decoding_message_size = self.max_decoding_message_size;
15485                    let max_encoding_message_size = self.max_encoding_message_size;
15486                    let inner = self.inner.clone();
15487                    let fut = async move {
15488                        let method = CreateTeamSvc(inner);
15489                        let codec = tonic_prost::ProstCodec::default();
15490                        let mut grpc = tonic::server::Grpc::new(codec)
15491                            .apply_compression_config(
15492                                accept_compression_encodings,
15493                                send_compression_encodings,
15494                            )
15495                            .apply_max_message_size_config(
15496                                max_decoding_message_size,
15497                                max_encoding_message_size,
15498                            );
15499                        let res = grpc.unary(method, req).await;
15500                        Ok(res)
15501                    };
15502                    Box::pin(fut)
15503                }
15504                "/pidgr.v1.TeamService/GetTeam" => {
15505                    #[allow(non_camel_case_types)]
15506                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15507                    impl<
15508                        T: TeamService,
15509                    > tonic::server::UnaryService<super::GetTeamRequest>
15510                    for GetTeamSvc<T> {
15511                        type Response = super::GetTeamResponse;
15512                        type Future = BoxFuture<
15513                            tonic::Response<Self::Response>,
15514                            tonic::Status,
15515                        >;
15516                        fn call(
15517                            &mut self,
15518                            request: tonic::Request<super::GetTeamRequest>,
15519                        ) -> Self::Future {
15520                            let inner = Arc::clone(&self.0);
15521                            let fut = async move {
15522                                <T as TeamService>::get_team(&inner, request).await
15523                            };
15524                            Box::pin(fut)
15525                        }
15526                    }
15527                    let accept_compression_encodings = self.accept_compression_encodings;
15528                    let send_compression_encodings = self.send_compression_encodings;
15529                    let max_decoding_message_size = self.max_decoding_message_size;
15530                    let max_encoding_message_size = self.max_encoding_message_size;
15531                    let inner = self.inner.clone();
15532                    let fut = async move {
15533                        let method = GetTeamSvc(inner);
15534                        let codec = tonic_prost::ProstCodec::default();
15535                        let mut grpc = tonic::server::Grpc::new(codec)
15536                            .apply_compression_config(
15537                                accept_compression_encodings,
15538                                send_compression_encodings,
15539                            )
15540                            .apply_max_message_size_config(
15541                                max_decoding_message_size,
15542                                max_encoding_message_size,
15543                            );
15544                        let res = grpc.unary(method, req).await;
15545                        Ok(res)
15546                    };
15547                    Box::pin(fut)
15548                }
15549                "/pidgr.v1.TeamService/ListTeams" => {
15550                    #[allow(non_camel_case_types)]
15551                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15552                    impl<
15553                        T: TeamService,
15554                    > tonic::server::UnaryService<super::ListTeamsRequest>
15555                    for ListTeamsSvc<T> {
15556                        type Response = super::ListTeamsResponse;
15557                        type Future = BoxFuture<
15558                            tonic::Response<Self::Response>,
15559                            tonic::Status,
15560                        >;
15561                        fn call(
15562                            &mut self,
15563                            request: tonic::Request<super::ListTeamsRequest>,
15564                        ) -> Self::Future {
15565                            let inner = Arc::clone(&self.0);
15566                            let fut = async move {
15567                                <T as TeamService>::list_teams(&inner, request).await
15568                            };
15569                            Box::pin(fut)
15570                        }
15571                    }
15572                    let accept_compression_encodings = self.accept_compression_encodings;
15573                    let send_compression_encodings = self.send_compression_encodings;
15574                    let max_decoding_message_size = self.max_decoding_message_size;
15575                    let max_encoding_message_size = self.max_encoding_message_size;
15576                    let inner = self.inner.clone();
15577                    let fut = async move {
15578                        let method = ListTeamsSvc(inner);
15579                        let codec = tonic_prost::ProstCodec::default();
15580                        let mut grpc = tonic::server::Grpc::new(codec)
15581                            .apply_compression_config(
15582                                accept_compression_encodings,
15583                                send_compression_encodings,
15584                            )
15585                            .apply_max_message_size_config(
15586                                max_decoding_message_size,
15587                                max_encoding_message_size,
15588                            );
15589                        let res = grpc.unary(method, req).await;
15590                        Ok(res)
15591                    };
15592                    Box::pin(fut)
15593                }
15594                "/pidgr.v1.TeamService/UpdateTeam" => {
15595                    #[allow(non_camel_case_types)]
15596                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15597                    impl<
15598                        T: TeamService,
15599                    > tonic::server::UnaryService<super::UpdateTeamRequest>
15600                    for UpdateTeamSvc<T> {
15601                        type Response = super::UpdateTeamResponse;
15602                        type Future = BoxFuture<
15603                            tonic::Response<Self::Response>,
15604                            tonic::Status,
15605                        >;
15606                        fn call(
15607                            &mut self,
15608                            request: tonic::Request<super::UpdateTeamRequest>,
15609                        ) -> Self::Future {
15610                            let inner = Arc::clone(&self.0);
15611                            let fut = async move {
15612                                <T as TeamService>::update_team(&inner, request).await
15613                            };
15614                            Box::pin(fut)
15615                        }
15616                    }
15617                    let accept_compression_encodings = self.accept_compression_encodings;
15618                    let send_compression_encodings = self.send_compression_encodings;
15619                    let max_decoding_message_size = self.max_decoding_message_size;
15620                    let max_encoding_message_size = self.max_encoding_message_size;
15621                    let inner = self.inner.clone();
15622                    let fut = async move {
15623                        let method = UpdateTeamSvc(inner);
15624                        let codec = tonic_prost::ProstCodec::default();
15625                        let mut grpc = tonic::server::Grpc::new(codec)
15626                            .apply_compression_config(
15627                                accept_compression_encodings,
15628                                send_compression_encodings,
15629                            )
15630                            .apply_max_message_size_config(
15631                                max_decoding_message_size,
15632                                max_encoding_message_size,
15633                            );
15634                        let res = grpc.unary(method, req).await;
15635                        Ok(res)
15636                    };
15637                    Box::pin(fut)
15638                }
15639                "/pidgr.v1.TeamService/DeleteTeam" => {
15640                    #[allow(non_camel_case_types)]
15641                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15642                    impl<
15643                        T: TeamService,
15644                    > tonic::server::UnaryService<super::DeleteTeamRequest>
15645                    for DeleteTeamSvc<T> {
15646                        type Response = super::DeleteTeamResponse;
15647                        type Future = BoxFuture<
15648                            tonic::Response<Self::Response>,
15649                            tonic::Status,
15650                        >;
15651                        fn call(
15652                            &mut self,
15653                            request: tonic::Request<super::DeleteTeamRequest>,
15654                        ) -> Self::Future {
15655                            let inner = Arc::clone(&self.0);
15656                            let fut = async move {
15657                                <T as TeamService>::delete_team(&inner, request).await
15658                            };
15659                            Box::pin(fut)
15660                        }
15661                    }
15662                    let accept_compression_encodings = self.accept_compression_encodings;
15663                    let send_compression_encodings = self.send_compression_encodings;
15664                    let max_decoding_message_size = self.max_decoding_message_size;
15665                    let max_encoding_message_size = self.max_encoding_message_size;
15666                    let inner = self.inner.clone();
15667                    let fut = async move {
15668                        let method = DeleteTeamSvc(inner);
15669                        let codec = tonic_prost::ProstCodec::default();
15670                        let mut grpc = tonic::server::Grpc::new(codec)
15671                            .apply_compression_config(
15672                                accept_compression_encodings,
15673                                send_compression_encodings,
15674                            )
15675                            .apply_max_message_size_config(
15676                                max_decoding_message_size,
15677                                max_encoding_message_size,
15678                            );
15679                        let res = grpc.unary(method, req).await;
15680                        Ok(res)
15681                    };
15682                    Box::pin(fut)
15683                }
15684                "/pidgr.v1.TeamService/AddTeamMembers" => {
15685                    #[allow(non_camel_case_types)]
15686                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15687                    impl<
15688                        T: TeamService,
15689                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
15690                    for AddTeamMembersSvc<T> {
15691                        type Response = super::AddTeamMembersResponse;
15692                        type Future = BoxFuture<
15693                            tonic::Response<Self::Response>,
15694                            tonic::Status,
15695                        >;
15696                        fn call(
15697                            &mut self,
15698                            request: tonic::Request<super::AddTeamMembersRequest>,
15699                        ) -> Self::Future {
15700                            let inner = Arc::clone(&self.0);
15701                            let fut = async move {
15702                                <T as TeamService>::add_team_members(&inner, request).await
15703                            };
15704                            Box::pin(fut)
15705                        }
15706                    }
15707                    let accept_compression_encodings = self.accept_compression_encodings;
15708                    let send_compression_encodings = self.send_compression_encodings;
15709                    let max_decoding_message_size = self.max_decoding_message_size;
15710                    let max_encoding_message_size = self.max_encoding_message_size;
15711                    let inner = self.inner.clone();
15712                    let fut = async move {
15713                        let method = AddTeamMembersSvc(inner);
15714                        let codec = tonic_prost::ProstCodec::default();
15715                        let mut grpc = tonic::server::Grpc::new(codec)
15716                            .apply_compression_config(
15717                                accept_compression_encodings,
15718                                send_compression_encodings,
15719                            )
15720                            .apply_max_message_size_config(
15721                                max_decoding_message_size,
15722                                max_encoding_message_size,
15723                            );
15724                        let res = grpc.unary(method, req).await;
15725                        Ok(res)
15726                    };
15727                    Box::pin(fut)
15728                }
15729                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15730                    #[allow(non_camel_case_types)]
15731                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15732                    impl<
15733                        T: TeamService,
15734                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15735                    for RemoveTeamMembersSvc<T> {
15736                        type Response = super::RemoveTeamMembersResponse;
15737                        type Future = BoxFuture<
15738                            tonic::Response<Self::Response>,
15739                            tonic::Status,
15740                        >;
15741                        fn call(
15742                            &mut self,
15743                            request: tonic::Request<super::RemoveTeamMembersRequest>,
15744                        ) -> Self::Future {
15745                            let inner = Arc::clone(&self.0);
15746                            let fut = async move {
15747                                <T as TeamService>::remove_team_members(&inner, request)
15748                                    .await
15749                            };
15750                            Box::pin(fut)
15751                        }
15752                    }
15753                    let accept_compression_encodings = self.accept_compression_encodings;
15754                    let send_compression_encodings = self.send_compression_encodings;
15755                    let max_decoding_message_size = self.max_decoding_message_size;
15756                    let max_encoding_message_size = self.max_encoding_message_size;
15757                    let inner = self.inner.clone();
15758                    let fut = async move {
15759                        let method = RemoveTeamMembersSvc(inner);
15760                        let codec = tonic_prost::ProstCodec::default();
15761                        let mut grpc = tonic::server::Grpc::new(codec)
15762                            .apply_compression_config(
15763                                accept_compression_encodings,
15764                                send_compression_encodings,
15765                            )
15766                            .apply_max_message_size_config(
15767                                max_decoding_message_size,
15768                                max_encoding_message_size,
15769                            );
15770                        let res = grpc.unary(method, req).await;
15771                        Ok(res)
15772                    };
15773                    Box::pin(fut)
15774                }
15775                "/pidgr.v1.TeamService/ListTeamMembers" => {
15776                    #[allow(non_camel_case_types)]
15777                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15778                    impl<
15779                        T: TeamService,
15780                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
15781                    for ListTeamMembersSvc<T> {
15782                        type Response = super::ListTeamMembersResponse;
15783                        type Future = BoxFuture<
15784                            tonic::Response<Self::Response>,
15785                            tonic::Status,
15786                        >;
15787                        fn call(
15788                            &mut self,
15789                            request: tonic::Request<super::ListTeamMembersRequest>,
15790                        ) -> Self::Future {
15791                            let inner = Arc::clone(&self.0);
15792                            let fut = async move {
15793                                <T as TeamService>::list_team_members(&inner, request).await
15794                            };
15795                            Box::pin(fut)
15796                        }
15797                    }
15798                    let accept_compression_encodings = self.accept_compression_encodings;
15799                    let send_compression_encodings = self.send_compression_encodings;
15800                    let max_decoding_message_size = self.max_decoding_message_size;
15801                    let max_encoding_message_size = self.max_encoding_message_size;
15802                    let inner = self.inner.clone();
15803                    let fut = async move {
15804                        let method = ListTeamMembersSvc(inner);
15805                        let codec = tonic_prost::ProstCodec::default();
15806                        let mut grpc = tonic::server::Grpc::new(codec)
15807                            .apply_compression_config(
15808                                accept_compression_encodings,
15809                                send_compression_encodings,
15810                            )
15811                            .apply_max_message_size_config(
15812                                max_decoding_message_size,
15813                                max_encoding_message_size,
15814                            );
15815                        let res = grpc.unary(method, req).await;
15816                        Ok(res)
15817                    };
15818                    Box::pin(fut)
15819                }
15820                _ => {
15821                    Box::pin(async move {
15822                        let mut response = http::Response::new(
15823                            tonic::body::Body::default(),
15824                        );
15825                        let headers = response.headers_mut();
15826                        headers
15827                            .insert(
15828                                tonic::Status::GRPC_STATUS,
15829                                (tonic::Code::Unimplemented as i32).into(),
15830                            );
15831                        headers
15832                            .insert(
15833                                http::header::CONTENT_TYPE,
15834                                tonic::metadata::GRPC_CONTENT_TYPE,
15835                            );
15836                        Ok(response)
15837                    })
15838                }
15839            }
15840        }
15841    }
15842    impl<T> Clone for TeamServiceServer<T> {
15843        fn clone(&self) -> Self {
15844            let inner = self.inner.clone();
15845            Self {
15846                inner,
15847                accept_compression_encodings: self.accept_compression_encodings,
15848                send_compression_encodings: self.send_compression_encodings,
15849                max_decoding_message_size: self.max_decoding_message_size,
15850                max_encoding_message_size: self.max_encoding_message_size,
15851            }
15852        }
15853    }
15854    /// Generated gRPC service name
15855    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
15856    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
15857        const NAME: &'static str = SERVICE_NAME;
15858    }
15859}
15860/// Generated client implementations.
15861pub mod template_service_client {
15862    #![allow(
15863        unused_variables,
15864        dead_code,
15865        missing_docs,
15866        clippy::wildcard_imports,
15867        clippy::let_unit_value,
15868    )]
15869    use tonic::codegen::*;
15870    use tonic::codegen::http::Uri;
15871    /** Manages versioned message templates used by campaigns.
15872 Templates are append-only — updates create new versions while preserving history.
15873*/
15874    #[derive(Debug, Clone)]
15875    pub struct TemplateServiceClient<T> {
15876        inner: tonic::client::Grpc<T>,
15877    }
15878    impl TemplateServiceClient<tonic::transport::Channel> {
15879        /// Attempt to create a new client by connecting to a given endpoint.
15880        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15881        where
15882            D: TryInto<tonic::transport::Endpoint>,
15883            D::Error: Into<StdError>,
15884        {
15885            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15886            Ok(Self::new(conn))
15887        }
15888    }
15889    impl<T> TemplateServiceClient<T>
15890    where
15891        T: tonic::client::GrpcService<tonic::body::Body>,
15892        T::Error: Into<StdError>,
15893        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15894        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15895    {
15896        pub fn new(inner: T) -> Self {
15897            let inner = tonic::client::Grpc::new(inner);
15898            Self { inner }
15899        }
15900        pub fn with_origin(inner: T, origin: Uri) -> Self {
15901            let inner = tonic::client::Grpc::with_origin(inner, origin);
15902            Self { inner }
15903        }
15904        pub fn with_interceptor<F>(
15905            inner: T,
15906            interceptor: F,
15907        ) -> TemplateServiceClient<InterceptedService<T, F>>
15908        where
15909            F: tonic::service::Interceptor,
15910            T::ResponseBody: Default,
15911            T: tonic::codegen::Service<
15912                http::Request<tonic::body::Body>,
15913                Response = http::Response<
15914                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15915                >,
15916            >,
15917            <T as tonic::codegen::Service<
15918                http::Request<tonic::body::Body>,
15919            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15920        {
15921            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
15922        }
15923        /// Compress requests with the given encoding.
15924        ///
15925        /// This requires the server to support it otherwise it might respond with an
15926        /// error.
15927        #[must_use]
15928        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15929            self.inner = self.inner.send_compressed(encoding);
15930            self
15931        }
15932        /// Enable decompressing responses.
15933        #[must_use]
15934        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15935            self.inner = self.inner.accept_compressed(encoding);
15936            self
15937        }
15938        /// Limits the maximum size of a decoded message.
15939        ///
15940        /// Default: `4MB`
15941        #[must_use]
15942        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15943            self.inner = self.inner.max_decoding_message_size(limit);
15944            self
15945        }
15946        /// Limits the maximum size of an encoded message.
15947        ///
15948        /// Default: `usize::MAX`
15949        #[must_use]
15950        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15951            self.inner = self.inner.max_encoding_message_size(limit);
15952            self
15953        }
15954        /** Create a new template with a body and variable definitions.
15955 Authorization: Requires MANAGER+ role.
15956*/
15957        pub async fn create_template(
15958            &mut self,
15959            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
15960        ) -> std::result::Result<
15961            tonic::Response<super::CreateTemplateResponse>,
15962            tonic::Status,
15963        > {
15964            self.inner
15965                .ready()
15966                .await
15967                .map_err(|e| {
15968                    tonic::Status::unknown(
15969                        format!("Service was not ready: {}", e.into()),
15970                    )
15971                })?;
15972            let codec = tonic_prost::ProstCodec::default();
15973            let path = http::uri::PathAndQuery::from_static(
15974                "/pidgr.v1.TemplateService/CreateTemplate",
15975            );
15976            let mut req = request.into_request();
15977            req.extensions_mut()
15978                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
15979            self.inner.unary(req, path, codec).await
15980        }
15981        /** Update an existing template, creating a new version.
15982 Authorization: Requires MANAGER+ role.
15983*/
15984        pub async fn update_template(
15985            &mut self,
15986            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
15987        ) -> std::result::Result<
15988            tonic::Response<super::UpdateTemplateResponse>,
15989            tonic::Status,
15990        > {
15991            self.inner
15992                .ready()
15993                .await
15994                .map_err(|e| {
15995                    tonic::Status::unknown(
15996                        format!("Service was not ready: {}", e.into()),
15997                    )
15998                })?;
15999            let codec = tonic_prost::ProstCodec::default();
16000            let path = http::uri::PathAndQuery::from_static(
16001                "/pidgr.v1.TemplateService/UpdateTemplate",
16002            );
16003            let mut req = request.into_request();
16004            req.extensions_mut()
16005                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
16006            self.inner.unary(req, path, codec).await
16007        }
16008        /** Retrieve a specific template by ID and optional version.
16009 Authorization: Authenticated user within the organization.
16010*/
16011        pub async fn get_template(
16012            &mut self,
16013            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
16014        ) -> std::result::Result<
16015            tonic::Response<super::GetTemplateResponse>,
16016            tonic::Status,
16017        > {
16018            self.inner
16019                .ready()
16020                .await
16021                .map_err(|e| {
16022                    tonic::Status::unknown(
16023                        format!("Service was not ready: {}", e.into()),
16024                    )
16025                })?;
16026            let codec = tonic_prost::ProstCodec::default();
16027            let path = http::uri::PathAndQuery::from_static(
16028                "/pidgr.v1.TemplateService/GetTemplate",
16029            );
16030            let mut req = request.into_request();
16031            req.extensions_mut()
16032                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
16033            self.inner.unary(req, path, codec).await
16034        }
16035        /** List all templates for the organization with pagination.
16036 Authorization: Authenticated user within the organization.
16037*/
16038        pub async fn list_templates(
16039            &mut self,
16040            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
16041        ) -> std::result::Result<
16042            tonic::Response<super::ListTemplatesResponse>,
16043            tonic::Status,
16044        > {
16045            self.inner
16046                .ready()
16047                .await
16048                .map_err(|e| {
16049                    tonic::Status::unknown(
16050                        format!("Service was not ready: {}", e.into()),
16051                    )
16052                })?;
16053            let codec = tonic_prost::ProstCodec::default();
16054            let path = http::uri::PathAndQuery::from_static(
16055                "/pidgr.v1.TemplateService/ListTemplates",
16056            );
16057            let mut req = request.into_request();
16058            req.extensions_mut()
16059                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
16060            self.inner.unary(req, path, codec).await
16061        }
16062        /** Create a locale-specific translation of a template.
16063 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16064*/
16065        pub async fn create_template_translation(
16066            &mut self,
16067            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
16068        ) -> std::result::Result<
16069            tonic::Response<super::CreateTemplateTranslationResponse>,
16070            tonic::Status,
16071        > {
16072            self.inner
16073                .ready()
16074                .await
16075                .map_err(|e| {
16076                    tonic::Status::unknown(
16077                        format!("Service was not ready: {}", e.into()),
16078                    )
16079                })?;
16080            let codec = tonic_prost::ProstCodec::default();
16081            let path = http::uri::PathAndQuery::from_static(
16082                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
16083            );
16084            let mut req = request.into_request();
16085            req.extensions_mut()
16086                .insert(
16087                    GrpcMethod::new(
16088                        "pidgr.v1.TemplateService",
16089                        "CreateTemplateTranslation",
16090                    ),
16091                );
16092            self.inner.unary(req, path, codec).await
16093        }
16094        /** Update an existing template translation.
16095 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16096*/
16097        pub async fn update_template_translation(
16098            &mut self,
16099            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
16100        ) -> std::result::Result<
16101            tonic::Response<super::UpdateTemplateTranslationResponse>,
16102            tonic::Status,
16103        > {
16104            self.inner
16105                .ready()
16106                .await
16107                .map_err(|e| {
16108                    tonic::Status::unknown(
16109                        format!("Service was not ready: {}", e.into()),
16110                    )
16111                })?;
16112            let codec = tonic_prost::ProstCodec::default();
16113            let path = http::uri::PathAndQuery::from_static(
16114                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
16115            );
16116            let mut req = request.into_request();
16117            req.extensions_mut()
16118                .insert(
16119                    GrpcMethod::new(
16120                        "pidgr.v1.TemplateService",
16121                        "UpdateTemplateTranslation",
16122                    ),
16123                );
16124            self.inner.unary(req, path, codec).await
16125        }
16126        /** List all translations for a template version.
16127 Authorization: Requires PERMISSION_TEMPLATES_READ.
16128*/
16129        pub async fn list_template_translations(
16130            &mut self,
16131            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
16132        ) -> std::result::Result<
16133            tonic::Response<super::ListTemplateTranslationsResponse>,
16134            tonic::Status,
16135        > {
16136            self.inner
16137                .ready()
16138                .await
16139                .map_err(|e| {
16140                    tonic::Status::unknown(
16141                        format!("Service was not ready: {}", e.into()),
16142                    )
16143                })?;
16144            let codec = tonic_prost::ProstCodec::default();
16145            let path = http::uri::PathAndQuery::from_static(
16146                "/pidgr.v1.TemplateService/ListTemplateTranslations",
16147            );
16148            let mut req = request.into_request();
16149            req.extensions_mut()
16150                .insert(
16151                    GrpcMethod::new(
16152                        "pidgr.v1.TemplateService",
16153                        "ListTemplateTranslations",
16154                    ),
16155                );
16156            self.inner.unary(req, path, codec).await
16157        }
16158        /** Approve a template translation for use in campaigns.
16159 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16160*/
16161        pub async fn approve_template_translation(
16162            &mut self,
16163            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
16164        ) -> std::result::Result<
16165            tonic::Response<super::ApproveTemplateTranslationResponse>,
16166            tonic::Status,
16167        > {
16168            self.inner
16169                .ready()
16170                .await
16171                .map_err(|e| {
16172                    tonic::Status::unknown(
16173                        format!("Service was not ready: {}", e.into()),
16174                    )
16175                })?;
16176            let codec = tonic_prost::ProstCodec::default();
16177            let path = http::uri::PathAndQuery::from_static(
16178                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
16179            );
16180            let mut req = request.into_request();
16181            req.extensions_mut()
16182                .insert(
16183                    GrpcMethod::new(
16184                        "pidgr.v1.TemplateService",
16185                        "ApproveTemplateTranslation",
16186                    ),
16187                );
16188            self.inner.unary(req, path, codec).await
16189        }
16190    }
16191}
16192/// Generated server implementations.
16193pub mod template_service_server {
16194    #![allow(
16195        unused_variables,
16196        dead_code,
16197        missing_docs,
16198        clippy::wildcard_imports,
16199        clippy::let_unit_value,
16200    )]
16201    use tonic::codegen::*;
16202    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
16203    #[async_trait]
16204    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
16205        /** Create a new template with a body and variable definitions.
16206 Authorization: Requires MANAGER+ role.
16207*/
16208        async fn create_template(
16209            &self,
16210            request: tonic::Request<super::CreateTemplateRequest>,
16211        ) -> std::result::Result<
16212            tonic::Response<super::CreateTemplateResponse>,
16213            tonic::Status,
16214        >;
16215        /** Update an existing template, creating a new version.
16216 Authorization: Requires MANAGER+ role.
16217*/
16218        async fn update_template(
16219            &self,
16220            request: tonic::Request<super::UpdateTemplateRequest>,
16221        ) -> std::result::Result<
16222            tonic::Response<super::UpdateTemplateResponse>,
16223            tonic::Status,
16224        >;
16225        /** Retrieve a specific template by ID and optional version.
16226 Authorization: Authenticated user within the organization.
16227*/
16228        async fn get_template(
16229            &self,
16230            request: tonic::Request<super::GetTemplateRequest>,
16231        ) -> std::result::Result<
16232            tonic::Response<super::GetTemplateResponse>,
16233            tonic::Status,
16234        >;
16235        /** List all templates for the organization with pagination.
16236 Authorization: Authenticated user within the organization.
16237*/
16238        async fn list_templates(
16239            &self,
16240            request: tonic::Request<super::ListTemplatesRequest>,
16241        ) -> std::result::Result<
16242            tonic::Response<super::ListTemplatesResponse>,
16243            tonic::Status,
16244        >;
16245        /** Create a locale-specific translation of a template.
16246 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16247*/
16248        async fn create_template_translation(
16249            &self,
16250            request: tonic::Request<super::CreateTemplateTranslationRequest>,
16251        ) -> std::result::Result<
16252            tonic::Response<super::CreateTemplateTranslationResponse>,
16253            tonic::Status,
16254        >;
16255        /** Update an existing template translation.
16256 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16257*/
16258        async fn update_template_translation(
16259            &self,
16260            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
16261        ) -> std::result::Result<
16262            tonic::Response<super::UpdateTemplateTranslationResponse>,
16263            tonic::Status,
16264        >;
16265        /** List all translations for a template version.
16266 Authorization: Requires PERMISSION_TEMPLATES_READ.
16267*/
16268        async fn list_template_translations(
16269            &self,
16270            request: tonic::Request<super::ListTemplateTranslationsRequest>,
16271        ) -> std::result::Result<
16272            tonic::Response<super::ListTemplateTranslationsResponse>,
16273            tonic::Status,
16274        >;
16275        /** Approve a template translation for use in campaigns.
16276 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16277*/
16278        async fn approve_template_translation(
16279            &self,
16280            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
16281        ) -> std::result::Result<
16282            tonic::Response<super::ApproveTemplateTranslationResponse>,
16283            tonic::Status,
16284        >;
16285    }
16286    /** Manages versioned message templates used by campaigns.
16287 Templates are append-only — updates create new versions while preserving history.
16288*/
16289    #[derive(Debug)]
16290    pub struct TemplateServiceServer<T> {
16291        inner: Arc<T>,
16292        accept_compression_encodings: EnabledCompressionEncodings,
16293        send_compression_encodings: EnabledCompressionEncodings,
16294        max_decoding_message_size: Option<usize>,
16295        max_encoding_message_size: Option<usize>,
16296    }
16297    impl<T> TemplateServiceServer<T> {
16298        pub fn new(inner: T) -> Self {
16299            Self::from_arc(Arc::new(inner))
16300        }
16301        pub fn from_arc(inner: Arc<T>) -> Self {
16302            Self {
16303                inner,
16304                accept_compression_encodings: Default::default(),
16305                send_compression_encodings: Default::default(),
16306                max_decoding_message_size: None,
16307                max_encoding_message_size: None,
16308            }
16309        }
16310        pub fn with_interceptor<F>(
16311            inner: T,
16312            interceptor: F,
16313        ) -> InterceptedService<Self, F>
16314        where
16315            F: tonic::service::Interceptor,
16316        {
16317            InterceptedService::new(Self::new(inner), interceptor)
16318        }
16319        /// Enable decompressing requests with the given encoding.
16320        #[must_use]
16321        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16322            self.accept_compression_encodings.enable(encoding);
16323            self
16324        }
16325        /// Compress responses with the given encoding, if the client supports it.
16326        #[must_use]
16327        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16328            self.send_compression_encodings.enable(encoding);
16329            self
16330        }
16331        /// Limits the maximum size of a decoded message.
16332        ///
16333        /// Default: `4MB`
16334        #[must_use]
16335        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16336            self.max_decoding_message_size = Some(limit);
16337            self
16338        }
16339        /// Limits the maximum size of an encoded message.
16340        ///
16341        /// Default: `usize::MAX`
16342        #[must_use]
16343        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16344            self.max_encoding_message_size = Some(limit);
16345            self
16346        }
16347    }
16348    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
16349    where
16350        T: TemplateService,
16351        B: Body + std::marker::Send + 'static,
16352        B::Error: Into<StdError> + std::marker::Send + 'static,
16353    {
16354        type Response = http::Response<tonic::body::Body>;
16355        type Error = std::convert::Infallible;
16356        type Future = BoxFuture<Self::Response, Self::Error>;
16357        fn poll_ready(
16358            &mut self,
16359            _cx: &mut Context<'_>,
16360        ) -> Poll<std::result::Result<(), Self::Error>> {
16361            Poll::Ready(Ok(()))
16362        }
16363        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16364            match req.uri().path() {
16365                "/pidgr.v1.TemplateService/CreateTemplate" => {
16366                    #[allow(non_camel_case_types)]
16367                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
16368                    impl<
16369                        T: TemplateService,
16370                    > tonic::server::UnaryService<super::CreateTemplateRequest>
16371                    for CreateTemplateSvc<T> {
16372                        type Response = super::CreateTemplateResponse;
16373                        type Future = BoxFuture<
16374                            tonic::Response<Self::Response>,
16375                            tonic::Status,
16376                        >;
16377                        fn call(
16378                            &mut self,
16379                            request: tonic::Request<super::CreateTemplateRequest>,
16380                        ) -> Self::Future {
16381                            let inner = Arc::clone(&self.0);
16382                            let fut = async move {
16383                                <T as TemplateService>::create_template(&inner, request)
16384                                    .await
16385                            };
16386                            Box::pin(fut)
16387                        }
16388                    }
16389                    let accept_compression_encodings = self.accept_compression_encodings;
16390                    let send_compression_encodings = self.send_compression_encodings;
16391                    let max_decoding_message_size = self.max_decoding_message_size;
16392                    let max_encoding_message_size = self.max_encoding_message_size;
16393                    let inner = self.inner.clone();
16394                    let fut = async move {
16395                        let method = CreateTemplateSvc(inner);
16396                        let codec = tonic_prost::ProstCodec::default();
16397                        let mut grpc = tonic::server::Grpc::new(codec)
16398                            .apply_compression_config(
16399                                accept_compression_encodings,
16400                                send_compression_encodings,
16401                            )
16402                            .apply_max_message_size_config(
16403                                max_decoding_message_size,
16404                                max_encoding_message_size,
16405                            );
16406                        let res = grpc.unary(method, req).await;
16407                        Ok(res)
16408                    };
16409                    Box::pin(fut)
16410                }
16411                "/pidgr.v1.TemplateService/UpdateTemplate" => {
16412                    #[allow(non_camel_case_types)]
16413                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
16414                    impl<
16415                        T: TemplateService,
16416                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
16417                    for UpdateTemplateSvc<T> {
16418                        type Response = super::UpdateTemplateResponse;
16419                        type Future = BoxFuture<
16420                            tonic::Response<Self::Response>,
16421                            tonic::Status,
16422                        >;
16423                        fn call(
16424                            &mut self,
16425                            request: tonic::Request<super::UpdateTemplateRequest>,
16426                        ) -> Self::Future {
16427                            let inner = Arc::clone(&self.0);
16428                            let fut = async move {
16429                                <T as TemplateService>::update_template(&inner, request)
16430                                    .await
16431                            };
16432                            Box::pin(fut)
16433                        }
16434                    }
16435                    let accept_compression_encodings = self.accept_compression_encodings;
16436                    let send_compression_encodings = self.send_compression_encodings;
16437                    let max_decoding_message_size = self.max_decoding_message_size;
16438                    let max_encoding_message_size = self.max_encoding_message_size;
16439                    let inner = self.inner.clone();
16440                    let fut = async move {
16441                        let method = UpdateTemplateSvc(inner);
16442                        let codec = tonic_prost::ProstCodec::default();
16443                        let mut grpc = tonic::server::Grpc::new(codec)
16444                            .apply_compression_config(
16445                                accept_compression_encodings,
16446                                send_compression_encodings,
16447                            )
16448                            .apply_max_message_size_config(
16449                                max_decoding_message_size,
16450                                max_encoding_message_size,
16451                            );
16452                        let res = grpc.unary(method, req).await;
16453                        Ok(res)
16454                    };
16455                    Box::pin(fut)
16456                }
16457                "/pidgr.v1.TemplateService/GetTemplate" => {
16458                    #[allow(non_camel_case_types)]
16459                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16460                    impl<
16461                        T: TemplateService,
16462                    > tonic::server::UnaryService<super::GetTemplateRequest>
16463                    for GetTemplateSvc<T> {
16464                        type Response = super::GetTemplateResponse;
16465                        type Future = BoxFuture<
16466                            tonic::Response<Self::Response>,
16467                            tonic::Status,
16468                        >;
16469                        fn call(
16470                            &mut self,
16471                            request: tonic::Request<super::GetTemplateRequest>,
16472                        ) -> Self::Future {
16473                            let inner = Arc::clone(&self.0);
16474                            let fut = async move {
16475                                <T as TemplateService>::get_template(&inner, request).await
16476                            };
16477                            Box::pin(fut)
16478                        }
16479                    }
16480                    let accept_compression_encodings = self.accept_compression_encodings;
16481                    let send_compression_encodings = self.send_compression_encodings;
16482                    let max_decoding_message_size = self.max_decoding_message_size;
16483                    let max_encoding_message_size = self.max_encoding_message_size;
16484                    let inner = self.inner.clone();
16485                    let fut = async move {
16486                        let method = GetTemplateSvc(inner);
16487                        let codec = tonic_prost::ProstCodec::default();
16488                        let mut grpc = tonic::server::Grpc::new(codec)
16489                            .apply_compression_config(
16490                                accept_compression_encodings,
16491                                send_compression_encodings,
16492                            )
16493                            .apply_max_message_size_config(
16494                                max_decoding_message_size,
16495                                max_encoding_message_size,
16496                            );
16497                        let res = grpc.unary(method, req).await;
16498                        Ok(res)
16499                    };
16500                    Box::pin(fut)
16501                }
16502                "/pidgr.v1.TemplateService/ListTemplates" => {
16503                    #[allow(non_camel_case_types)]
16504                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16505                    impl<
16506                        T: TemplateService,
16507                    > tonic::server::UnaryService<super::ListTemplatesRequest>
16508                    for ListTemplatesSvc<T> {
16509                        type Response = super::ListTemplatesResponse;
16510                        type Future = BoxFuture<
16511                            tonic::Response<Self::Response>,
16512                            tonic::Status,
16513                        >;
16514                        fn call(
16515                            &mut self,
16516                            request: tonic::Request<super::ListTemplatesRequest>,
16517                        ) -> Self::Future {
16518                            let inner = Arc::clone(&self.0);
16519                            let fut = async move {
16520                                <T as TemplateService>::list_templates(&inner, request)
16521                                    .await
16522                            };
16523                            Box::pin(fut)
16524                        }
16525                    }
16526                    let accept_compression_encodings = self.accept_compression_encodings;
16527                    let send_compression_encodings = self.send_compression_encodings;
16528                    let max_decoding_message_size = self.max_decoding_message_size;
16529                    let max_encoding_message_size = self.max_encoding_message_size;
16530                    let inner = self.inner.clone();
16531                    let fut = async move {
16532                        let method = ListTemplatesSvc(inner);
16533                        let codec = tonic_prost::ProstCodec::default();
16534                        let mut grpc = tonic::server::Grpc::new(codec)
16535                            .apply_compression_config(
16536                                accept_compression_encodings,
16537                                send_compression_encodings,
16538                            )
16539                            .apply_max_message_size_config(
16540                                max_decoding_message_size,
16541                                max_encoding_message_size,
16542                            );
16543                        let res = grpc.unary(method, req).await;
16544                        Ok(res)
16545                    };
16546                    Box::pin(fut)
16547                }
16548                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16549                    #[allow(non_camel_case_types)]
16550                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16551                    impl<
16552                        T: TemplateService,
16553                    > tonic::server::UnaryService<
16554                        super::CreateTemplateTranslationRequest,
16555                    > for CreateTemplateTranslationSvc<T> {
16556                        type Response = super::CreateTemplateTranslationResponse;
16557                        type Future = BoxFuture<
16558                            tonic::Response<Self::Response>,
16559                            tonic::Status,
16560                        >;
16561                        fn call(
16562                            &mut self,
16563                            request: tonic::Request<
16564                                super::CreateTemplateTranslationRequest,
16565                            >,
16566                        ) -> Self::Future {
16567                            let inner = Arc::clone(&self.0);
16568                            let fut = async move {
16569                                <T as TemplateService>::create_template_translation(
16570                                        &inner,
16571                                        request,
16572                                    )
16573                                    .await
16574                            };
16575                            Box::pin(fut)
16576                        }
16577                    }
16578                    let accept_compression_encodings = self.accept_compression_encodings;
16579                    let send_compression_encodings = self.send_compression_encodings;
16580                    let max_decoding_message_size = self.max_decoding_message_size;
16581                    let max_encoding_message_size = self.max_encoding_message_size;
16582                    let inner = self.inner.clone();
16583                    let fut = async move {
16584                        let method = CreateTemplateTranslationSvc(inner);
16585                        let codec = tonic_prost::ProstCodec::default();
16586                        let mut grpc = tonic::server::Grpc::new(codec)
16587                            .apply_compression_config(
16588                                accept_compression_encodings,
16589                                send_compression_encodings,
16590                            )
16591                            .apply_max_message_size_config(
16592                                max_decoding_message_size,
16593                                max_encoding_message_size,
16594                            );
16595                        let res = grpc.unary(method, req).await;
16596                        Ok(res)
16597                    };
16598                    Box::pin(fut)
16599                }
16600                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16601                    #[allow(non_camel_case_types)]
16602                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16603                    impl<
16604                        T: TemplateService,
16605                    > tonic::server::UnaryService<
16606                        super::UpdateTemplateTranslationRequest,
16607                    > for UpdateTemplateTranslationSvc<T> {
16608                        type Response = super::UpdateTemplateTranslationResponse;
16609                        type Future = BoxFuture<
16610                            tonic::Response<Self::Response>,
16611                            tonic::Status,
16612                        >;
16613                        fn call(
16614                            &mut self,
16615                            request: tonic::Request<
16616                                super::UpdateTemplateTranslationRequest,
16617                            >,
16618                        ) -> Self::Future {
16619                            let inner = Arc::clone(&self.0);
16620                            let fut = async move {
16621                                <T as TemplateService>::update_template_translation(
16622                                        &inner,
16623                                        request,
16624                                    )
16625                                    .await
16626                            };
16627                            Box::pin(fut)
16628                        }
16629                    }
16630                    let accept_compression_encodings = self.accept_compression_encodings;
16631                    let send_compression_encodings = self.send_compression_encodings;
16632                    let max_decoding_message_size = self.max_decoding_message_size;
16633                    let max_encoding_message_size = self.max_encoding_message_size;
16634                    let inner = self.inner.clone();
16635                    let fut = async move {
16636                        let method = UpdateTemplateTranslationSvc(inner);
16637                        let codec = tonic_prost::ProstCodec::default();
16638                        let mut grpc = tonic::server::Grpc::new(codec)
16639                            .apply_compression_config(
16640                                accept_compression_encodings,
16641                                send_compression_encodings,
16642                            )
16643                            .apply_max_message_size_config(
16644                                max_decoding_message_size,
16645                                max_encoding_message_size,
16646                            );
16647                        let res = grpc.unary(method, req).await;
16648                        Ok(res)
16649                    };
16650                    Box::pin(fut)
16651                }
16652                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16653                    #[allow(non_camel_case_types)]
16654                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16655                    impl<
16656                        T: TemplateService,
16657                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16658                    for ListTemplateTranslationsSvc<T> {
16659                        type Response = super::ListTemplateTranslationsResponse;
16660                        type Future = BoxFuture<
16661                            tonic::Response<Self::Response>,
16662                            tonic::Status,
16663                        >;
16664                        fn call(
16665                            &mut self,
16666                            request: tonic::Request<
16667                                super::ListTemplateTranslationsRequest,
16668                            >,
16669                        ) -> Self::Future {
16670                            let inner = Arc::clone(&self.0);
16671                            let fut = async move {
16672                                <T as TemplateService>::list_template_translations(
16673                                        &inner,
16674                                        request,
16675                                    )
16676                                    .await
16677                            };
16678                            Box::pin(fut)
16679                        }
16680                    }
16681                    let accept_compression_encodings = self.accept_compression_encodings;
16682                    let send_compression_encodings = self.send_compression_encodings;
16683                    let max_decoding_message_size = self.max_decoding_message_size;
16684                    let max_encoding_message_size = self.max_encoding_message_size;
16685                    let inner = self.inner.clone();
16686                    let fut = async move {
16687                        let method = ListTemplateTranslationsSvc(inner);
16688                        let codec = tonic_prost::ProstCodec::default();
16689                        let mut grpc = tonic::server::Grpc::new(codec)
16690                            .apply_compression_config(
16691                                accept_compression_encodings,
16692                                send_compression_encodings,
16693                            )
16694                            .apply_max_message_size_config(
16695                                max_decoding_message_size,
16696                                max_encoding_message_size,
16697                            );
16698                        let res = grpc.unary(method, req).await;
16699                        Ok(res)
16700                    };
16701                    Box::pin(fut)
16702                }
16703                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16704                    #[allow(non_camel_case_types)]
16705                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16706                    impl<
16707                        T: TemplateService,
16708                    > tonic::server::UnaryService<
16709                        super::ApproveTemplateTranslationRequest,
16710                    > for ApproveTemplateTranslationSvc<T> {
16711                        type Response = super::ApproveTemplateTranslationResponse;
16712                        type Future = BoxFuture<
16713                            tonic::Response<Self::Response>,
16714                            tonic::Status,
16715                        >;
16716                        fn call(
16717                            &mut self,
16718                            request: tonic::Request<
16719                                super::ApproveTemplateTranslationRequest,
16720                            >,
16721                        ) -> Self::Future {
16722                            let inner = Arc::clone(&self.0);
16723                            let fut = async move {
16724                                <T as TemplateService>::approve_template_translation(
16725                                        &inner,
16726                                        request,
16727                                    )
16728                                    .await
16729                            };
16730                            Box::pin(fut)
16731                        }
16732                    }
16733                    let accept_compression_encodings = self.accept_compression_encodings;
16734                    let send_compression_encodings = self.send_compression_encodings;
16735                    let max_decoding_message_size = self.max_decoding_message_size;
16736                    let max_encoding_message_size = self.max_encoding_message_size;
16737                    let inner = self.inner.clone();
16738                    let fut = async move {
16739                        let method = ApproveTemplateTranslationSvc(inner);
16740                        let codec = tonic_prost::ProstCodec::default();
16741                        let mut grpc = tonic::server::Grpc::new(codec)
16742                            .apply_compression_config(
16743                                accept_compression_encodings,
16744                                send_compression_encodings,
16745                            )
16746                            .apply_max_message_size_config(
16747                                max_decoding_message_size,
16748                                max_encoding_message_size,
16749                            );
16750                        let res = grpc.unary(method, req).await;
16751                        Ok(res)
16752                    };
16753                    Box::pin(fut)
16754                }
16755                _ => {
16756                    Box::pin(async move {
16757                        let mut response = http::Response::new(
16758                            tonic::body::Body::default(),
16759                        );
16760                        let headers = response.headers_mut();
16761                        headers
16762                            .insert(
16763                                tonic::Status::GRPC_STATUS,
16764                                (tonic::Code::Unimplemented as i32).into(),
16765                            );
16766                        headers
16767                            .insert(
16768                                http::header::CONTENT_TYPE,
16769                                tonic::metadata::GRPC_CONTENT_TYPE,
16770                            );
16771                        Ok(response)
16772                    })
16773                }
16774            }
16775        }
16776    }
16777    impl<T> Clone for TemplateServiceServer<T> {
16778        fn clone(&self) -> Self {
16779            let inner = self.inner.clone();
16780            Self {
16781                inner,
16782                accept_compression_encodings: self.accept_compression_encodings,
16783                send_compression_encodings: self.send_compression_encodings,
16784                max_decoding_message_size: self.max_decoding_message_size,
16785                max_encoding_message_size: self.max_encoding_message_size,
16786            }
16787        }
16788    }
16789    /// Generated gRPC service name
16790    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16791    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16792        const NAME: &'static str = SERVICE_NAME;
16793    }
16794}
16795/// Generated client implementations.
16796pub mod token_service_client {
16797    #![allow(
16798        unused_variables,
16799        dead_code,
16800        missing_docs,
16801        clippy::wildcard_imports,
16802        clippy::let_unit_value,
16803    )]
16804    use tonic::codegen::*;
16805    use tonic::codegen::http::Uri;
16806    /** HMAC-signed deeplink-token signing and validation.
16807
16808 Deeplink tokens carry the (campaign, recipient, step) tuple that
16809 authorizes a third-party-channel deeplink
16810 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16811 pidgr-api with a per-org HMAC key managed by the platform's key store;
16812 rotation is automatic with a 7-day overlap window so callers do not
16813 have to coordinate.
16814*/
16815    #[derive(Debug, Clone)]
16816    pub struct TokenServiceClient<T> {
16817        inner: tonic::client::Grpc<T>,
16818    }
16819    impl TokenServiceClient<tonic::transport::Channel> {
16820        /// Attempt to create a new client by connecting to a given endpoint.
16821        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16822        where
16823            D: TryInto<tonic::transport::Endpoint>,
16824            D::Error: Into<StdError>,
16825        {
16826            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16827            Ok(Self::new(conn))
16828        }
16829    }
16830    impl<T> TokenServiceClient<T>
16831    where
16832        T: tonic::client::GrpcService<tonic::body::Body>,
16833        T::Error: Into<StdError>,
16834        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16835        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16836    {
16837        pub fn new(inner: T) -> Self {
16838            let inner = tonic::client::Grpc::new(inner);
16839            Self { inner }
16840        }
16841        pub fn with_origin(inner: T, origin: Uri) -> Self {
16842            let inner = tonic::client::Grpc::with_origin(inner, origin);
16843            Self { inner }
16844        }
16845        pub fn with_interceptor<F>(
16846            inner: T,
16847            interceptor: F,
16848        ) -> TokenServiceClient<InterceptedService<T, F>>
16849        where
16850            F: tonic::service::Interceptor,
16851            T::ResponseBody: Default,
16852            T: tonic::codegen::Service<
16853                http::Request<tonic::body::Body>,
16854                Response = http::Response<
16855                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16856                >,
16857            >,
16858            <T as tonic::codegen::Service<
16859                http::Request<tonic::body::Body>,
16860            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16861        {
16862            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
16863        }
16864        /// Compress requests with the given encoding.
16865        ///
16866        /// This requires the server to support it otherwise it might respond with an
16867        /// error.
16868        #[must_use]
16869        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16870            self.inner = self.inner.send_compressed(encoding);
16871            self
16872        }
16873        /// Enable decompressing responses.
16874        #[must_use]
16875        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16876            self.inner = self.inner.accept_compressed(encoding);
16877            self
16878        }
16879        /// Limits the maximum size of a decoded message.
16880        ///
16881        /// Default: `4MB`
16882        #[must_use]
16883        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16884            self.inner = self.inner.max_decoding_message_size(limit);
16885            self
16886        }
16887        /// Limits the maximum size of an encoded message.
16888        ///
16889        /// Default: `usize::MAX`
16890        #[must_use]
16891        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16892            self.inner = self.inner.max_encoding_message_size(limit);
16893            self
16894        }
16895        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16896 the dispatch layer assembling a deeplink during message
16897 composition).
16898*/
16899        pub async fn sign_deeplink_token(
16900            &mut self,
16901            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
16902        ) -> std::result::Result<
16903            tonic::Response<super::SignDeeplinkTokenResponse>,
16904            tonic::Status,
16905        > {
16906            self.inner
16907                .ready()
16908                .await
16909                .map_err(|e| {
16910                    tonic::Status::unknown(
16911                        format!("Service was not ready: {}", e.into()),
16912                    )
16913                })?;
16914            let codec = tonic_prost::ProstCodec::default();
16915            let path = http::uri::PathAndQuery::from_static(
16916                "/pidgr.v1.TokenService/SignDeeplinkToken",
16917            );
16918            let mut req = request.into_request();
16919            req.extensions_mut()
16920                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
16921            self.inner.unary(req, path, codec).await
16922        }
16923        /** Validate a deeplink token. Authorization: unauthenticated (caller
16924 is the native app validating before showing the auth gate). The
16925 token IS the lookup key; valid responses carry the decoded payload.
16926*/
16927        pub async fn validate_deeplink_token(
16928            &mut self,
16929            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
16930        ) -> std::result::Result<
16931            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16932            tonic::Status,
16933        > {
16934            self.inner
16935                .ready()
16936                .await
16937                .map_err(|e| {
16938                    tonic::Status::unknown(
16939                        format!("Service was not ready: {}", e.into()),
16940                    )
16941                })?;
16942            let codec = tonic_prost::ProstCodec::default();
16943            let path = http::uri::PathAndQuery::from_static(
16944                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
16945            );
16946            let mut req = request.into_request();
16947            req.extensions_mut()
16948                .insert(
16949                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
16950                );
16951            self.inner.unary(req, path, codec).await
16952        }
16953    }
16954}
16955/// Generated server implementations.
16956pub mod token_service_server {
16957    #![allow(
16958        unused_variables,
16959        dead_code,
16960        missing_docs,
16961        clippy::wildcard_imports,
16962        clippy::let_unit_value,
16963    )]
16964    use tonic::codegen::*;
16965    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
16966    #[async_trait]
16967    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
16968        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16969 the dispatch layer assembling a deeplink during message
16970 composition).
16971*/
16972        async fn sign_deeplink_token(
16973            &self,
16974            request: tonic::Request<super::SignDeeplinkTokenRequest>,
16975        ) -> std::result::Result<
16976            tonic::Response<super::SignDeeplinkTokenResponse>,
16977            tonic::Status,
16978        >;
16979        /** Validate a deeplink token. Authorization: unauthenticated (caller
16980 is the native app validating before showing the auth gate). The
16981 token IS the lookup key; valid responses carry the decoded payload.
16982*/
16983        async fn validate_deeplink_token(
16984            &self,
16985            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16986        ) -> std::result::Result<
16987            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16988            tonic::Status,
16989        >;
16990    }
16991    /** HMAC-signed deeplink-token signing and validation.
16992
16993 Deeplink tokens carry the (campaign, recipient, step) tuple that
16994 authorizes a third-party-channel deeplink
16995 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16996 pidgr-api with a per-org HMAC key managed by the platform's key store;
16997 rotation is automatic with a 7-day overlap window so callers do not
16998 have to coordinate.
16999*/
17000    #[derive(Debug)]
17001    pub struct TokenServiceServer<T> {
17002        inner: Arc<T>,
17003        accept_compression_encodings: EnabledCompressionEncodings,
17004        send_compression_encodings: EnabledCompressionEncodings,
17005        max_decoding_message_size: Option<usize>,
17006        max_encoding_message_size: Option<usize>,
17007    }
17008    impl<T> TokenServiceServer<T> {
17009        pub fn new(inner: T) -> Self {
17010            Self::from_arc(Arc::new(inner))
17011        }
17012        pub fn from_arc(inner: Arc<T>) -> Self {
17013            Self {
17014                inner,
17015                accept_compression_encodings: Default::default(),
17016                send_compression_encodings: Default::default(),
17017                max_decoding_message_size: None,
17018                max_encoding_message_size: None,
17019            }
17020        }
17021        pub fn with_interceptor<F>(
17022            inner: T,
17023            interceptor: F,
17024        ) -> InterceptedService<Self, F>
17025        where
17026            F: tonic::service::Interceptor,
17027        {
17028            InterceptedService::new(Self::new(inner), interceptor)
17029        }
17030        /// Enable decompressing requests with the given encoding.
17031        #[must_use]
17032        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17033            self.accept_compression_encodings.enable(encoding);
17034            self
17035        }
17036        /// Compress responses with the given encoding, if the client supports it.
17037        #[must_use]
17038        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17039            self.send_compression_encodings.enable(encoding);
17040            self
17041        }
17042        /// Limits the maximum size of a decoded message.
17043        ///
17044        /// Default: `4MB`
17045        #[must_use]
17046        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17047            self.max_decoding_message_size = Some(limit);
17048            self
17049        }
17050        /// Limits the maximum size of an encoded message.
17051        ///
17052        /// Default: `usize::MAX`
17053        #[must_use]
17054        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17055            self.max_encoding_message_size = Some(limit);
17056            self
17057        }
17058    }
17059    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
17060    where
17061        T: TokenService,
17062        B: Body + std::marker::Send + 'static,
17063        B::Error: Into<StdError> + std::marker::Send + 'static,
17064    {
17065        type Response = http::Response<tonic::body::Body>;
17066        type Error = std::convert::Infallible;
17067        type Future = BoxFuture<Self::Response, Self::Error>;
17068        fn poll_ready(
17069            &mut self,
17070            _cx: &mut Context<'_>,
17071        ) -> Poll<std::result::Result<(), Self::Error>> {
17072            Poll::Ready(Ok(()))
17073        }
17074        fn call(&mut self, req: http::Request<B>) -> Self::Future {
17075            match req.uri().path() {
17076                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
17077                    #[allow(non_camel_case_types)]
17078                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17079                    impl<
17080                        T: TokenService,
17081                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
17082                    for SignDeeplinkTokenSvc<T> {
17083                        type Response = super::SignDeeplinkTokenResponse;
17084                        type Future = BoxFuture<
17085                            tonic::Response<Self::Response>,
17086                            tonic::Status,
17087                        >;
17088                        fn call(
17089                            &mut self,
17090                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
17091                        ) -> Self::Future {
17092                            let inner = Arc::clone(&self.0);
17093                            let fut = async move {
17094                                <T as TokenService>::sign_deeplink_token(&inner, request)
17095                                    .await
17096                            };
17097                            Box::pin(fut)
17098                        }
17099                    }
17100                    let accept_compression_encodings = self.accept_compression_encodings;
17101                    let send_compression_encodings = self.send_compression_encodings;
17102                    let max_decoding_message_size = self.max_decoding_message_size;
17103                    let max_encoding_message_size = self.max_encoding_message_size;
17104                    let inner = self.inner.clone();
17105                    let fut = async move {
17106                        let method = SignDeeplinkTokenSvc(inner);
17107                        let codec = tonic_prost::ProstCodec::default();
17108                        let mut grpc = tonic::server::Grpc::new(codec)
17109                            .apply_compression_config(
17110                                accept_compression_encodings,
17111                                send_compression_encodings,
17112                            )
17113                            .apply_max_message_size_config(
17114                                max_decoding_message_size,
17115                                max_encoding_message_size,
17116                            );
17117                        let res = grpc.unary(method, req).await;
17118                        Ok(res)
17119                    };
17120                    Box::pin(fut)
17121                }
17122                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
17123                    #[allow(non_camel_case_types)]
17124                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17125                    impl<
17126                        T: TokenService,
17127                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
17128                    for ValidateDeeplinkTokenSvc<T> {
17129                        type Response = super::ValidateDeeplinkTokenResponse;
17130                        type Future = BoxFuture<
17131                            tonic::Response<Self::Response>,
17132                            tonic::Status,
17133                        >;
17134                        fn call(
17135                            &mut self,
17136                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17137                        ) -> Self::Future {
17138                            let inner = Arc::clone(&self.0);
17139                            let fut = async move {
17140                                <T as TokenService>::validate_deeplink_token(
17141                                        &inner,
17142                                        request,
17143                                    )
17144                                    .await
17145                            };
17146                            Box::pin(fut)
17147                        }
17148                    }
17149                    let accept_compression_encodings = self.accept_compression_encodings;
17150                    let send_compression_encodings = self.send_compression_encodings;
17151                    let max_decoding_message_size = self.max_decoding_message_size;
17152                    let max_encoding_message_size = self.max_encoding_message_size;
17153                    let inner = self.inner.clone();
17154                    let fut = async move {
17155                        let method = ValidateDeeplinkTokenSvc(inner);
17156                        let codec = tonic_prost::ProstCodec::default();
17157                        let mut grpc = tonic::server::Grpc::new(codec)
17158                            .apply_compression_config(
17159                                accept_compression_encodings,
17160                                send_compression_encodings,
17161                            )
17162                            .apply_max_message_size_config(
17163                                max_decoding_message_size,
17164                                max_encoding_message_size,
17165                            );
17166                        let res = grpc.unary(method, req).await;
17167                        Ok(res)
17168                    };
17169                    Box::pin(fut)
17170                }
17171                _ => {
17172                    Box::pin(async move {
17173                        let mut response = http::Response::new(
17174                            tonic::body::Body::default(),
17175                        );
17176                        let headers = response.headers_mut();
17177                        headers
17178                            .insert(
17179                                tonic::Status::GRPC_STATUS,
17180                                (tonic::Code::Unimplemented as i32).into(),
17181                            );
17182                        headers
17183                            .insert(
17184                                http::header::CONTENT_TYPE,
17185                                tonic::metadata::GRPC_CONTENT_TYPE,
17186                            );
17187                        Ok(response)
17188                    })
17189                }
17190            }
17191        }
17192    }
17193    impl<T> Clone for TokenServiceServer<T> {
17194        fn clone(&self) -> Self {
17195            let inner = self.inner.clone();
17196            Self {
17197                inner,
17198                accept_compression_encodings: self.accept_compression_encodings,
17199                send_compression_encodings: self.send_compression_encodings,
17200                max_decoding_message_size: self.max_decoding_message_size,
17201                max_encoding_message_size: self.max_encoding_message_size,
17202            }
17203        }
17204    }
17205    /// Generated gRPC service name
17206    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
17207    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
17208        const NAME: &'static str = SERVICE_NAME;
17209    }
17210}