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        /** Delete or anonymize all personal data associated with a user.
1336 Deletion has a 30-day grace period during which processing is restricted
1337 and the request can be cancelled. After 30 days, deletion is irreversible.
1338 Auth: Requires JWT. Admin only.
1339*/
1340        pub async fn delete_user_data(
1341            &mut self,
1342            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1343        ) -> std::result::Result<
1344            tonic::Response<super::DeleteUserDataResponse>,
1345            tonic::Status,
1346        > {
1347            self.inner
1348                .ready()
1349                .await
1350                .map_err(|e| {
1351                    tonic::Status::unknown(
1352                        format!("Service was not ready: {}", e.into()),
1353                    )
1354                })?;
1355            let codec = tonic_prost::ProstCodec::default();
1356            let path = http::uri::PathAndQuery::from_static(
1357                "/pidgr.v1.PrivacyService/DeleteUserData",
1358            );
1359            let mut req = request.into_request();
1360            req.extensions_mut()
1361                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1362            self.inner.unary(req, path, codec).await
1363        }
1364        /** Correct personal data for a user. Propagates corrections to all stored
1365 locations (profile, delivery records, analytics metadata).
1366 Auth: Requires JWT. Callable by the user themselves or an org admin.
1367*/
1368        pub async fn rectify_user_data(
1369            &mut self,
1370            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1371        ) -> std::result::Result<
1372            tonic::Response<super::RectifyUserDataResponse>,
1373            tonic::Status,
1374        > {
1375            self.inner
1376                .ready()
1377                .await
1378                .map_err(|e| {
1379                    tonic::Status::unknown(
1380                        format!("Service was not ready: {}", e.into()),
1381                    )
1382                })?;
1383            let codec = tonic_prost::ProstCodec::default();
1384            let path = http::uri::PathAndQuery::from_static(
1385                "/pidgr.v1.PrivacyService/RectifyUserData",
1386            );
1387            let mut req = request.into_request();
1388            req.extensions_mut()
1389                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1390            self.inner.unary(req, path, codec).await
1391        }
1392        /** Restrict or unrestrict processing for a user. When restricted, the API
1393 skips this user in campaigns, analytics, and session replay.
1394 Auth: Requires JWT. Admin only.
1395*/
1396        pub async fn restrict_processing(
1397            &mut self,
1398            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1399        ) -> std::result::Result<
1400            tonic::Response<super::RestrictProcessingResponse>,
1401            tonic::Status,
1402        > {
1403            self.inner
1404                .ready()
1405                .await
1406                .map_err(|e| {
1407                    tonic::Status::unknown(
1408                        format!("Service was not ready: {}", e.into()),
1409                    )
1410                })?;
1411            let codec = tonic_prost::ProstCodec::default();
1412            let path = http::uri::PathAndQuery::from_static(
1413                "/pidgr.v1.PrivacyService/RestrictProcessing",
1414            );
1415            let mut req = request.into_request();
1416            req.extensions_mut()
1417                .insert(
1418                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1419                );
1420            self.inner.unary(req, path, codec).await
1421        }
1422        /** Confirm whether personal data exists for a user and list data categories.
1423 LGPD-specific: confirmação de existência (Art. 18, I).
1424 Auth: Requires JWT. Admin only.
1425*/
1426        pub async fn get_data_existence_confirmation(
1427            &mut self,
1428            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1429        ) -> std::result::Result<
1430            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1431            tonic::Status,
1432        > {
1433            self.inner
1434                .ready()
1435                .await
1436                .map_err(|e| {
1437                    tonic::Status::unknown(
1438                        format!("Service was not ready: {}", e.into()),
1439                    )
1440                })?;
1441            let codec = tonic_prost::ProstCodec::default();
1442            let path = http::uri::PathAndQuery::from_static(
1443                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1444            );
1445            let mut req = request.into_request();
1446            req.extensions_mut()
1447                .insert(
1448                    GrpcMethod::new(
1449                        "pidgr.v1.PrivacyService",
1450                        "GetDataExistenceConfirmation",
1451                    ),
1452                );
1453            self.inner.unary(req, path, codec).await
1454        }
1455        /** List privacy requests for the organization, with optional filters.
1456 Used by the admin UI to show scheduled deletions table.
1457 Auth: Requires JWT. Admin only.
1458*/
1459        pub async fn list_privacy_requests(
1460            &mut self,
1461            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1462        ) -> std::result::Result<
1463            tonic::Response<super::ListPrivacyRequestsResponse>,
1464            tonic::Status,
1465        > {
1466            self.inner
1467                .ready()
1468                .await
1469                .map_err(|e| {
1470                    tonic::Status::unknown(
1471                        format!("Service was not ready: {}", e.into()),
1472                    )
1473                })?;
1474            let codec = tonic_prost::ProstCodec::default();
1475            let path = http::uri::PathAndQuery::from_static(
1476                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1477            );
1478            let mut req = request.into_request();
1479            req.extensions_mut()
1480                .insert(
1481                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1482                );
1483            self.inner.unary(req, path, codec).await
1484        }
1485        /** Cancel a pending deletion request. Reactivates the user and aborts
1486 the deletion workflow. Only valid during the 30-day grace period.
1487 Auth: Requires JWT. Admin only.
1488*/
1489        pub async fn cancel_deletion(
1490            &mut self,
1491            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1492        ) -> std::result::Result<
1493            tonic::Response<super::CancelDeletionResponse>,
1494            tonic::Status,
1495        > {
1496            self.inner
1497                .ready()
1498                .await
1499                .map_err(|e| {
1500                    tonic::Status::unknown(
1501                        format!("Service was not ready: {}", e.into()),
1502                    )
1503                })?;
1504            let codec = tonic_prost::ProstCodec::default();
1505            let path = http::uri::PathAndQuery::from_static(
1506                "/pidgr.v1.PrivacyService/CancelDeletion",
1507            );
1508            let mut req = request.into_request();
1509            req.extensions_mut()
1510                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1511            self.inner.unary(req, path, codec).await
1512        }
1513        /** Skip the grace period and delete immediately. Signals the deletion
1514 workflow to proceed without waiting for the 30-day timer.
1515 Auth: Requires JWT. Admin only.
1516*/
1517        pub async fn immediate_delete(
1518            &mut self,
1519            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1520        ) -> std::result::Result<
1521            tonic::Response<super::ImmediateDeleteResponse>,
1522            tonic::Status,
1523        > {
1524            self.inner
1525                .ready()
1526                .await
1527                .map_err(|e| {
1528                    tonic::Status::unknown(
1529                        format!("Service was not ready: {}", e.into()),
1530                    )
1531                })?;
1532            let codec = tonic_prost::ProstCodec::default();
1533            let path = http::uri::PathAndQuery::from_static(
1534                "/pidgr.v1.PrivacyService/ImmediateDelete",
1535            );
1536            let mut req = request.into_request();
1537            req.extensions_mut()
1538                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1539            self.inner.unary(req, path, codec).await
1540        }
1541        /** List the calling user's own privacy requests (export, rectify).
1542 The server extracts user_id from the JWT — no admin permission required.
1543 Auth: Requires JWT. Any authenticated user.
1544*/
1545        pub async fn list_my_privacy_requests(
1546            &mut self,
1547            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1548        ) -> std::result::Result<
1549            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1550            tonic::Status,
1551        > {
1552            self.inner
1553                .ready()
1554                .await
1555                .map_err(|e| {
1556                    tonic::Status::unknown(
1557                        format!("Service was not ready: {}", e.into()),
1558                    )
1559                })?;
1560            let codec = tonic_prost::ProstCodec::default();
1561            let path = http::uri::PathAndQuery::from_static(
1562                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1563            );
1564            let mut req = request.into_request();
1565            req.extensions_mut()
1566                .insert(
1567                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1568                );
1569            self.inner.unary(req, path, codec).await
1570        }
1571    }
1572}
1573/// Generated server implementations.
1574pub mod privacy_service_server {
1575    #![allow(
1576        unused_variables,
1577        dead_code,
1578        missing_docs,
1579        clippy::wildcard_imports,
1580        clippy::let_unit_value,
1581    )]
1582    use tonic::codegen::*;
1583    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
1584    #[async_trait]
1585    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1586        /** Export all personal data associated with a user as a downloadable ZIP.
1587 Async operation — returns immediately with PENDING status, sends push
1588 notification when the export is ready.
1589 Auth: Requires JWT. Callable by the user themselves or an org admin.
1590*/
1591        async fn export_user_data(
1592            &self,
1593            request: tonic::Request<super::ExportUserDataRequest>,
1594        ) -> std::result::Result<
1595            tonic::Response<super::ExportUserDataResponse>,
1596            tonic::Status,
1597        >;
1598        /** Delete or anonymize all personal data associated with a user.
1599 Deletion has a 30-day grace period during which processing is restricted
1600 and the request can be cancelled. After 30 days, deletion is irreversible.
1601 Auth: Requires JWT. Admin only.
1602*/
1603        async fn delete_user_data(
1604            &self,
1605            request: tonic::Request<super::DeleteUserDataRequest>,
1606        ) -> std::result::Result<
1607            tonic::Response<super::DeleteUserDataResponse>,
1608            tonic::Status,
1609        >;
1610        /** Correct personal data for a user. Propagates corrections to all stored
1611 locations (profile, delivery records, analytics metadata).
1612 Auth: Requires JWT. Callable by the user themselves or an org admin.
1613*/
1614        async fn rectify_user_data(
1615            &self,
1616            request: tonic::Request<super::RectifyUserDataRequest>,
1617        ) -> std::result::Result<
1618            tonic::Response<super::RectifyUserDataResponse>,
1619            tonic::Status,
1620        >;
1621        /** Restrict or unrestrict processing for a user. When restricted, the API
1622 skips this user in campaigns, analytics, and session replay.
1623 Auth: Requires JWT. Admin only.
1624*/
1625        async fn restrict_processing(
1626            &self,
1627            request: tonic::Request<super::RestrictProcessingRequest>,
1628        ) -> std::result::Result<
1629            tonic::Response<super::RestrictProcessingResponse>,
1630            tonic::Status,
1631        >;
1632        /** Confirm whether personal data exists for a user and list data categories.
1633 LGPD-specific: confirmação de existência (Art. 18, I).
1634 Auth: Requires JWT. Admin only.
1635*/
1636        async fn get_data_existence_confirmation(
1637            &self,
1638            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1639        ) -> std::result::Result<
1640            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1641            tonic::Status,
1642        >;
1643        /** List privacy requests for the organization, with optional filters.
1644 Used by the admin UI to show scheduled deletions table.
1645 Auth: Requires JWT. Admin only.
1646*/
1647        async fn list_privacy_requests(
1648            &self,
1649            request: tonic::Request<super::ListPrivacyRequestsRequest>,
1650        ) -> std::result::Result<
1651            tonic::Response<super::ListPrivacyRequestsResponse>,
1652            tonic::Status,
1653        >;
1654        /** Cancel a pending deletion request. Reactivates the user and aborts
1655 the deletion workflow. Only valid during the 30-day grace period.
1656 Auth: Requires JWT. Admin only.
1657*/
1658        async fn cancel_deletion(
1659            &self,
1660            request: tonic::Request<super::CancelDeletionRequest>,
1661        ) -> std::result::Result<
1662            tonic::Response<super::CancelDeletionResponse>,
1663            tonic::Status,
1664        >;
1665        /** Skip the grace period and delete immediately. Signals the deletion
1666 workflow to proceed without waiting for the 30-day timer.
1667 Auth: Requires JWT. Admin only.
1668*/
1669        async fn immediate_delete(
1670            &self,
1671            request: tonic::Request<super::ImmediateDeleteRequest>,
1672        ) -> std::result::Result<
1673            tonic::Response<super::ImmediateDeleteResponse>,
1674            tonic::Status,
1675        >;
1676        /** List the calling user's own privacy requests (export, rectify).
1677 The server extracts user_id from the JWT — no admin permission required.
1678 Auth: Requires JWT. Any authenticated user.
1679*/
1680        async fn list_my_privacy_requests(
1681            &self,
1682            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1683        ) -> std::result::Result<
1684            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1685            tonic::Status,
1686        >;
1687    }
1688    /** PrivacyService handles GDPR/LGPD data subject rights.
1689 All RPCs extract org_id from the JWT — it is never in request messages.
1690*/
1691    #[derive(Debug)]
1692    pub struct PrivacyServiceServer<T> {
1693        inner: Arc<T>,
1694        accept_compression_encodings: EnabledCompressionEncodings,
1695        send_compression_encodings: EnabledCompressionEncodings,
1696        max_decoding_message_size: Option<usize>,
1697        max_encoding_message_size: Option<usize>,
1698    }
1699    impl<T> PrivacyServiceServer<T> {
1700        pub fn new(inner: T) -> Self {
1701            Self::from_arc(Arc::new(inner))
1702        }
1703        pub fn from_arc(inner: Arc<T>) -> Self {
1704            Self {
1705                inner,
1706                accept_compression_encodings: Default::default(),
1707                send_compression_encodings: Default::default(),
1708                max_decoding_message_size: None,
1709                max_encoding_message_size: None,
1710            }
1711        }
1712        pub fn with_interceptor<F>(
1713            inner: T,
1714            interceptor: F,
1715        ) -> InterceptedService<Self, F>
1716        where
1717            F: tonic::service::Interceptor,
1718        {
1719            InterceptedService::new(Self::new(inner), interceptor)
1720        }
1721        /// Enable decompressing requests with the given encoding.
1722        #[must_use]
1723        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1724            self.accept_compression_encodings.enable(encoding);
1725            self
1726        }
1727        /// Compress responses with the given encoding, if the client supports it.
1728        #[must_use]
1729        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1730            self.send_compression_encodings.enable(encoding);
1731            self
1732        }
1733        /// Limits the maximum size of a decoded message.
1734        ///
1735        /// Default: `4MB`
1736        #[must_use]
1737        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1738            self.max_decoding_message_size = Some(limit);
1739            self
1740        }
1741        /// Limits the maximum size of an encoded message.
1742        ///
1743        /// Default: `usize::MAX`
1744        #[must_use]
1745        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1746            self.max_encoding_message_size = Some(limit);
1747            self
1748        }
1749    }
1750    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1751    where
1752        T: PrivacyService,
1753        B: Body + std::marker::Send + 'static,
1754        B::Error: Into<StdError> + std::marker::Send + 'static,
1755    {
1756        type Response = http::Response<tonic::body::Body>;
1757        type Error = std::convert::Infallible;
1758        type Future = BoxFuture<Self::Response, Self::Error>;
1759        fn poll_ready(
1760            &mut self,
1761            _cx: &mut Context<'_>,
1762        ) -> Poll<std::result::Result<(), Self::Error>> {
1763            Poll::Ready(Ok(()))
1764        }
1765        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1766            match req.uri().path() {
1767                "/pidgr.v1.PrivacyService/ExportUserData" => {
1768                    #[allow(non_camel_case_types)]
1769                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1770                    impl<
1771                        T: PrivacyService,
1772                    > tonic::server::UnaryService<super::ExportUserDataRequest>
1773                    for ExportUserDataSvc<T> {
1774                        type Response = super::ExportUserDataResponse;
1775                        type Future = BoxFuture<
1776                            tonic::Response<Self::Response>,
1777                            tonic::Status,
1778                        >;
1779                        fn call(
1780                            &mut self,
1781                            request: tonic::Request<super::ExportUserDataRequest>,
1782                        ) -> Self::Future {
1783                            let inner = Arc::clone(&self.0);
1784                            let fut = async move {
1785                                <T as PrivacyService>::export_user_data(&inner, request)
1786                                    .await
1787                            };
1788                            Box::pin(fut)
1789                        }
1790                    }
1791                    let accept_compression_encodings = self.accept_compression_encodings;
1792                    let send_compression_encodings = self.send_compression_encodings;
1793                    let max_decoding_message_size = self.max_decoding_message_size;
1794                    let max_encoding_message_size = self.max_encoding_message_size;
1795                    let inner = self.inner.clone();
1796                    let fut = async move {
1797                        let method = ExportUserDataSvc(inner);
1798                        let codec = tonic_prost::ProstCodec::default();
1799                        let mut grpc = tonic::server::Grpc::new(codec)
1800                            .apply_compression_config(
1801                                accept_compression_encodings,
1802                                send_compression_encodings,
1803                            )
1804                            .apply_max_message_size_config(
1805                                max_decoding_message_size,
1806                                max_encoding_message_size,
1807                            );
1808                        let res = grpc.unary(method, req).await;
1809                        Ok(res)
1810                    };
1811                    Box::pin(fut)
1812                }
1813                "/pidgr.v1.PrivacyService/DeleteUserData" => {
1814                    #[allow(non_camel_case_types)]
1815                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1816                    impl<
1817                        T: PrivacyService,
1818                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
1819                    for DeleteUserDataSvc<T> {
1820                        type Response = super::DeleteUserDataResponse;
1821                        type Future = BoxFuture<
1822                            tonic::Response<Self::Response>,
1823                            tonic::Status,
1824                        >;
1825                        fn call(
1826                            &mut self,
1827                            request: tonic::Request<super::DeleteUserDataRequest>,
1828                        ) -> Self::Future {
1829                            let inner = Arc::clone(&self.0);
1830                            let fut = async move {
1831                                <T as PrivacyService>::delete_user_data(&inner, request)
1832                                    .await
1833                            };
1834                            Box::pin(fut)
1835                        }
1836                    }
1837                    let accept_compression_encodings = self.accept_compression_encodings;
1838                    let send_compression_encodings = self.send_compression_encodings;
1839                    let max_decoding_message_size = self.max_decoding_message_size;
1840                    let max_encoding_message_size = self.max_encoding_message_size;
1841                    let inner = self.inner.clone();
1842                    let fut = async move {
1843                        let method = DeleteUserDataSvc(inner);
1844                        let codec = tonic_prost::ProstCodec::default();
1845                        let mut grpc = tonic::server::Grpc::new(codec)
1846                            .apply_compression_config(
1847                                accept_compression_encodings,
1848                                send_compression_encodings,
1849                            )
1850                            .apply_max_message_size_config(
1851                                max_decoding_message_size,
1852                                max_encoding_message_size,
1853                            );
1854                        let res = grpc.unary(method, req).await;
1855                        Ok(res)
1856                    };
1857                    Box::pin(fut)
1858                }
1859                "/pidgr.v1.PrivacyService/RectifyUserData" => {
1860                    #[allow(non_camel_case_types)]
1861                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1862                    impl<
1863                        T: PrivacyService,
1864                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
1865                    for RectifyUserDataSvc<T> {
1866                        type Response = super::RectifyUserDataResponse;
1867                        type Future = BoxFuture<
1868                            tonic::Response<Self::Response>,
1869                            tonic::Status,
1870                        >;
1871                        fn call(
1872                            &mut self,
1873                            request: tonic::Request<super::RectifyUserDataRequest>,
1874                        ) -> Self::Future {
1875                            let inner = Arc::clone(&self.0);
1876                            let fut = async move {
1877                                <T as PrivacyService>::rectify_user_data(&inner, request)
1878                                    .await
1879                            };
1880                            Box::pin(fut)
1881                        }
1882                    }
1883                    let accept_compression_encodings = self.accept_compression_encodings;
1884                    let send_compression_encodings = self.send_compression_encodings;
1885                    let max_decoding_message_size = self.max_decoding_message_size;
1886                    let max_encoding_message_size = self.max_encoding_message_size;
1887                    let inner = self.inner.clone();
1888                    let fut = async move {
1889                        let method = RectifyUserDataSvc(inner);
1890                        let codec = tonic_prost::ProstCodec::default();
1891                        let mut grpc = tonic::server::Grpc::new(codec)
1892                            .apply_compression_config(
1893                                accept_compression_encodings,
1894                                send_compression_encodings,
1895                            )
1896                            .apply_max_message_size_config(
1897                                max_decoding_message_size,
1898                                max_encoding_message_size,
1899                            );
1900                        let res = grpc.unary(method, req).await;
1901                        Ok(res)
1902                    };
1903                    Box::pin(fut)
1904                }
1905                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
1906                    #[allow(non_camel_case_types)]
1907                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
1908                    impl<
1909                        T: PrivacyService,
1910                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
1911                    for RestrictProcessingSvc<T> {
1912                        type Response = super::RestrictProcessingResponse;
1913                        type Future = BoxFuture<
1914                            tonic::Response<Self::Response>,
1915                            tonic::Status,
1916                        >;
1917                        fn call(
1918                            &mut self,
1919                            request: tonic::Request<super::RestrictProcessingRequest>,
1920                        ) -> Self::Future {
1921                            let inner = Arc::clone(&self.0);
1922                            let fut = async move {
1923                                <T as PrivacyService>::restrict_processing(&inner, request)
1924                                    .await
1925                            };
1926                            Box::pin(fut)
1927                        }
1928                    }
1929                    let accept_compression_encodings = self.accept_compression_encodings;
1930                    let send_compression_encodings = self.send_compression_encodings;
1931                    let max_decoding_message_size = self.max_decoding_message_size;
1932                    let max_encoding_message_size = self.max_encoding_message_size;
1933                    let inner = self.inner.clone();
1934                    let fut = async move {
1935                        let method = RestrictProcessingSvc(inner);
1936                        let codec = tonic_prost::ProstCodec::default();
1937                        let mut grpc = tonic::server::Grpc::new(codec)
1938                            .apply_compression_config(
1939                                accept_compression_encodings,
1940                                send_compression_encodings,
1941                            )
1942                            .apply_max_message_size_config(
1943                                max_decoding_message_size,
1944                                max_encoding_message_size,
1945                            );
1946                        let res = grpc.unary(method, req).await;
1947                        Ok(res)
1948                    };
1949                    Box::pin(fut)
1950                }
1951                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
1952                    #[allow(non_camel_case_types)]
1953                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
1954                        pub Arc<T>,
1955                    );
1956                    impl<
1957                        T: PrivacyService,
1958                    > tonic::server::UnaryService<
1959                        super::GetDataExistenceConfirmationRequest,
1960                    > for GetDataExistenceConfirmationSvc<T> {
1961                        type Response = super::GetDataExistenceConfirmationResponse;
1962                        type Future = BoxFuture<
1963                            tonic::Response<Self::Response>,
1964                            tonic::Status,
1965                        >;
1966                        fn call(
1967                            &mut self,
1968                            request: tonic::Request<
1969                                super::GetDataExistenceConfirmationRequest,
1970                            >,
1971                        ) -> Self::Future {
1972                            let inner = Arc::clone(&self.0);
1973                            let fut = async move {
1974                                <T as PrivacyService>::get_data_existence_confirmation(
1975                                        &inner,
1976                                        request,
1977                                    )
1978                                    .await
1979                            };
1980                            Box::pin(fut)
1981                        }
1982                    }
1983                    let accept_compression_encodings = self.accept_compression_encodings;
1984                    let send_compression_encodings = self.send_compression_encodings;
1985                    let max_decoding_message_size = self.max_decoding_message_size;
1986                    let max_encoding_message_size = self.max_encoding_message_size;
1987                    let inner = self.inner.clone();
1988                    let fut = async move {
1989                        let method = GetDataExistenceConfirmationSvc(inner);
1990                        let codec = tonic_prost::ProstCodec::default();
1991                        let mut grpc = tonic::server::Grpc::new(codec)
1992                            .apply_compression_config(
1993                                accept_compression_encodings,
1994                                send_compression_encodings,
1995                            )
1996                            .apply_max_message_size_config(
1997                                max_decoding_message_size,
1998                                max_encoding_message_size,
1999                            );
2000                        let res = grpc.unary(method, req).await;
2001                        Ok(res)
2002                    };
2003                    Box::pin(fut)
2004                }
2005                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2006                    #[allow(non_camel_case_types)]
2007                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2008                    impl<
2009                        T: PrivacyService,
2010                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2011                    for ListPrivacyRequestsSvc<T> {
2012                        type Response = super::ListPrivacyRequestsResponse;
2013                        type Future = BoxFuture<
2014                            tonic::Response<Self::Response>,
2015                            tonic::Status,
2016                        >;
2017                        fn call(
2018                            &mut self,
2019                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2020                        ) -> Self::Future {
2021                            let inner = Arc::clone(&self.0);
2022                            let fut = async move {
2023                                <T as PrivacyService>::list_privacy_requests(
2024                                        &inner,
2025                                        request,
2026                                    )
2027                                    .await
2028                            };
2029                            Box::pin(fut)
2030                        }
2031                    }
2032                    let accept_compression_encodings = self.accept_compression_encodings;
2033                    let send_compression_encodings = self.send_compression_encodings;
2034                    let max_decoding_message_size = self.max_decoding_message_size;
2035                    let max_encoding_message_size = self.max_encoding_message_size;
2036                    let inner = self.inner.clone();
2037                    let fut = async move {
2038                        let method = ListPrivacyRequestsSvc(inner);
2039                        let codec = tonic_prost::ProstCodec::default();
2040                        let mut grpc = tonic::server::Grpc::new(codec)
2041                            .apply_compression_config(
2042                                accept_compression_encodings,
2043                                send_compression_encodings,
2044                            )
2045                            .apply_max_message_size_config(
2046                                max_decoding_message_size,
2047                                max_encoding_message_size,
2048                            );
2049                        let res = grpc.unary(method, req).await;
2050                        Ok(res)
2051                    };
2052                    Box::pin(fut)
2053                }
2054                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2055                    #[allow(non_camel_case_types)]
2056                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2057                    impl<
2058                        T: PrivacyService,
2059                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2060                    for CancelDeletionSvc<T> {
2061                        type Response = super::CancelDeletionResponse;
2062                        type Future = BoxFuture<
2063                            tonic::Response<Self::Response>,
2064                            tonic::Status,
2065                        >;
2066                        fn call(
2067                            &mut self,
2068                            request: tonic::Request<super::CancelDeletionRequest>,
2069                        ) -> Self::Future {
2070                            let inner = Arc::clone(&self.0);
2071                            let fut = async move {
2072                                <T as PrivacyService>::cancel_deletion(&inner, request)
2073                                    .await
2074                            };
2075                            Box::pin(fut)
2076                        }
2077                    }
2078                    let accept_compression_encodings = self.accept_compression_encodings;
2079                    let send_compression_encodings = self.send_compression_encodings;
2080                    let max_decoding_message_size = self.max_decoding_message_size;
2081                    let max_encoding_message_size = self.max_encoding_message_size;
2082                    let inner = self.inner.clone();
2083                    let fut = async move {
2084                        let method = CancelDeletionSvc(inner);
2085                        let codec = tonic_prost::ProstCodec::default();
2086                        let mut grpc = tonic::server::Grpc::new(codec)
2087                            .apply_compression_config(
2088                                accept_compression_encodings,
2089                                send_compression_encodings,
2090                            )
2091                            .apply_max_message_size_config(
2092                                max_decoding_message_size,
2093                                max_encoding_message_size,
2094                            );
2095                        let res = grpc.unary(method, req).await;
2096                        Ok(res)
2097                    };
2098                    Box::pin(fut)
2099                }
2100                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2101                    #[allow(non_camel_case_types)]
2102                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2103                    impl<
2104                        T: PrivacyService,
2105                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2106                    for ImmediateDeleteSvc<T> {
2107                        type Response = super::ImmediateDeleteResponse;
2108                        type Future = BoxFuture<
2109                            tonic::Response<Self::Response>,
2110                            tonic::Status,
2111                        >;
2112                        fn call(
2113                            &mut self,
2114                            request: tonic::Request<super::ImmediateDeleteRequest>,
2115                        ) -> Self::Future {
2116                            let inner = Arc::clone(&self.0);
2117                            let fut = async move {
2118                                <T as PrivacyService>::immediate_delete(&inner, request)
2119                                    .await
2120                            };
2121                            Box::pin(fut)
2122                        }
2123                    }
2124                    let accept_compression_encodings = self.accept_compression_encodings;
2125                    let send_compression_encodings = self.send_compression_encodings;
2126                    let max_decoding_message_size = self.max_decoding_message_size;
2127                    let max_encoding_message_size = self.max_encoding_message_size;
2128                    let inner = self.inner.clone();
2129                    let fut = async move {
2130                        let method = ImmediateDeleteSvc(inner);
2131                        let codec = tonic_prost::ProstCodec::default();
2132                        let mut grpc = tonic::server::Grpc::new(codec)
2133                            .apply_compression_config(
2134                                accept_compression_encodings,
2135                                send_compression_encodings,
2136                            )
2137                            .apply_max_message_size_config(
2138                                max_decoding_message_size,
2139                                max_encoding_message_size,
2140                            );
2141                        let res = grpc.unary(method, req).await;
2142                        Ok(res)
2143                    };
2144                    Box::pin(fut)
2145                }
2146                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2147                    #[allow(non_camel_case_types)]
2148                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2149                    impl<
2150                        T: PrivacyService,
2151                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2152                    for ListMyPrivacyRequestsSvc<T> {
2153                        type Response = super::ListMyPrivacyRequestsResponse;
2154                        type Future = BoxFuture<
2155                            tonic::Response<Self::Response>,
2156                            tonic::Status,
2157                        >;
2158                        fn call(
2159                            &mut self,
2160                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2161                        ) -> Self::Future {
2162                            let inner = Arc::clone(&self.0);
2163                            let fut = async move {
2164                                <T as PrivacyService>::list_my_privacy_requests(
2165                                        &inner,
2166                                        request,
2167                                    )
2168                                    .await
2169                            };
2170                            Box::pin(fut)
2171                        }
2172                    }
2173                    let accept_compression_encodings = self.accept_compression_encodings;
2174                    let send_compression_encodings = self.send_compression_encodings;
2175                    let max_decoding_message_size = self.max_decoding_message_size;
2176                    let max_encoding_message_size = self.max_encoding_message_size;
2177                    let inner = self.inner.clone();
2178                    let fut = async move {
2179                        let method = ListMyPrivacyRequestsSvc(inner);
2180                        let codec = tonic_prost::ProstCodec::default();
2181                        let mut grpc = tonic::server::Grpc::new(codec)
2182                            .apply_compression_config(
2183                                accept_compression_encodings,
2184                                send_compression_encodings,
2185                            )
2186                            .apply_max_message_size_config(
2187                                max_decoding_message_size,
2188                                max_encoding_message_size,
2189                            );
2190                        let res = grpc.unary(method, req).await;
2191                        Ok(res)
2192                    };
2193                    Box::pin(fut)
2194                }
2195                _ => {
2196                    Box::pin(async move {
2197                        let mut response = http::Response::new(
2198                            tonic::body::Body::default(),
2199                        );
2200                        let headers = response.headers_mut();
2201                        headers
2202                            .insert(
2203                                tonic::Status::GRPC_STATUS,
2204                                (tonic::Code::Unimplemented as i32).into(),
2205                            );
2206                        headers
2207                            .insert(
2208                                http::header::CONTENT_TYPE,
2209                                tonic::metadata::GRPC_CONTENT_TYPE,
2210                            );
2211                        Ok(response)
2212                    })
2213                }
2214            }
2215        }
2216    }
2217    impl<T> Clone for PrivacyServiceServer<T> {
2218        fn clone(&self) -> Self {
2219            let inner = self.inner.clone();
2220            Self {
2221                inner,
2222                accept_compression_encodings: self.accept_compression_encodings,
2223                send_compression_encodings: self.send_compression_encodings,
2224                max_decoding_message_size: self.max_decoding_message_size,
2225                max_encoding_message_size: self.max_encoding_message_size,
2226            }
2227        }
2228    }
2229    /// Generated gRPC service name
2230    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2231    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2232        const NAME: &'static str = SERVICE_NAME;
2233    }
2234}
2235/// Generated client implementations.
2236pub mod audit_service_client {
2237    #![allow(
2238        unused_variables,
2239        dead_code,
2240        missing_docs,
2241        clippy::wildcard_imports,
2242        clippy::let_unit_value,
2243    )]
2244    use tonic::codegen::*;
2245    use tonic::codegen::http::Uri;
2246    /** AuditService provides read access to the append-only audit trail, plus an
2247 internal-mTLS-only Append RPC for sibling services that need to record
2248 their own audit events into the shared trail.
2249
2250 All read RPCs extract org_id from the JWT — it is never in request
2251 messages. The Append RPC carries org_id explicitly because it is
2252 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2253*/
2254    #[derive(Debug, Clone)]
2255    pub struct AuditServiceClient<T> {
2256        inner: tonic::client::Grpc<T>,
2257    }
2258    impl AuditServiceClient<tonic::transport::Channel> {
2259        /// Attempt to create a new client by connecting to a given endpoint.
2260        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2261        where
2262            D: TryInto<tonic::transport::Endpoint>,
2263            D::Error: Into<StdError>,
2264        {
2265            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2266            Ok(Self::new(conn))
2267        }
2268    }
2269    impl<T> AuditServiceClient<T>
2270    where
2271        T: tonic::client::GrpcService<tonic::body::Body>,
2272        T::Error: Into<StdError>,
2273        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2274        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2275    {
2276        pub fn new(inner: T) -> Self {
2277            let inner = tonic::client::Grpc::new(inner);
2278            Self { inner }
2279        }
2280        pub fn with_origin(inner: T, origin: Uri) -> Self {
2281            let inner = tonic::client::Grpc::with_origin(inner, origin);
2282            Self { inner }
2283        }
2284        pub fn with_interceptor<F>(
2285            inner: T,
2286            interceptor: F,
2287        ) -> AuditServiceClient<InterceptedService<T, F>>
2288        where
2289            F: tonic::service::Interceptor,
2290            T::ResponseBody: Default,
2291            T: tonic::codegen::Service<
2292                http::Request<tonic::body::Body>,
2293                Response = http::Response<
2294                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2295                >,
2296            >,
2297            <T as tonic::codegen::Service<
2298                http::Request<tonic::body::Body>,
2299            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2300        {
2301            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2302        }
2303        /// Compress requests with the given encoding.
2304        ///
2305        /// This requires the server to support it otherwise it might respond with an
2306        /// error.
2307        #[must_use]
2308        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2309            self.inner = self.inner.send_compressed(encoding);
2310            self
2311        }
2312        /// Enable decompressing responses.
2313        #[must_use]
2314        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2315            self.inner = self.inner.accept_compressed(encoding);
2316            self
2317        }
2318        /// Limits the maximum size of a decoded message.
2319        ///
2320        /// Default: `4MB`
2321        #[must_use]
2322        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2323            self.inner = self.inner.max_decoding_message_size(limit);
2324            self
2325        }
2326        /// Limits the maximum size of an encoded message.
2327        ///
2328        /// Default: `usize::MAX`
2329        #[must_use]
2330        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2331            self.inner = self.inner.max_encoding_message_size(limit);
2332            self
2333        }
2334        /** List audit events with optional filtering by event type, actor, and date range.
2335 Results are ordered by created_at descending (newest first).
2336 Auth: Requires JWT. Admin only.
2337*/
2338        pub async fn list_audit_events(
2339            &mut self,
2340            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2341        ) -> std::result::Result<
2342            tonic::Response<super::ListAuditEventsResponse>,
2343            tonic::Status,
2344        > {
2345            self.inner
2346                .ready()
2347                .await
2348                .map_err(|e| {
2349                    tonic::Status::unknown(
2350                        format!("Service was not ready: {}", e.into()),
2351                    )
2352                })?;
2353            let codec = tonic_prost::ProstCodec::default();
2354            let path = http::uri::PathAndQuery::from_static(
2355                "/pidgr.v1.AuditService/ListAuditEvents",
2356            );
2357            let mut req = request.into_request();
2358            req.extensions_mut()
2359                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2360            self.inner.unary(req, path, codec).await
2361        }
2362        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2363 Creates a persistent record and starts an async Temporal workflow.
2364 Auth: Requires JWT. Admin only.
2365*/
2366        pub async fn export_audit_trail(
2367            &mut self,
2368            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2369        ) -> std::result::Result<
2370            tonic::Response<super::ExportAuditTrailResponse>,
2371            tonic::Status,
2372        > {
2373            self.inner
2374                .ready()
2375                .await
2376                .map_err(|e| {
2377                    tonic::Status::unknown(
2378                        format!("Service was not ready: {}", e.into()),
2379                    )
2380                })?;
2381            let codec = tonic_prost::ProstCodec::default();
2382            let path = http::uri::PathAndQuery::from_static(
2383                "/pidgr.v1.AuditService/ExportAuditTrail",
2384            );
2385            let mut req = request.into_request();
2386            req.extensions_mut()
2387                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2388            self.inner.unary(req, path, codec).await
2389        }
2390        /** List audit export history for the organization.
2391 Auth: Requires JWT. Admin only.
2392*/
2393        pub async fn list_audit_exports(
2394            &mut self,
2395            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2396        ) -> std::result::Result<
2397            tonic::Response<super::ListAuditExportsResponse>,
2398            tonic::Status,
2399        > {
2400            self.inner
2401                .ready()
2402                .await
2403                .map_err(|e| {
2404                    tonic::Status::unknown(
2405                        format!("Service was not ready: {}", e.into()),
2406                    )
2407                })?;
2408            let codec = tonic_prost::ProstCodec::default();
2409            let path = http::uri::PathAndQuery::from_static(
2410                "/pidgr.v1.AuditService/ListAuditExports",
2411            );
2412            let mut req = request.into_request();
2413            req.extensions_mut()
2414                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2415            self.inner.unary(req, path, codec).await
2416        }
2417        /** Append one audit event to the trail. Used by sibling services
2418 (pidgr-integrations, future internal services) to record GDPR-relevant
2419 events that originate outside pidgr-api.
2420
2421 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2422 presents only a JWT. The server MUST allowlist callers by their mTLS
2423 client-certificate subject DN.
2424*/
2425        pub async fn append(
2426            &mut self,
2427            request: impl tonic::IntoRequest<super::AppendRequest>,
2428        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status> {
2429            self.inner
2430                .ready()
2431                .await
2432                .map_err(|e| {
2433                    tonic::Status::unknown(
2434                        format!("Service was not ready: {}", e.into()),
2435                    )
2436                })?;
2437            let codec = tonic_prost::ProstCodec::default();
2438            let path = http::uri::PathAndQuery::from_static(
2439                "/pidgr.v1.AuditService/Append",
2440            );
2441            let mut req = request.into_request();
2442            req.extensions_mut()
2443                .insert(GrpcMethod::new("pidgr.v1.AuditService", "Append"));
2444            self.inner.unary(req, path, codec).await
2445        }
2446    }
2447}
2448/// Generated server implementations.
2449pub mod audit_service_server {
2450    #![allow(
2451        unused_variables,
2452        dead_code,
2453        missing_docs,
2454        clippy::wildcard_imports,
2455        clippy::let_unit_value,
2456    )]
2457    use tonic::codegen::*;
2458    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2459    #[async_trait]
2460    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2461        /** List audit events with optional filtering by event type, actor, and date range.
2462 Results are ordered by created_at descending (newest first).
2463 Auth: Requires JWT. Admin only.
2464*/
2465        async fn list_audit_events(
2466            &self,
2467            request: tonic::Request<super::ListAuditEventsRequest>,
2468        ) -> std::result::Result<
2469            tonic::Response<super::ListAuditEventsResponse>,
2470            tonic::Status,
2471        >;
2472        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2473 Creates a persistent record and starts an async Temporal workflow.
2474 Auth: Requires JWT. Admin only.
2475*/
2476        async fn export_audit_trail(
2477            &self,
2478            request: tonic::Request<super::ExportAuditTrailRequest>,
2479        ) -> std::result::Result<
2480            tonic::Response<super::ExportAuditTrailResponse>,
2481            tonic::Status,
2482        >;
2483        /** List audit export history for the organization.
2484 Auth: Requires JWT. Admin only.
2485*/
2486        async fn list_audit_exports(
2487            &self,
2488            request: tonic::Request<super::ListAuditExportsRequest>,
2489        ) -> std::result::Result<
2490            tonic::Response<super::ListAuditExportsResponse>,
2491            tonic::Status,
2492        >;
2493        /** Append one audit event to the trail. Used by sibling services
2494 (pidgr-integrations, future internal services) to record GDPR-relevant
2495 events that originate outside pidgr-api.
2496
2497 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2498 presents only a JWT. The server MUST allowlist callers by their mTLS
2499 client-certificate subject DN.
2500*/
2501        async fn append(
2502            &self,
2503            request: tonic::Request<super::AppendRequest>,
2504        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
2505    }
2506    /** AuditService provides read access to the append-only audit trail, plus an
2507 internal-mTLS-only Append RPC for sibling services that need to record
2508 their own audit events into the shared trail.
2509
2510 All read RPCs extract org_id from the JWT — it is never in request
2511 messages. The Append RPC carries org_id explicitly because it is
2512 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2513*/
2514    #[derive(Debug)]
2515    pub struct AuditServiceServer<T> {
2516        inner: Arc<T>,
2517        accept_compression_encodings: EnabledCompressionEncodings,
2518        send_compression_encodings: EnabledCompressionEncodings,
2519        max_decoding_message_size: Option<usize>,
2520        max_encoding_message_size: Option<usize>,
2521    }
2522    impl<T> AuditServiceServer<T> {
2523        pub fn new(inner: T) -> Self {
2524            Self::from_arc(Arc::new(inner))
2525        }
2526        pub fn from_arc(inner: Arc<T>) -> Self {
2527            Self {
2528                inner,
2529                accept_compression_encodings: Default::default(),
2530                send_compression_encodings: Default::default(),
2531                max_decoding_message_size: None,
2532                max_encoding_message_size: None,
2533            }
2534        }
2535        pub fn with_interceptor<F>(
2536            inner: T,
2537            interceptor: F,
2538        ) -> InterceptedService<Self, F>
2539        where
2540            F: tonic::service::Interceptor,
2541        {
2542            InterceptedService::new(Self::new(inner), interceptor)
2543        }
2544        /// Enable decompressing requests with the given encoding.
2545        #[must_use]
2546        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2547            self.accept_compression_encodings.enable(encoding);
2548            self
2549        }
2550        /// Compress responses with the given encoding, if the client supports it.
2551        #[must_use]
2552        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2553            self.send_compression_encodings.enable(encoding);
2554            self
2555        }
2556        /// Limits the maximum size of a decoded message.
2557        ///
2558        /// Default: `4MB`
2559        #[must_use]
2560        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2561            self.max_decoding_message_size = Some(limit);
2562            self
2563        }
2564        /// Limits the maximum size of an encoded message.
2565        ///
2566        /// Default: `usize::MAX`
2567        #[must_use]
2568        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2569            self.max_encoding_message_size = Some(limit);
2570            self
2571        }
2572    }
2573    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2574    where
2575        T: AuditService,
2576        B: Body + std::marker::Send + 'static,
2577        B::Error: Into<StdError> + std::marker::Send + 'static,
2578    {
2579        type Response = http::Response<tonic::body::Body>;
2580        type Error = std::convert::Infallible;
2581        type Future = BoxFuture<Self::Response, Self::Error>;
2582        fn poll_ready(
2583            &mut self,
2584            _cx: &mut Context<'_>,
2585        ) -> Poll<std::result::Result<(), Self::Error>> {
2586            Poll::Ready(Ok(()))
2587        }
2588        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2589            match req.uri().path() {
2590                "/pidgr.v1.AuditService/ListAuditEvents" => {
2591                    #[allow(non_camel_case_types)]
2592                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2593                    impl<
2594                        T: AuditService,
2595                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
2596                    for ListAuditEventsSvc<T> {
2597                        type Response = super::ListAuditEventsResponse;
2598                        type Future = BoxFuture<
2599                            tonic::Response<Self::Response>,
2600                            tonic::Status,
2601                        >;
2602                        fn call(
2603                            &mut self,
2604                            request: tonic::Request<super::ListAuditEventsRequest>,
2605                        ) -> Self::Future {
2606                            let inner = Arc::clone(&self.0);
2607                            let fut = async move {
2608                                <T as AuditService>::list_audit_events(&inner, request)
2609                                    .await
2610                            };
2611                            Box::pin(fut)
2612                        }
2613                    }
2614                    let accept_compression_encodings = self.accept_compression_encodings;
2615                    let send_compression_encodings = self.send_compression_encodings;
2616                    let max_decoding_message_size = self.max_decoding_message_size;
2617                    let max_encoding_message_size = self.max_encoding_message_size;
2618                    let inner = self.inner.clone();
2619                    let fut = async move {
2620                        let method = ListAuditEventsSvc(inner);
2621                        let codec = tonic_prost::ProstCodec::default();
2622                        let mut grpc = tonic::server::Grpc::new(codec)
2623                            .apply_compression_config(
2624                                accept_compression_encodings,
2625                                send_compression_encodings,
2626                            )
2627                            .apply_max_message_size_config(
2628                                max_decoding_message_size,
2629                                max_encoding_message_size,
2630                            );
2631                        let res = grpc.unary(method, req).await;
2632                        Ok(res)
2633                    };
2634                    Box::pin(fut)
2635                }
2636                "/pidgr.v1.AuditService/ExportAuditTrail" => {
2637                    #[allow(non_camel_case_types)]
2638                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2639                    impl<
2640                        T: AuditService,
2641                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2642                    for ExportAuditTrailSvc<T> {
2643                        type Response = super::ExportAuditTrailResponse;
2644                        type Future = BoxFuture<
2645                            tonic::Response<Self::Response>,
2646                            tonic::Status,
2647                        >;
2648                        fn call(
2649                            &mut self,
2650                            request: tonic::Request<super::ExportAuditTrailRequest>,
2651                        ) -> Self::Future {
2652                            let inner = Arc::clone(&self.0);
2653                            let fut = async move {
2654                                <T as AuditService>::export_audit_trail(&inner, request)
2655                                    .await
2656                            };
2657                            Box::pin(fut)
2658                        }
2659                    }
2660                    let accept_compression_encodings = self.accept_compression_encodings;
2661                    let send_compression_encodings = self.send_compression_encodings;
2662                    let max_decoding_message_size = self.max_decoding_message_size;
2663                    let max_encoding_message_size = self.max_encoding_message_size;
2664                    let inner = self.inner.clone();
2665                    let fut = async move {
2666                        let method = ExportAuditTrailSvc(inner);
2667                        let codec = tonic_prost::ProstCodec::default();
2668                        let mut grpc = tonic::server::Grpc::new(codec)
2669                            .apply_compression_config(
2670                                accept_compression_encodings,
2671                                send_compression_encodings,
2672                            )
2673                            .apply_max_message_size_config(
2674                                max_decoding_message_size,
2675                                max_encoding_message_size,
2676                            );
2677                        let res = grpc.unary(method, req).await;
2678                        Ok(res)
2679                    };
2680                    Box::pin(fut)
2681                }
2682                "/pidgr.v1.AuditService/ListAuditExports" => {
2683                    #[allow(non_camel_case_types)]
2684                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2685                    impl<
2686                        T: AuditService,
2687                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
2688                    for ListAuditExportsSvc<T> {
2689                        type Response = super::ListAuditExportsResponse;
2690                        type Future = BoxFuture<
2691                            tonic::Response<Self::Response>,
2692                            tonic::Status,
2693                        >;
2694                        fn call(
2695                            &mut self,
2696                            request: tonic::Request<super::ListAuditExportsRequest>,
2697                        ) -> Self::Future {
2698                            let inner = Arc::clone(&self.0);
2699                            let fut = async move {
2700                                <T as AuditService>::list_audit_exports(&inner, request)
2701                                    .await
2702                            };
2703                            Box::pin(fut)
2704                        }
2705                    }
2706                    let accept_compression_encodings = self.accept_compression_encodings;
2707                    let send_compression_encodings = self.send_compression_encodings;
2708                    let max_decoding_message_size = self.max_decoding_message_size;
2709                    let max_encoding_message_size = self.max_encoding_message_size;
2710                    let inner = self.inner.clone();
2711                    let fut = async move {
2712                        let method = ListAuditExportsSvc(inner);
2713                        let codec = tonic_prost::ProstCodec::default();
2714                        let mut grpc = tonic::server::Grpc::new(codec)
2715                            .apply_compression_config(
2716                                accept_compression_encodings,
2717                                send_compression_encodings,
2718                            )
2719                            .apply_max_message_size_config(
2720                                max_decoding_message_size,
2721                                max_encoding_message_size,
2722                            );
2723                        let res = grpc.unary(method, req).await;
2724                        Ok(res)
2725                    };
2726                    Box::pin(fut)
2727                }
2728                "/pidgr.v1.AuditService/Append" => {
2729                    #[allow(non_camel_case_types)]
2730                    struct AppendSvc<T: AuditService>(pub Arc<T>);
2731                    impl<
2732                        T: AuditService,
2733                    > tonic::server::UnaryService<super::AppendRequest>
2734                    for AppendSvc<T> {
2735                        type Response = super::AppendResponse;
2736                        type Future = BoxFuture<
2737                            tonic::Response<Self::Response>,
2738                            tonic::Status,
2739                        >;
2740                        fn call(
2741                            &mut self,
2742                            request: tonic::Request<super::AppendRequest>,
2743                        ) -> Self::Future {
2744                            let inner = Arc::clone(&self.0);
2745                            let fut = async move {
2746                                <T as AuditService>::append(&inner, request).await
2747                            };
2748                            Box::pin(fut)
2749                        }
2750                    }
2751                    let accept_compression_encodings = self.accept_compression_encodings;
2752                    let send_compression_encodings = self.send_compression_encodings;
2753                    let max_decoding_message_size = self.max_decoding_message_size;
2754                    let max_encoding_message_size = self.max_encoding_message_size;
2755                    let inner = self.inner.clone();
2756                    let fut = async move {
2757                        let method = AppendSvc(inner);
2758                        let codec = tonic_prost::ProstCodec::default();
2759                        let mut grpc = tonic::server::Grpc::new(codec)
2760                            .apply_compression_config(
2761                                accept_compression_encodings,
2762                                send_compression_encodings,
2763                            )
2764                            .apply_max_message_size_config(
2765                                max_decoding_message_size,
2766                                max_encoding_message_size,
2767                            );
2768                        let res = grpc.unary(method, req).await;
2769                        Ok(res)
2770                    };
2771                    Box::pin(fut)
2772                }
2773                _ => {
2774                    Box::pin(async move {
2775                        let mut response = http::Response::new(
2776                            tonic::body::Body::default(),
2777                        );
2778                        let headers = response.headers_mut();
2779                        headers
2780                            .insert(
2781                                tonic::Status::GRPC_STATUS,
2782                                (tonic::Code::Unimplemented as i32).into(),
2783                            );
2784                        headers
2785                            .insert(
2786                                http::header::CONTENT_TYPE,
2787                                tonic::metadata::GRPC_CONTENT_TYPE,
2788                            );
2789                        Ok(response)
2790                    })
2791                }
2792            }
2793        }
2794    }
2795    impl<T> Clone for AuditServiceServer<T> {
2796        fn clone(&self) -> Self {
2797            let inner = self.inner.clone();
2798            Self {
2799                inner,
2800                accept_compression_encodings: self.accept_compression_encodings,
2801                send_compression_encodings: self.send_compression_encodings,
2802                max_decoding_message_size: self.max_decoding_message_size,
2803                max_encoding_message_size: self.max_encoding_message_size,
2804            }
2805        }
2806    }
2807    /// Generated gRPC service name
2808    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2809    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2810        const NAME: &'static str = SERVICE_NAME;
2811    }
2812}
2813/// Generated client implementations.
2814pub mod campaign_service_client {
2815    #![allow(
2816        unused_variables,
2817        dead_code,
2818        missing_docs,
2819        clippy::wildcard_imports,
2820        clippy::let_unit_value,
2821    )]
2822    use tonic::codegen::*;
2823    use tonic::codegen::http::Uri;
2824    /** Manages the full lifecycle of communication campaigns — creation,
2825 execution, monitoring, and cancellation.
2826*/
2827    #[derive(Debug, Clone)]
2828    pub struct CampaignServiceClient<T> {
2829        inner: tonic::client::Grpc<T>,
2830    }
2831    impl CampaignServiceClient<tonic::transport::Channel> {
2832        /// Attempt to create a new client by connecting to a given endpoint.
2833        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2834        where
2835            D: TryInto<tonic::transport::Endpoint>,
2836            D::Error: Into<StdError>,
2837        {
2838            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2839            Ok(Self::new(conn))
2840        }
2841    }
2842    impl<T> CampaignServiceClient<T>
2843    where
2844        T: tonic::client::GrpcService<tonic::body::Body>,
2845        T::Error: Into<StdError>,
2846        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2847        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2848    {
2849        pub fn new(inner: T) -> Self {
2850            let inner = tonic::client::Grpc::new(inner);
2851            Self { inner }
2852        }
2853        pub fn with_origin(inner: T, origin: Uri) -> Self {
2854            let inner = tonic::client::Grpc::with_origin(inner, origin);
2855            Self { inner }
2856        }
2857        pub fn with_interceptor<F>(
2858            inner: T,
2859            interceptor: F,
2860        ) -> CampaignServiceClient<InterceptedService<T, F>>
2861        where
2862            F: tonic::service::Interceptor,
2863            T::ResponseBody: Default,
2864            T: tonic::codegen::Service<
2865                http::Request<tonic::body::Body>,
2866                Response = http::Response<
2867                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2868                >,
2869            >,
2870            <T as tonic::codegen::Service<
2871                http::Request<tonic::body::Body>,
2872            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2873        {
2874            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
2875        }
2876        /// Compress requests with the given encoding.
2877        ///
2878        /// This requires the server to support it otherwise it might respond with an
2879        /// error.
2880        #[must_use]
2881        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2882            self.inner = self.inner.send_compressed(encoding);
2883            self
2884        }
2885        /// Enable decompressing responses.
2886        #[must_use]
2887        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2888            self.inner = self.inner.accept_compressed(encoding);
2889            self
2890        }
2891        /// Limits the maximum size of a decoded message.
2892        ///
2893        /// Default: `4MB`
2894        #[must_use]
2895        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2896            self.inner = self.inner.max_decoding_message_size(limit);
2897            self
2898        }
2899        /// Limits the maximum size of an encoded message.
2900        ///
2901        /// Default: `usize::MAX`
2902        #[must_use]
2903        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2904            self.inner = self.inner.max_encoding_message_size(limit);
2905            self
2906        }
2907        /** Create a new campaign with a template, audience, and workflow.
2908 Authorization: Requires MANAGER+ role.
2909*/
2910        pub async fn create_campaign(
2911            &mut self,
2912            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
2913        ) -> std::result::Result<
2914            tonic::Response<super::CreateCampaignResponse>,
2915            tonic::Status,
2916        > {
2917            self.inner
2918                .ready()
2919                .await
2920                .map_err(|e| {
2921                    tonic::Status::unknown(
2922                        format!("Service was not ready: {}", e.into()),
2923                    )
2924                })?;
2925            let codec = tonic_prost::ProstCodec::default();
2926            let path = http::uri::PathAndQuery::from_static(
2927                "/pidgr.v1.CampaignService/CreateCampaign",
2928            );
2929            let mut req = request.into_request();
2930            req.extensions_mut()
2931                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
2932            self.inner.unary(req, path, codec).await
2933        }
2934        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
2935 Authorization: Requires MANAGER+ role.
2936*/
2937        pub async fn start_campaign(
2938            &mut self,
2939            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
2940        ) -> std::result::Result<
2941            tonic::Response<super::StartCampaignResponse>,
2942            tonic::Status,
2943        > {
2944            self.inner
2945                .ready()
2946                .await
2947                .map_err(|e| {
2948                    tonic::Status::unknown(
2949                        format!("Service was not ready: {}", e.into()),
2950                    )
2951                })?;
2952            let codec = tonic_prost::ProstCodec::default();
2953            let path = http::uri::PathAndQuery::from_static(
2954                "/pidgr.v1.CampaignService/StartCampaign",
2955            );
2956            let mut req = request.into_request();
2957            req.extensions_mut()
2958                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
2959            self.inner.unary(req, path, codec).await
2960        }
2961        /** Retrieve a single campaign by ID.
2962 Authorization: Authenticated user within the organization.
2963*/
2964        pub async fn get_campaign(
2965            &mut self,
2966            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
2967        ) -> std::result::Result<
2968            tonic::Response<super::GetCampaignResponse>,
2969            tonic::Status,
2970        > {
2971            self.inner
2972                .ready()
2973                .await
2974                .map_err(|e| {
2975                    tonic::Status::unknown(
2976                        format!("Service was not ready: {}", e.into()),
2977                    )
2978                })?;
2979            let codec = tonic_prost::ProstCodec::default();
2980            let path = http::uri::PathAndQuery::from_static(
2981                "/pidgr.v1.CampaignService/GetCampaign",
2982            );
2983            let mut req = request.into_request();
2984            req.extensions_mut()
2985                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
2986            self.inner.unary(req, path, codec).await
2987        }
2988        /** List campaigns for the organization with pagination.
2989 Authorization: Authenticated user within the organization.
2990*/
2991        pub async fn list_campaigns(
2992            &mut self,
2993            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
2994        ) -> std::result::Result<
2995            tonic::Response<super::ListCampaignsResponse>,
2996            tonic::Status,
2997        > {
2998            self.inner
2999                .ready()
3000                .await
3001                .map_err(|e| {
3002                    tonic::Status::unknown(
3003                        format!("Service was not ready: {}", e.into()),
3004                    )
3005                })?;
3006            let codec = tonic_prost::ProstCodec::default();
3007            let path = http::uri::PathAndQuery::from_static(
3008                "/pidgr.v1.CampaignService/ListCampaigns",
3009            );
3010            let mut req = request.into_request();
3011            req.extensions_mut()
3012                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3013            self.inner.unary(req, path, codec).await
3014        }
3015        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3016 Authorization: Requires MANAGER+ role.
3017*/
3018        pub async fn update_campaign(
3019            &mut self,
3020            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3021        ) -> std::result::Result<
3022            tonic::Response<super::UpdateCampaignResponse>,
3023            tonic::Status,
3024        > {
3025            self.inner
3026                .ready()
3027                .await
3028                .map_err(|e| {
3029                    tonic::Status::unknown(
3030                        format!("Service was not ready: {}", e.into()),
3031                    )
3032                })?;
3033            let codec = tonic_prost::ProstCodec::default();
3034            let path = http::uri::PathAndQuery::from_static(
3035                "/pidgr.v1.CampaignService/UpdateCampaign",
3036            );
3037            let mut req = request.into_request();
3038            req.extensions_mut()
3039                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3040            self.inner.unary(req, path, codec).await
3041        }
3042        /** Cancel a running campaign, stopping further deliveries and reminders.
3043 Authorization: Requires MANAGER+ role.
3044*/
3045        pub async fn cancel_campaign(
3046            &mut self,
3047            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3048        ) -> std::result::Result<
3049            tonic::Response<super::CancelCampaignResponse>,
3050            tonic::Status,
3051        > {
3052            self.inner
3053                .ready()
3054                .await
3055                .map_err(|e| {
3056                    tonic::Status::unknown(
3057                        format!("Service was not ready: {}", e.into()),
3058                    )
3059                })?;
3060            let codec = tonic_prost::ProstCodec::default();
3061            let path = http::uri::PathAndQuery::from_static(
3062                "/pidgr.v1.CampaignService/CancelCampaign",
3063            );
3064            let mut req = request.into_request();
3065            req.extensions_mut()
3066                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3067            self.inner.unary(req, path, codec).await
3068        }
3069        /** List delivery records for a campaign, optionally filtered by status.
3070 Authorization: Authenticated user within the organization.
3071*/
3072        pub async fn list_deliveries(
3073            &mut self,
3074            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3075        ) -> std::result::Result<
3076            tonic::Response<super::ListDeliveriesResponse>,
3077            tonic::Status,
3078        > {
3079            self.inner
3080                .ready()
3081                .await
3082                .map_err(|e| {
3083                    tonic::Status::unknown(
3084                        format!("Service was not ready: {}", e.into()),
3085                    )
3086                })?;
3087            let codec = tonic_prost::ProstCodec::default();
3088            let path = http::uri::PathAndQuery::from_static(
3089                "/pidgr.v1.CampaignService/ListDeliveries",
3090            );
3091            let mut req = request.into_request();
3092            req.extensions_mut()
3093                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3094            self.inner.unary(req, path, codec).await
3095        }
3096        /** Break down a campaign's recipients by current archetype membership
3097 and return ack-rate per bucket, with k-anonymity gate applied.
3098 Only valid for campaigns whose originating_archetype is set.
3099 Authorization: Authenticated user within the organization.
3100*/
3101        pub async fn get_campaign_archetype_breakdown(
3102            &mut self,
3103            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3104        ) -> std::result::Result<
3105            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3106            tonic::Status,
3107        > {
3108            self.inner
3109                .ready()
3110                .await
3111                .map_err(|e| {
3112                    tonic::Status::unknown(
3113                        format!("Service was not ready: {}", e.into()),
3114                    )
3115                })?;
3116            let codec = tonic_prost::ProstCodec::default();
3117            let path = http::uri::PathAndQuery::from_static(
3118                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3119            );
3120            let mut req = request.into_request();
3121            req.extensions_mut()
3122                .insert(
3123                    GrpcMethod::new(
3124                        "pidgr.v1.CampaignService",
3125                        "GetCampaignArchetypeBreakdown",
3126                    ),
3127                );
3128            self.inner.unary(req, path, codec).await
3129        }
3130        /** Resolve a campaign's 8-character base62 short-code, lazily
3131 generating one on the first call. Stable for the campaign's
3132 lifetime; the same campaign always returns the same code.
3133 Authorization: Internal-service callers only (mTLS-gated). The
3134 dispatch layer calls this when assembling a third-party-channel
3135 deeplink.
3136*/
3137        pub async fn resolve_or_create_short_code(
3138            &mut self,
3139            request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3140        ) -> std::result::Result<
3141            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3142            tonic::Status,
3143        > {
3144            self.inner
3145                .ready()
3146                .await
3147                .map_err(|e| {
3148                    tonic::Status::unknown(
3149                        format!("Service was not ready: {}", e.into()),
3150                    )
3151                })?;
3152            let codec = tonic_prost::ProstCodec::default();
3153            let path = http::uri::PathAndQuery::from_static(
3154                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3155            );
3156            let mut req = request.into_request();
3157            req.extensions_mut()
3158                .insert(
3159                    GrpcMethod::new(
3160                        "pidgr.v1.CampaignService",
3161                        "ResolveOrCreateShortCode",
3162                    ),
3163                );
3164            self.inner.unary(req, path, codec).await
3165        }
3166        /** Look up a campaign by its short-code. Returns minimal, non-PII
3167 metadata sufficient for the native app to route a tapped
3168 third-party-channel deeplink to the correct campaign card and
3169 show org branding before the auth gate.
3170 Authorization: Unauthenticated. The short-code IS the lookup key;
3171 returned fields are already visible to the recipient via their
3172 inbox or the org's public profile.
3173*/
3174        pub async fn get_campaign_by_short_code(
3175            &mut self,
3176            request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3177        ) -> std::result::Result<
3178            tonic::Response<super::GetCampaignByShortCodeResponse>,
3179            tonic::Status,
3180        > {
3181            self.inner
3182                .ready()
3183                .await
3184                .map_err(|e| {
3185                    tonic::Status::unknown(
3186                        format!("Service was not ready: {}", e.into()),
3187                    )
3188                })?;
3189            let codec = tonic_prost::ProstCodec::default();
3190            let path = http::uri::PathAndQuery::from_static(
3191                "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3192            );
3193            let mut req = request.into_request();
3194            req.extensions_mut()
3195                .insert(
3196                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3197                );
3198            self.inner.unary(req, path, codec).await
3199        }
3200    }
3201}
3202/// Generated server implementations.
3203pub mod campaign_service_server {
3204    #![allow(
3205        unused_variables,
3206        dead_code,
3207        missing_docs,
3208        clippy::wildcard_imports,
3209        clippy::let_unit_value,
3210    )]
3211    use tonic::codegen::*;
3212    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3213    #[async_trait]
3214    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3215        /** Create a new campaign with a template, audience, and workflow.
3216 Authorization: Requires MANAGER+ role.
3217*/
3218        async fn create_campaign(
3219            &self,
3220            request: tonic::Request<super::CreateCampaignRequest>,
3221        ) -> std::result::Result<
3222            tonic::Response<super::CreateCampaignResponse>,
3223            tonic::Status,
3224        >;
3225        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3226 Authorization: Requires MANAGER+ role.
3227*/
3228        async fn start_campaign(
3229            &self,
3230            request: tonic::Request<super::StartCampaignRequest>,
3231        ) -> std::result::Result<
3232            tonic::Response<super::StartCampaignResponse>,
3233            tonic::Status,
3234        >;
3235        /** Retrieve a single campaign by ID.
3236 Authorization: Authenticated user within the organization.
3237*/
3238        async fn get_campaign(
3239            &self,
3240            request: tonic::Request<super::GetCampaignRequest>,
3241        ) -> std::result::Result<
3242            tonic::Response<super::GetCampaignResponse>,
3243            tonic::Status,
3244        >;
3245        /** List campaigns for the organization with pagination.
3246 Authorization: Authenticated user within the organization.
3247*/
3248        async fn list_campaigns(
3249            &self,
3250            request: tonic::Request<super::ListCampaignsRequest>,
3251        ) -> std::result::Result<
3252            tonic::Response<super::ListCampaignsResponse>,
3253            tonic::Status,
3254        >;
3255        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3256 Authorization: Requires MANAGER+ role.
3257*/
3258        async fn update_campaign(
3259            &self,
3260            request: tonic::Request<super::UpdateCampaignRequest>,
3261        ) -> std::result::Result<
3262            tonic::Response<super::UpdateCampaignResponse>,
3263            tonic::Status,
3264        >;
3265        /** Cancel a running campaign, stopping further deliveries and reminders.
3266 Authorization: Requires MANAGER+ role.
3267*/
3268        async fn cancel_campaign(
3269            &self,
3270            request: tonic::Request<super::CancelCampaignRequest>,
3271        ) -> std::result::Result<
3272            tonic::Response<super::CancelCampaignResponse>,
3273            tonic::Status,
3274        >;
3275        /** List delivery records for a campaign, optionally filtered by status.
3276 Authorization: Authenticated user within the organization.
3277*/
3278        async fn list_deliveries(
3279            &self,
3280            request: tonic::Request<super::ListDeliveriesRequest>,
3281        ) -> std::result::Result<
3282            tonic::Response<super::ListDeliveriesResponse>,
3283            tonic::Status,
3284        >;
3285        /** Break down a campaign's recipients by current archetype membership
3286 and return ack-rate per bucket, with k-anonymity gate applied.
3287 Only valid for campaigns whose originating_archetype is set.
3288 Authorization: Authenticated user within the organization.
3289*/
3290        async fn get_campaign_archetype_breakdown(
3291            &self,
3292            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3293        ) -> std::result::Result<
3294            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3295            tonic::Status,
3296        >;
3297        /** Resolve a campaign's 8-character base62 short-code, lazily
3298 generating one on the first call. Stable for the campaign's
3299 lifetime; the same campaign always returns the same code.
3300 Authorization: Internal-service callers only (mTLS-gated). The
3301 dispatch layer calls this when assembling a third-party-channel
3302 deeplink.
3303*/
3304        async fn resolve_or_create_short_code(
3305            &self,
3306            request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3307        ) -> std::result::Result<
3308            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3309            tonic::Status,
3310        >;
3311        /** Look up a campaign by its short-code. Returns minimal, non-PII
3312 metadata sufficient for the native app to route a tapped
3313 third-party-channel deeplink to the correct campaign card and
3314 show org branding before the auth gate.
3315 Authorization: Unauthenticated. The short-code IS the lookup key;
3316 returned fields are already visible to the recipient via their
3317 inbox or the org's public profile.
3318*/
3319        async fn get_campaign_by_short_code(
3320            &self,
3321            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3322        ) -> std::result::Result<
3323            tonic::Response<super::GetCampaignByShortCodeResponse>,
3324            tonic::Status,
3325        >;
3326    }
3327    /** Manages the full lifecycle of communication campaigns — creation,
3328 execution, monitoring, and cancellation.
3329*/
3330    #[derive(Debug)]
3331    pub struct CampaignServiceServer<T> {
3332        inner: Arc<T>,
3333        accept_compression_encodings: EnabledCompressionEncodings,
3334        send_compression_encodings: EnabledCompressionEncodings,
3335        max_decoding_message_size: Option<usize>,
3336        max_encoding_message_size: Option<usize>,
3337    }
3338    impl<T> CampaignServiceServer<T> {
3339        pub fn new(inner: T) -> Self {
3340            Self::from_arc(Arc::new(inner))
3341        }
3342        pub fn from_arc(inner: Arc<T>) -> Self {
3343            Self {
3344                inner,
3345                accept_compression_encodings: Default::default(),
3346                send_compression_encodings: Default::default(),
3347                max_decoding_message_size: None,
3348                max_encoding_message_size: None,
3349            }
3350        }
3351        pub fn with_interceptor<F>(
3352            inner: T,
3353            interceptor: F,
3354        ) -> InterceptedService<Self, F>
3355        where
3356            F: tonic::service::Interceptor,
3357        {
3358            InterceptedService::new(Self::new(inner), interceptor)
3359        }
3360        /// Enable decompressing requests with the given encoding.
3361        #[must_use]
3362        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3363            self.accept_compression_encodings.enable(encoding);
3364            self
3365        }
3366        /// Compress responses with the given encoding, if the client supports it.
3367        #[must_use]
3368        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3369            self.send_compression_encodings.enable(encoding);
3370            self
3371        }
3372        /// Limits the maximum size of a decoded message.
3373        ///
3374        /// Default: `4MB`
3375        #[must_use]
3376        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3377            self.max_decoding_message_size = Some(limit);
3378            self
3379        }
3380        /// Limits the maximum size of an encoded message.
3381        ///
3382        /// Default: `usize::MAX`
3383        #[must_use]
3384        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3385            self.max_encoding_message_size = Some(limit);
3386            self
3387        }
3388    }
3389    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3390    where
3391        T: CampaignService,
3392        B: Body + std::marker::Send + 'static,
3393        B::Error: Into<StdError> + std::marker::Send + 'static,
3394    {
3395        type Response = http::Response<tonic::body::Body>;
3396        type Error = std::convert::Infallible;
3397        type Future = BoxFuture<Self::Response, Self::Error>;
3398        fn poll_ready(
3399            &mut self,
3400            _cx: &mut Context<'_>,
3401        ) -> Poll<std::result::Result<(), Self::Error>> {
3402            Poll::Ready(Ok(()))
3403        }
3404        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3405            match req.uri().path() {
3406                "/pidgr.v1.CampaignService/CreateCampaign" => {
3407                    #[allow(non_camel_case_types)]
3408                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3409                    impl<
3410                        T: CampaignService,
3411                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3412                    for CreateCampaignSvc<T> {
3413                        type Response = super::CreateCampaignResponse;
3414                        type Future = BoxFuture<
3415                            tonic::Response<Self::Response>,
3416                            tonic::Status,
3417                        >;
3418                        fn call(
3419                            &mut self,
3420                            request: tonic::Request<super::CreateCampaignRequest>,
3421                        ) -> Self::Future {
3422                            let inner = Arc::clone(&self.0);
3423                            let fut = async move {
3424                                <T as CampaignService>::create_campaign(&inner, request)
3425                                    .await
3426                            };
3427                            Box::pin(fut)
3428                        }
3429                    }
3430                    let accept_compression_encodings = self.accept_compression_encodings;
3431                    let send_compression_encodings = self.send_compression_encodings;
3432                    let max_decoding_message_size = self.max_decoding_message_size;
3433                    let max_encoding_message_size = self.max_encoding_message_size;
3434                    let inner = self.inner.clone();
3435                    let fut = async move {
3436                        let method = CreateCampaignSvc(inner);
3437                        let codec = tonic_prost::ProstCodec::default();
3438                        let mut grpc = tonic::server::Grpc::new(codec)
3439                            .apply_compression_config(
3440                                accept_compression_encodings,
3441                                send_compression_encodings,
3442                            )
3443                            .apply_max_message_size_config(
3444                                max_decoding_message_size,
3445                                max_encoding_message_size,
3446                            );
3447                        let res = grpc.unary(method, req).await;
3448                        Ok(res)
3449                    };
3450                    Box::pin(fut)
3451                }
3452                "/pidgr.v1.CampaignService/StartCampaign" => {
3453                    #[allow(non_camel_case_types)]
3454                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3455                    impl<
3456                        T: CampaignService,
3457                    > tonic::server::UnaryService<super::StartCampaignRequest>
3458                    for StartCampaignSvc<T> {
3459                        type Response = super::StartCampaignResponse;
3460                        type Future = BoxFuture<
3461                            tonic::Response<Self::Response>,
3462                            tonic::Status,
3463                        >;
3464                        fn call(
3465                            &mut self,
3466                            request: tonic::Request<super::StartCampaignRequest>,
3467                        ) -> Self::Future {
3468                            let inner = Arc::clone(&self.0);
3469                            let fut = async move {
3470                                <T as CampaignService>::start_campaign(&inner, request)
3471                                    .await
3472                            };
3473                            Box::pin(fut)
3474                        }
3475                    }
3476                    let accept_compression_encodings = self.accept_compression_encodings;
3477                    let send_compression_encodings = self.send_compression_encodings;
3478                    let max_decoding_message_size = self.max_decoding_message_size;
3479                    let max_encoding_message_size = self.max_encoding_message_size;
3480                    let inner = self.inner.clone();
3481                    let fut = async move {
3482                        let method = StartCampaignSvc(inner);
3483                        let codec = tonic_prost::ProstCodec::default();
3484                        let mut grpc = tonic::server::Grpc::new(codec)
3485                            .apply_compression_config(
3486                                accept_compression_encodings,
3487                                send_compression_encodings,
3488                            )
3489                            .apply_max_message_size_config(
3490                                max_decoding_message_size,
3491                                max_encoding_message_size,
3492                            );
3493                        let res = grpc.unary(method, req).await;
3494                        Ok(res)
3495                    };
3496                    Box::pin(fut)
3497                }
3498                "/pidgr.v1.CampaignService/GetCampaign" => {
3499                    #[allow(non_camel_case_types)]
3500                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3501                    impl<
3502                        T: CampaignService,
3503                    > tonic::server::UnaryService<super::GetCampaignRequest>
3504                    for GetCampaignSvc<T> {
3505                        type Response = super::GetCampaignResponse;
3506                        type Future = BoxFuture<
3507                            tonic::Response<Self::Response>,
3508                            tonic::Status,
3509                        >;
3510                        fn call(
3511                            &mut self,
3512                            request: tonic::Request<super::GetCampaignRequest>,
3513                        ) -> Self::Future {
3514                            let inner = Arc::clone(&self.0);
3515                            let fut = async move {
3516                                <T as CampaignService>::get_campaign(&inner, request).await
3517                            };
3518                            Box::pin(fut)
3519                        }
3520                    }
3521                    let accept_compression_encodings = self.accept_compression_encodings;
3522                    let send_compression_encodings = self.send_compression_encodings;
3523                    let max_decoding_message_size = self.max_decoding_message_size;
3524                    let max_encoding_message_size = self.max_encoding_message_size;
3525                    let inner = self.inner.clone();
3526                    let fut = async move {
3527                        let method = GetCampaignSvc(inner);
3528                        let codec = tonic_prost::ProstCodec::default();
3529                        let mut grpc = tonic::server::Grpc::new(codec)
3530                            .apply_compression_config(
3531                                accept_compression_encodings,
3532                                send_compression_encodings,
3533                            )
3534                            .apply_max_message_size_config(
3535                                max_decoding_message_size,
3536                                max_encoding_message_size,
3537                            );
3538                        let res = grpc.unary(method, req).await;
3539                        Ok(res)
3540                    };
3541                    Box::pin(fut)
3542                }
3543                "/pidgr.v1.CampaignService/ListCampaigns" => {
3544                    #[allow(non_camel_case_types)]
3545                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3546                    impl<
3547                        T: CampaignService,
3548                    > tonic::server::UnaryService<super::ListCampaignsRequest>
3549                    for ListCampaignsSvc<T> {
3550                        type Response = super::ListCampaignsResponse;
3551                        type Future = BoxFuture<
3552                            tonic::Response<Self::Response>,
3553                            tonic::Status,
3554                        >;
3555                        fn call(
3556                            &mut self,
3557                            request: tonic::Request<super::ListCampaignsRequest>,
3558                        ) -> Self::Future {
3559                            let inner = Arc::clone(&self.0);
3560                            let fut = async move {
3561                                <T as CampaignService>::list_campaigns(&inner, request)
3562                                    .await
3563                            };
3564                            Box::pin(fut)
3565                        }
3566                    }
3567                    let accept_compression_encodings = self.accept_compression_encodings;
3568                    let send_compression_encodings = self.send_compression_encodings;
3569                    let max_decoding_message_size = self.max_decoding_message_size;
3570                    let max_encoding_message_size = self.max_encoding_message_size;
3571                    let inner = self.inner.clone();
3572                    let fut = async move {
3573                        let method = ListCampaignsSvc(inner);
3574                        let codec = tonic_prost::ProstCodec::default();
3575                        let mut grpc = tonic::server::Grpc::new(codec)
3576                            .apply_compression_config(
3577                                accept_compression_encodings,
3578                                send_compression_encodings,
3579                            )
3580                            .apply_max_message_size_config(
3581                                max_decoding_message_size,
3582                                max_encoding_message_size,
3583                            );
3584                        let res = grpc.unary(method, req).await;
3585                        Ok(res)
3586                    };
3587                    Box::pin(fut)
3588                }
3589                "/pidgr.v1.CampaignService/UpdateCampaign" => {
3590                    #[allow(non_camel_case_types)]
3591                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3592                    impl<
3593                        T: CampaignService,
3594                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
3595                    for UpdateCampaignSvc<T> {
3596                        type Response = super::UpdateCampaignResponse;
3597                        type Future = BoxFuture<
3598                            tonic::Response<Self::Response>,
3599                            tonic::Status,
3600                        >;
3601                        fn call(
3602                            &mut self,
3603                            request: tonic::Request<super::UpdateCampaignRequest>,
3604                        ) -> Self::Future {
3605                            let inner = Arc::clone(&self.0);
3606                            let fut = async move {
3607                                <T as CampaignService>::update_campaign(&inner, request)
3608                                    .await
3609                            };
3610                            Box::pin(fut)
3611                        }
3612                    }
3613                    let accept_compression_encodings = self.accept_compression_encodings;
3614                    let send_compression_encodings = self.send_compression_encodings;
3615                    let max_decoding_message_size = self.max_decoding_message_size;
3616                    let max_encoding_message_size = self.max_encoding_message_size;
3617                    let inner = self.inner.clone();
3618                    let fut = async move {
3619                        let method = UpdateCampaignSvc(inner);
3620                        let codec = tonic_prost::ProstCodec::default();
3621                        let mut grpc = tonic::server::Grpc::new(codec)
3622                            .apply_compression_config(
3623                                accept_compression_encodings,
3624                                send_compression_encodings,
3625                            )
3626                            .apply_max_message_size_config(
3627                                max_decoding_message_size,
3628                                max_encoding_message_size,
3629                            );
3630                        let res = grpc.unary(method, req).await;
3631                        Ok(res)
3632                    };
3633                    Box::pin(fut)
3634                }
3635                "/pidgr.v1.CampaignService/CancelCampaign" => {
3636                    #[allow(non_camel_case_types)]
3637                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3638                    impl<
3639                        T: CampaignService,
3640                    > tonic::server::UnaryService<super::CancelCampaignRequest>
3641                    for CancelCampaignSvc<T> {
3642                        type Response = super::CancelCampaignResponse;
3643                        type Future = BoxFuture<
3644                            tonic::Response<Self::Response>,
3645                            tonic::Status,
3646                        >;
3647                        fn call(
3648                            &mut self,
3649                            request: tonic::Request<super::CancelCampaignRequest>,
3650                        ) -> Self::Future {
3651                            let inner = Arc::clone(&self.0);
3652                            let fut = async move {
3653                                <T as CampaignService>::cancel_campaign(&inner, request)
3654                                    .await
3655                            };
3656                            Box::pin(fut)
3657                        }
3658                    }
3659                    let accept_compression_encodings = self.accept_compression_encodings;
3660                    let send_compression_encodings = self.send_compression_encodings;
3661                    let max_decoding_message_size = self.max_decoding_message_size;
3662                    let max_encoding_message_size = self.max_encoding_message_size;
3663                    let inner = self.inner.clone();
3664                    let fut = async move {
3665                        let method = CancelCampaignSvc(inner);
3666                        let codec = tonic_prost::ProstCodec::default();
3667                        let mut grpc = tonic::server::Grpc::new(codec)
3668                            .apply_compression_config(
3669                                accept_compression_encodings,
3670                                send_compression_encodings,
3671                            )
3672                            .apply_max_message_size_config(
3673                                max_decoding_message_size,
3674                                max_encoding_message_size,
3675                            );
3676                        let res = grpc.unary(method, req).await;
3677                        Ok(res)
3678                    };
3679                    Box::pin(fut)
3680                }
3681                "/pidgr.v1.CampaignService/ListDeliveries" => {
3682                    #[allow(non_camel_case_types)]
3683                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3684                    impl<
3685                        T: CampaignService,
3686                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
3687                    for ListDeliveriesSvc<T> {
3688                        type Response = super::ListDeliveriesResponse;
3689                        type Future = BoxFuture<
3690                            tonic::Response<Self::Response>,
3691                            tonic::Status,
3692                        >;
3693                        fn call(
3694                            &mut self,
3695                            request: tonic::Request<super::ListDeliveriesRequest>,
3696                        ) -> Self::Future {
3697                            let inner = Arc::clone(&self.0);
3698                            let fut = async move {
3699                                <T as CampaignService>::list_deliveries(&inner, request)
3700                                    .await
3701                            };
3702                            Box::pin(fut)
3703                        }
3704                    }
3705                    let accept_compression_encodings = self.accept_compression_encodings;
3706                    let send_compression_encodings = self.send_compression_encodings;
3707                    let max_decoding_message_size = self.max_decoding_message_size;
3708                    let max_encoding_message_size = self.max_encoding_message_size;
3709                    let inner = self.inner.clone();
3710                    let fut = async move {
3711                        let method = ListDeliveriesSvc(inner);
3712                        let codec = tonic_prost::ProstCodec::default();
3713                        let mut grpc = tonic::server::Grpc::new(codec)
3714                            .apply_compression_config(
3715                                accept_compression_encodings,
3716                                send_compression_encodings,
3717                            )
3718                            .apply_max_message_size_config(
3719                                max_decoding_message_size,
3720                                max_encoding_message_size,
3721                            );
3722                        let res = grpc.unary(method, req).await;
3723                        Ok(res)
3724                    };
3725                    Box::pin(fut)
3726                }
3727                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
3728                    #[allow(non_camel_case_types)]
3729                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
3730                        pub Arc<T>,
3731                    );
3732                    impl<
3733                        T: CampaignService,
3734                    > tonic::server::UnaryService<
3735                        super::GetCampaignArchetypeBreakdownRequest,
3736                    > for GetCampaignArchetypeBreakdownSvc<T> {
3737                        type Response = super::GetCampaignArchetypeBreakdownResponse;
3738                        type Future = BoxFuture<
3739                            tonic::Response<Self::Response>,
3740                            tonic::Status,
3741                        >;
3742                        fn call(
3743                            &mut self,
3744                            request: tonic::Request<
3745                                super::GetCampaignArchetypeBreakdownRequest,
3746                            >,
3747                        ) -> Self::Future {
3748                            let inner = Arc::clone(&self.0);
3749                            let fut = async move {
3750                                <T as CampaignService>::get_campaign_archetype_breakdown(
3751                                        &inner,
3752                                        request,
3753                                    )
3754                                    .await
3755                            };
3756                            Box::pin(fut)
3757                        }
3758                    }
3759                    let accept_compression_encodings = self.accept_compression_encodings;
3760                    let send_compression_encodings = self.send_compression_encodings;
3761                    let max_decoding_message_size = self.max_decoding_message_size;
3762                    let max_encoding_message_size = self.max_encoding_message_size;
3763                    let inner = self.inner.clone();
3764                    let fut = async move {
3765                        let method = GetCampaignArchetypeBreakdownSvc(inner);
3766                        let codec = tonic_prost::ProstCodec::default();
3767                        let mut grpc = tonic::server::Grpc::new(codec)
3768                            .apply_compression_config(
3769                                accept_compression_encodings,
3770                                send_compression_encodings,
3771                            )
3772                            .apply_max_message_size_config(
3773                                max_decoding_message_size,
3774                                max_encoding_message_size,
3775                            );
3776                        let res = grpc.unary(method, req).await;
3777                        Ok(res)
3778                    };
3779                    Box::pin(fut)
3780                }
3781                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
3782                    #[allow(non_camel_case_types)]
3783                    struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
3784                    impl<
3785                        T: CampaignService,
3786                    > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
3787                    for ResolveOrCreateShortCodeSvc<T> {
3788                        type Response = super::ResolveOrCreateShortCodeResponse;
3789                        type Future = BoxFuture<
3790                            tonic::Response<Self::Response>,
3791                            tonic::Status,
3792                        >;
3793                        fn call(
3794                            &mut self,
3795                            request: tonic::Request<
3796                                super::ResolveOrCreateShortCodeRequest,
3797                            >,
3798                        ) -> Self::Future {
3799                            let inner = Arc::clone(&self.0);
3800                            let fut = async move {
3801                                <T as CampaignService>::resolve_or_create_short_code(
3802                                        &inner,
3803                                        request,
3804                                    )
3805                                    .await
3806                            };
3807                            Box::pin(fut)
3808                        }
3809                    }
3810                    let accept_compression_encodings = self.accept_compression_encodings;
3811                    let send_compression_encodings = self.send_compression_encodings;
3812                    let max_decoding_message_size = self.max_decoding_message_size;
3813                    let max_encoding_message_size = self.max_encoding_message_size;
3814                    let inner = self.inner.clone();
3815                    let fut = async move {
3816                        let method = ResolveOrCreateShortCodeSvc(inner);
3817                        let codec = tonic_prost::ProstCodec::default();
3818                        let mut grpc = tonic::server::Grpc::new(codec)
3819                            .apply_compression_config(
3820                                accept_compression_encodings,
3821                                send_compression_encodings,
3822                            )
3823                            .apply_max_message_size_config(
3824                                max_decoding_message_size,
3825                                max_encoding_message_size,
3826                            );
3827                        let res = grpc.unary(method, req).await;
3828                        Ok(res)
3829                    };
3830                    Box::pin(fut)
3831                }
3832                "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
3833                    #[allow(non_camel_case_types)]
3834                    struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
3835                    impl<
3836                        T: CampaignService,
3837                    > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
3838                    for GetCampaignByShortCodeSvc<T> {
3839                        type Response = super::GetCampaignByShortCodeResponse;
3840                        type Future = BoxFuture<
3841                            tonic::Response<Self::Response>,
3842                            tonic::Status,
3843                        >;
3844                        fn call(
3845                            &mut self,
3846                            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3847                        ) -> Self::Future {
3848                            let inner = Arc::clone(&self.0);
3849                            let fut = async move {
3850                                <T as CampaignService>::get_campaign_by_short_code(
3851                                        &inner,
3852                                        request,
3853                                    )
3854                                    .await
3855                            };
3856                            Box::pin(fut)
3857                        }
3858                    }
3859                    let accept_compression_encodings = self.accept_compression_encodings;
3860                    let send_compression_encodings = self.send_compression_encodings;
3861                    let max_decoding_message_size = self.max_decoding_message_size;
3862                    let max_encoding_message_size = self.max_encoding_message_size;
3863                    let inner = self.inner.clone();
3864                    let fut = async move {
3865                        let method = GetCampaignByShortCodeSvc(inner);
3866                        let codec = tonic_prost::ProstCodec::default();
3867                        let mut grpc = tonic::server::Grpc::new(codec)
3868                            .apply_compression_config(
3869                                accept_compression_encodings,
3870                                send_compression_encodings,
3871                            )
3872                            .apply_max_message_size_config(
3873                                max_decoding_message_size,
3874                                max_encoding_message_size,
3875                            );
3876                        let res = grpc.unary(method, req).await;
3877                        Ok(res)
3878                    };
3879                    Box::pin(fut)
3880                }
3881                _ => {
3882                    Box::pin(async move {
3883                        let mut response = http::Response::new(
3884                            tonic::body::Body::default(),
3885                        );
3886                        let headers = response.headers_mut();
3887                        headers
3888                            .insert(
3889                                tonic::Status::GRPC_STATUS,
3890                                (tonic::Code::Unimplemented as i32).into(),
3891                            );
3892                        headers
3893                            .insert(
3894                                http::header::CONTENT_TYPE,
3895                                tonic::metadata::GRPC_CONTENT_TYPE,
3896                            );
3897                        Ok(response)
3898                    })
3899                }
3900            }
3901        }
3902    }
3903    impl<T> Clone for CampaignServiceServer<T> {
3904        fn clone(&self) -> Self {
3905            let inner = self.inner.clone();
3906            Self {
3907                inner,
3908                accept_compression_encodings: self.accept_compression_encodings,
3909                send_compression_encodings: self.send_compression_encodings,
3910                max_decoding_message_size: self.max_decoding_message_size,
3911                max_encoding_message_size: self.max_encoding_message_size,
3912            }
3913        }
3914    }
3915    /// Generated gRPC service name
3916    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
3917    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
3918        const NAME: &'static str = SERVICE_NAME;
3919    }
3920}
3921/// Generated client implementations.
3922pub mod device_service_client {
3923    #![allow(
3924        unused_variables,
3925        dead_code,
3926        missing_docs,
3927        clippy::wildcard_imports,
3928        clippy::let_unit_value,
3929    )]
3930    use tonic::codegen::*;
3931    use tonic::codegen::http::Uri;
3932    /** Manages push notification device registration.
3933 Used by the mobile app to register push tokens and manage device lifecycle.
3934*/
3935    #[derive(Debug, Clone)]
3936    pub struct DeviceServiceClient<T> {
3937        inner: tonic::client::Grpc<T>,
3938    }
3939    impl DeviceServiceClient<tonic::transport::Channel> {
3940        /// Attempt to create a new client by connecting to a given endpoint.
3941        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3942        where
3943            D: TryInto<tonic::transport::Endpoint>,
3944            D::Error: Into<StdError>,
3945        {
3946            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3947            Ok(Self::new(conn))
3948        }
3949    }
3950    impl<T> DeviceServiceClient<T>
3951    where
3952        T: tonic::client::GrpcService<tonic::body::Body>,
3953        T::Error: Into<StdError>,
3954        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3955        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3956    {
3957        pub fn new(inner: T) -> Self {
3958            let inner = tonic::client::Grpc::new(inner);
3959            Self { inner }
3960        }
3961        pub fn with_origin(inner: T, origin: Uri) -> Self {
3962            let inner = tonic::client::Grpc::with_origin(inner, origin);
3963            Self { inner }
3964        }
3965        pub fn with_interceptor<F>(
3966            inner: T,
3967            interceptor: F,
3968        ) -> DeviceServiceClient<InterceptedService<T, F>>
3969        where
3970            F: tonic::service::Interceptor,
3971            T::ResponseBody: Default,
3972            T: tonic::codegen::Service<
3973                http::Request<tonic::body::Body>,
3974                Response = http::Response<
3975                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3976                >,
3977            >,
3978            <T as tonic::codegen::Service<
3979                http::Request<tonic::body::Body>,
3980            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3981        {
3982            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
3983        }
3984        /// Compress requests with the given encoding.
3985        ///
3986        /// This requires the server to support it otherwise it might respond with an
3987        /// error.
3988        #[must_use]
3989        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3990            self.inner = self.inner.send_compressed(encoding);
3991            self
3992        }
3993        /// Enable decompressing responses.
3994        #[must_use]
3995        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3996            self.inner = self.inner.accept_compressed(encoding);
3997            self
3998        }
3999        /// Limits the maximum size of a decoded message.
4000        ///
4001        /// Default: `4MB`
4002        #[must_use]
4003        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4004            self.inner = self.inner.max_decoding_message_size(limit);
4005            self
4006        }
4007        /// Limits the maximum size of an encoded message.
4008        ///
4009        /// Default: `usize::MAX`
4010        #[must_use]
4011        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4012            self.inner = self.inner.max_encoding_message_size(limit);
4013            self
4014        }
4015        /** Register a device with its push token for receiving notifications.
4016 Authorization: Authenticated user (own devices only).
4017*/
4018        pub async fn register(
4019            &mut self,
4020            request: impl tonic::IntoRequest<super::RegisterRequest>,
4021        ) -> std::result::Result<
4022            tonic::Response<super::RegisterResponse>,
4023            tonic::Status,
4024        > {
4025            self.inner
4026                .ready()
4027                .await
4028                .map_err(|e| {
4029                    tonic::Status::unknown(
4030                        format!("Service was not ready: {}", e.into()),
4031                    )
4032                })?;
4033            let codec = tonic_prost::ProstCodec::default();
4034            let path = http::uri::PathAndQuery::from_static(
4035                "/pidgr.v1.DeviceService/Register",
4036            );
4037            let mut req = request.into_request();
4038            req.extensions_mut()
4039                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4040            self.inner.unary(req, path, codec).await
4041        }
4042        /** Deactivate a device, preventing further push notifications.
4043 Authorization: Authenticated user (own devices only).
4044*/
4045        pub async fn deactivate(
4046            &mut self,
4047            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4048        ) -> std::result::Result<
4049            tonic::Response<super::DeactivateResponse>,
4050            tonic::Status,
4051        > {
4052            self.inner
4053                .ready()
4054                .await
4055                .map_err(|e| {
4056                    tonic::Status::unknown(
4057                        format!("Service was not ready: {}", e.into()),
4058                    )
4059                })?;
4060            let codec = tonic_prost::ProstCodec::default();
4061            let path = http::uri::PathAndQuery::from_static(
4062                "/pidgr.v1.DeviceService/Deactivate",
4063            );
4064            let mut req = request.into_request();
4065            req.extensions_mut()
4066                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4067            self.inner.unary(req, path, codec).await
4068        }
4069        /** List all devices registered to the authenticated user.
4070 Authorization: Authenticated user (own devices only).
4071*/
4072        pub async fn list_devices(
4073            &mut self,
4074            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4075        ) -> std::result::Result<
4076            tonic::Response<super::ListDevicesResponse>,
4077            tonic::Status,
4078        > {
4079            self.inner
4080                .ready()
4081                .await
4082                .map_err(|e| {
4083                    tonic::Status::unknown(
4084                        format!("Service was not ready: {}", e.into()),
4085                    )
4086                })?;
4087            let codec = tonic_prost::ProstCodec::default();
4088            let path = http::uri::PathAndQuery::from_static(
4089                "/pidgr.v1.DeviceService/ListDevices",
4090            );
4091            let mut req = request.into_request();
4092            req.extensions_mut()
4093                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4094            self.inner.unary(req, path, codec).await
4095        }
4096        /** List all devices for a specific organization member.
4097 Authorization: Requires MEMBERS_READ permission.
4098*/
4099        pub async fn list_member_devices(
4100            &mut self,
4101            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4102        ) -> std::result::Result<
4103            tonic::Response<super::ListMemberDevicesResponse>,
4104            tonic::Status,
4105        > {
4106            self.inner
4107                .ready()
4108                .await
4109                .map_err(|e| {
4110                    tonic::Status::unknown(
4111                        format!("Service was not ready: {}", e.into()),
4112                    )
4113                })?;
4114            let codec = tonic_prost::ProstCodec::default();
4115            let path = http::uri::PathAndQuery::from_static(
4116                "/pidgr.v1.DeviceService/ListMemberDevices",
4117            );
4118            let mut req = request.into_request();
4119            req.extensions_mut()
4120                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4121            self.inner.unary(req, path, codec).await
4122        }
4123    }
4124}
4125/// Generated server implementations.
4126pub mod device_service_server {
4127    #![allow(
4128        unused_variables,
4129        dead_code,
4130        missing_docs,
4131        clippy::wildcard_imports,
4132        clippy::let_unit_value,
4133    )]
4134    use tonic::codegen::*;
4135    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4136    #[async_trait]
4137    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4138        /** Register a device with its push token for receiving notifications.
4139 Authorization: Authenticated user (own devices only).
4140*/
4141        async fn register(
4142            &self,
4143            request: tonic::Request<super::RegisterRequest>,
4144        ) -> std::result::Result<
4145            tonic::Response<super::RegisterResponse>,
4146            tonic::Status,
4147        >;
4148        /** Deactivate a device, preventing further push notifications.
4149 Authorization: Authenticated user (own devices only).
4150*/
4151        async fn deactivate(
4152            &self,
4153            request: tonic::Request<super::DeactivateRequest>,
4154        ) -> std::result::Result<
4155            tonic::Response<super::DeactivateResponse>,
4156            tonic::Status,
4157        >;
4158        /** List all devices registered to the authenticated user.
4159 Authorization: Authenticated user (own devices only).
4160*/
4161        async fn list_devices(
4162            &self,
4163            request: tonic::Request<super::ListDevicesRequest>,
4164        ) -> std::result::Result<
4165            tonic::Response<super::ListDevicesResponse>,
4166            tonic::Status,
4167        >;
4168        /** List all devices for a specific organization member.
4169 Authorization: Requires MEMBERS_READ permission.
4170*/
4171        async fn list_member_devices(
4172            &self,
4173            request: tonic::Request<super::ListMemberDevicesRequest>,
4174        ) -> std::result::Result<
4175            tonic::Response<super::ListMemberDevicesResponse>,
4176            tonic::Status,
4177        >;
4178    }
4179    /** Manages push notification device registration.
4180 Used by the mobile app to register push tokens and manage device lifecycle.
4181*/
4182    #[derive(Debug)]
4183    pub struct DeviceServiceServer<T> {
4184        inner: Arc<T>,
4185        accept_compression_encodings: EnabledCompressionEncodings,
4186        send_compression_encodings: EnabledCompressionEncodings,
4187        max_decoding_message_size: Option<usize>,
4188        max_encoding_message_size: Option<usize>,
4189    }
4190    impl<T> DeviceServiceServer<T> {
4191        pub fn new(inner: T) -> Self {
4192            Self::from_arc(Arc::new(inner))
4193        }
4194        pub fn from_arc(inner: Arc<T>) -> Self {
4195            Self {
4196                inner,
4197                accept_compression_encodings: Default::default(),
4198                send_compression_encodings: Default::default(),
4199                max_decoding_message_size: None,
4200                max_encoding_message_size: None,
4201            }
4202        }
4203        pub fn with_interceptor<F>(
4204            inner: T,
4205            interceptor: F,
4206        ) -> InterceptedService<Self, F>
4207        where
4208            F: tonic::service::Interceptor,
4209        {
4210            InterceptedService::new(Self::new(inner), interceptor)
4211        }
4212        /// Enable decompressing requests with the given encoding.
4213        #[must_use]
4214        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4215            self.accept_compression_encodings.enable(encoding);
4216            self
4217        }
4218        /// Compress responses with the given encoding, if the client supports it.
4219        #[must_use]
4220        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4221            self.send_compression_encodings.enable(encoding);
4222            self
4223        }
4224        /// Limits the maximum size of a decoded message.
4225        ///
4226        /// Default: `4MB`
4227        #[must_use]
4228        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4229            self.max_decoding_message_size = Some(limit);
4230            self
4231        }
4232        /// Limits the maximum size of an encoded message.
4233        ///
4234        /// Default: `usize::MAX`
4235        #[must_use]
4236        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4237            self.max_encoding_message_size = Some(limit);
4238            self
4239        }
4240    }
4241    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4242    where
4243        T: DeviceService,
4244        B: Body + std::marker::Send + 'static,
4245        B::Error: Into<StdError> + std::marker::Send + 'static,
4246    {
4247        type Response = http::Response<tonic::body::Body>;
4248        type Error = std::convert::Infallible;
4249        type Future = BoxFuture<Self::Response, Self::Error>;
4250        fn poll_ready(
4251            &mut self,
4252            _cx: &mut Context<'_>,
4253        ) -> Poll<std::result::Result<(), Self::Error>> {
4254            Poll::Ready(Ok(()))
4255        }
4256        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4257            match req.uri().path() {
4258                "/pidgr.v1.DeviceService/Register" => {
4259                    #[allow(non_camel_case_types)]
4260                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4261                    impl<
4262                        T: DeviceService,
4263                    > tonic::server::UnaryService<super::RegisterRequest>
4264                    for RegisterSvc<T> {
4265                        type Response = super::RegisterResponse;
4266                        type Future = BoxFuture<
4267                            tonic::Response<Self::Response>,
4268                            tonic::Status,
4269                        >;
4270                        fn call(
4271                            &mut self,
4272                            request: tonic::Request<super::RegisterRequest>,
4273                        ) -> Self::Future {
4274                            let inner = Arc::clone(&self.0);
4275                            let fut = async move {
4276                                <T as DeviceService>::register(&inner, request).await
4277                            };
4278                            Box::pin(fut)
4279                        }
4280                    }
4281                    let accept_compression_encodings = self.accept_compression_encodings;
4282                    let send_compression_encodings = self.send_compression_encodings;
4283                    let max_decoding_message_size = self.max_decoding_message_size;
4284                    let max_encoding_message_size = self.max_encoding_message_size;
4285                    let inner = self.inner.clone();
4286                    let fut = async move {
4287                        let method = RegisterSvc(inner);
4288                        let codec = tonic_prost::ProstCodec::default();
4289                        let mut grpc = tonic::server::Grpc::new(codec)
4290                            .apply_compression_config(
4291                                accept_compression_encodings,
4292                                send_compression_encodings,
4293                            )
4294                            .apply_max_message_size_config(
4295                                max_decoding_message_size,
4296                                max_encoding_message_size,
4297                            );
4298                        let res = grpc.unary(method, req).await;
4299                        Ok(res)
4300                    };
4301                    Box::pin(fut)
4302                }
4303                "/pidgr.v1.DeviceService/Deactivate" => {
4304                    #[allow(non_camel_case_types)]
4305                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4306                    impl<
4307                        T: DeviceService,
4308                    > tonic::server::UnaryService<super::DeactivateRequest>
4309                    for DeactivateSvc<T> {
4310                        type Response = super::DeactivateResponse;
4311                        type Future = BoxFuture<
4312                            tonic::Response<Self::Response>,
4313                            tonic::Status,
4314                        >;
4315                        fn call(
4316                            &mut self,
4317                            request: tonic::Request<super::DeactivateRequest>,
4318                        ) -> Self::Future {
4319                            let inner = Arc::clone(&self.0);
4320                            let fut = async move {
4321                                <T as DeviceService>::deactivate(&inner, request).await
4322                            };
4323                            Box::pin(fut)
4324                        }
4325                    }
4326                    let accept_compression_encodings = self.accept_compression_encodings;
4327                    let send_compression_encodings = self.send_compression_encodings;
4328                    let max_decoding_message_size = self.max_decoding_message_size;
4329                    let max_encoding_message_size = self.max_encoding_message_size;
4330                    let inner = self.inner.clone();
4331                    let fut = async move {
4332                        let method = DeactivateSvc(inner);
4333                        let codec = tonic_prost::ProstCodec::default();
4334                        let mut grpc = tonic::server::Grpc::new(codec)
4335                            .apply_compression_config(
4336                                accept_compression_encodings,
4337                                send_compression_encodings,
4338                            )
4339                            .apply_max_message_size_config(
4340                                max_decoding_message_size,
4341                                max_encoding_message_size,
4342                            );
4343                        let res = grpc.unary(method, req).await;
4344                        Ok(res)
4345                    };
4346                    Box::pin(fut)
4347                }
4348                "/pidgr.v1.DeviceService/ListDevices" => {
4349                    #[allow(non_camel_case_types)]
4350                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4351                    impl<
4352                        T: DeviceService,
4353                    > tonic::server::UnaryService<super::ListDevicesRequest>
4354                    for ListDevicesSvc<T> {
4355                        type Response = super::ListDevicesResponse;
4356                        type Future = BoxFuture<
4357                            tonic::Response<Self::Response>,
4358                            tonic::Status,
4359                        >;
4360                        fn call(
4361                            &mut self,
4362                            request: tonic::Request<super::ListDevicesRequest>,
4363                        ) -> Self::Future {
4364                            let inner = Arc::clone(&self.0);
4365                            let fut = async move {
4366                                <T as DeviceService>::list_devices(&inner, request).await
4367                            };
4368                            Box::pin(fut)
4369                        }
4370                    }
4371                    let accept_compression_encodings = self.accept_compression_encodings;
4372                    let send_compression_encodings = self.send_compression_encodings;
4373                    let max_decoding_message_size = self.max_decoding_message_size;
4374                    let max_encoding_message_size = self.max_encoding_message_size;
4375                    let inner = self.inner.clone();
4376                    let fut = async move {
4377                        let method = ListDevicesSvc(inner);
4378                        let codec = tonic_prost::ProstCodec::default();
4379                        let mut grpc = tonic::server::Grpc::new(codec)
4380                            .apply_compression_config(
4381                                accept_compression_encodings,
4382                                send_compression_encodings,
4383                            )
4384                            .apply_max_message_size_config(
4385                                max_decoding_message_size,
4386                                max_encoding_message_size,
4387                            );
4388                        let res = grpc.unary(method, req).await;
4389                        Ok(res)
4390                    };
4391                    Box::pin(fut)
4392                }
4393                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4394                    #[allow(non_camel_case_types)]
4395                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4396                    impl<
4397                        T: DeviceService,
4398                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4399                    for ListMemberDevicesSvc<T> {
4400                        type Response = super::ListMemberDevicesResponse;
4401                        type Future = BoxFuture<
4402                            tonic::Response<Self::Response>,
4403                            tonic::Status,
4404                        >;
4405                        fn call(
4406                            &mut self,
4407                            request: tonic::Request<super::ListMemberDevicesRequest>,
4408                        ) -> Self::Future {
4409                            let inner = Arc::clone(&self.0);
4410                            let fut = async move {
4411                                <T as DeviceService>::list_member_devices(&inner, request)
4412                                    .await
4413                            };
4414                            Box::pin(fut)
4415                        }
4416                    }
4417                    let accept_compression_encodings = self.accept_compression_encodings;
4418                    let send_compression_encodings = self.send_compression_encodings;
4419                    let max_decoding_message_size = self.max_decoding_message_size;
4420                    let max_encoding_message_size = self.max_encoding_message_size;
4421                    let inner = self.inner.clone();
4422                    let fut = async move {
4423                        let method = ListMemberDevicesSvc(inner);
4424                        let codec = tonic_prost::ProstCodec::default();
4425                        let mut grpc = tonic::server::Grpc::new(codec)
4426                            .apply_compression_config(
4427                                accept_compression_encodings,
4428                                send_compression_encodings,
4429                            )
4430                            .apply_max_message_size_config(
4431                                max_decoding_message_size,
4432                                max_encoding_message_size,
4433                            );
4434                        let res = grpc.unary(method, req).await;
4435                        Ok(res)
4436                    };
4437                    Box::pin(fut)
4438                }
4439                _ => {
4440                    Box::pin(async move {
4441                        let mut response = http::Response::new(
4442                            tonic::body::Body::default(),
4443                        );
4444                        let headers = response.headers_mut();
4445                        headers
4446                            .insert(
4447                                tonic::Status::GRPC_STATUS,
4448                                (tonic::Code::Unimplemented as i32).into(),
4449                            );
4450                        headers
4451                            .insert(
4452                                http::header::CONTENT_TYPE,
4453                                tonic::metadata::GRPC_CONTENT_TYPE,
4454                            );
4455                        Ok(response)
4456                    })
4457                }
4458            }
4459        }
4460    }
4461    impl<T> Clone for DeviceServiceServer<T> {
4462        fn clone(&self) -> Self {
4463            let inner = self.inner.clone();
4464            Self {
4465                inner,
4466                accept_compression_encodings: self.accept_compression_encodings,
4467                send_compression_encodings: self.send_compression_encodings,
4468                max_decoding_message_size: self.max_decoding_message_size,
4469                max_encoding_message_size: self.max_encoding_message_size,
4470            }
4471        }
4472    }
4473    /// Generated gRPC service name
4474    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4475    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4476        const NAME: &'static str = SERVICE_NAME;
4477    }
4478}
4479/// Generated client implementations.
4480pub mod group_service_client {
4481    #![allow(
4482        unused_variables,
4483        dead_code,
4484        missing_docs,
4485        clippy::wildcard_imports,
4486        clippy::let_unit_value,
4487    )]
4488    use tonic::codegen::*;
4489    use tonic::codegen::http::Uri;
4490    /** Manages groups and group membership within an organization.
4491 Groups are recipient collections used for campaign audience targeting.
4492 All RPCs operate within the caller's org (extracted from JWT).
4493*/
4494    #[derive(Debug, Clone)]
4495    pub struct GroupServiceClient<T> {
4496        inner: tonic::client::Grpc<T>,
4497    }
4498    impl GroupServiceClient<tonic::transport::Channel> {
4499        /// Attempt to create a new client by connecting to a given endpoint.
4500        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4501        where
4502            D: TryInto<tonic::transport::Endpoint>,
4503            D::Error: Into<StdError>,
4504        {
4505            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4506            Ok(Self::new(conn))
4507        }
4508    }
4509    impl<T> GroupServiceClient<T>
4510    where
4511        T: tonic::client::GrpcService<tonic::body::Body>,
4512        T::Error: Into<StdError>,
4513        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4514        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4515    {
4516        pub fn new(inner: T) -> Self {
4517            let inner = tonic::client::Grpc::new(inner);
4518            Self { inner }
4519        }
4520        pub fn with_origin(inner: T, origin: Uri) -> Self {
4521            let inner = tonic::client::Grpc::with_origin(inner, origin);
4522            Self { inner }
4523        }
4524        pub fn with_interceptor<F>(
4525            inner: T,
4526            interceptor: F,
4527        ) -> GroupServiceClient<InterceptedService<T, F>>
4528        where
4529            F: tonic::service::Interceptor,
4530            T::ResponseBody: Default,
4531            T: tonic::codegen::Service<
4532                http::Request<tonic::body::Body>,
4533                Response = http::Response<
4534                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4535                >,
4536            >,
4537            <T as tonic::codegen::Service<
4538                http::Request<tonic::body::Body>,
4539            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4540        {
4541            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4542        }
4543        /// Compress requests with the given encoding.
4544        ///
4545        /// This requires the server to support it otherwise it might respond with an
4546        /// error.
4547        #[must_use]
4548        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4549            self.inner = self.inner.send_compressed(encoding);
4550            self
4551        }
4552        /// Enable decompressing responses.
4553        #[must_use]
4554        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4555            self.inner = self.inner.accept_compressed(encoding);
4556            self
4557        }
4558        /// Limits the maximum size of a decoded message.
4559        ///
4560        /// Default: `4MB`
4561        #[must_use]
4562        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4563            self.inner = self.inner.max_decoding_message_size(limit);
4564            self
4565        }
4566        /// Limits the maximum size of an encoded message.
4567        ///
4568        /// Default: `usize::MAX`
4569        #[must_use]
4570        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4571            self.inner = self.inner.max_encoding_message_size(limit);
4572            self
4573        }
4574        /** Create a new group in the organization.
4575 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4576*/
4577        pub async fn create_group(
4578            &mut self,
4579            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4580        ) -> std::result::Result<
4581            tonic::Response<super::CreateGroupResponse>,
4582            tonic::Status,
4583        > {
4584            self.inner
4585                .ready()
4586                .await
4587                .map_err(|e| {
4588                    tonic::Status::unknown(
4589                        format!("Service was not ready: {}", e.into()),
4590                    )
4591                })?;
4592            let codec = tonic_prost::ProstCodec::default();
4593            let path = http::uri::PathAndQuery::from_static(
4594                "/pidgr.v1.GroupService/CreateGroup",
4595            );
4596            let mut req = request.into_request();
4597            req.extensions_mut()
4598                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4599            self.inner.unary(req, path, codec).await
4600        }
4601        /** Retrieve a group by ID.
4602 Authorization: Caller must be a member of the group, or have
4603 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4604*/
4605        pub async fn get_group(
4606            &mut self,
4607            request: impl tonic::IntoRequest<super::GetGroupRequest>,
4608        ) -> std::result::Result<
4609            tonic::Response<super::GetGroupResponse>,
4610            tonic::Status,
4611        > {
4612            self.inner
4613                .ready()
4614                .await
4615                .map_err(|e| {
4616                    tonic::Status::unknown(
4617                        format!("Service was not ready: {}", e.into()),
4618                    )
4619                })?;
4620            let codec = tonic_prost::ProstCodec::default();
4621            let path = http::uri::PathAndQuery::from_static(
4622                "/pidgr.v1.GroupService/GetGroup",
4623            );
4624            let mut req = request.into_request();
4625            req.extensions_mut()
4626                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4627            self.inner.unary(req, path, codec).await
4628        }
4629        /** List groups in the organization with pagination.
4630 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4631*/
4632        pub async fn list_groups(
4633            &mut self,
4634            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4635        ) -> std::result::Result<
4636            tonic::Response<super::ListGroupsResponse>,
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.GroupService/ListGroups",
4650            );
4651            let mut req = request.into_request();
4652            req.extensions_mut()
4653                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4654            self.inner.unary(req, path, codec).await
4655        }
4656        /** Update a group's name and/or description.
4657 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4658*/
4659        pub async fn update_group(
4660            &mut self,
4661            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4662        ) -> std::result::Result<
4663            tonic::Response<super::UpdateGroupResponse>,
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.GroupService/UpdateGroup",
4677            );
4678            let mut req = request.into_request();
4679            req.extensions_mut()
4680                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4681            self.inner.unary(req, path, codec).await
4682        }
4683        /** Delete a group and all its membership records. Default groups cannot be deleted.
4684 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4685*/
4686        pub async fn delete_group(
4687            &mut self,
4688            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4689        ) -> std::result::Result<
4690            tonic::Response<super::DeleteGroupResponse>,
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.GroupService/DeleteGroup",
4704            );
4705            let mut req = request.into_request();
4706            req.extensions_mut()
4707                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4708            self.inner.unary(req, path, codec).await
4709        }
4710        /** Add one or more users to a group (idempotent).
4711 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4712*/
4713        pub async fn add_group_members(
4714            &mut self,
4715            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4716        ) -> std::result::Result<
4717            tonic::Response<super::AddGroupMembersResponse>,
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.GroupService/AddGroupMembers",
4731            );
4732            let mut req = request.into_request();
4733            req.extensions_mut()
4734                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4735            self.inner.unary(req, path, codec).await
4736        }
4737        /** Remove one or more users from a group (idempotent).
4738 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4739*/
4740        pub async fn remove_group_members(
4741            &mut self,
4742            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4743        ) -> std::result::Result<
4744            tonic::Response<super::RemoveGroupMembersResponse>,
4745            tonic::Status,
4746        > {
4747            self.inner
4748                .ready()
4749                .await
4750                .map_err(|e| {
4751                    tonic::Status::unknown(
4752                        format!("Service was not ready: {}", e.into()),
4753                    )
4754                })?;
4755            let codec = tonic_prost::ProstCodec::default();
4756            let path = http::uri::PathAndQuery::from_static(
4757                "/pidgr.v1.GroupService/RemoveGroupMembers",
4758            );
4759            let mut req = request.into_request();
4760            req.extensions_mut()
4761                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4762            self.inner.unary(req, path, codec).await
4763        }
4764        /** List members of a group with pagination.
4765 Authorization: Caller must be a member of the group, or have
4766 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4767*/
4768        pub async fn list_group_members(
4769            &mut self,
4770            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4771        ) -> std::result::Result<
4772            tonic::Response<super::ListGroupMembersResponse>,
4773            tonic::Status,
4774        > {
4775            self.inner
4776                .ready()
4777                .await
4778                .map_err(|e| {
4779                    tonic::Status::unknown(
4780                        format!("Service was not ready: {}", e.into()),
4781                    )
4782                })?;
4783            let codec = tonic_prost::ProstCodec::default();
4784            let path = http::uri::PathAndQuery::from_static(
4785                "/pidgr.v1.GroupService/ListGroupMembers",
4786            );
4787            let mut req = request.into_request();
4788            req.extensions_mut()
4789                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4790            self.inner.unary(req, path, codec).await
4791        }
4792        /** Get group memberships for a batch of users.
4793 Used by campaign audience to show group badges.
4794 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4795*/
4796        pub async fn get_user_group_memberships(
4797            &mut self,
4798            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4799        ) -> std::result::Result<
4800            tonic::Response<super::GetUserGroupMembershipsResponse>,
4801            tonic::Status,
4802        > {
4803            self.inner
4804                .ready()
4805                .await
4806                .map_err(|e| {
4807                    tonic::Status::unknown(
4808                        format!("Service was not ready: {}", e.into()),
4809                    )
4810                })?;
4811            let codec = tonic_prost::ProstCodec::default();
4812            let path = http::uri::PathAndQuery::from_static(
4813                "/pidgr.v1.GroupService/GetUserGroupMemberships",
4814            );
4815            let mut req = request.into_request();
4816            req.extensions_mut()
4817                .insert(
4818                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
4819                );
4820            self.inner.unary(req, path, codec).await
4821        }
4822    }
4823}
4824/// Generated server implementations.
4825pub mod group_service_server {
4826    #![allow(
4827        unused_variables,
4828        dead_code,
4829        missing_docs,
4830        clippy::wildcard_imports,
4831        clippy::let_unit_value,
4832    )]
4833    use tonic::codegen::*;
4834    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
4835    #[async_trait]
4836    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
4837        /** Create a new group in the organization.
4838 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4839*/
4840        async fn create_group(
4841            &self,
4842            request: tonic::Request<super::CreateGroupRequest>,
4843        ) -> std::result::Result<
4844            tonic::Response<super::CreateGroupResponse>,
4845            tonic::Status,
4846        >;
4847        /** Retrieve a group by ID.
4848 Authorization: Caller must be a member of the group, or have
4849 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4850*/
4851        async fn get_group(
4852            &self,
4853            request: tonic::Request<super::GetGroupRequest>,
4854        ) -> std::result::Result<
4855            tonic::Response<super::GetGroupResponse>,
4856            tonic::Status,
4857        >;
4858        /** List groups in the organization with pagination.
4859 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4860*/
4861        async fn list_groups(
4862            &self,
4863            request: tonic::Request<super::ListGroupsRequest>,
4864        ) -> std::result::Result<
4865            tonic::Response<super::ListGroupsResponse>,
4866            tonic::Status,
4867        >;
4868        /** Update a group's name and/or description.
4869 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4870*/
4871        async fn update_group(
4872            &self,
4873            request: tonic::Request<super::UpdateGroupRequest>,
4874        ) -> std::result::Result<
4875            tonic::Response<super::UpdateGroupResponse>,
4876            tonic::Status,
4877        >;
4878        /** Delete a group and all its membership records. Default groups cannot be deleted.
4879 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4880*/
4881        async fn delete_group(
4882            &self,
4883            request: tonic::Request<super::DeleteGroupRequest>,
4884        ) -> std::result::Result<
4885            tonic::Response<super::DeleteGroupResponse>,
4886            tonic::Status,
4887        >;
4888        /** Add one or more users to a group (idempotent).
4889 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4890*/
4891        async fn add_group_members(
4892            &self,
4893            request: tonic::Request<super::AddGroupMembersRequest>,
4894        ) -> std::result::Result<
4895            tonic::Response<super::AddGroupMembersResponse>,
4896            tonic::Status,
4897        >;
4898        /** Remove one or more users from a group (idempotent).
4899 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4900*/
4901        async fn remove_group_members(
4902            &self,
4903            request: tonic::Request<super::RemoveGroupMembersRequest>,
4904        ) -> std::result::Result<
4905            tonic::Response<super::RemoveGroupMembersResponse>,
4906            tonic::Status,
4907        >;
4908        /** List members of a group with pagination.
4909 Authorization: Caller must be a member of the group, or have
4910 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4911*/
4912        async fn list_group_members(
4913            &self,
4914            request: tonic::Request<super::ListGroupMembersRequest>,
4915        ) -> std::result::Result<
4916            tonic::Response<super::ListGroupMembersResponse>,
4917            tonic::Status,
4918        >;
4919        /** Get group memberships for a batch of users.
4920 Used by campaign audience to show group badges.
4921 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4922*/
4923        async fn get_user_group_memberships(
4924            &self,
4925            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
4926        ) -> std::result::Result<
4927            tonic::Response<super::GetUserGroupMembershipsResponse>,
4928            tonic::Status,
4929        >;
4930    }
4931    /** Manages groups and group membership within an organization.
4932 Groups are recipient collections used for campaign audience targeting.
4933 All RPCs operate within the caller's org (extracted from JWT).
4934*/
4935    #[derive(Debug)]
4936    pub struct GroupServiceServer<T> {
4937        inner: Arc<T>,
4938        accept_compression_encodings: EnabledCompressionEncodings,
4939        send_compression_encodings: EnabledCompressionEncodings,
4940        max_decoding_message_size: Option<usize>,
4941        max_encoding_message_size: Option<usize>,
4942    }
4943    impl<T> GroupServiceServer<T> {
4944        pub fn new(inner: T) -> Self {
4945            Self::from_arc(Arc::new(inner))
4946        }
4947        pub fn from_arc(inner: Arc<T>) -> Self {
4948            Self {
4949                inner,
4950                accept_compression_encodings: Default::default(),
4951                send_compression_encodings: Default::default(),
4952                max_decoding_message_size: None,
4953                max_encoding_message_size: None,
4954            }
4955        }
4956        pub fn with_interceptor<F>(
4957            inner: T,
4958            interceptor: F,
4959        ) -> InterceptedService<Self, F>
4960        where
4961            F: tonic::service::Interceptor,
4962        {
4963            InterceptedService::new(Self::new(inner), interceptor)
4964        }
4965        /// Enable decompressing requests with the given encoding.
4966        #[must_use]
4967        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4968            self.accept_compression_encodings.enable(encoding);
4969            self
4970        }
4971        /// Compress responses with the given encoding, if the client supports it.
4972        #[must_use]
4973        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4974            self.send_compression_encodings.enable(encoding);
4975            self
4976        }
4977        /// Limits the maximum size of a decoded message.
4978        ///
4979        /// Default: `4MB`
4980        #[must_use]
4981        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4982            self.max_decoding_message_size = Some(limit);
4983            self
4984        }
4985        /// Limits the maximum size of an encoded message.
4986        ///
4987        /// Default: `usize::MAX`
4988        #[must_use]
4989        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4990            self.max_encoding_message_size = Some(limit);
4991            self
4992        }
4993    }
4994    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
4995    where
4996        T: GroupService,
4997        B: Body + std::marker::Send + 'static,
4998        B::Error: Into<StdError> + std::marker::Send + 'static,
4999    {
5000        type Response = http::Response<tonic::body::Body>;
5001        type Error = std::convert::Infallible;
5002        type Future = BoxFuture<Self::Response, Self::Error>;
5003        fn poll_ready(
5004            &mut self,
5005            _cx: &mut Context<'_>,
5006        ) -> Poll<std::result::Result<(), Self::Error>> {
5007            Poll::Ready(Ok(()))
5008        }
5009        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5010            match req.uri().path() {
5011                "/pidgr.v1.GroupService/CreateGroup" => {
5012                    #[allow(non_camel_case_types)]
5013                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5014                    impl<
5015                        T: GroupService,
5016                    > tonic::server::UnaryService<super::CreateGroupRequest>
5017                    for CreateGroupSvc<T> {
5018                        type Response = super::CreateGroupResponse;
5019                        type Future = BoxFuture<
5020                            tonic::Response<Self::Response>,
5021                            tonic::Status,
5022                        >;
5023                        fn call(
5024                            &mut self,
5025                            request: tonic::Request<super::CreateGroupRequest>,
5026                        ) -> Self::Future {
5027                            let inner = Arc::clone(&self.0);
5028                            let fut = async move {
5029                                <T as GroupService>::create_group(&inner, request).await
5030                            };
5031                            Box::pin(fut)
5032                        }
5033                    }
5034                    let accept_compression_encodings = self.accept_compression_encodings;
5035                    let send_compression_encodings = self.send_compression_encodings;
5036                    let max_decoding_message_size = self.max_decoding_message_size;
5037                    let max_encoding_message_size = self.max_encoding_message_size;
5038                    let inner = self.inner.clone();
5039                    let fut = async move {
5040                        let method = CreateGroupSvc(inner);
5041                        let codec = tonic_prost::ProstCodec::default();
5042                        let mut grpc = tonic::server::Grpc::new(codec)
5043                            .apply_compression_config(
5044                                accept_compression_encodings,
5045                                send_compression_encodings,
5046                            )
5047                            .apply_max_message_size_config(
5048                                max_decoding_message_size,
5049                                max_encoding_message_size,
5050                            );
5051                        let res = grpc.unary(method, req).await;
5052                        Ok(res)
5053                    };
5054                    Box::pin(fut)
5055                }
5056                "/pidgr.v1.GroupService/GetGroup" => {
5057                    #[allow(non_camel_case_types)]
5058                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5059                    impl<
5060                        T: GroupService,
5061                    > tonic::server::UnaryService<super::GetGroupRequest>
5062                    for GetGroupSvc<T> {
5063                        type Response = super::GetGroupResponse;
5064                        type Future = BoxFuture<
5065                            tonic::Response<Self::Response>,
5066                            tonic::Status,
5067                        >;
5068                        fn call(
5069                            &mut self,
5070                            request: tonic::Request<super::GetGroupRequest>,
5071                        ) -> Self::Future {
5072                            let inner = Arc::clone(&self.0);
5073                            let fut = async move {
5074                                <T as GroupService>::get_group(&inner, request).await
5075                            };
5076                            Box::pin(fut)
5077                        }
5078                    }
5079                    let accept_compression_encodings = self.accept_compression_encodings;
5080                    let send_compression_encodings = self.send_compression_encodings;
5081                    let max_decoding_message_size = self.max_decoding_message_size;
5082                    let max_encoding_message_size = self.max_encoding_message_size;
5083                    let inner = self.inner.clone();
5084                    let fut = async move {
5085                        let method = GetGroupSvc(inner);
5086                        let codec = tonic_prost::ProstCodec::default();
5087                        let mut grpc = tonic::server::Grpc::new(codec)
5088                            .apply_compression_config(
5089                                accept_compression_encodings,
5090                                send_compression_encodings,
5091                            )
5092                            .apply_max_message_size_config(
5093                                max_decoding_message_size,
5094                                max_encoding_message_size,
5095                            );
5096                        let res = grpc.unary(method, req).await;
5097                        Ok(res)
5098                    };
5099                    Box::pin(fut)
5100                }
5101                "/pidgr.v1.GroupService/ListGroups" => {
5102                    #[allow(non_camel_case_types)]
5103                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5104                    impl<
5105                        T: GroupService,
5106                    > tonic::server::UnaryService<super::ListGroupsRequest>
5107                    for ListGroupsSvc<T> {
5108                        type Response = super::ListGroupsResponse;
5109                        type Future = BoxFuture<
5110                            tonic::Response<Self::Response>,
5111                            tonic::Status,
5112                        >;
5113                        fn call(
5114                            &mut self,
5115                            request: tonic::Request<super::ListGroupsRequest>,
5116                        ) -> Self::Future {
5117                            let inner = Arc::clone(&self.0);
5118                            let fut = async move {
5119                                <T as GroupService>::list_groups(&inner, request).await
5120                            };
5121                            Box::pin(fut)
5122                        }
5123                    }
5124                    let accept_compression_encodings = self.accept_compression_encodings;
5125                    let send_compression_encodings = self.send_compression_encodings;
5126                    let max_decoding_message_size = self.max_decoding_message_size;
5127                    let max_encoding_message_size = self.max_encoding_message_size;
5128                    let inner = self.inner.clone();
5129                    let fut = async move {
5130                        let method = ListGroupsSvc(inner);
5131                        let codec = tonic_prost::ProstCodec::default();
5132                        let mut grpc = tonic::server::Grpc::new(codec)
5133                            .apply_compression_config(
5134                                accept_compression_encodings,
5135                                send_compression_encodings,
5136                            )
5137                            .apply_max_message_size_config(
5138                                max_decoding_message_size,
5139                                max_encoding_message_size,
5140                            );
5141                        let res = grpc.unary(method, req).await;
5142                        Ok(res)
5143                    };
5144                    Box::pin(fut)
5145                }
5146                "/pidgr.v1.GroupService/UpdateGroup" => {
5147                    #[allow(non_camel_case_types)]
5148                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5149                    impl<
5150                        T: GroupService,
5151                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5152                    for UpdateGroupSvc<T> {
5153                        type Response = super::UpdateGroupResponse;
5154                        type Future = BoxFuture<
5155                            tonic::Response<Self::Response>,
5156                            tonic::Status,
5157                        >;
5158                        fn call(
5159                            &mut self,
5160                            request: tonic::Request<super::UpdateGroupRequest>,
5161                        ) -> Self::Future {
5162                            let inner = Arc::clone(&self.0);
5163                            let fut = async move {
5164                                <T as GroupService>::update_group(&inner, request).await
5165                            };
5166                            Box::pin(fut)
5167                        }
5168                    }
5169                    let accept_compression_encodings = self.accept_compression_encodings;
5170                    let send_compression_encodings = self.send_compression_encodings;
5171                    let max_decoding_message_size = self.max_decoding_message_size;
5172                    let max_encoding_message_size = self.max_encoding_message_size;
5173                    let inner = self.inner.clone();
5174                    let fut = async move {
5175                        let method = UpdateGroupSvc(inner);
5176                        let codec = tonic_prost::ProstCodec::default();
5177                        let mut grpc = tonic::server::Grpc::new(codec)
5178                            .apply_compression_config(
5179                                accept_compression_encodings,
5180                                send_compression_encodings,
5181                            )
5182                            .apply_max_message_size_config(
5183                                max_decoding_message_size,
5184                                max_encoding_message_size,
5185                            );
5186                        let res = grpc.unary(method, req).await;
5187                        Ok(res)
5188                    };
5189                    Box::pin(fut)
5190                }
5191                "/pidgr.v1.GroupService/DeleteGroup" => {
5192                    #[allow(non_camel_case_types)]
5193                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5194                    impl<
5195                        T: GroupService,
5196                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5197                    for DeleteGroupSvc<T> {
5198                        type Response = super::DeleteGroupResponse;
5199                        type Future = BoxFuture<
5200                            tonic::Response<Self::Response>,
5201                            tonic::Status,
5202                        >;
5203                        fn call(
5204                            &mut self,
5205                            request: tonic::Request<super::DeleteGroupRequest>,
5206                        ) -> Self::Future {
5207                            let inner = Arc::clone(&self.0);
5208                            let fut = async move {
5209                                <T as GroupService>::delete_group(&inner, request).await
5210                            };
5211                            Box::pin(fut)
5212                        }
5213                    }
5214                    let accept_compression_encodings = self.accept_compression_encodings;
5215                    let send_compression_encodings = self.send_compression_encodings;
5216                    let max_decoding_message_size = self.max_decoding_message_size;
5217                    let max_encoding_message_size = self.max_encoding_message_size;
5218                    let inner = self.inner.clone();
5219                    let fut = async move {
5220                        let method = DeleteGroupSvc(inner);
5221                        let codec = tonic_prost::ProstCodec::default();
5222                        let mut grpc = tonic::server::Grpc::new(codec)
5223                            .apply_compression_config(
5224                                accept_compression_encodings,
5225                                send_compression_encodings,
5226                            )
5227                            .apply_max_message_size_config(
5228                                max_decoding_message_size,
5229                                max_encoding_message_size,
5230                            );
5231                        let res = grpc.unary(method, req).await;
5232                        Ok(res)
5233                    };
5234                    Box::pin(fut)
5235                }
5236                "/pidgr.v1.GroupService/AddGroupMembers" => {
5237                    #[allow(non_camel_case_types)]
5238                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5239                    impl<
5240                        T: GroupService,
5241                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5242                    for AddGroupMembersSvc<T> {
5243                        type Response = super::AddGroupMembersResponse;
5244                        type Future = BoxFuture<
5245                            tonic::Response<Self::Response>,
5246                            tonic::Status,
5247                        >;
5248                        fn call(
5249                            &mut self,
5250                            request: tonic::Request<super::AddGroupMembersRequest>,
5251                        ) -> Self::Future {
5252                            let inner = Arc::clone(&self.0);
5253                            let fut = async move {
5254                                <T as GroupService>::add_group_members(&inner, request)
5255                                    .await
5256                            };
5257                            Box::pin(fut)
5258                        }
5259                    }
5260                    let accept_compression_encodings = self.accept_compression_encodings;
5261                    let send_compression_encodings = self.send_compression_encodings;
5262                    let max_decoding_message_size = self.max_decoding_message_size;
5263                    let max_encoding_message_size = self.max_encoding_message_size;
5264                    let inner = self.inner.clone();
5265                    let fut = async move {
5266                        let method = AddGroupMembersSvc(inner);
5267                        let codec = tonic_prost::ProstCodec::default();
5268                        let mut grpc = tonic::server::Grpc::new(codec)
5269                            .apply_compression_config(
5270                                accept_compression_encodings,
5271                                send_compression_encodings,
5272                            )
5273                            .apply_max_message_size_config(
5274                                max_decoding_message_size,
5275                                max_encoding_message_size,
5276                            );
5277                        let res = grpc.unary(method, req).await;
5278                        Ok(res)
5279                    };
5280                    Box::pin(fut)
5281                }
5282                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5283                    #[allow(non_camel_case_types)]
5284                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5285                    impl<
5286                        T: GroupService,
5287                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5288                    for RemoveGroupMembersSvc<T> {
5289                        type Response = super::RemoveGroupMembersResponse;
5290                        type Future = BoxFuture<
5291                            tonic::Response<Self::Response>,
5292                            tonic::Status,
5293                        >;
5294                        fn call(
5295                            &mut self,
5296                            request: tonic::Request<super::RemoveGroupMembersRequest>,
5297                        ) -> Self::Future {
5298                            let inner = Arc::clone(&self.0);
5299                            let fut = async move {
5300                                <T as GroupService>::remove_group_members(&inner, request)
5301                                    .await
5302                            };
5303                            Box::pin(fut)
5304                        }
5305                    }
5306                    let accept_compression_encodings = self.accept_compression_encodings;
5307                    let send_compression_encodings = self.send_compression_encodings;
5308                    let max_decoding_message_size = self.max_decoding_message_size;
5309                    let max_encoding_message_size = self.max_encoding_message_size;
5310                    let inner = self.inner.clone();
5311                    let fut = async move {
5312                        let method = RemoveGroupMembersSvc(inner);
5313                        let codec = tonic_prost::ProstCodec::default();
5314                        let mut grpc = tonic::server::Grpc::new(codec)
5315                            .apply_compression_config(
5316                                accept_compression_encodings,
5317                                send_compression_encodings,
5318                            )
5319                            .apply_max_message_size_config(
5320                                max_decoding_message_size,
5321                                max_encoding_message_size,
5322                            );
5323                        let res = grpc.unary(method, req).await;
5324                        Ok(res)
5325                    };
5326                    Box::pin(fut)
5327                }
5328                "/pidgr.v1.GroupService/ListGroupMembers" => {
5329                    #[allow(non_camel_case_types)]
5330                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5331                    impl<
5332                        T: GroupService,
5333                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5334                    for ListGroupMembersSvc<T> {
5335                        type Response = super::ListGroupMembersResponse;
5336                        type Future = BoxFuture<
5337                            tonic::Response<Self::Response>,
5338                            tonic::Status,
5339                        >;
5340                        fn call(
5341                            &mut self,
5342                            request: tonic::Request<super::ListGroupMembersRequest>,
5343                        ) -> Self::Future {
5344                            let inner = Arc::clone(&self.0);
5345                            let fut = async move {
5346                                <T as GroupService>::list_group_members(&inner, request)
5347                                    .await
5348                            };
5349                            Box::pin(fut)
5350                        }
5351                    }
5352                    let accept_compression_encodings = self.accept_compression_encodings;
5353                    let send_compression_encodings = self.send_compression_encodings;
5354                    let max_decoding_message_size = self.max_decoding_message_size;
5355                    let max_encoding_message_size = self.max_encoding_message_size;
5356                    let inner = self.inner.clone();
5357                    let fut = async move {
5358                        let method = ListGroupMembersSvc(inner);
5359                        let codec = tonic_prost::ProstCodec::default();
5360                        let mut grpc = tonic::server::Grpc::new(codec)
5361                            .apply_compression_config(
5362                                accept_compression_encodings,
5363                                send_compression_encodings,
5364                            )
5365                            .apply_max_message_size_config(
5366                                max_decoding_message_size,
5367                                max_encoding_message_size,
5368                            );
5369                        let res = grpc.unary(method, req).await;
5370                        Ok(res)
5371                    };
5372                    Box::pin(fut)
5373                }
5374                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5375                    #[allow(non_camel_case_types)]
5376                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5377                    impl<
5378                        T: GroupService,
5379                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5380                    for GetUserGroupMembershipsSvc<T> {
5381                        type Response = super::GetUserGroupMembershipsResponse;
5382                        type Future = BoxFuture<
5383                            tonic::Response<Self::Response>,
5384                            tonic::Status,
5385                        >;
5386                        fn call(
5387                            &mut self,
5388                            request: tonic::Request<
5389                                super::GetUserGroupMembershipsRequest,
5390                            >,
5391                        ) -> Self::Future {
5392                            let inner = Arc::clone(&self.0);
5393                            let fut = async move {
5394                                <T as GroupService>::get_user_group_memberships(
5395                                        &inner,
5396                                        request,
5397                                    )
5398                                    .await
5399                            };
5400                            Box::pin(fut)
5401                        }
5402                    }
5403                    let accept_compression_encodings = self.accept_compression_encodings;
5404                    let send_compression_encodings = self.send_compression_encodings;
5405                    let max_decoding_message_size = self.max_decoding_message_size;
5406                    let max_encoding_message_size = self.max_encoding_message_size;
5407                    let inner = self.inner.clone();
5408                    let fut = async move {
5409                        let method = GetUserGroupMembershipsSvc(inner);
5410                        let codec = tonic_prost::ProstCodec::default();
5411                        let mut grpc = tonic::server::Grpc::new(codec)
5412                            .apply_compression_config(
5413                                accept_compression_encodings,
5414                                send_compression_encodings,
5415                            )
5416                            .apply_max_message_size_config(
5417                                max_decoding_message_size,
5418                                max_encoding_message_size,
5419                            );
5420                        let res = grpc.unary(method, req).await;
5421                        Ok(res)
5422                    };
5423                    Box::pin(fut)
5424                }
5425                _ => {
5426                    Box::pin(async move {
5427                        let mut response = http::Response::new(
5428                            tonic::body::Body::default(),
5429                        );
5430                        let headers = response.headers_mut();
5431                        headers
5432                            .insert(
5433                                tonic::Status::GRPC_STATUS,
5434                                (tonic::Code::Unimplemented as i32).into(),
5435                            );
5436                        headers
5437                            .insert(
5438                                http::header::CONTENT_TYPE,
5439                                tonic::metadata::GRPC_CONTENT_TYPE,
5440                            );
5441                        Ok(response)
5442                    })
5443                }
5444            }
5445        }
5446    }
5447    impl<T> Clone for GroupServiceServer<T> {
5448        fn clone(&self) -> Self {
5449            let inner = self.inner.clone();
5450            Self {
5451                inner,
5452                accept_compression_encodings: self.accept_compression_encodings,
5453                send_compression_encodings: self.send_compression_encodings,
5454                max_decoding_message_size: self.max_decoding_message_size,
5455                max_encoding_message_size: self.max_encoding_message_size,
5456            }
5457        }
5458    }
5459    /// Generated gRPC service name
5460    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5461    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5462        const NAME: &'static str = SERVICE_NAME;
5463    }
5464}
5465/// Generated client implementations.
5466pub mod heatmap_service_client {
5467    #![allow(
5468        unused_variables,
5469        dead_code,
5470        missing_docs,
5471        clippy::wildcard_imports,
5472        clippy::let_unit_value,
5473    )]
5474    use tonic::codegen::*;
5475    use tonic::codegen::http::Uri;
5476    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5477 for mobile app interaction analytics.
5478*/
5479    #[derive(Debug, Clone)]
5480    pub struct HeatmapServiceClient<T> {
5481        inner: tonic::client::Grpc<T>,
5482    }
5483    impl HeatmapServiceClient<tonic::transport::Channel> {
5484        /// Attempt to create a new client by connecting to a given endpoint.
5485        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5486        where
5487            D: TryInto<tonic::transport::Endpoint>,
5488            D::Error: Into<StdError>,
5489        {
5490            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5491            Ok(Self::new(conn))
5492        }
5493    }
5494    impl<T> HeatmapServiceClient<T>
5495    where
5496        T: tonic::client::GrpcService<tonic::body::Body>,
5497        T::Error: Into<StdError>,
5498        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5499        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5500    {
5501        pub fn new(inner: T) -> Self {
5502            let inner = tonic::client::Grpc::new(inner);
5503            Self { inner }
5504        }
5505        pub fn with_origin(inner: T, origin: Uri) -> Self {
5506            let inner = tonic::client::Grpc::with_origin(inner, origin);
5507            Self { inner }
5508        }
5509        pub fn with_interceptor<F>(
5510            inner: T,
5511            interceptor: F,
5512        ) -> HeatmapServiceClient<InterceptedService<T, F>>
5513        where
5514            F: tonic::service::Interceptor,
5515            T::ResponseBody: Default,
5516            T: tonic::codegen::Service<
5517                http::Request<tonic::body::Body>,
5518                Response = http::Response<
5519                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5520                >,
5521            >,
5522            <T as tonic::codegen::Service<
5523                http::Request<tonic::body::Body>,
5524            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5525        {
5526            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5527        }
5528        /// Compress requests with the given encoding.
5529        ///
5530        /// This requires the server to support it otherwise it might respond with an
5531        /// error.
5532        #[must_use]
5533        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5534            self.inner = self.inner.send_compressed(encoding);
5535            self
5536        }
5537        /// Enable decompressing responses.
5538        #[must_use]
5539        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5540            self.inner = self.inner.accept_compressed(encoding);
5541            self
5542        }
5543        /// Limits the maximum size of a decoded message.
5544        ///
5545        /// Default: `4MB`
5546        #[must_use]
5547        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5548            self.inner = self.inner.max_decoding_message_size(limit);
5549            self
5550        }
5551        /// Limits the maximum size of an encoded message.
5552        ///
5553        /// Default: `usize::MAX`
5554        #[must_use]
5555        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5556            self.inner = self.inner.max_encoding_message_size(limit);
5557            self
5558        }
5559        /** Ingest a batch of touch events from the mobile app.
5560 Authorization: Authenticated mobile user.
5561*/
5562        pub async fn ingest_touch_events(
5563            &mut self,
5564            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5565        ) -> std::result::Result<
5566            tonic::Response<super::IngestTouchEventsResponse>,
5567            tonic::Status,
5568        > {
5569            self.inner
5570                .ready()
5571                .await
5572                .map_err(|e| {
5573                    tonic::Status::unknown(
5574                        format!("Service was not ready: {}", e.into()),
5575                    )
5576                })?;
5577            let codec = tonic_prost::ProstCodec::default();
5578            let path = http::uri::PathAndQuery::from_static(
5579                "/pidgr.v1.HeatmapService/IngestTouchEvents",
5580            );
5581            let mut req = request.into_request();
5582            req.extensions_mut()
5583                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5584            self.inner.unary(req, path, codec).await
5585        }
5586        /** Query aggregated touch data for heatmap rendering.
5587 Authorization: Requires CAMPAIGNS_READ permission.
5588*/
5589        pub async fn query_heatmap_data(
5590            &mut self,
5591            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5592        ) -> std::result::Result<
5593            tonic::Response<super::QueryHeatmapDataResponse>,
5594            tonic::Status,
5595        > {
5596            self.inner
5597                .ready()
5598                .await
5599                .map_err(|e| {
5600                    tonic::Status::unknown(
5601                        format!("Service was not ready: {}", e.into()),
5602                    )
5603                })?;
5604            let codec = tonic_prost::ProstCodec::default();
5605            let path = http::uri::PathAndQuery::from_static(
5606                "/pidgr.v1.HeatmapService/QueryHeatmapData",
5607            );
5608            let mut req = request.into_request();
5609            req.extensions_mut()
5610                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5611            self.inner.unary(req, path, codec).await
5612        }
5613        /** List available screen screenshots for heatmap backgrounds.
5614 Authorization: Requires CAMPAIGNS_READ permission.
5615*/
5616        pub async fn list_screenshots(
5617            &mut self,
5618            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5619        ) -> std::result::Result<
5620            tonic::Response<super::ListScreenshotsResponse>,
5621            tonic::Status,
5622        > {
5623            self.inner
5624                .ready()
5625                .await
5626                .map_err(|e| {
5627                    tonic::Status::unknown(
5628                        format!("Service was not ready: {}", e.into()),
5629                    )
5630                })?;
5631            let codec = tonic_prost::ProstCodec::default();
5632            let path = http::uri::PathAndQuery::from_static(
5633                "/pidgr.v1.HeatmapService/ListScreenshots",
5634            );
5635            let mut req = request.into_request();
5636            req.extensions_mut()
5637                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5638            self.inner.unary(req, path, codec).await
5639        }
5640        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5641 Authorization: Authenticated mobile user.
5642*/
5643        pub async fn upload_screenshot(
5644            &mut self,
5645            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5646        ) -> std::result::Result<
5647            tonic::Response<super::UploadScreenshotResponse>,
5648            tonic::Status,
5649        > {
5650            self.inner
5651                .ready()
5652                .await
5653                .map_err(|e| {
5654                    tonic::Status::unknown(
5655                        format!("Service was not ready: {}", e.into()),
5656                    )
5657                })?;
5658            let codec = tonic_prost::ProstCodec::default();
5659            let path = http::uri::PathAndQuery::from_static(
5660                "/pidgr.v1.HeatmapService/UploadScreenshot",
5661            );
5662            let mut req = request.into_request();
5663            req.extensions_mut()
5664                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5665            self.inner.unary(req, path, codec).await
5666        }
5667    }
5668}
5669/// Generated server implementations.
5670pub mod heatmap_service_server {
5671    #![allow(
5672        unused_variables,
5673        dead_code,
5674        missing_docs,
5675        clippy::wildcard_imports,
5676        clippy::let_unit_value,
5677    )]
5678    use tonic::codegen::*;
5679    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
5680    #[async_trait]
5681    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5682        /** Ingest a batch of touch events from the mobile app.
5683 Authorization: Authenticated mobile user.
5684*/
5685        async fn ingest_touch_events(
5686            &self,
5687            request: tonic::Request<super::IngestTouchEventsRequest>,
5688        ) -> std::result::Result<
5689            tonic::Response<super::IngestTouchEventsResponse>,
5690            tonic::Status,
5691        >;
5692        /** Query aggregated touch data for heatmap rendering.
5693 Authorization: Requires CAMPAIGNS_READ permission.
5694*/
5695        async fn query_heatmap_data(
5696            &self,
5697            request: tonic::Request<super::QueryHeatmapDataRequest>,
5698        ) -> std::result::Result<
5699            tonic::Response<super::QueryHeatmapDataResponse>,
5700            tonic::Status,
5701        >;
5702        /** List available screen screenshots for heatmap backgrounds.
5703 Authorization: Requires CAMPAIGNS_READ permission.
5704*/
5705        async fn list_screenshots(
5706            &self,
5707            request: tonic::Request<super::ListScreenshotsRequest>,
5708        ) -> std::result::Result<
5709            tonic::Response<super::ListScreenshotsResponse>,
5710            tonic::Status,
5711        >;
5712        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5713 Authorization: Authenticated mobile user.
5714*/
5715        async fn upload_screenshot(
5716            &self,
5717            request: tonic::Request<super::UploadScreenshotRequest>,
5718        ) -> std::result::Result<
5719            tonic::Response<super::UploadScreenshotResponse>,
5720            tonic::Status,
5721        >;
5722    }
5723    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5724 for mobile app interaction analytics.
5725*/
5726    #[derive(Debug)]
5727    pub struct HeatmapServiceServer<T> {
5728        inner: Arc<T>,
5729        accept_compression_encodings: EnabledCompressionEncodings,
5730        send_compression_encodings: EnabledCompressionEncodings,
5731        max_decoding_message_size: Option<usize>,
5732        max_encoding_message_size: Option<usize>,
5733    }
5734    impl<T> HeatmapServiceServer<T> {
5735        pub fn new(inner: T) -> Self {
5736            Self::from_arc(Arc::new(inner))
5737        }
5738        pub fn from_arc(inner: Arc<T>) -> Self {
5739            Self {
5740                inner,
5741                accept_compression_encodings: Default::default(),
5742                send_compression_encodings: Default::default(),
5743                max_decoding_message_size: None,
5744                max_encoding_message_size: None,
5745            }
5746        }
5747        pub fn with_interceptor<F>(
5748            inner: T,
5749            interceptor: F,
5750        ) -> InterceptedService<Self, F>
5751        where
5752            F: tonic::service::Interceptor,
5753        {
5754            InterceptedService::new(Self::new(inner), interceptor)
5755        }
5756        /// Enable decompressing requests with the given encoding.
5757        #[must_use]
5758        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5759            self.accept_compression_encodings.enable(encoding);
5760            self
5761        }
5762        /// Compress responses with the given encoding, if the client supports it.
5763        #[must_use]
5764        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5765            self.send_compression_encodings.enable(encoding);
5766            self
5767        }
5768        /// Limits the maximum size of a decoded message.
5769        ///
5770        /// Default: `4MB`
5771        #[must_use]
5772        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5773            self.max_decoding_message_size = Some(limit);
5774            self
5775        }
5776        /// Limits the maximum size of an encoded message.
5777        ///
5778        /// Default: `usize::MAX`
5779        #[must_use]
5780        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5781            self.max_encoding_message_size = Some(limit);
5782            self
5783        }
5784    }
5785    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5786    where
5787        T: HeatmapService,
5788        B: Body + std::marker::Send + 'static,
5789        B::Error: Into<StdError> + std::marker::Send + 'static,
5790    {
5791        type Response = http::Response<tonic::body::Body>;
5792        type Error = std::convert::Infallible;
5793        type Future = BoxFuture<Self::Response, Self::Error>;
5794        fn poll_ready(
5795            &mut self,
5796            _cx: &mut Context<'_>,
5797        ) -> Poll<std::result::Result<(), Self::Error>> {
5798            Poll::Ready(Ok(()))
5799        }
5800        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5801            match req.uri().path() {
5802                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5803                    #[allow(non_camel_case_types)]
5804                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
5805                    impl<
5806                        T: HeatmapService,
5807                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
5808                    for IngestTouchEventsSvc<T> {
5809                        type Response = super::IngestTouchEventsResponse;
5810                        type Future = BoxFuture<
5811                            tonic::Response<Self::Response>,
5812                            tonic::Status,
5813                        >;
5814                        fn call(
5815                            &mut self,
5816                            request: tonic::Request<super::IngestTouchEventsRequest>,
5817                        ) -> Self::Future {
5818                            let inner = Arc::clone(&self.0);
5819                            let fut = async move {
5820                                <T as HeatmapService>::ingest_touch_events(&inner, request)
5821                                    .await
5822                            };
5823                            Box::pin(fut)
5824                        }
5825                    }
5826                    let accept_compression_encodings = self.accept_compression_encodings;
5827                    let send_compression_encodings = self.send_compression_encodings;
5828                    let max_decoding_message_size = self.max_decoding_message_size;
5829                    let max_encoding_message_size = self.max_encoding_message_size;
5830                    let inner = self.inner.clone();
5831                    let fut = async move {
5832                        let method = IngestTouchEventsSvc(inner);
5833                        let codec = tonic_prost::ProstCodec::default();
5834                        let mut grpc = tonic::server::Grpc::new(codec)
5835                            .apply_compression_config(
5836                                accept_compression_encodings,
5837                                send_compression_encodings,
5838                            )
5839                            .apply_max_message_size_config(
5840                                max_decoding_message_size,
5841                                max_encoding_message_size,
5842                            );
5843                        let res = grpc.unary(method, req).await;
5844                        Ok(res)
5845                    };
5846                    Box::pin(fut)
5847                }
5848                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
5849                    #[allow(non_camel_case_types)]
5850                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
5851                    impl<
5852                        T: HeatmapService,
5853                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
5854                    for QueryHeatmapDataSvc<T> {
5855                        type Response = super::QueryHeatmapDataResponse;
5856                        type Future = BoxFuture<
5857                            tonic::Response<Self::Response>,
5858                            tonic::Status,
5859                        >;
5860                        fn call(
5861                            &mut self,
5862                            request: tonic::Request<super::QueryHeatmapDataRequest>,
5863                        ) -> Self::Future {
5864                            let inner = Arc::clone(&self.0);
5865                            let fut = async move {
5866                                <T as HeatmapService>::query_heatmap_data(&inner, request)
5867                                    .await
5868                            };
5869                            Box::pin(fut)
5870                        }
5871                    }
5872                    let accept_compression_encodings = self.accept_compression_encodings;
5873                    let send_compression_encodings = self.send_compression_encodings;
5874                    let max_decoding_message_size = self.max_decoding_message_size;
5875                    let max_encoding_message_size = self.max_encoding_message_size;
5876                    let inner = self.inner.clone();
5877                    let fut = async move {
5878                        let method = QueryHeatmapDataSvc(inner);
5879                        let codec = tonic_prost::ProstCodec::default();
5880                        let mut grpc = tonic::server::Grpc::new(codec)
5881                            .apply_compression_config(
5882                                accept_compression_encodings,
5883                                send_compression_encodings,
5884                            )
5885                            .apply_max_message_size_config(
5886                                max_decoding_message_size,
5887                                max_encoding_message_size,
5888                            );
5889                        let res = grpc.unary(method, req).await;
5890                        Ok(res)
5891                    };
5892                    Box::pin(fut)
5893                }
5894                "/pidgr.v1.HeatmapService/ListScreenshots" => {
5895                    #[allow(non_camel_case_types)]
5896                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
5897                    impl<
5898                        T: HeatmapService,
5899                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
5900                    for ListScreenshotsSvc<T> {
5901                        type Response = super::ListScreenshotsResponse;
5902                        type Future = BoxFuture<
5903                            tonic::Response<Self::Response>,
5904                            tonic::Status,
5905                        >;
5906                        fn call(
5907                            &mut self,
5908                            request: tonic::Request<super::ListScreenshotsRequest>,
5909                        ) -> Self::Future {
5910                            let inner = Arc::clone(&self.0);
5911                            let fut = async move {
5912                                <T as HeatmapService>::list_screenshots(&inner, request)
5913                                    .await
5914                            };
5915                            Box::pin(fut)
5916                        }
5917                    }
5918                    let accept_compression_encodings = self.accept_compression_encodings;
5919                    let send_compression_encodings = self.send_compression_encodings;
5920                    let max_decoding_message_size = self.max_decoding_message_size;
5921                    let max_encoding_message_size = self.max_encoding_message_size;
5922                    let inner = self.inner.clone();
5923                    let fut = async move {
5924                        let method = ListScreenshotsSvc(inner);
5925                        let codec = tonic_prost::ProstCodec::default();
5926                        let mut grpc = tonic::server::Grpc::new(codec)
5927                            .apply_compression_config(
5928                                accept_compression_encodings,
5929                                send_compression_encodings,
5930                            )
5931                            .apply_max_message_size_config(
5932                                max_decoding_message_size,
5933                                max_encoding_message_size,
5934                            );
5935                        let res = grpc.unary(method, req).await;
5936                        Ok(res)
5937                    };
5938                    Box::pin(fut)
5939                }
5940                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
5941                    #[allow(non_camel_case_types)]
5942                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
5943                    impl<
5944                        T: HeatmapService,
5945                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
5946                    for UploadScreenshotSvc<T> {
5947                        type Response = super::UploadScreenshotResponse;
5948                        type Future = BoxFuture<
5949                            tonic::Response<Self::Response>,
5950                            tonic::Status,
5951                        >;
5952                        fn call(
5953                            &mut self,
5954                            request: tonic::Request<super::UploadScreenshotRequest>,
5955                        ) -> Self::Future {
5956                            let inner = Arc::clone(&self.0);
5957                            let fut = async move {
5958                                <T as HeatmapService>::upload_screenshot(&inner, request)
5959                                    .await
5960                            };
5961                            Box::pin(fut)
5962                        }
5963                    }
5964                    let accept_compression_encodings = self.accept_compression_encodings;
5965                    let send_compression_encodings = self.send_compression_encodings;
5966                    let max_decoding_message_size = self.max_decoding_message_size;
5967                    let max_encoding_message_size = self.max_encoding_message_size;
5968                    let inner = self.inner.clone();
5969                    let fut = async move {
5970                        let method = UploadScreenshotSvc(inner);
5971                        let codec = tonic_prost::ProstCodec::default();
5972                        let mut grpc = tonic::server::Grpc::new(codec)
5973                            .apply_compression_config(
5974                                accept_compression_encodings,
5975                                send_compression_encodings,
5976                            )
5977                            .apply_max_message_size_config(
5978                                max_decoding_message_size,
5979                                max_encoding_message_size,
5980                            );
5981                        let res = grpc.unary(method, req).await;
5982                        Ok(res)
5983                    };
5984                    Box::pin(fut)
5985                }
5986                _ => {
5987                    Box::pin(async move {
5988                        let mut response = http::Response::new(
5989                            tonic::body::Body::default(),
5990                        );
5991                        let headers = response.headers_mut();
5992                        headers
5993                            .insert(
5994                                tonic::Status::GRPC_STATUS,
5995                                (tonic::Code::Unimplemented as i32).into(),
5996                            );
5997                        headers
5998                            .insert(
5999                                http::header::CONTENT_TYPE,
6000                                tonic::metadata::GRPC_CONTENT_TYPE,
6001                            );
6002                        Ok(response)
6003                    })
6004                }
6005            }
6006        }
6007    }
6008    impl<T> Clone for HeatmapServiceServer<T> {
6009        fn clone(&self) -> Self {
6010            let inner = self.inner.clone();
6011            Self {
6012                inner,
6013                accept_compression_encodings: self.accept_compression_encodings,
6014                send_compression_encodings: self.send_compression_encodings,
6015                max_decoding_message_size: self.max_decoding_message_size,
6016                max_encoding_message_size: self.max_encoding_message_size,
6017            }
6018        }
6019    }
6020    /// Generated gRPC service name
6021    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6022    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6023        const NAME: &'static str = SERVICE_NAME;
6024    }
6025}
6026/// Generated client implementations.
6027pub mod inbox_service_client {
6028    #![allow(
6029        unused_variables,
6030        dead_code,
6031        missing_docs,
6032        clippy::wildcard_imports,
6033        clippy::let_unit_value,
6034    )]
6035    use tonic::codegen::*;
6036    use tonic::codegen::http::Uri;
6037    /** Provides the mobile app's inbox experience — syncing messages,
6038 tracking read status, and retrieving individual entries.
6039*/
6040    #[derive(Debug, Clone)]
6041    pub struct InboxServiceClient<T> {
6042        inner: tonic::client::Grpc<T>,
6043    }
6044    impl InboxServiceClient<tonic::transport::Channel> {
6045        /// Attempt to create a new client by connecting to a given endpoint.
6046        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6047        where
6048            D: TryInto<tonic::transport::Endpoint>,
6049            D::Error: Into<StdError>,
6050        {
6051            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6052            Ok(Self::new(conn))
6053        }
6054    }
6055    impl<T> InboxServiceClient<T>
6056    where
6057        T: tonic::client::GrpcService<tonic::body::Body>,
6058        T::Error: Into<StdError>,
6059        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6060        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6061    {
6062        pub fn new(inner: T) -> Self {
6063            let inner = tonic::client::Grpc::new(inner);
6064            Self { inner }
6065        }
6066        pub fn with_origin(inner: T, origin: Uri) -> Self {
6067            let inner = tonic::client::Grpc::with_origin(inner, origin);
6068            Self { inner }
6069        }
6070        pub fn with_interceptor<F>(
6071            inner: T,
6072            interceptor: F,
6073        ) -> InboxServiceClient<InterceptedService<T, F>>
6074        where
6075            F: tonic::service::Interceptor,
6076            T::ResponseBody: Default,
6077            T: tonic::codegen::Service<
6078                http::Request<tonic::body::Body>,
6079                Response = http::Response<
6080                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6081                >,
6082            >,
6083            <T as tonic::codegen::Service<
6084                http::Request<tonic::body::Body>,
6085            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6086        {
6087            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6088        }
6089        /// Compress requests with the given encoding.
6090        ///
6091        /// This requires the server to support it otherwise it might respond with an
6092        /// error.
6093        #[must_use]
6094        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6095            self.inner = self.inner.send_compressed(encoding);
6096            self
6097        }
6098        /// Enable decompressing responses.
6099        #[must_use]
6100        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6101            self.inner = self.inner.accept_compressed(encoding);
6102            self
6103        }
6104        /// Limits the maximum size of a decoded message.
6105        ///
6106        /// Default: `4MB`
6107        #[must_use]
6108        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6109            self.inner = self.inner.max_decoding_message_size(limit);
6110            self
6111        }
6112        /// Limits the maximum size of an encoded message.
6113        ///
6114        /// Default: `usize::MAX`
6115        #[must_use]
6116        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6117            self.inner = self.inner.max_encoding_message_size(limit);
6118            self
6119        }
6120        /** Sync inbox entries since a given timestamp for incremental updates.
6121 Authorization: Authenticated user (own inbox only).
6122*/
6123        pub async fn sync(
6124            &mut self,
6125            request: impl tonic::IntoRequest<super::SyncRequest>,
6126        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6127            self.inner
6128                .ready()
6129                .await
6130                .map_err(|e| {
6131                    tonic::Status::unknown(
6132                        format!("Service was not ready: {}", e.into()),
6133                    )
6134                })?;
6135            let codec = tonic_prost::ProstCodec::default();
6136            let path = http::uri::PathAndQuery::from_static(
6137                "/pidgr.v1.InboxService/Sync",
6138            );
6139            let mut req = request.into_request();
6140            req.extensions_mut()
6141                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6142            self.inner.unary(req, path, codec).await
6143        }
6144        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6145 Authorization: Authenticated user (own inbox only).
6146*/
6147        pub async fn mark_read(
6148            &mut self,
6149            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6150        ) -> std::result::Result<
6151            tonic::Response<super::MarkReadResponse>,
6152            tonic::Status,
6153        > {
6154            self.inner
6155                .ready()
6156                .await
6157                .map_err(|e| {
6158                    tonic::Status::unknown(
6159                        format!("Service was not ready: {}", e.into()),
6160                    )
6161                })?;
6162            let codec = tonic_prost::ProstCodec::default();
6163            let path = http::uri::PathAndQuery::from_static(
6164                "/pidgr.v1.InboxService/MarkRead",
6165            );
6166            let mut req = request.into_request();
6167            req.extensions_mut()
6168                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6169            self.inner.unary(req, path, codec).await
6170        }
6171        /** Retrieve a single inbox entry by delivery ID.
6172 Authorization: Authenticated user (own inbox only).
6173*/
6174        pub async fn get_message(
6175            &mut self,
6176            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6177        ) -> std::result::Result<
6178            tonic::Response<super::GetMessageResponse>,
6179            tonic::Status,
6180        > {
6181            self.inner
6182                .ready()
6183                .await
6184                .map_err(|e| {
6185                    tonic::Status::unknown(
6186                        format!("Service was not ready: {}", e.into()),
6187                    )
6188                })?;
6189            let codec = tonic_prost::ProstCodec::default();
6190            let path = http::uri::PathAndQuery::from_static(
6191                "/pidgr.v1.InboxService/GetMessage",
6192            );
6193            let mut req = request.into_request();
6194            req.extensions_mut()
6195                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6196            self.inner.unary(req, path, codec).await
6197        }
6198    }
6199}
6200/// Generated server implementations.
6201pub mod inbox_service_server {
6202    #![allow(
6203        unused_variables,
6204        dead_code,
6205        missing_docs,
6206        clippy::wildcard_imports,
6207        clippy::let_unit_value,
6208    )]
6209    use tonic::codegen::*;
6210    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6211    #[async_trait]
6212    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6213        /** Sync inbox entries since a given timestamp for incremental updates.
6214 Authorization: Authenticated user (own inbox only).
6215*/
6216        async fn sync(
6217            &self,
6218            request: tonic::Request<super::SyncRequest>,
6219        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6220        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6221 Authorization: Authenticated user (own inbox only).
6222*/
6223        async fn mark_read(
6224            &self,
6225            request: tonic::Request<super::MarkReadRequest>,
6226        ) -> std::result::Result<
6227            tonic::Response<super::MarkReadResponse>,
6228            tonic::Status,
6229        >;
6230        /** Retrieve a single inbox entry by delivery ID.
6231 Authorization: Authenticated user (own inbox only).
6232*/
6233        async fn get_message(
6234            &self,
6235            request: tonic::Request<super::GetMessageRequest>,
6236        ) -> std::result::Result<
6237            tonic::Response<super::GetMessageResponse>,
6238            tonic::Status,
6239        >;
6240    }
6241    /** Provides the mobile app's inbox experience — syncing messages,
6242 tracking read status, and retrieving individual entries.
6243*/
6244    #[derive(Debug)]
6245    pub struct InboxServiceServer<T> {
6246        inner: Arc<T>,
6247        accept_compression_encodings: EnabledCompressionEncodings,
6248        send_compression_encodings: EnabledCompressionEncodings,
6249        max_decoding_message_size: Option<usize>,
6250        max_encoding_message_size: Option<usize>,
6251    }
6252    impl<T> InboxServiceServer<T> {
6253        pub fn new(inner: T) -> Self {
6254            Self::from_arc(Arc::new(inner))
6255        }
6256        pub fn from_arc(inner: Arc<T>) -> Self {
6257            Self {
6258                inner,
6259                accept_compression_encodings: Default::default(),
6260                send_compression_encodings: Default::default(),
6261                max_decoding_message_size: None,
6262                max_encoding_message_size: None,
6263            }
6264        }
6265        pub fn with_interceptor<F>(
6266            inner: T,
6267            interceptor: F,
6268        ) -> InterceptedService<Self, F>
6269        where
6270            F: tonic::service::Interceptor,
6271        {
6272            InterceptedService::new(Self::new(inner), interceptor)
6273        }
6274        /// Enable decompressing requests with the given encoding.
6275        #[must_use]
6276        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6277            self.accept_compression_encodings.enable(encoding);
6278            self
6279        }
6280        /// Compress responses with the given encoding, if the client supports it.
6281        #[must_use]
6282        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6283            self.send_compression_encodings.enable(encoding);
6284            self
6285        }
6286        /// Limits the maximum size of a decoded message.
6287        ///
6288        /// Default: `4MB`
6289        #[must_use]
6290        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6291            self.max_decoding_message_size = Some(limit);
6292            self
6293        }
6294        /// Limits the maximum size of an encoded message.
6295        ///
6296        /// Default: `usize::MAX`
6297        #[must_use]
6298        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6299            self.max_encoding_message_size = Some(limit);
6300            self
6301        }
6302    }
6303    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6304    where
6305        T: InboxService,
6306        B: Body + std::marker::Send + 'static,
6307        B::Error: Into<StdError> + std::marker::Send + 'static,
6308    {
6309        type Response = http::Response<tonic::body::Body>;
6310        type Error = std::convert::Infallible;
6311        type Future = BoxFuture<Self::Response, Self::Error>;
6312        fn poll_ready(
6313            &mut self,
6314            _cx: &mut Context<'_>,
6315        ) -> Poll<std::result::Result<(), Self::Error>> {
6316            Poll::Ready(Ok(()))
6317        }
6318        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6319            match req.uri().path() {
6320                "/pidgr.v1.InboxService/Sync" => {
6321                    #[allow(non_camel_case_types)]
6322                    struct SyncSvc<T: InboxService>(pub Arc<T>);
6323                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6324                    for SyncSvc<T> {
6325                        type Response = super::SyncResponse;
6326                        type Future = BoxFuture<
6327                            tonic::Response<Self::Response>,
6328                            tonic::Status,
6329                        >;
6330                        fn call(
6331                            &mut self,
6332                            request: tonic::Request<super::SyncRequest>,
6333                        ) -> Self::Future {
6334                            let inner = Arc::clone(&self.0);
6335                            let fut = async move {
6336                                <T as InboxService>::sync(&inner, request).await
6337                            };
6338                            Box::pin(fut)
6339                        }
6340                    }
6341                    let accept_compression_encodings = self.accept_compression_encodings;
6342                    let send_compression_encodings = self.send_compression_encodings;
6343                    let max_decoding_message_size = self.max_decoding_message_size;
6344                    let max_encoding_message_size = self.max_encoding_message_size;
6345                    let inner = self.inner.clone();
6346                    let fut = async move {
6347                        let method = SyncSvc(inner);
6348                        let codec = tonic_prost::ProstCodec::default();
6349                        let mut grpc = tonic::server::Grpc::new(codec)
6350                            .apply_compression_config(
6351                                accept_compression_encodings,
6352                                send_compression_encodings,
6353                            )
6354                            .apply_max_message_size_config(
6355                                max_decoding_message_size,
6356                                max_encoding_message_size,
6357                            );
6358                        let res = grpc.unary(method, req).await;
6359                        Ok(res)
6360                    };
6361                    Box::pin(fut)
6362                }
6363                "/pidgr.v1.InboxService/MarkRead" => {
6364                    #[allow(non_camel_case_types)]
6365                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6366                    impl<
6367                        T: InboxService,
6368                    > tonic::server::UnaryService<super::MarkReadRequest>
6369                    for MarkReadSvc<T> {
6370                        type Response = super::MarkReadResponse;
6371                        type Future = BoxFuture<
6372                            tonic::Response<Self::Response>,
6373                            tonic::Status,
6374                        >;
6375                        fn call(
6376                            &mut self,
6377                            request: tonic::Request<super::MarkReadRequest>,
6378                        ) -> Self::Future {
6379                            let inner = Arc::clone(&self.0);
6380                            let fut = async move {
6381                                <T as InboxService>::mark_read(&inner, request).await
6382                            };
6383                            Box::pin(fut)
6384                        }
6385                    }
6386                    let accept_compression_encodings = self.accept_compression_encodings;
6387                    let send_compression_encodings = self.send_compression_encodings;
6388                    let max_decoding_message_size = self.max_decoding_message_size;
6389                    let max_encoding_message_size = self.max_encoding_message_size;
6390                    let inner = self.inner.clone();
6391                    let fut = async move {
6392                        let method = MarkReadSvc(inner);
6393                        let codec = tonic_prost::ProstCodec::default();
6394                        let mut grpc = tonic::server::Grpc::new(codec)
6395                            .apply_compression_config(
6396                                accept_compression_encodings,
6397                                send_compression_encodings,
6398                            )
6399                            .apply_max_message_size_config(
6400                                max_decoding_message_size,
6401                                max_encoding_message_size,
6402                            );
6403                        let res = grpc.unary(method, req).await;
6404                        Ok(res)
6405                    };
6406                    Box::pin(fut)
6407                }
6408                "/pidgr.v1.InboxService/GetMessage" => {
6409                    #[allow(non_camel_case_types)]
6410                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6411                    impl<
6412                        T: InboxService,
6413                    > tonic::server::UnaryService<super::GetMessageRequest>
6414                    for GetMessageSvc<T> {
6415                        type Response = super::GetMessageResponse;
6416                        type Future = BoxFuture<
6417                            tonic::Response<Self::Response>,
6418                            tonic::Status,
6419                        >;
6420                        fn call(
6421                            &mut self,
6422                            request: tonic::Request<super::GetMessageRequest>,
6423                        ) -> Self::Future {
6424                            let inner = Arc::clone(&self.0);
6425                            let fut = async move {
6426                                <T as InboxService>::get_message(&inner, request).await
6427                            };
6428                            Box::pin(fut)
6429                        }
6430                    }
6431                    let accept_compression_encodings = self.accept_compression_encodings;
6432                    let send_compression_encodings = self.send_compression_encodings;
6433                    let max_decoding_message_size = self.max_decoding_message_size;
6434                    let max_encoding_message_size = self.max_encoding_message_size;
6435                    let inner = self.inner.clone();
6436                    let fut = async move {
6437                        let method = GetMessageSvc(inner);
6438                        let codec = tonic_prost::ProstCodec::default();
6439                        let mut grpc = tonic::server::Grpc::new(codec)
6440                            .apply_compression_config(
6441                                accept_compression_encodings,
6442                                send_compression_encodings,
6443                            )
6444                            .apply_max_message_size_config(
6445                                max_decoding_message_size,
6446                                max_encoding_message_size,
6447                            );
6448                        let res = grpc.unary(method, req).await;
6449                        Ok(res)
6450                    };
6451                    Box::pin(fut)
6452                }
6453                _ => {
6454                    Box::pin(async move {
6455                        let mut response = http::Response::new(
6456                            tonic::body::Body::default(),
6457                        );
6458                        let headers = response.headers_mut();
6459                        headers
6460                            .insert(
6461                                tonic::Status::GRPC_STATUS,
6462                                (tonic::Code::Unimplemented as i32).into(),
6463                            );
6464                        headers
6465                            .insert(
6466                                http::header::CONTENT_TYPE,
6467                                tonic::metadata::GRPC_CONTENT_TYPE,
6468                            );
6469                        Ok(response)
6470                    })
6471                }
6472            }
6473        }
6474    }
6475    impl<T> Clone for InboxServiceServer<T> {
6476        fn clone(&self) -> Self {
6477            let inner = self.inner.clone();
6478            Self {
6479                inner,
6480                accept_compression_encodings: self.accept_compression_encodings,
6481                send_compression_encodings: self.send_compression_encodings,
6482                max_decoding_message_size: self.max_decoding_message_size,
6483                max_encoding_message_size: self.max_encoding_message_size,
6484            }
6485        }
6486    }
6487    /// Generated gRPC service name
6488    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6489    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6490        const NAME: &'static str = SERVICE_NAME;
6491    }
6492}
6493/// Generated client implementations.
6494pub mod insights_service_client {
6495    #![allow(
6496        unused_variables,
6497        dead_code,
6498        missing_docs,
6499        clippy::wildcard_imports,
6500        clippy::let_unit_value,
6501    )]
6502    use tonic::codegen::*;
6503    use tonic::codegen::http::Uri;
6504    /** Provides cohort-level AI insights for campaign planning and optimization.
6505 All predictions are aggregate — no individual-level profiling.
6506 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6507 All RPCs operate within the caller's org (extracted from JWT).
6508*/
6509    #[derive(Debug, Clone)]
6510    pub struct InsightsServiceClient<T> {
6511        inner: tonic::client::Grpc<T>,
6512    }
6513    impl InsightsServiceClient<tonic::transport::Channel> {
6514        /// Attempt to create a new client by connecting to a given endpoint.
6515        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6516        where
6517            D: TryInto<tonic::transport::Endpoint>,
6518            D::Error: Into<StdError>,
6519        {
6520            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6521            Ok(Self::new(conn))
6522        }
6523    }
6524    impl<T> InsightsServiceClient<T>
6525    where
6526        T: tonic::client::GrpcService<tonic::body::Body>,
6527        T::Error: Into<StdError>,
6528        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6529        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6530    {
6531        pub fn new(inner: T) -> Self {
6532            let inner = tonic::client::Grpc::new(inner);
6533            Self { inner }
6534        }
6535        pub fn with_origin(inner: T, origin: Uri) -> Self {
6536            let inner = tonic::client::Grpc::with_origin(inner, origin);
6537            Self { inner }
6538        }
6539        pub fn with_interceptor<F>(
6540            inner: T,
6541            interceptor: F,
6542        ) -> InsightsServiceClient<InterceptedService<T, F>>
6543        where
6544            F: tonic::service::Interceptor,
6545            T::ResponseBody: Default,
6546            T: tonic::codegen::Service<
6547                http::Request<tonic::body::Body>,
6548                Response = http::Response<
6549                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6550                >,
6551            >,
6552            <T as tonic::codegen::Service<
6553                http::Request<tonic::body::Body>,
6554            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6555        {
6556            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
6557        }
6558        /// Compress requests with the given encoding.
6559        ///
6560        /// This requires the server to support it otherwise it might respond with an
6561        /// error.
6562        #[must_use]
6563        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6564            self.inner = self.inner.send_compressed(encoding);
6565            self
6566        }
6567        /// Enable decompressing responses.
6568        #[must_use]
6569        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6570            self.inner = self.inner.accept_compressed(encoding);
6571            self
6572        }
6573        /// Limits the maximum size of a decoded message.
6574        ///
6575        /// Default: `4MB`
6576        #[must_use]
6577        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6578            self.inner = self.inner.max_decoding_message_size(limit);
6579            self
6580        }
6581        /// Limits the maximum size of an encoded message.
6582        ///
6583        /// Default: `usize::MAX`
6584        #[must_use]
6585        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6586            self.inner = self.inner.max_encoding_message_size(limit);
6587            self
6588        }
6589        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6590 Returns empty archetypes if insufficient data (cold start).
6591 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6592*/
6593        pub async fn get_group_archetypes(
6594            &mut self,
6595            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
6596        ) -> std::result::Result<
6597            tonic::Response<super::GetGroupArchetypesResponse>,
6598            tonic::Status,
6599        > {
6600            self.inner
6601                .ready()
6602                .await
6603                .map_err(|e| {
6604                    tonic::Status::unknown(
6605                        format!("Service was not ready: {}", e.into()),
6606                    )
6607                })?;
6608            let codec = tonic_prost::ProstCodec::default();
6609            let path = http::uri::PathAndQuery::from_static(
6610                "/pidgr.v1.InsightsService/GetGroupArchetypes",
6611            );
6612            let mut req = request.into_request();
6613            req.extensions_mut()
6614                .insert(
6615                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
6616                );
6617            self.inner.unary(req, path, codec).await
6618        }
6619        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6620 Returns a confidence interval that narrows as more campaign data accumulates.
6621 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6622*/
6623        pub async fn predict_campaign_ack(
6624            &mut self,
6625            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
6626        ) -> std::result::Result<
6627            tonic::Response<super::PredictCampaignAckResponse>,
6628            tonic::Status,
6629        > {
6630            self.inner
6631                .ready()
6632                .await
6633                .map_err(|e| {
6634                    tonic::Status::unknown(
6635                        format!("Service was not ready: {}", e.into()),
6636                    )
6637                })?;
6638            let codec = tonic_prost::ProstCodec::default();
6639            let path = http::uri::PathAndQuery::from_static(
6640                "/pidgr.v1.InsightsService/PredictCampaignACK",
6641            );
6642            let mut req = request.into_request();
6643            req.extensions_mut()
6644                .insert(
6645                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
6646                );
6647            self.inner.unary(req, path, codec).await
6648        }
6649        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6650 Advisory is informational only — never drives automated decisions.
6651 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6652*/
6653        pub async fn get_campaign_advisory(
6654            &mut self,
6655            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
6656        ) -> std::result::Result<
6657            tonic::Response<super::GetCampaignAdvisoryResponse>,
6658            tonic::Status,
6659        > {
6660            self.inner
6661                .ready()
6662                .await
6663                .map_err(|e| {
6664                    tonic::Status::unknown(
6665                        format!("Service was not ready: {}", e.into()),
6666                    )
6667                })?;
6668            let codec = tonic_prost::ProstCodec::default();
6669            let path = http::uri::PathAndQuery::from_static(
6670                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
6671            );
6672            let mut req = request.into_request();
6673            req.extensions_mut()
6674                .insert(
6675                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
6676                );
6677            self.inner.unary(req, path, codec).await
6678        }
6679        /** Generate an AI-powered narrative summary of a group's insights.
6680 Combines archetype, prediction, and campaign data into human-readable analysis.
6681 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6682*/
6683        pub async fn get_insight_narrative(
6684            &mut self,
6685            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
6686        ) -> std::result::Result<
6687            tonic::Response<super::GetInsightNarrativeResponse>,
6688            tonic::Status,
6689        > {
6690            self.inner
6691                .ready()
6692                .await
6693                .map_err(|e| {
6694                    tonic::Status::unknown(
6695                        format!("Service was not ready: {}", e.into()),
6696                    )
6697                })?;
6698            let codec = tonic_prost::ProstCodec::default();
6699            let path = http::uri::PathAndQuery::from_static(
6700                "/pidgr.v1.InsightsService/GetInsightNarrative",
6701            );
6702            let mut req = request.into_request();
6703            req.extensions_mut()
6704                .insert(
6705                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
6706                );
6707            self.inner.unary(req, path, codec).await
6708        }
6709        /** Manually trigger the ML training pipeline for the caller's organization.
6710 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6711 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6712*/
6713        pub async fn trigger_ml_pipeline(
6714            &mut self,
6715            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
6716        ) -> std::result::Result<
6717            tonic::Response<super::TriggerMlPipelineResponse>,
6718            tonic::Status,
6719        > {
6720            self.inner
6721                .ready()
6722                .await
6723                .map_err(|e| {
6724                    tonic::Status::unknown(
6725                        format!("Service was not ready: {}", e.into()),
6726                    )
6727                })?;
6728            let codec = tonic_prost::ProstCodec::default();
6729            let path = http::uri::PathAndQuery::from_static(
6730                "/pidgr.v1.InsightsService/TriggerMLPipeline",
6731            );
6732            let mut req = request.into_request();
6733            req.extensions_mut()
6734                .insert(
6735                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
6736                );
6737            self.inner.unary(req, path, codec).await
6738        }
6739        /** Manually retrigger archetype clustering for a single group, reusing
6740 the already-deployed SageMaker clustering model. Cheaper than a
6741 full TriggerMLPipeline run because no training happens. Shares the
6742 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
6743 get N manual retrains per month across both RPCs.
6744 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6745*/
6746        pub async fn trigger_archetype_clustering(
6747            &mut self,
6748            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
6749        ) -> std::result::Result<
6750            tonic::Response<super::TriggerArchetypeClusteringResponse>,
6751            tonic::Status,
6752        > {
6753            self.inner
6754                .ready()
6755                .await
6756                .map_err(|e| {
6757                    tonic::Status::unknown(
6758                        format!("Service was not ready: {}", e.into()),
6759                    )
6760                })?;
6761            let codec = tonic_prost::ProstCodec::default();
6762            let path = http::uri::PathAndQuery::from_static(
6763                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
6764            );
6765            let mut req = request.into_request();
6766            req.extensions_mut()
6767                .insert(
6768                    GrpcMethod::new(
6769                        "pidgr.v1.InsightsService",
6770                        "TriggerArchetypeClustering",
6771                    ),
6772                );
6773            self.inner.unary(req, path, codec).await
6774        }
6775        /** Draft a campaign body for the given archetype using Bedrock with the
6776 campaign-for-archetype prompt template. Used by the Compass
6777 "Target this archetype" CTA to pre-fill the wizard's body field.
6778 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
6779 returns NOT_FOUND.
6780 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
6781*/
6782        pub async fn generate_campaign_body_draft(
6783            &mut self,
6784            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
6785        ) -> std::result::Result<
6786            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
6787            tonic::Status,
6788        > {
6789            self.inner
6790                .ready()
6791                .await
6792                .map_err(|e| {
6793                    tonic::Status::unknown(
6794                        format!("Service was not ready: {}", e.into()),
6795                    )
6796                })?;
6797            let codec = tonic_prost::ProstCodec::default();
6798            let path = http::uri::PathAndQuery::from_static(
6799                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
6800            );
6801            let mut req = request.into_request();
6802            req.extensions_mut()
6803                .insert(
6804                    GrpcMethod::new(
6805                        "pidgr.v1.InsightsService",
6806                        "GenerateCampaignBodyDraft",
6807                    ),
6808                );
6809            self.inner.unary(req, path, codec).await
6810        }
6811    }
6812}
6813/// Generated server implementations.
6814pub mod insights_service_server {
6815    #![allow(
6816        unused_variables,
6817        dead_code,
6818        missing_docs,
6819        clippy::wildcard_imports,
6820        clippy::let_unit_value,
6821    )]
6822    use tonic::codegen::*;
6823    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
6824    #[async_trait]
6825    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
6826        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6827 Returns empty archetypes if insufficient data (cold start).
6828 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6829*/
6830        async fn get_group_archetypes(
6831            &self,
6832            request: tonic::Request<super::GetGroupArchetypesRequest>,
6833        ) -> std::result::Result<
6834            tonic::Response<super::GetGroupArchetypesResponse>,
6835            tonic::Status,
6836        >;
6837        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6838 Returns a confidence interval that narrows as more campaign data accumulates.
6839 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6840*/
6841        async fn predict_campaign_ack(
6842            &self,
6843            request: tonic::Request<super::PredictCampaignAckRequest>,
6844        ) -> std::result::Result<
6845            tonic::Response<super::PredictCampaignAckResponse>,
6846            tonic::Status,
6847        >;
6848        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6849 Advisory is informational only — never drives automated decisions.
6850 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6851*/
6852        async fn get_campaign_advisory(
6853            &self,
6854            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6855        ) -> std::result::Result<
6856            tonic::Response<super::GetCampaignAdvisoryResponse>,
6857            tonic::Status,
6858        >;
6859        /** Generate an AI-powered narrative summary of a group's insights.
6860 Combines archetype, prediction, and campaign data into human-readable analysis.
6861 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6862*/
6863        async fn get_insight_narrative(
6864            &self,
6865            request: tonic::Request<super::GetInsightNarrativeRequest>,
6866        ) -> std::result::Result<
6867            tonic::Response<super::GetInsightNarrativeResponse>,
6868            tonic::Status,
6869        >;
6870        /** Manually trigger the ML training pipeline for the caller's organization.
6871 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6872 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6873*/
6874        async fn trigger_ml_pipeline(
6875            &self,
6876            request: tonic::Request<super::TriggerMlPipelineRequest>,
6877        ) -> std::result::Result<
6878            tonic::Response<super::TriggerMlPipelineResponse>,
6879            tonic::Status,
6880        >;
6881        /** Manually retrigger archetype clustering for a single group, reusing
6882 the already-deployed SageMaker clustering model. Cheaper than a
6883 full TriggerMLPipeline run because no training happens. Shares the
6884 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
6885 get N manual retrains per month across both RPCs.
6886 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6887*/
6888        async fn trigger_archetype_clustering(
6889            &self,
6890            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
6891        ) -> std::result::Result<
6892            tonic::Response<super::TriggerArchetypeClusteringResponse>,
6893            tonic::Status,
6894        >;
6895        /** Draft a campaign body for the given archetype using Bedrock with the
6896 campaign-for-archetype prompt template. Used by the Compass
6897 "Target this archetype" CTA to pre-fill the wizard's body field.
6898 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
6899 returns NOT_FOUND.
6900 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
6901*/
6902        async fn generate_campaign_body_draft(
6903            &self,
6904            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
6905        ) -> std::result::Result<
6906            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
6907            tonic::Status,
6908        >;
6909    }
6910    /** Provides cohort-level AI insights for campaign planning and optimization.
6911 All predictions are aggregate — no individual-level profiling.
6912 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6913 All RPCs operate within the caller's org (extracted from JWT).
6914*/
6915    #[derive(Debug)]
6916    pub struct InsightsServiceServer<T> {
6917        inner: Arc<T>,
6918        accept_compression_encodings: EnabledCompressionEncodings,
6919        send_compression_encodings: EnabledCompressionEncodings,
6920        max_decoding_message_size: Option<usize>,
6921        max_encoding_message_size: Option<usize>,
6922    }
6923    impl<T> InsightsServiceServer<T> {
6924        pub fn new(inner: T) -> Self {
6925            Self::from_arc(Arc::new(inner))
6926        }
6927        pub fn from_arc(inner: Arc<T>) -> Self {
6928            Self {
6929                inner,
6930                accept_compression_encodings: Default::default(),
6931                send_compression_encodings: Default::default(),
6932                max_decoding_message_size: None,
6933                max_encoding_message_size: None,
6934            }
6935        }
6936        pub fn with_interceptor<F>(
6937            inner: T,
6938            interceptor: F,
6939        ) -> InterceptedService<Self, F>
6940        where
6941            F: tonic::service::Interceptor,
6942        {
6943            InterceptedService::new(Self::new(inner), interceptor)
6944        }
6945        /// Enable decompressing requests with the given encoding.
6946        #[must_use]
6947        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6948            self.accept_compression_encodings.enable(encoding);
6949            self
6950        }
6951        /// Compress responses with the given encoding, if the client supports it.
6952        #[must_use]
6953        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6954            self.send_compression_encodings.enable(encoding);
6955            self
6956        }
6957        /// Limits the maximum size of a decoded message.
6958        ///
6959        /// Default: `4MB`
6960        #[must_use]
6961        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6962            self.max_decoding_message_size = Some(limit);
6963            self
6964        }
6965        /// Limits the maximum size of an encoded message.
6966        ///
6967        /// Default: `usize::MAX`
6968        #[must_use]
6969        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6970            self.max_encoding_message_size = Some(limit);
6971            self
6972        }
6973    }
6974    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
6975    where
6976        T: InsightsService,
6977        B: Body + std::marker::Send + 'static,
6978        B::Error: Into<StdError> + std::marker::Send + 'static,
6979    {
6980        type Response = http::Response<tonic::body::Body>;
6981        type Error = std::convert::Infallible;
6982        type Future = BoxFuture<Self::Response, Self::Error>;
6983        fn poll_ready(
6984            &mut self,
6985            _cx: &mut Context<'_>,
6986        ) -> Poll<std::result::Result<(), Self::Error>> {
6987            Poll::Ready(Ok(()))
6988        }
6989        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6990            match req.uri().path() {
6991                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
6992                    #[allow(non_camel_case_types)]
6993                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
6994                    impl<
6995                        T: InsightsService,
6996                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
6997                    for GetGroupArchetypesSvc<T> {
6998                        type Response = super::GetGroupArchetypesResponse;
6999                        type Future = BoxFuture<
7000                            tonic::Response<Self::Response>,
7001                            tonic::Status,
7002                        >;
7003                        fn call(
7004                            &mut self,
7005                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7006                        ) -> Self::Future {
7007                            let inner = Arc::clone(&self.0);
7008                            let fut = async move {
7009                                <T as InsightsService>::get_group_archetypes(
7010                                        &inner,
7011                                        request,
7012                                    )
7013                                    .await
7014                            };
7015                            Box::pin(fut)
7016                        }
7017                    }
7018                    let accept_compression_encodings = self.accept_compression_encodings;
7019                    let send_compression_encodings = self.send_compression_encodings;
7020                    let max_decoding_message_size = self.max_decoding_message_size;
7021                    let max_encoding_message_size = self.max_encoding_message_size;
7022                    let inner = self.inner.clone();
7023                    let fut = async move {
7024                        let method = GetGroupArchetypesSvc(inner);
7025                        let codec = tonic_prost::ProstCodec::default();
7026                        let mut grpc = tonic::server::Grpc::new(codec)
7027                            .apply_compression_config(
7028                                accept_compression_encodings,
7029                                send_compression_encodings,
7030                            )
7031                            .apply_max_message_size_config(
7032                                max_decoding_message_size,
7033                                max_encoding_message_size,
7034                            );
7035                        let res = grpc.unary(method, req).await;
7036                        Ok(res)
7037                    };
7038                    Box::pin(fut)
7039                }
7040                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7041                    #[allow(non_camel_case_types)]
7042                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7043                    impl<
7044                        T: InsightsService,
7045                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7046                    for PredictCampaignACKSvc<T> {
7047                        type Response = super::PredictCampaignAckResponse;
7048                        type Future = BoxFuture<
7049                            tonic::Response<Self::Response>,
7050                            tonic::Status,
7051                        >;
7052                        fn call(
7053                            &mut self,
7054                            request: tonic::Request<super::PredictCampaignAckRequest>,
7055                        ) -> Self::Future {
7056                            let inner = Arc::clone(&self.0);
7057                            let fut = async move {
7058                                <T as InsightsService>::predict_campaign_ack(
7059                                        &inner,
7060                                        request,
7061                                    )
7062                                    .await
7063                            };
7064                            Box::pin(fut)
7065                        }
7066                    }
7067                    let accept_compression_encodings = self.accept_compression_encodings;
7068                    let send_compression_encodings = self.send_compression_encodings;
7069                    let max_decoding_message_size = self.max_decoding_message_size;
7070                    let max_encoding_message_size = self.max_encoding_message_size;
7071                    let inner = self.inner.clone();
7072                    let fut = async move {
7073                        let method = PredictCampaignACKSvc(inner);
7074                        let codec = tonic_prost::ProstCodec::default();
7075                        let mut grpc = tonic::server::Grpc::new(codec)
7076                            .apply_compression_config(
7077                                accept_compression_encodings,
7078                                send_compression_encodings,
7079                            )
7080                            .apply_max_message_size_config(
7081                                max_decoding_message_size,
7082                                max_encoding_message_size,
7083                            );
7084                        let res = grpc.unary(method, req).await;
7085                        Ok(res)
7086                    };
7087                    Box::pin(fut)
7088                }
7089                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7090                    #[allow(non_camel_case_types)]
7091                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7092                    impl<
7093                        T: InsightsService,
7094                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7095                    for GetCampaignAdvisorySvc<T> {
7096                        type Response = super::GetCampaignAdvisoryResponse;
7097                        type Future = BoxFuture<
7098                            tonic::Response<Self::Response>,
7099                            tonic::Status,
7100                        >;
7101                        fn call(
7102                            &mut self,
7103                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7104                        ) -> Self::Future {
7105                            let inner = Arc::clone(&self.0);
7106                            let fut = async move {
7107                                <T as InsightsService>::get_campaign_advisory(
7108                                        &inner,
7109                                        request,
7110                                    )
7111                                    .await
7112                            };
7113                            Box::pin(fut)
7114                        }
7115                    }
7116                    let accept_compression_encodings = self.accept_compression_encodings;
7117                    let send_compression_encodings = self.send_compression_encodings;
7118                    let max_decoding_message_size = self.max_decoding_message_size;
7119                    let max_encoding_message_size = self.max_encoding_message_size;
7120                    let inner = self.inner.clone();
7121                    let fut = async move {
7122                        let method = GetCampaignAdvisorySvc(inner);
7123                        let codec = tonic_prost::ProstCodec::default();
7124                        let mut grpc = tonic::server::Grpc::new(codec)
7125                            .apply_compression_config(
7126                                accept_compression_encodings,
7127                                send_compression_encodings,
7128                            )
7129                            .apply_max_message_size_config(
7130                                max_decoding_message_size,
7131                                max_encoding_message_size,
7132                            );
7133                        let res = grpc.unary(method, req).await;
7134                        Ok(res)
7135                    };
7136                    Box::pin(fut)
7137                }
7138                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7139                    #[allow(non_camel_case_types)]
7140                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7141                    impl<
7142                        T: InsightsService,
7143                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7144                    for GetInsightNarrativeSvc<T> {
7145                        type Response = super::GetInsightNarrativeResponse;
7146                        type Future = BoxFuture<
7147                            tonic::Response<Self::Response>,
7148                            tonic::Status,
7149                        >;
7150                        fn call(
7151                            &mut self,
7152                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7153                        ) -> Self::Future {
7154                            let inner = Arc::clone(&self.0);
7155                            let fut = async move {
7156                                <T as InsightsService>::get_insight_narrative(
7157                                        &inner,
7158                                        request,
7159                                    )
7160                                    .await
7161                            };
7162                            Box::pin(fut)
7163                        }
7164                    }
7165                    let accept_compression_encodings = self.accept_compression_encodings;
7166                    let send_compression_encodings = self.send_compression_encodings;
7167                    let max_decoding_message_size = self.max_decoding_message_size;
7168                    let max_encoding_message_size = self.max_encoding_message_size;
7169                    let inner = self.inner.clone();
7170                    let fut = async move {
7171                        let method = GetInsightNarrativeSvc(inner);
7172                        let codec = tonic_prost::ProstCodec::default();
7173                        let mut grpc = tonic::server::Grpc::new(codec)
7174                            .apply_compression_config(
7175                                accept_compression_encodings,
7176                                send_compression_encodings,
7177                            )
7178                            .apply_max_message_size_config(
7179                                max_decoding_message_size,
7180                                max_encoding_message_size,
7181                            );
7182                        let res = grpc.unary(method, req).await;
7183                        Ok(res)
7184                    };
7185                    Box::pin(fut)
7186                }
7187                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7188                    #[allow(non_camel_case_types)]
7189                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7190                    impl<
7191                        T: InsightsService,
7192                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7193                    for TriggerMLPipelineSvc<T> {
7194                        type Response = super::TriggerMlPipelineResponse;
7195                        type Future = BoxFuture<
7196                            tonic::Response<Self::Response>,
7197                            tonic::Status,
7198                        >;
7199                        fn call(
7200                            &mut self,
7201                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7202                        ) -> Self::Future {
7203                            let inner = Arc::clone(&self.0);
7204                            let fut = async move {
7205                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7206                                    .await
7207                            };
7208                            Box::pin(fut)
7209                        }
7210                    }
7211                    let accept_compression_encodings = self.accept_compression_encodings;
7212                    let send_compression_encodings = self.send_compression_encodings;
7213                    let max_decoding_message_size = self.max_decoding_message_size;
7214                    let max_encoding_message_size = self.max_encoding_message_size;
7215                    let inner = self.inner.clone();
7216                    let fut = async move {
7217                        let method = TriggerMLPipelineSvc(inner);
7218                        let codec = tonic_prost::ProstCodec::default();
7219                        let mut grpc = tonic::server::Grpc::new(codec)
7220                            .apply_compression_config(
7221                                accept_compression_encodings,
7222                                send_compression_encodings,
7223                            )
7224                            .apply_max_message_size_config(
7225                                max_decoding_message_size,
7226                                max_encoding_message_size,
7227                            );
7228                        let res = grpc.unary(method, req).await;
7229                        Ok(res)
7230                    };
7231                    Box::pin(fut)
7232                }
7233                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7234                    #[allow(non_camel_case_types)]
7235                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7236                    impl<
7237                        T: InsightsService,
7238                    > tonic::server::UnaryService<
7239                        super::TriggerArchetypeClusteringRequest,
7240                    > for TriggerArchetypeClusteringSvc<T> {
7241                        type Response = super::TriggerArchetypeClusteringResponse;
7242                        type Future = BoxFuture<
7243                            tonic::Response<Self::Response>,
7244                            tonic::Status,
7245                        >;
7246                        fn call(
7247                            &mut self,
7248                            request: tonic::Request<
7249                                super::TriggerArchetypeClusteringRequest,
7250                            >,
7251                        ) -> Self::Future {
7252                            let inner = Arc::clone(&self.0);
7253                            let fut = async move {
7254                                <T as InsightsService>::trigger_archetype_clustering(
7255                                        &inner,
7256                                        request,
7257                                    )
7258                                    .await
7259                            };
7260                            Box::pin(fut)
7261                        }
7262                    }
7263                    let accept_compression_encodings = self.accept_compression_encodings;
7264                    let send_compression_encodings = self.send_compression_encodings;
7265                    let max_decoding_message_size = self.max_decoding_message_size;
7266                    let max_encoding_message_size = self.max_encoding_message_size;
7267                    let inner = self.inner.clone();
7268                    let fut = async move {
7269                        let method = TriggerArchetypeClusteringSvc(inner);
7270                        let codec = tonic_prost::ProstCodec::default();
7271                        let mut grpc = tonic::server::Grpc::new(codec)
7272                            .apply_compression_config(
7273                                accept_compression_encodings,
7274                                send_compression_encodings,
7275                            )
7276                            .apply_max_message_size_config(
7277                                max_decoding_message_size,
7278                                max_encoding_message_size,
7279                            );
7280                        let res = grpc.unary(method, req).await;
7281                        Ok(res)
7282                    };
7283                    Box::pin(fut)
7284                }
7285                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7286                    #[allow(non_camel_case_types)]
7287                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7288                    impl<
7289                        T: InsightsService,
7290                    > tonic::server::UnaryService<
7291                        super::GenerateCampaignBodyDraftRequest,
7292                    > for GenerateCampaignBodyDraftSvc<T> {
7293                        type Response = super::GenerateCampaignBodyDraftResponse;
7294                        type Future = BoxFuture<
7295                            tonic::Response<Self::Response>,
7296                            tonic::Status,
7297                        >;
7298                        fn call(
7299                            &mut self,
7300                            request: tonic::Request<
7301                                super::GenerateCampaignBodyDraftRequest,
7302                            >,
7303                        ) -> Self::Future {
7304                            let inner = Arc::clone(&self.0);
7305                            let fut = async move {
7306                                <T as InsightsService>::generate_campaign_body_draft(
7307                                        &inner,
7308                                        request,
7309                                    )
7310                                    .await
7311                            };
7312                            Box::pin(fut)
7313                        }
7314                    }
7315                    let accept_compression_encodings = self.accept_compression_encodings;
7316                    let send_compression_encodings = self.send_compression_encodings;
7317                    let max_decoding_message_size = self.max_decoding_message_size;
7318                    let max_encoding_message_size = self.max_encoding_message_size;
7319                    let inner = self.inner.clone();
7320                    let fut = async move {
7321                        let method = GenerateCampaignBodyDraftSvc(inner);
7322                        let codec = tonic_prost::ProstCodec::default();
7323                        let mut grpc = tonic::server::Grpc::new(codec)
7324                            .apply_compression_config(
7325                                accept_compression_encodings,
7326                                send_compression_encodings,
7327                            )
7328                            .apply_max_message_size_config(
7329                                max_decoding_message_size,
7330                                max_encoding_message_size,
7331                            );
7332                        let res = grpc.unary(method, req).await;
7333                        Ok(res)
7334                    };
7335                    Box::pin(fut)
7336                }
7337                _ => {
7338                    Box::pin(async move {
7339                        let mut response = http::Response::new(
7340                            tonic::body::Body::default(),
7341                        );
7342                        let headers = response.headers_mut();
7343                        headers
7344                            .insert(
7345                                tonic::Status::GRPC_STATUS,
7346                                (tonic::Code::Unimplemented as i32).into(),
7347                            );
7348                        headers
7349                            .insert(
7350                                http::header::CONTENT_TYPE,
7351                                tonic::metadata::GRPC_CONTENT_TYPE,
7352                            );
7353                        Ok(response)
7354                    })
7355                }
7356            }
7357        }
7358    }
7359    impl<T> Clone for InsightsServiceServer<T> {
7360        fn clone(&self) -> Self {
7361            let inner = self.inner.clone();
7362            Self {
7363                inner,
7364                accept_compression_encodings: self.accept_compression_encodings,
7365                send_compression_encodings: self.send_compression_encodings,
7366                max_decoding_message_size: self.max_decoding_message_size,
7367                max_encoding_message_size: self.max_encoding_message_size,
7368            }
7369        }
7370    }
7371    /// Generated gRPC service name
7372    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7373    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7374        const NAME: &'static str = SERVICE_NAME;
7375    }
7376}
7377/// Generated client implementations.
7378pub mod integrations_service_client {
7379    #![allow(
7380        unused_variables,
7381        dead_code,
7382        missing_docs,
7383        clippy::wildcard_imports,
7384        clippy::let_unit_value,
7385    )]
7386    use tonic::codegen::*;
7387    use tonic::codegen::http::Uri;
7388    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
7389
7390 Auth model:
7391   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
7392     on behalf of pidgr-api dispatch activities. Never exposed publicly.
7393   - UpsertReachability / RemoveReachability / GetReachability /
7394     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
7395     caller's `custom:org_id` claim).
7396   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
7397     SetCostCapPolicy: Cognito JWT (admin only, org-scoped).
7398
7399 Cross-org access is denied with `permission_denied`.
7400*/
7401    #[derive(Debug, Clone)]
7402    pub struct IntegrationsServiceClient<T> {
7403        inner: tonic::client::Grpc<T>,
7404    }
7405    impl IntegrationsServiceClient<tonic::transport::Channel> {
7406        /// Attempt to create a new client by connecting to a given endpoint.
7407        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7408        where
7409            D: TryInto<tonic::transport::Endpoint>,
7410            D::Error: Into<StdError>,
7411        {
7412            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7413            Ok(Self::new(conn))
7414        }
7415    }
7416    impl<T> IntegrationsServiceClient<T>
7417    where
7418        T: tonic::client::GrpcService<tonic::body::Body>,
7419        T::Error: Into<StdError>,
7420        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7421        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7422    {
7423        pub fn new(inner: T) -> Self {
7424            let inner = tonic::client::Grpc::new(inner);
7425            Self { inner }
7426        }
7427        pub fn with_origin(inner: T, origin: Uri) -> Self {
7428            let inner = tonic::client::Grpc::with_origin(inner, origin);
7429            Self { inner }
7430        }
7431        pub fn with_interceptor<F>(
7432            inner: T,
7433            interceptor: F,
7434        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
7435        where
7436            F: tonic::service::Interceptor,
7437            T::ResponseBody: Default,
7438            T: tonic::codegen::Service<
7439                http::Request<tonic::body::Body>,
7440                Response = http::Response<
7441                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7442                >,
7443            >,
7444            <T as tonic::codegen::Service<
7445                http::Request<tonic::body::Body>,
7446            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7447        {
7448            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
7449        }
7450        /// Compress requests with the given encoding.
7451        ///
7452        /// This requires the server to support it otherwise it might respond with an
7453        /// error.
7454        #[must_use]
7455        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7456            self.inner = self.inner.send_compressed(encoding);
7457            self
7458        }
7459        /// Enable decompressing responses.
7460        #[must_use]
7461        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7462            self.inner = self.inner.accept_compressed(encoding);
7463            self
7464        }
7465        /// Limits the maximum size of a decoded message.
7466        ///
7467        /// Default: `4MB`
7468        #[must_use]
7469        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7470            self.inner = self.inner.max_decoding_message_size(limit);
7471            self
7472        }
7473        /// Limits the maximum size of an encoded message.
7474        ///
7475        /// Default: `usize::MAX`
7476        #[must_use]
7477        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7478            self.inner = self.inner.max_encoding_message_size(limit);
7479            self
7480        }
7481        /** Dispatch a single rendered message to one channel. Idempotent on
7482 `dispatch_id`. Internal-mTLS only.
7483*/
7484        pub async fn dispatch_to_channel(
7485            &mut self,
7486            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
7487        ) -> std::result::Result<
7488            tonic::Response<super::DispatchToChannelResponse>,
7489            tonic::Status,
7490        > {
7491            self.inner
7492                .ready()
7493                .await
7494                .map_err(|e| {
7495                    tonic::Status::unknown(
7496                        format!("Service was not ready: {}", e.into()),
7497                    )
7498                })?;
7499            let codec = tonic_prost::ProstCodec::default();
7500            let path = http::uri::PathAndQuery::from_static(
7501                "/pidgr.v1.IntegrationsService/DispatchToChannel",
7502            );
7503            let mut req = request.into_request();
7504            req.extensions_mut()
7505                .insert(
7506                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
7507                );
7508            self.inner.unary(req, path, codec).await
7509        }
7510        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
7511 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
7512 audit row BEFORE the registry commit.
7513*/
7514        pub async fn upsert_reachability(
7515            &mut self,
7516            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
7517        ) -> std::result::Result<
7518            tonic::Response<super::UpsertReachabilityResponse>,
7519            tonic::Status,
7520        > {
7521            self.inner
7522                .ready()
7523                .await
7524                .map_err(|e| {
7525                    tonic::Status::unknown(
7526                        format!("Service was not ready: {}", e.into()),
7527                    )
7528                })?;
7529            let codec = tonic_prost::ProstCodec::default();
7530            let path = http::uri::PathAndQuery::from_static(
7531                "/pidgr.v1.IntegrationsService/UpsertReachability",
7532            );
7533            let mut req = request.into_request();
7534            req.extensions_mut()
7535                .insert(
7536                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
7537                );
7538            self.inner.unary(req, path, codec).await
7539        }
7540        /** Remove a reachability identifier. Idempotent. Emits a
7541 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
7542*/
7543        pub async fn remove_reachability(
7544            &mut self,
7545            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
7546        ) -> std::result::Result<
7547            tonic::Response<super::RemoveReachabilityResponse>,
7548            tonic::Status,
7549        > {
7550            self.inner
7551                .ready()
7552                .await
7553                .map_err(|e| {
7554                    tonic::Status::unknown(
7555                        format!("Service was not ready: {}", e.into()),
7556                    )
7557                })?;
7558            let codec = tonic_prost::ProstCodec::default();
7559            let path = http::uri::PathAndQuery::from_static(
7560                "/pidgr.v1.IntegrationsService/RemoveReachability",
7561            );
7562            let mut req = request.into_request();
7563            req.extensions_mut()
7564                .insert(
7565                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
7566                );
7567            self.inner.unary(req, path, codec).await
7568        }
7569        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
7570 Does not return plaintext or envelope ciphertext.
7571*/
7572        pub async fn get_reachability(
7573            &mut self,
7574            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
7575        ) -> std::result::Result<
7576            tonic::Response<super::GetReachabilityResponse>,
7577            tonic::Status,
7578        > {
7579            self.inner
7580                .ready()
7581                .await
7582                .map_err(|e| {
7583                    tonic::Status::unknown(
7584                        format!("Service was not ready: {}", e.into()),
7585                    )
7586                })?;
7587            let codec = tonic_prost::ProstCodec::default();
7588            let path = http::uri::PathAndQuery::from_static(
7589                "/pidgr.v1.IntegrationsService/GetReachability",
7590            );
7591            let mut req = request.into_request();
7592            req.extensions_mut()
7593                .insert(
7594                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
7595                );
7596            self.inner.unary(req, path, codec).await
7597        }
7598        /** List per-channel reachability metadata for a single user. Used by the
7599 admin per-user matrix view. Does not return plaintext or ciphertext.
7600*/
7601        pub async fn list_reachability_for_user(
7602            &mut self,
7603            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
7604        ) -> std::result::Result<
7605            tonic::Response<super::ListReachabilityForUserResponse>,
7606            tonic::Status,
7607        > {
7608            self.inner
7609                .ready()
7610                .await
7611                .map_err(|e| {
7612                    tonic::Status::unknown(
7613                        format!("Service was not ready: {}", e.into()),
7614                    )
7615                })?;
7616            let codec = tonic_prost::ProstCodec::default();
7617            let path = http::uri::PathAndQuery::from_static(
7618                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
7619            );
7620            let mut req = request.into_request();
7621            req.extensions_mut()
7622                .insert(
7623                    GrpcMethod::new(
7624                        "pidgr.v1.IntegrationsService",
7625                        "ListReachabilityForUser",
7626                    ),
7627                );
7628            self.inner.unary(req, path, codec).await
7629        }
7630        /** Read the per-(org, channel) region allowlist. Returns an empty list when
7631 no policy is configured — NOT a NOT_FOUND.
7632*/
7633        pub async fn get_region_policy(
7634            &mut self,
7635            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
7636        ) -> std::result::Result<
7637            tonic::Response<super::GetRegionPolicyResponse>,
7638            tonic::Status,
7639        > {
7640            self.inner
7641                .ready()
7642                .await
7643                .map_err(|e| {
7644                    tonic::Status::unknown(
7645                        format!("Service was not ready: {}", e.into()),
7646                    )
7647                })?;
7648            let codec = tonic_prost::ProstCodec::default();
7649            let path = http::uri::PathAndQuery::from_static(
7650                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
7651            );
7652            let mut req = request.into_request();
7653            req.extensions_mut()
7654                .insert(
7655                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
7656                );
7657            self.inner.unary(req, path, codec).await
7658        }
7659        /** Admin-only upsert of the per-(org, channel) region allowlist.
7660*/
7661        pub async fn set_region_policy(
7662            &mut self,
7663            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
7664        ) -> std::result::Result<
7665            tonic::Response<super::SetRegionPolicyResponse>,
7666            tonic::Status,
7667        > {
7668            self.inner
7669                .ready()
7670                .await
7671                .map_err(|e| {
7672                    tonic::Status::unknown(
7673                        format!("Service was not ready: {}", e.into()),
7674                    )
7675                })?;
7676            let codec = tonic_prost::ProstCodec::default();
7677            let path = http::uri::PathAndQuery::from_static(
7678                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
7679            );
7680            let mut req = request.into_request();
7681            req.extensions_mut()
7682                .insert(
7683                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
7684                );
7685            self.inner.unary(req, path, codec).await
7686        }
7687        /** Read the current calendar-month cost-cap state. Returns the channel
7688 default cap when no row exists; never NOT_FOUND.
7689*/
7690        pub async fn get_cost_cap_policy(
7691            &mut self,
7692            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
7693        ) -> std::result::Result<
7694            tonic::Response<super::GetCostCapPolicyResponse>,
7695            tonic::Status,
7696        > {
7697            self.inner
7698                .ready()
7699                .await
7700                .map_err(|e| {
7701                    tonic::Status::unknown(
7702                        format!("Service was not ready: {}", e.into()),
7703                    )
7704                })?;
7705            let codec = tonic_prost::ProstCodec::default();
7706            let path = http::uri::PathAndQuery::from_static(
7707                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
7708            );
7709            let mut req = request.into_request();
7710            req.extensions_mut()
7711                .insert(
7712                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
7713                );
7714            self.inner.unary(req, path, codec).await
7715        }
7716        /** Admin-only upsert of the current calendar-month cost cap.
7717*/
7718        pub async fn set_cost_cap_policy(
7719            &mut self,
7720            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
7721        ) -> std::result::Result<
7722            tonic::Response<super::SetCostCapPolicyResponse>,
7723            tonic::Status,
7724        > {
7725            self.inner
7726                .ready()
7727                .await
7728                .map_err(|e| {
7729                    tonic::Status::unknown(
7730                        format!("Service was not ready: {}", e.into()),
7731                    )
7732                })?;
7733            let codec = tonic_prost::ProstCodec::default();
7734            let path = http::uri::PathAndQuery::from_static(
7735                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
7736            );
7737            let mut req = request.into_request();
7738            req.extensions_mut()
7739                .insert(
7740                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
7741                );
7742            self.inner.unary(req, path, codec).await
7743        }
7744    }
7745}
7746/// Generated server implementations.
7747pub mod integrations_service_server {
7748    #![allow(
7749        unused_variables,
7750        dead_code,
7751        missing_docs,
7752        clippy::wildcard_imports,
7753        clippy::let_unit_value,
7754    )]
7755    use tonic::codegen::*;
7756    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
7757    #[async_trait]
7758    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
7759        /** Dispatch a single rendered message to one channel. Idempotent on
7760 `dispatch_id`. Internal-mTLS only.
7761*/
7762        async fn dispatch_to_channel(
7763            &self,
7764            request: tonic::Request<super::DispatchToChannelRequest>,
7765        ) -> std::result::Result<
7766            tonic::Response<super::DispatchToChannelResponse>,
7767            tonic::Status,
7768        >;
7769        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
7770 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
7771 audit row BEFORE the registry commit.
7772*/
7773        async fn upsert_reachability(
7774            &self,
7775            request: tonic::Request<super::UpsertReachabilityRequest>,
7776        ) -> std::result::Result<
7777            tonic::Response<super::UpsertReachabilityResponse>,
7778            tonic::Status,
7779        >;
7780        /** Remove a reachability identifier. Idempotent. Emits a
7781 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
7782*/
7783        async fn remove_reachability(
7784            &self,
7785            request: tonic::Request<super::RemoveReachabilityRequest>,
7786        ) -> std::result::Result<
7787            tonic::Response<super::RemoveReachabilityResponse>,
7788            tonic::Status,
7789        >;
7790        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
7791 Does not return plaintext or envelope ciphertext.
7792*/
7793        async fn get_reachability(
7794            &self,
7795            request: tonic::Request<super::GetReachabilityRequest>,
7796        ) -> std::result::Result<
7797            tonic::Response<super::GetReachabilityResponse>,
7798            tonic::Status,
7799        >;
7800        /** List per-channel reachability metadata for a single user. Used by the
7801 admin per-user matrix view. Does not return plaintext or ciphertext.
7802*/
7803        async fn list_reachability_for_user(
7804            &self,
7805            request: tonic::Request<super::ListReachabilityForUserRequest>,
7806        ) -> std::result::Result<
7807            tonic::Response<super::ListReachabilityForUserResponse>,
7808            tonic::Status,
7809        >;
7810        /** Read the per-(org, channel) region allowlist. Returns an empty list when
7811 no policy is configured — NOT a NOT_FOUND.
7812*/
7813        async fn get_region_policy(
7814            &self,
7815            request: tonic::Request<super::GetRegionPolicyRequest>,
7816        ) -> std::result::Result<
7817            tonic::Response<super::GetRegionPolicyResponse>,
7818            tonic::Status,
7819        >;
7820        /** Admin-only upsert of the per-(org, channel) region allowlist.
7821*/
7822        async fn set_region_policy(
7823            &self,
7824            request: tonic::Request<super::SetRegionPolicyRequest>,
7825        ) -> std::result::Result<
7826            tonic::Response<super::SetRegionPolicyResponse>,
7827            tonic::Status,
7828        >;
7829        /** Read the current calendar-month cost-cap state. Returns the channel
7830 default cap when no row exists; never NOT_FOUND.
7831*/
7832        async fn get_cost_cap_policy(
7833            &self,
7834            request: tonic::Request<super::GetCostCapPolicyRequest>,
7835        ) -> std::result::Result<
7836            tonic::Response<super::GetCostCapPolicyResponse>,
7837            tonic::Status,
7838        >;
7839        /** Admin-only upsert of the current calendar-month cost cap.
7840*/
7841        async fn set_cost_cap_policy(
7842            &self,
7843            request: tonic::Request<super::SetCostCapPolicyRequest>,
7844        ) -> std::result::Result<
7845            tonic::Response<super::SetCostCapPolicyResponse>,
7846            tonic::Status,
7847        >;
7848    }
7849    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
7850
7851 Auth model:
7852   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
7853     on behalf of pidgr-api dispatch activities. Never exposed publicly.
7854   - UpsertReachability / RemoveReachability / GetReachability /
7855     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
7856     caller's `custom:org_id` claim).
7857   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
7858     SetCostCapPolicy: Cognito JWT (admin only, org-scoped).
7859
7860 Cross-org access is denied with `permission_denied`.
7861*/
7862    #[derive(Debug)]
7863    pub struct IntegrationsServiceServer<T> {
7864        inner: Arc<T>,
7865        accept_compression_encodings: EnabledCompressionEncodings,
7866        send_compression_encodings: EnabledCompressionEncodings,
7867        max_decoding_message_size: Option<usize>,
7868        max_encoding_message_size: Option<usize>,
7869    }
7870    impl<T> IntegrationsServiceServer<T> {
7871        pub fn new(inner: T) -> Self {
7872            Self::from_arc(Arc::new(inner))
7873        }
7874        pub fn from_arc(inner: Arc<T>) -> Self {
7875            Self {
7876                inner,
7877                accept_compression_encodings: Default::default(),
7878                send_compression_encodings: Default::default(),
7879                max_decoding_message_size: None,
7880                max_encoding_message_size: None,
7881            }
7882        }
7883        pub fn with_interceptor<F>(
7884            inner: T,
7885            interceptor: F,
7886        ) -> InterceptedService<Self, F>
7887        where
7888            F: tonic::service::Interceptor,
7889        {
7890            InterceptedService::new(Self::new(inner), interceptor)
7891        }
7892        /// Enable decompressing requests with the given encoding.
7893        #[must_use]
7894        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7895            self.accept_compression_encodings.enable(encoding);
7896            self
7897        }
7898        /// Compress responses with the given encoding, if the client supports it.
7899        #[must_use]
7900        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7901            self.send_compression_encodings.enable(encoding);
7902            self
7903        }
7904        /// Limits the maximum size of a decoded message.
7905        ///
7906        /// Default: `4MB`
7907        #[must_use]
7908        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7909            self.max_decoding_message_size = Some(limit);
7910            self
7911        }
7912        /// Limits the maximum size of an encoded message.
7913        ///
7914        /// Default: `usize::MAX`
7915        #[must_use]
7916        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7917            self.max_encoding_message_size = Some(limit);
7918            self
7919        }
7920    }
7921    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
7922    where
7923        T: IntegrationsService,
7924        B: Body + std::marker::Send + 'static,
7925        B::Error: Into<StdError> + std::marker::Send + 'static,
7926    {
7927        type Response = http::Response<tonic::body::Body>;
7928        type Error = std::convert::Infallible;
7929        type Future = BoxFuture<Self::Response, Self::Error>;
7930        fn poll_ready(
7931            &mut self,
7932            _cx: &mut Context<'_>,
7933        ) -> Poll<std::result::Result<(), Self::Error>> {
7934            Poll::Ready(Ok(()))
7935        }
7936        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7937            match req.uri().path() {
7938                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
7939                    #[allow(non_camel_case_types)]
7940                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
7941                    impl<
7942                        T: IntegrationsService,
7943                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
7944                    for DispatchToChannelSvc<T> {
7945                        type Response = super::DispatchToChannelResponse;
7946                        type Future = BoxFuture<
7947                            tonic::Response<Self::Response>,
7948                            tonic::Status,
7949                        >;
7950                        fn call(
7951                            &mut self,
7952                            request: tonic::Request<super::DispatchToChannelRequest>,
7953                        ) -> Self::Future {
7954                            let inner = Arc::clone(&self.0);
7955                            let fut = async move {
7956                                <T as IntegrationsService>::dispatch_to_channel(
7957                                        &inner,
7958                                        request,
7959                                    )
7960                                    .await
7961                            };
7962                            Box::pin(fut)
7963                        }
7964                    }
7965                    let accept_compression_encodings = self.accept_compression_encodings;
7966                    let send_compression_encodings = self.send_compression_encodings;
7967                    let max_decoding_message_size = self.max_decoding_message_size;
7968                    let max_encoding_message_size = self.max_encoding_message_size;
7969                    let inner = self.inner.clone();
7970                    let fut = async move {
7971                        let method = DispatchToChannelSvc(inner);
7972                        let codec = tonic_prost::ProstCodec::default();
7973                        let mut grpc = tonic::server::Grpc::new(codec)
7974                            .apply_compression_config(
7975                                accept_compression_encodings,
7976                                send_compression_encodings,
7977                            )
7978                            .apply_max_message_size_config(
7979                                max_decoding_message_size,
7980                                max_encoding_message_size,
7981                            );
7982                        let res = grpc.unary(method, req).await;
7983                        Ok(res)
7984                    };
7985                    Box::pin(fut)
7986                }
7987                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
7988                    #[allow(non_camel_case_types)]
7989                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
7990                    impl<
7991                        T: IntegrationsService,
7992                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
7993                    for UpsertReachabilitySvc<T> {
7994                        type Response = super::UpsertReachabilityResponse;
7995                        type Future = BoxFuture<
7996                            tonic::Response<Self::Response>,
7997                            tonic::Status,
7998                        >;
7999                        fn call(
8000                            &mut self,
8001                            request: tonic::Request<super::UpsertReachabilityRequest>,
8002                        ) -> Self::Future {
8003                            let inner = Arc::clone(&self.0);
8004                            let fut = async move {
8005                                <T as IntegrationsService>::upsert_reachability(
8006                                        &inner,
8007                                        request,
8008                                    )
8009                                    .await
8010                            };
8011                            Box::pin(fut)
8012                        }
8013                    }
8014                    let accept_compression_encodings = self.accept_compression_encodings;
8015                    let send_compression_encodings = self.send_compression_encodings;
8016                    let max_decoding_message_size = self.max_decoding_message_size;
8017                    let max_encoding_message_size = self.max_encoding_message_size;
8018                    let inner = self.inner.clone();
8019                    let fut = async move {
8020                        let method = UpsertReachabilitySvc(inner);
8021                        let codec = tonic_prost::ProstCodec::default();
8022                        let mut grpc = tonic::server::Grpc::new(codec)
8023                            .apply_compression_config(
8024                                accept_compression_encodings,
8025                                send_compression_encodings,
8026                            )
8027                            .apply_max_message_size_config(
8028                                max_decoding_message_size,
8029                                max_encoding_message_size,
8030                            );
8031                        let res = grpc.unary(method, req).await;
8032                        Ok(res)
8033                    };
8034                    Box::pin(fut)
8035                }
8036                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8037                    #[allow(non_camel_case_types)]
8038                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8039                    impl<
8040                        T: IntegrationsService,
8041                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8042                    for RemoveReachabilitySvc<T> {
8043                        type Response = super::RemoveReachabilityResponse;
8044                        type Future = BoxFuture<
8045                            tonic::Response<Self::Response>,
8046                            tonic::Status,
8047                        >;
8048                        fn call(
8049                            &mut self,
8050                            request: tonic::Request<super::RemoveReachabilityRequest>,
8051                        ) -> Self::Future {
8052                            let inner = Arc::clone(&self.0);
8053                            let fut = async move {
8054                                <T as IntegrationsService>::remove_reachability(
8055                                        &inner,
8056                                        request,
8057                                    )
8058                                    .await
8059                            };
8060                            Box::pin(fut)
8061                        }
8062                    }
8063                    let accept_compression_encodings = self.accept_compression_encodings;
8064                    let send_compression_encodings = self.send_compression_encodings;
8065                    let max_decoding_message_size = self.max_decoding_message_size;
8066                    let max_encoding_message_size = self.max_encoding_message_size;
8067                    let inner = self.inner.clone();
8068                    let fut = async move {
8069                        let method = RemoveReachabilitySvc(inner);
8070                        let codec = tonic_prost::ProstCodec::default();
8071                        let mut grpc = tonic::server::Grpc::new(codec)
8072                            .apply_compression_config(
8073                                accept_compression_encodings,
8074                                send_compression_encodings,
8075                            )
8076                            .apply_max_message_size_config(
8077                                max_decoding_message_size,
8078                                max_encoding_message_size,
8079                            );
8080                        let res = grpc.unary(method, req).await;
8081                        Ok(res)
8082                    };
8083                    Box::pin(fut)
8084                }
8085                "/pidgr.v1.IntegrationsService/GetReachability" => {
8086                    #[allow(non_camel_case_types)]
8087                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8088                    impl<
8089                        T: IntegrationsService,
8090                    > tonic::server::UnaryService<super::GetReachabilityRequest>
8091                    for GetReachabilitySvc<T> {
8092                        type Response = super::GetReachabilityResponse;
8093                        type Future = BoxFuture<
8094                            tonic::Response<Self::Response>,
8095                            tonic::Status,
8096                        >;
8097                        fn call(
8098                            &mut self,
8099                            request: tonic::Request<super::GetReachabilityRequest>,
8100                        ) -> Self::Future {
8101                            let inner = Arc::clone(&self.0);
8102                            let fut = async move {
8103                                <T as IntegrationsService>::get_reachability(
8104                                        &inner,
8105                                        request,
8106                                    )
8107                                    .await
8108                            };
8109                            Box::pin(fut)
8110                        }
8111                    }
8112                    let accept_compression_encodings = self.accept_compression_encodings;
8113                    let send_compression_encodings = self.send_compression_encodings;
8114                    let max_decoding_message_size = self.max_decoding_message_size;
8115                    let max_encoding_message_size = self.max_encoding_message_size;
8116                    let inner = self.inner.clone();
8117                    let fut = async move {
8118                        let method = GetReachabilitySvc(inner);
8119                        let codec = tonic_prost::ProstCodec::default();
8120                        let mut grpc = tonic::server::Grpc::new(codec)
8121                            .apply_compression_config(
8122                                accept_compression_encodings,
8123                                send_compression_encodings,
8124                            )
8125                            .apply_max_message_size_config(
8126                                max_decoding_message_size,
8127                                max_encoding_message_size,
8128                            );
8129                        let res = grpc.unary(method, req).await;
8130                        Ok(res)
8131                    };
8132                    Box::pin(fut)
8133                }
8134                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8135                    #[allow(non_camel_case_types)]
8136                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
8137                        pub Arc<T>,
8138                    );
8139                    impl<
8140                        T: IntegrationsService,
8141                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8142                    for ListReachabilityForUserSvc<T> {
8143                        type Response = super::ListReachabilityForUserResponse;
8144                        type Future = BoxFuture<
8145                            tonic::Response<Self::Response>,
8146                            tonic::Status,
8147                        >;
8148                        fn call(
8149                            &mut self,
8150                            request: tonic::Request<
8151                                super::ListReachabilityForUserRequest,
8152                            >,
8153                        ) -> Self::Future {
8154                            let inner = Arc::clone(&self.0);
8155                            let fut = async move {
8156                                <T as IntegrationsService>::list_reachability_for_user(
8157                                        &inner,
8158                                        request,
8159                                    )
8160                                    .await
8161                            };
8162                            Box::pin(fut)
8163                        }
8164                    }
8165                    let accept_compression_encodings = self.accept_compression_encodings;
8166                    let send_compression_encodings = self.send_compression_encodings;
8167                    let max_decoding_message_size = self.max_decoding_message_size;
8168                    let max_encoding_message_size = self.max_encoding_message_size;
8169                    let inner = self.inner.clone();
8170                    let fut = async move {
8171                        let method = ListReachabilityForUserSvc(inner);
8172                        let codec = tonic_prost::ProstCodec::default();
8173                        let mut grpc = tonic::server::Grpc::new(codec)
8174                            .apply_compression_config(
8175                                accept_compression_encodings,
8176                                send_compression_encodings,
8177                            )
8178                            .apply_max_message_size_config(
8179                                max_decoding_message_size,
8180                                max_encoding_message_size,
8181                            );
8182                        let res = grpc.unary(method, req).await;
8183                        Ok(res)
8184                    };
8185                    Box::pin(fut)
8186                }
8187                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
8188                    #[allow(non_camel_case_types)]
8189                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8190                    impl<
8191                        T: IntegrationsService,
8192                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
8193                    for GetRegionPolicySvc<T> {
8194                        type Response = super::GetRegionPolicyResponse;
8195                        type Future = BoxFuture<
8196                            tonic::Response<Self::Response>,
8197                            tonic::Status,
8198                        >;
8199                        fn call(
8200                            &mut self,
8201                            request: tonic::Request<super::GetRegionPolicyRequest>,
8202                        ) -> Self::Future {
8203                            let inner = Arc::clone(&self.0);
8204                            let fut = async move {
8205                                <T as IntegrationsService>::get_region_policy(
8206                                        &inner,
8207                                        request,
8208                                    )
8209                                    .await
8210                            };
8211                            Box::pin(fut)
8212                        }
8213                    }
8214                    let accept_compression_encodings = self.accept_compression_encodings;
8215                    let send_compression_encodings = self.send_compression_encodings;
8216                    let max_decoding_message_size = self.max_decoding_message_size;
8217                    let max_encoding_message_size = self.max_encoding_message_size;
8218                    let inner = self.inner.clone();
8219                    let fut = async move {
8220                        let method = GetRegionPolicySvc(inner);
8221                        let codec = tonic_prost::ProstCodec::default();
8222                        let mut grpc = tonic::server::Grpc::new(codec)
8223                            .apply_compression_config(
8224                                accept_compression_encodings,
8225                                send_compression_encodings,
8226                            )
8227                            .apply_max_message_size_config(
8228                                max_decoding_message_size,
8229                                max_encoding_message_size,
8230                            );
8231                        let res = grpc.unary(method, req).await;
8232                        Ok(res)
8233                    };
8234                    Box::pin(fut)
8235                }
8236                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
8237                    #[allow(non_camel_case_types)]
8238                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8239                    impl<
8240                        T: IntegrationsService,
8241                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
8242                    for SetRegionPolicySvc<T> {
8243                        type Response = super::SetRegionPolicyResponse;
8244                        type Future = BoxFuture<
8245                            tonic::Response<Self::Response>,
8246                            tonic::Status,
8247                        >;
8248                        fn call(
8249                            &mut self,
8250                            request: tonic::Request<super::SetRegionPolicyRequest>,
8251                        ) -> Self::Future {
8252                            let inner = Arc::clone(&self.0);
8253                            let fut = async move {
8254                                <T as IntegrationsService>::set_region_policy(
8255                                        &inner,
8256                                        request,
8257                                    )
8258                                    .await
8259                            };
8260                            Box::pin(fut)
8261                        }
8262                    }
8263                    let accept_compression_encodings = self.accept_compression_encodings;
8264                    let send_compression_encodings = self.send_compression_encodings;
8265                    let max_decoding_message_size = self.max_decoding_message_size;
8266                    let max_encoding_message_size = self.max_encoding_message_size;
8267                    let inner = self.inner.clone();
8268                    let fut = async move {
8269                        let method = SetRegionPolicySvc(inner);
8270                        let codec = tonic_prost::ProstCodec::default();
8271                        let mut grpc = tonic::server::Grpc::new(codec)
8272                            .apply_compression_config(
8273                                accept_compression_encodings,
8274                                send_compression_encodings,
8275                            )
8276                            .apply_max_message_size_config(
8277                                max_decoding_message_size,
8278                                max_encoding_message_size,
8279                            );
8280                        let res = grpc.unary(method, req).await;
8281                        Ok(res)
8282                    };
8283                    Box::pin(fut)
8284                }
8285                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
8286                    #[allow(non_camel_case_types)]
8287                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8288                    impl<
8289                        T: IntegrationsService,
8290                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
8291                    for GetCostCapPolicySvc<T> {
8292                        type Response = super::GetCostCapPolicyResponse;
8293                        type Future = BoxFuture<
8294                            tonic::Response<Self::Response>,
8295                            tonic::Status,
8296                        >;
8297                        fn call(
8298                            &mut self,
8299                            request: tonic::Request<super::GetCostCapPolicyRequest>,
8300                        ) -> Self::Future {
8301                            let inner = Arc::clone(&self.0);
8302                            let fut = async move {
8303                                <T as IntegrationsService>::get_cost_cap_policy(
8304                                        &inner,
8305                                        request,
8306                                    )
8307                                    .await
8308                            };
8309                            Box::pin(fut)
8310                        }
8311                    }
8312                    let accept_compression_encodings = self.accept_compression_encodings;
8313                    let send_compression_encodings = self.send_compression_encodings;
8314                    let max_decoding_message_size = self.max_decoding_message_size;
8315                    let max_encoding_message_size = self.max_encoding_message_size;
8316                    let inner = self.inner.clone();
8317                    let fut = async move {
8318                        let method = GetCostCapPolicySvc(inner);
8319                        let codec = tonic_prost::ProstCodec::default();
8320                        let mut grpc = tonic::server::Grpc::new(codec)
8321                            .apply_compression_config(
8322                                accept_compression_encodings,
8323                                send_compression_encodings,
8324                            )
8325                            .apply_max_message_size_config(
8326                                max_decoding_message_size,
8327                                max_encoding_message_size,
8328                            );
8329                        let res = grpc.unary(method, req).await;
8330                        Ok(res)
8331                    };
8332                    Box::pin(fut)
8333                }
8334                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
8335                    #[allow(non_camel_case_types)]
8336                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8337                    impl<
8338                        T: IntegrationsService,
8339                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
8340                    for SetCostCapPolicySvc<T> {
8341                        type Response = super::SetCostCapPolicyResponse;
8342                        type Future = BoxFuture<
8343                            tonic::Response<Self::Response>,
8344                            tonic::Status,
8345                        >;
8346                        fn call(
8347                            &mut self,
8348                            request: tonic::Request<super::SetCostCapPolicyRequest>,
8349                        ) -> Self::Future {
8350                            let inner = Arc::clone(&self.0);
8351                            let fut = async move {
8352                                <T as IntegrationsService>::set_cost_cap_policy(
8353                                        &inner,
8354                                        request,
8355                                    )
8356                                    .await
8357                            };
8358                            Box::pin(fut)
8359                        }
8360                    }
8361                    let accept_compression_encodings = self.accept_compression_encodings;
8362                    let send_compression_encodings = self.send_compression_encodings;
8363                    let max_decoding_message_size = self.max_decoding_message_size;
8364                    let max_encoding_message_size = self.max_encoding_message_size;
8365                    let inner = self.inner.clone();
8366                    let fut = async move {
8367                        let method = SetCostCapPolicySvc(inner);
8368                        let codec = tonic_prost::ProstCodec::default();
8369                        let mut grpc = tonic::server::Grpc::new(codec)
8370                            .apply_compression_config(
8371                                accept_compression_encodings,
8372                                send_compression_encodings,
8373                            )
8374                            .apply_max_message_size_config(
8375                                max_decoding_message_size,
8376                                max_encoding_message_size,
8377                            );
8378                        let res = grpc.unary(method, req).await;
8379                        Ok(res)
8380                    };
8381                    Box::pin(fut)
8382                }
8383                _ => {
8384                    Box::pin(async move {
8385                        let mut response = http::Response::new(
8386                            tonic::body::Body::default(),
8387                        );
8388                        let headers = response.headers_mut();
8389                        headers
8390                            .insert(
8391                                tonic::Status::GRPC_STATUS,
8392                                (tonic::Code::Unimplemented as i32).into(),
8393                            );
8394                        headers
8395                            .insert(
8396                                http::header::CONTENT_TYPE,
8397                                tonic::metadata::GRPC_CONTENT_TYPE,
8398                            );
8399                        Ok(response)
8400                    })
8401                }
8402            }
8403        }
8404    }
8405    impl<T> Clone for IntegrationsServiceServer<T> {
8406        fn clone(&self) -> Self {
8407            let inner = self.inner.clone();
8408            Self {
8409                inner,
8410                accept_compression_encodings: self.accept_compression_encodings,
8411                send_compression_encodings: self.send_compression_encodings,
8412                max_decoding_message_size: self.max_decoding_message_size,
8413                max_encoding_message_size: self.max_encoding_message_size,
8414            }
8415        }
8416    }
8417    /// Generated gRPC service name
8418    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
8419    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
8420        const NAME: &'static str = SERVICE_NAME;
8421    }
8422}
8423/// Generated client implementations.
8424pub mod invite_link_service_client {
8425    #![allow(
8426        unused_variables,
8427        dead_code,
8428        missing_docs,
8429        clippy::wildcard_imports,
8430        clippy::let_unit_value,
8431    )]
8432    use tonic::codegen::*;
8433    use tonic::codegen::http::Uri;
8434    /** Manages shareable invite links for organization self-join.
8435 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
8436 ValidateInviteLink is unauthenticated — the token IS the authorization.
8437 RedeemInviteLink requires a valid JWT.
8438*/
8439    #[derive(Debug, Clone)]
8440    pub struct InviteLinkServiceClient<T> {
8441        inner: tonic::client::Grpc<T>,
8442    }
8443    impl InviteLinkServiceClient<tonic::transport::Channel> {
8444        /// Attempt to create a new client by connecting to a given endpoint.
8445        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8446        where
8447            D: TryInto<tonic::transport::Endpoint>,
8448            D::Error: Into<StdError>,
8449        {
8450            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8451            Ok(Self::new(conn))
8452        }
8453    }
8454    impl<T> InviteLinkServiceClient<T>
8455    where
8456        T: tonic::client::GrpcService<tonic::body::Body>,
8457        T::Error: Into<StdError>,
8458        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8459        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8460    {
8461        pub fn new(inner: T) -> Self {
8462            let inner = tonic::client::Grpc::new(inner);
8463            Self { inner }
8464        }
8465        pub fn with_origin(inner: T, origin: Uri) -> Self {
8466            let inner = tonic::client::Grpc::with_origin(inner, origin);
8467            Self { inner }
8468        }
8469        pub fn with_interceptor<F>(
8470            inner: T,
8471            interceptor: F,
8472        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
8473        where
8474            F: tonic::service::Interceptor,
8475            T::ResponseBody: Default,
8476            T: tonic::codegen::Service<
8477                http::Request<tonic::body::Body>,
8478                Response = http::Response<
8479                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8480                >,
8481            >,
8482            <T as tonic::codegen::Service<
8483                http::Request<tonic::body::Body>,
8484            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8485        {
8486            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
8487        }
8488        /// Compress requests with the given encoding.
8489        ///
8490        /// This requires the server to support it otherwise it might respond with an
8491        /// error.
8492        #[must_use]
8493        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8494            self.inner = self.inner.send_compressed(encoding);
8495            self
8496        }
8497        /// Enable decompressing responses.
8498        #[must_use]
8499        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8500            self.inner = self.inner.accept_compressed(encoding);
8501            self
8502        }
8503        /// Limits the maximum size of a decoded message.
8504        ///
8505        /// Default: `4MB`
8506        #[must_use]
8507        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8508            self.inner = self.inner.max_decoding_message_size(limit);
8509            self
8510        }
8511        /// Limits the maximum size of an encoded message.
8512        ///
8513        /// Default: `usize::MAX`
8514        #[must_use]
8515        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8516            self.inner = self.inner.max_encoding_message_size(limit);
8517            self
8518        }
8519        /** Create a new shareable invite link for the organization.
8520 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8521*/
8522        pub async fn create_invite_link(
8523            &mut self,
8524            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
8525        ) -> std::result::Result<
8526            tonic::Response<super::CreateInviteLinkResponse>,
8527            tonic::Status,
8528        > {
8529            self.inner
8530                .ready()
8531                .await
8532                .map_err(|e| {
8533                    tonic::Status::unknown(
8534                        format!("Service was not ready: {}", e.into()),
8535                    )
8536                })?;
8537            let codec = tonic_prost::ProstCodec::default();
8538            let path = http::uri::PathAndQuery::from_static(
8539                "/pidgr.v1.InviteLinkService/CreateInviteLink",
8540            );
8541            let mut req = request.into_request();
8542            req.extensions_mut()
8543                .insert(
8544                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
8545                );
8546            self.inner.unary(req, path, codec).await
8547        }
8548        /** List all invite links for the organization.
8549 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8550*/
8551        pub async fn list_invite_links(
8552            &mut self,
8553            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
8554        ) -> std::result::Result<
8555            tonic::Response<super::ListInviteLinksResponse>,
8556            tonic::Status,
8557        > {
8558            self.inner
8559                .ready()
8560                .await
8561                .map_err(|e| {
8562                    tonic::Status::unknown(
8563                        format!("Service was not ready: {}", e.into()),
8564                    )
8565                })?;
8566            let codec = tonic_prost::ProstCodec::default();
8567            let path = http::uri::PathAndQuery::from_static(
8568                "/pidgr.v1.InviteLinkService/ListInviteLinks",
8569            );
8570            let mut req = request.into_request();
8571            req.extensions_mut()
8572                .insert(
8573                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
8574                );
8575            self.inner.unary(req, path, codec).await
8576        }
8577        /** Revoke an invite link, making it immediately unusable. Idempotent.
8578 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8579*/
8580        pub async fn revoke_invite_link(
8581            &mut self,
8582            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
8583        ) -> std::result::Result<
8584            tonic::Response<super::RevokeInviteLinkResponse>,
8585            tonic::Status,
8586        > {
8587            self.inner
8588                .ready()
8589                .await
8590                .map_err(|e| {
8591                    tonic::Status::unknown(
8592                        format!("Service was not ready: {}", e.into()),
8593                    )
8594                })?;
8595            let codec = tonic_prost::ProstCodec::default();
8596            let path = http::uri::PathAndQuery::from_static(
8597                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
8598            );
8599            let mut req = request.into_request();
8600            req.extensions_mut()
8601                .insert(
8602                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
8603                );
8604            self.inner.unary(req, path, codec).await
8605        }
8606        /** Validate an invite link and provision a user account if needed.
8607 This is a pre-authentication endpoint — no JWT required.
8608 Rate limited to 10 requests per minute per IP.
8609 Authorization: None (token-based).
8610*/
8611        pub async fn validate_invite_link(
8612            &mut self,
8613            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
8614        ) -> std::result::Result<
8615            tonic::Response<super::ValidateInviteLinkResponse>,
8616            tonic::Status,
8617        > {
8618            self.inner
8619                .ready()
8620                .await
8621                .map_err(|e| {
8622                    tonic::Status::unknown(
8623                        format!("Service was not ready: {}", e.into()),
8624                    )
8625                })?;
8626            let codec = tonic_prost::ProstCodec::default();
8627            let path = http::uri::PathAndQuery::from_static(
8628                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
8629            );
8630            let mut req = request.into_request();
8631            req.extensions_mut()
8632                .insert(
8633                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
8634                );
8635            self.inner.unary(req, path, codec).await
8636        }
8637        /** Redeem an invite link to join an organization.
8638 Requires a valid JWT — the email is extracted from the token.
8639 Authorization: JWT required.
8640*/
8641        pub async fn redeem_invite_link(
8642            &mut self,
8643            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
8644        ) -> std::result::Result<
8645            tonic::Response<super::RedeemInviteLinkResponse>,
8646            tonic::Status,
8647        > {
8648            self.inner
8649                .ready()
8650                .await
8651                .map_err(|e| {
8652                    tonic::Status::unknown(
8653                        format!("Service was not ready: {}", e.into()),
8654                    )
8655                })?;
8656            let codec = tonic_prost::ProstCodec::default();
8657            let path = http::uri::PathAndQuery::from_static(
8658                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
8659            );
8660            let mut req = request.into_request();
8661            req.extensions_mut()
8662                .insert(
8663                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
8664                );
8665            self.inner.unary(req, path, codec).await
8666        }
8667    }
8668}
8669/// Generated server implementations.
8670pub mod invite_link_service_server {
8671    #![allow(
8672        unused_variables,
8673        dead_code,
8674        missing_docs,
8675        clippy::wildcard_imports,
8676        clippy::let_unit_value,
8677    )]
8678    use tonic::codegen::*;
8679    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
8680    #[async_trait]
8681    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
8682        /** Create a new shareable invite link for the organization.
8683 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8684*/
8685        async fn create_invite_link(
8686            &self,
8687            request: tonic::Request<super::CreateInviteLinkRequest>,
8688        ) -> std::result::Result<
8689            tonic::Response<super::CreateInviteLinkResponse>,
8690            tonic::Status,
8691        >;
8692        /** List all invite links for the organization.
8693 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8694*/
8695        async fn list_invite_links(
8696            &self,
8697            request: tonic::Request<super::ListInviteLinksRequest>,
8698        ) -> std::result::Result<
8699            tonic::Response<super::ListInviteLinksResponse>,
8700            tonic::Status,
8701        >;
8702        /** Revoke an invite link, making it immediately unusable. Idempotent.
8703 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8704*/
8705        async fn revoke_invite_link(
8706            &self,
8707            request: tonic::Request<super::RevokeInviteLinkRequest>,
8708        ) -> std::result::Result<
8709            tonic::Response<super::RevokeInviteLinkResponse>,
8710            tonic::Status,
8711        >;
8712        /** Validate an invite link and provision a user account if needed.
8713 This is a pre-authentication endpoint — no JWT required.
8714 Rate limited to 10 requests per minute per IP.
8715 Authorization: None (token-based).
8716*/
8717        async fn validate_invite_link(
8718            &self,
8719            request: tonic::Request<super::ValidateInviteLinkRequest>,
8720        ) -> std::result::Result<
8721            tonic::Response<super::ValidateInviteLinkResponse>,
8722            tonic::Status,
8723        >;
8724        /** Redeem an invite link to join an organization.
8725 Requires a valid JWT — the email is extracted from the token.
8726 Authorization: JWT required.
8727*/
8728        async fn redeem_invite_link(
8729            &self,
8730            request: tonic::Request<super::RedeemInviteLinkRequest>,
8731        ) -> std::result::Result<
8732            tonic::Response<super::RedeemInviteLinkResponse>,
8733            tonic::Status,
8734        >;
8735    }
8736    /** Manages shareable invite links for organization self-join.
8737 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
8738 ValidateInviteLink is unauthenticated — the token IS the authorization.
8739 RedeemInviteLink requires a valid JWT.
8740*/
8741    #[derive(Debug)]
8742    pub struct InviteLinkServiceServer<T> {
8743        inner: Arc<T>,
8744        accept_compression_encodings: EnabledCompressionEncodings,
8745        send_compression_encodings: EnabledCompressionEncodings,
8746        max_decoding_message_size: Option<usize>,
8747        max_encoding_message_size: Option<usize>,
8748    }
8749    impl<T> InviteLinkServiceServer<T> {
8750        pub fn new(inner: T) -> Self {
8751            Self::from_arc(Arc::new(inner))
8752        }
8753        pub fn from_arc(inner: Arc<T>) -> Self {
8754            Self {
8755                inner,
8756                accept_compression_encodings: Default::default(),
8757                send_compression_encodings: Default::default(),
8758                max_decoding_message_size: None,
8759                max_encoding_message_size: None,
8760            }
8761        }
8762        pub fn with_interceptor<F>(
8763            inner: T,
8764            interceptor: F,
8765        ) -> InterceptedService<Self, F>
8766        where
8767            F: tonic::service::Interceptor,
8768        {
8769            InterceptedService::new(Self::new(inner), interceptor)
8770        }
8771        /// Enable decompressing requests with the given encoding.
8772        #[must_use]
8773        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8774            self.accept_compression_encodings.enable(encoding);
8775            self
8776        }
8777        /// Compress responses with the given encoding, if the client supports it.
8778        #[must_use]
8779        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8780            self.send_compression_encodings.enable(encoding);
8781            self
8782        }
8783        /// Limits the maximum size of a decoded message.
8784        ///
8785        /// Default: `4MB`
8786        #[must_use]
8787        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8788            self.max_decoding_message_size = Some(limit);
8789            self
8790        }
8791        /// Limits the maximum size of an encoded message.
8792        ///
8793        /// Default: `usize::MAX`
8794        #[must_use]
8795        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8796            self.max_encoding_message_size = Some(limit);
8797            self
8798        }
8799    }
8800    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
8801    where
8802        T: InviteLinkService,
8803        B: Body + std::marker::Send + 'static,
8804        B::Error: Into<StdError> + std::marker::Send + 'static,
8805    {
8806        type Response = http::Response<tonic::body::Body>;
8807        type Error = std::convert::Infallible;
8808        type Future = BoxFuture<Self::Response, Self::Error>;
8809        fn poll_ready(
8810            &mut self,
8811            _cx: &mut Context<'_>,
8812        ) -> Poll<std::result::Result<(), Self::Error>> {
8813            Poll::Ready(Ok(()))
8814        }
8815        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8816            match req.uri().path() {
8817                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
8818                    #[allow(non_camel_case_types)]
8819                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8820                    impl<
8821                        T: InviteLinkService,
8822                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
8823                    for CreateInviteLinkSvc<T> {
8824                        type Response = super::CreateInviteLinkResponse;
8825                        type Future = BoxFuture<
8826                            tonic::Response<Self::Response>,
8827                            tonic::Status,
8828                        >;
8829                        fn call(
8830                            &mut self,
8831                            request: tonic::Request<super::CreateInviteLinkRequest>,
8832                        ) -> Self::Future {
8833                            let inner = Arc::clone(&self.0);
8834                            let fut = async move {
8835                                <T as InviteLinkService>::create_invite_link(
8836                                        &inner,
8837                                        request,
8838                                    )
8839                                    .await
8840                            };
8841                            Box::pin(fut)
8842                        }
8843                    }
8844                    let accept_compression_encodings = self.accept_compression_encodings;
8845                    let send_compression_encodings = self.send_compression_encodings;
8846                    let max_decoding_message_size = self.max_decoding_message_size;
8847                    let max_encoding_message_size = self.max_encoding_message_size;
8848                    let inner = self.inner.clone();
8849                    let fut = async move {
8850                        let method = CreateInviteLinkSvc(inner);
8851                        let codec = tonic_prost::ProstCodec::default();
8852                        let mut grpc = tonic::server::Grpc::new(codec)
8853                            .apply_compression_config(
8854                                accept_compression_encodings,
8855                                send_compression_encodings,
8856                            )
8857                            .apply_max_message_size_config(
8858                                max_decoding_message_size,
8859                                max_encoding_message_size,
8860                            );
8861                        let res = grpc.unary(method, req).await;
8862                        Ok(res)
8863                    };
8864                    Box::pin(fut)
8865                }
8866                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
8867                    #[allow(non_camel_case_types)]
8868                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
8869                    impl<
8870                        T: InviteLinkService,
8871                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
8872                    for ListInviteLinksSvc<T> {
8873                        type Response = super::ListInviteLinksResponse;
8874                        type Future = BoxFuture<
8875                            tonic::Response<Self::Response>,
8876                            tonic::Status,
8877                        >;
8878                        fn call(
8879                            &mut self,
8880                            request: tonic::Request<super::ListInviteLinksRequest>,
8881                        ) -> Self::Future {
8882                            let inner = Arc::clone(&self.0);
8883                            let fut = async move {
8884                                <T as InviteLinkService>::list_invite_links(&inner, request)
8885                                    .await
8886                            };
8887                            Box::pin(fut)
8888                        }
8889                    }
8890                    let accept_compression_encodings = self.accept_compression_encodings;
8891                    let send_compression_encodings = self.send_compression_encodings;
8892                    let max_decoding_message_size = self.max_decoding_message_size;
8893                    let max_encoding_message_size = self.max_encoding_message_size;
8894                    let inner = self.inner.clone();
8895                    let fut = async move {
8896                        let method = ListInviteLinksSvc(inner);
8897                        let codec = tonic_prost::ProstCodec::default();
8898                        let mut grpc = tonic::server::Grpc::new(codec)
8899                            .apply_compression_config(
8900                                accept_compression_encodings,
8901                                send_compression_encodings,
8902                            )
8903                            .apply_max_message_size_config(
8904                                max_decoding_message_size,
8905                                max_encoding_message_size,
8906                            );
8907                        let res = grpc.unary(method, req).await;
8908                        Ok(res)
8909                    };
8910                    Box::pin(fut)
8911                }
8912                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
8913                    #[allow(non_camel_case_types)]
8914                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8915                    impl<
8916                        T: InviteLinkService,
8917                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
8918                    for RevokeInviteLinkSvc<T> {
8919                        type Response = super::RevokeInviteLinkResponse;
8920                        type Future = BoxFuture<
8921                            tonic::Response<Self::Response>,
8922                            tonic::Status,
8923                        >;
8924                        fn call(
8925                            &mut self,
8926                            request: tonic::Request<super::RevokeInviteLinkRequest>,
8927                        ) -> Self::Future {
8928                            let inner = Arc::clone(&self.0);
8929                            let fut = async move {
8930                                <T as InviteLinkService>::revoke_invite_link(
8931                                        &inner,
8932                                        request,
8933                                    )
8934                                    .await
8935                            };
8936                            Box::pin(fut)
8937                        }
8938                    }
8939                    let accept_compression_encodings = self.accept_compression_encodings;
8940                    let send_compression_encodings = self.send_compression_encodings;
8941                    let max_decoding_message_size = self.max_decoding_message_size;
8942                    let max_encoding_message_size = self.max_encoding_message_size;
8943                    let inner = self.inner.clone();
8944                    let fut = async move {
8945                        let method = RevokeInviteLinkSvc(inner);
8946                        let codec = tonic_prost::ProstCodec::default();
8947                        let mut grpc = tonic::server::Grpc::new(codec)
8948                            .apply_compression_config(
8949                                accept_compression_encodings,
8950                                send_compression_encodings,
8951                            )
8952                            .apply_max_message_size_config(
8953                                max_decoding_message_size,
8954                                max_encoding_message_size,
8955                            );
8956                        let res = grpc.unary(method, req).await;
8957                        Ok(res)
8958                    };
8959                    Box::pin(fut)
8960                }
8961                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
8962                    #[allow(non_camel_case_types)]
8963                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8964                    impl<
8965                        T: InviteLinkService,
8966                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
8967                    for ValidateInviteLinkSvc<T> {
8968                        type Response = super::ValidateInviteLinkResponse;
8969                        type Future = BoxFuture<
8970                            tonic::Response<Self::Response>,
8971                            tonic::Status,
8972                        >;
8973                        fn call(
8974                            &mut self,
8975                            request: tonic::Request<super::ValidateInviteLinkRequest>,
8976                        ) -> Self::Future {
8977                            let inner = Arc::clone(&self.0);
8978                            let fut = async move {
8979                                <T as InviteLinkService>::validate_invite_link(
8980                                        &inner,
8981                                        request,
8982                                    )
8983                                    .await
8984                            };
8985                            Box::pin(fut)
8986                        }
8987                    }
8988                    let accept_compression_encodings = self.accept_compression_encodings;
8989                    let send_compression_encodings = self.send_compression_encodings;
8990                    let max_decoding_message_size = self.max_decoding_message_size;
8991                    let max_encoding_message_size = self.max_encoding_message_size;
8992                    let inner = self.inner.clone();
8993                    let fut = async move {
8994                        let method = ValidateInviteLinkSvc(inner);
8995                        let codec = tonic_prost::ProstCodec::default();
8996                        let mut grpc = tonic::server::Grpc::new(codec)
8997                            .apply_compression_config(
8998                                accept_compression_encodings,
8999                                send_compression_encodings,
9000                            )
9001                            .apply_max_message_size_config(
9002                                max_decoding_message_size,
9003                                max_encoding_message_size,
9004                            );
9005                        let res = grpc.unary(method, req).await;
9006                        Ok(res)
9007                    };
9008                    Box::pin(fut)
9009                }
9010                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
9011                    #[allow(non_camel_case_types)]
9012                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9013                    impl<
9014                        T: InviteLinkService,
9015                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
9016                    for RedeemInviteLinkSvc<T> {
9017                        type Response = super::RedeemInviteLinkResponse;
9018                        type Future = BoxFuture<
9019                            tonic::Response<Self::Response>,
9020                            tonic::Status,
9021                        >;
9022                        fn call(
9023                            &mut self,
9024                            request: tonic::Request<super::RedeemInviteLinkRequest>,
9025                        ) -> Self::Future {
9026                            let inner = Arc::clone(&self.0);
9027                            let fut = async move {
9028                                <T as InviteLinkService>::redeem_invite_link(
9029                                        &inner,
9030                                        request,
9031                                    )
9032                                    .await
9033                            };
9034                            Box::pin(fut)
9035                        }
9036                    }
9037                    let accept_compression_encodings = self.accept_compression_encodings;
9038                    let send_compression_encodings = self.send_compression_encodings;
9039                    let max_decoding_message_size = self.max_decoding_message_size;
9040                    let max_encoding_message_size = self.max_encoding_message_size;
9041                    let inner = self.inner.clone();
9042                    let fut = async move {
9043                        let method = RedeemInviteLinkSvc(inner);
9044                        let codec = tonic_prost::ProstCodec::default();
9045                        let mut grpc = tonic::server::Grpc::new(codec)
9046                            .apply_compression_config(
9047                                accept_compression_encodings,
9048                                send_compression_encodings,
9049                            )
9050                            .apply_max_message_size_config(
9051                                max_decoding_message_size,
9052                                max_encoding_message_size,
9053                            );
9054                        let res = grpc.unary(method, req).await;
9055                        Ok(res)
9056                    };
9057                    Box::pin(fut)
9058                }
9059                _ => {
9060                    Box::pin(async move {
9061                        let mut response = http::Response::new(
9062                            tonic::body::Body::default(),
9063                        );
9064                        let headers = response.headers_mut();
9065                        headers
9066                            .insert(
9067                                tonic::Status::GRPC_STATUS,
9068                                (tonic::Code::Unimplemented as i32).into(),
9069                            );
9070                        headers
9071                            .insert(
9072                                http::header::CONTENT_TYPE,
9073                                tonic::metadata::GRPC_CONTENT_TYPE,
9074                            );
9075                        Ok(response)
9076                    })
9077                }
9078            }
9079        }
9080    }
9081    impl<T> Clone for InviteLinkServiceServer<T> {
9082        fn clone(&self) -> Self {
9083            let inner = self.inner.clone();
9084            Self {
9085                inner,
9086                accept_compression_encodings: self.accept_compression_encodings,
9087                send_compression_encodings: self.send_compression_encodings,
9088                max_decoding_message_size: self.max_decoding_message_size,
9089                max_encoding_message_size: self.max_encoding_message_size,
9090            }
9091        }
9092    }
9093    /// Generated gRPC service name
9094    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
9095    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
9096        const NAME: &'static str = SERVICE_NAME;
9097    }
9098}
9099/// Generated client implementations.
9100pub mod member_service_client {
9101    #![allow(
9102        unused_variables,
9103        dead_code,
9104        missing_docs,
9105        clippy::wildcard_imports,
9106        clippy::let_unit_value,
9107    )]
9108    use tonic::codegen::*;
9109    use tonic::codegen::http::Uri;
9110    /** Manages members (users) within an organization.
9111 All RPCs operate within the caller's org (extracted from JWT).
9112*/
9113    #[derive(Debug, Clone)]
9114    pub struct MemberServiceClient<T> {
9115        inner: tonic::client::Grpc<T>,
9116    }
9117    impl MemberServiceClient<tonic::transport::Channel> {
9118        /// Attempt to create a new client by connecting to a given endpoint.
9119        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9120        where
9121            D: TryInto<tonic::transport::Endpoint>,
9122            D::Error: Into<StdError>,
9123        {
9124            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9125            Ok(Self::new(conn))
9126        }
9127    }
9128    impl<T> MemberServiceClient<T>
9129    where
9130        T: tonic::client::GrpcService<tonic::body::Body>,
9131        T::Error: Into<StdError>,
9132        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9133        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9134    {
9135        pub fn new(inner: T) -> Self {
9136            let inner = tonic::client::Grpc::new(inner);
9137            Self { inner }
9138        }
9139        pub fn with_origin(inner: T, origin: Uri) -> Self {
9140            let inner = tonic::client::Grpc::with_origin(inner, origin);
9141            Self { inner }
9142        }
9143        pub fn with_interceptor<F>(
9144            inner: T,
9145            interceptor: F,
9146        ) -> MemberServiceClient<InterceptedService<T, F>>
9147        where
9148            F: tonic::service::Interceptor,
9149            T::ResponseBody: Default,
9150            T: tonic::codegen::Service<
9151                http::Request<tonic::body::Body>,
9152                Response = http::Response<
9153                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9154                >,
9155            >,
9156            <T as tonic::codegen::Service<
9157                http::Request<tonic::body::Body>,
9158            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9159        {
9160            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
9161        }
9162        /// Compress requests with the given encoding.
9163        ///
9164        /// This requires the server to support it otherwise it might respond with an
9165        /// error.
9166        #[must_use]
9167        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9168            self.inner = self.inner.send_compressed(encoding);
9169            self
9170        }
9171        /// Enable decompressing responses.
9172        #[must_use]
9173        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9174            self.inner = self.inner.accept_compressed(encoding);
9175            self
9176        }
9177        /// Limits the maximum size of a decoded message.
9178        ///
9179        /// Default: `4MB`
9180        #[must_use]
9181        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9182            self.inner = self.inner.max_decoding_message_size(limit);
9183            self
9184        }
9185        /// Limits the maximum size of an encoded message.
9186        ///
9187        /// Default: `usize::MAX`
9188        #[must_use]
9189        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9190            self.inner = self.inner.max_encoding_message_size(limit);
9191            self
9192        }
9193        /** Invite a new user to the organization via email.
9194 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9195*/
9196        pub async fn invite_user(
9197            &mut self,
9198            request: impl tonic::IntoRequest<super::InviteUserRequest>,
9199        ) -> std::result::Result<
9200            tonic::Response<super::InviteUserResponse>,
9201            tonic::Status,
9202        > {
9203            self.inner
9204                .ready()
9205                .await
9206                .map_err(|e| {
9207                    tonic::Status::unknown(
9208                        format!("Service was not ready: {}", e.into()),
9209                    )
9210                })?;
9211            let codec = tonic_prost::ProstCodec::default();
9212            let path = http::uri::PathAndQuery::from_static(
9213                "/pidgr.v1.MemberService/InviteUser",
9214            );
9215            let mut req = request.into_request();
9216            req.extensions_mut()
9217                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
9218            self.inner.unary(req, path, codec).await
9219        }
9220        /** Retrieve a user by ID within the organization.
9221 Self-lookup (empty user_id) is allowed for any authenticated user.
9222 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
9223*/
9224        pub async fn get_user(
9225            &mut self,
9226            request: impl tonic::IntoRequest<super::GetUserRequest>,
9227        ) -> std::result::Result<
9228            tonic::Response<super::GetUserResponse>,
9229            tonic::Status,
9230        > {
9231            self.inner
9232                .ready()
9233                .await
9234                .map_err(|e| {
9235                    tonic::Status::unknown(
9236                        format!("Service was not ready: {}", e.into()),
9237                    )
9238                })?;
9239            let codec = tonic_prost::ProstCodec::default();
9240            let path = http::uri::PathAndQuery::from_static(
9241                "/pidgr.v1.MemberService/GetUser",
9242            );
9243            let mut req = request.into_request();
9244            req.extensions_mut()
9245                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
9246            self.inner.unary(req, path, codec).await
9247        }
9248        /** List all users in the organization with pagination.
9249 Authorization: Requires PERMISSION_MEMBERS_READ.
9250*/
9251        pub async fn list_users(
9252            &mut self,
9253            request: impl tonic::IntoRequest<super::ListUsersRequest>,
9254        ) -> std::result::Result<
9255            tonic::Response<super::ListUsersResponse>,
9256            tonic::Status,
9257        > {
9258            self.inner
9259                .ready()
9260                .await
9261                .map_err(|e| {
9262                    tonic::Status::unknown(
9263                        format!("Service was not ready: {}", e.into()),
9264                    )
9265                })?;
9266            let codec = tonic_prost::ProstCodec::default();
9267            let path = http::uri::PathAndQuery::from_static(
9268                "/pidgr.v1.MemberService/ListUsers",
9269            );
9270            let mut req = request.into_request();
9271            req.extensions_mut()
9272                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
9273            self.inner.unary(req, path, codec).await
9274        }
9275        /** Change a user's role within the organization.
9276 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9277*/
9278        pub async fn update_user_role(
9279            &mut self,
9280            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
9281        ) -> std::result::Result<
9282            tonic::Response<super::UpdateUserRoleResponse>,
9283            tonic::Status,
9284        > {
9285            self.inner
9286                .ready()
9287                .await
9288                .map_err(|e| {
9289                    tonic::Status::unknown(
9290                        format!("Service was not ready: {}", e.into()),
9291                    )
9292                })?;
9293            let codec = tonic_prost::ProstCodec::default();
9294            let path = http::uri::PathAndQuery::from_static(
9295                "/pidgr.v1.MemberService/UpdateUserRole",
9296            );
9297            let mut req = request.into_request();
9298            req.extensions_mut()
9299                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
9300            self.inner.unary(req, path, codec).await
9301        }
9302        /** Deactivate a user within the organization.
9303 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9304*/
9305        pub async fn deactivate_user(
9306            &mut self,
9307            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
9308        ) -> std::result::Result<
9309            tonic::Response<super::DeactivateUserResponse>,
9310            tonic::Status,
9311        > {
9312            self.inner
9313                .ready()
9314                .await
9315                .map_err(|e| {
9316                    tonic::Status::unknown(
9317                        format!("Service was not ready: {}", e.into()),
9318                    )
9319                })?;
9320            let codec = tonic_prost::ProstCodec::default();
9321            let path = http::uri::PathAndQuery::from_static(
9322                "/pidgr.v1.MemberService/DeactivateUser",
9323            );
9324            let mut req = request.into_request();
9325            req.extensions_mut()
9326                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
9327            self.inner.unary(req, path, codec).await
9328        }
9329        /** Reactivate a deactivated user, restoring their status to INVITED.
9330 The user must complete the invite link flow again to become ACTIVE.
9331 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9332*/
9333        pub async fn reactivate_user(
9334            &mut self,
9335            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
9336        ) -> std::result::Result<
9337            tonic::Response<super::ReactivateUserResponse>,
9338            tonic::Status,
9339        > {
9340            self.inner
9341                .ready()
9342                .await
9343                .map_err(|e| {
9344                    tonic::Status::unknown(
9345                        format!("Service was not ready: {}", e.into()),
9346                    )
9347                })?;
9348            let codec = tonic_prost::ProstCodec::default();
9349            let path = http::uri::PathAndQuery::from_static(
9350                "/pidgr.v1.MemberService/ReactivateUser",
9351            );
9352            let mut req = request.into_request();
9353            req.extensions_mut()
9354                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
9355            self.inner.unary(req, path, codec).await
9356        }
9357        /** Revoke an invitation for a user who has not yet completed registration.
9358 Hard-deletes the user record (INVITED users have no data to preserve).
9359 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9360*/
9361        pub async fn revoke_invite(
9362            &mut self,
9363            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
9364        ) -> std::result::Result<
9365            tonic::Response<super::RevokeInviteResponse>,
9366            tonic::Status,
9367        > {
9368            self.inner
9369                .ready()
9370                .await
9371                .map_err(|e| {
9372                    tonic::Status::unknown(
9373                        format!("Service was not ready: {}", e.into()),
9374                    )
9375                })?;
9376            let codec = tonic_prost::ProstCodec::default();
9377            let path = http::uri::PathAndQuery::from_static(
9378                "/pidgr.v1.MemberService/RevokeInvite",
9379            );
9380            let mut req = request.into_request();
9381            req.extensions_mut()
9382                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
9383            self.inner.unary(req, path, codec).await
9384        }
9385        /** Update a user's profile attributes (department, title, etc.).
9386 Self-update (empty user_id or matching JWT sub) requires no special permission.
9387 Updating another user requires PERMISSION_MEMBERS_MANAGE.
9388*/
9389        pub async fn update_user_profile(
9390            &mut self,
9391            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
9392        ) -> std::result::Result<
9393            tonic::Response<super::UpdateUserProfileResponse>,
9394            tonic::Status,
9395        > {
9396            self.inner
9397                .ready()
9398                .await
9399                .map_err(|e| {
9400                    tonic::Status::unknown(
9401                        format!("Service was not ready: {}", e.into()),
9402                    )
9403                })?;
9404            let codec = tonic_prost::ProstCodec::default();
9405            let path = http::uri::PathAndQuery::from_static(
9406                "/pidgr.v1.MemberService/UpdateUserProfile",
9407            );
9408            let mut req = request.into_request();
9409            req.extensions_mut()
9410                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
9411            self.inner.unary(req, path, codec).await
9412        }
9413        /** Retrieve the caller's platform settings (theme, etc.).
9414 Authorization: Any authenticated user (self-only).
9415*/
9416        pub async fn get_user_settings(
9417            &mut self,
9418            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
9419        ) -> std::result::Result<
9420            tonic::Response<super::GetUserSettingsResponse>,
9421            tonic::Status,
9422        > {
9423            self.inner
9424                .ready()
9425                .await
9426                .map_err(|e| {
9427                    tonic::Status::unknown(
9428                        format!("Service was not ready: {}", e.into()),
9429                    )
9430                })?;
9431            let codec = tonic_prost::ProstCodec::default();
9432            let path = http::uri::PathAndQuery::from_static(
9433                "/pidgr.v1.MemberService/GetUserSettings",
9434            );
9435            let mut req = request.into_request();
9436            req.extensions_mut()
9437                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
9438            self.inner.unary(req, path, codec).await
9439        }
9440        /** Update the caller's platform settings.
9441 Only fields with non-default values are applied; others are left unchanged.
9442 Authorization: Any authenticated user (self-only).
9443*/
9444        pub async fn update_user_settings(
9445            &mut self,
9446            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
9447        ) -> std::result::Result<
9448            tonic::Response<super::UpdateUserSettingsResponse>,
9449            tonic::Status,
9450        > {
9451            self.inner
9452                .ready()
9453                .await
9454                .map_err(|e| {
9455                    tonic::Status::unknown(
9456                        format!("Service was not ready: {}", e.into()),
9457                    )
9458                })?;
9459            let codec = tonic_prost::ProstCodec::default();
9460            let path = http::uri::PathAndQuery::from_static(
9461                "/pidgr.v1.MemberService/UpdateUserSettings",
9462            );
9463            let mut req = request.into_request();
9464            req.extensions_mut()
9465                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
9466            self.inner.unary(req, path, codec).await
9467        }
9468        /** Invite multiple users to the organization in a single call.
9469 Emails are deduplicated. Each email is processed independently — individual
9470 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
9471 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9472*/
9473        pub async fn bulk_invite_users(
9474            &mut self,
9475            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
9476        ) -> std::result::Result<
9477            tonic::Response<super::BulkInviteUsersResponse>,
9478            tonic::Status,
9479        > {
9480            self.inner
9481                .ready()
9482                .await
9483                .map_err(|e| {
9484                    tonic::Status::unknown(
9485                        format!("Service was not ready: {}", e.into()),
9486                    )
9487                })?;
9488            let codec = tonic_prost::ProstCodec::default();
9489            let path = http::uri::PathAndQuery::from_static(
9490                "/pidgr.v1.MemberService/BulkInviteUsers",
9491            );
9492            let mut req = request.into_request();
9493            req.extensions_mut()
9494                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
9495            self.inner.unary(req, path, codec).await
9496        }
9497        /** Confirm passkey enrollment after client-side WebAuthn registration.
9498 Verifies the caller has at least one registered credential server-side,
9499 then marks the user as passkey-enrolled in the identity provider.
9500 Authorization: Any authenticated user (self-only, no permission required).
9501*/
9502        pub async fn confirm_passkey_enrollment(
9503            &mut self,
9504            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
9505        ) -> std::result::Result<
9506            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
9507            tonic::Status,
9508        > {
9509            self.inner
9510                .ready()
9511                .await
9512                .map_err(|e| {
9513                    tonic::Status::unknown(
9514                        format!("Service was not ready: {}", e.into()),
9515                    )
9516                })?;
9517            let codec = tonic_prost::ProstCodec::default();
9518            let path = http::uri::PathAndQuery::from_static(
9519                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
9520            );
9521            let mut req = request.into_request();
9522            req.extensions_mut()
9523                .insert(
9524                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
9525                );
9526            self.inner.unary(req, path, codec).await
9527        }
9528        /** Update the data governance region for a user. Triggers a data migration
9529 workflow if the region changed. Admin-only operation.
9530 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9531*/
9532        pub async fn update_user_region(
9533            &mut self,
9534            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
9535        ) -> std::result::Result<
9536            tonic::Response<super::UpdateUserRegionResponse>,
9537            tonic::Status,
9538        > {
9539            self.inner
9540                .ready()
9541                .await
9542                .map_err(|e| {
9543                    tonic::Status::unknown(
9544                        format!("Service was not ready: {}", e.into()),
9545                    )
9546                })?;
9547            let codec = tonic_prost::ProstCodec::default();
9548            let path = http::uri::PathAndQuery::from_static(
9549                "/pidgr.v1.MemberService/UpdateUserRegion",
9550            );
9551            let mut req = request.into_request();
9552            req.extensions_mut()
9553                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
9554            self.inner.unary(req, path, codec).await
9555        }
9556    }
9557}
9558/// Generated server implementations.
9559pub mod member_service_server {
9560    #![allow(
9561        unused_variables,
9562        dead_code,
9563        missing_docs,
9564        clippy::wildcard_imports,
9565        clippy::let_unit_value,
9566    )]
9567    use tonic::codegen::*;
9568    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
9569    #[async_trait]
9570    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
9571        /** Invite a new user to the organization via email.
9572 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9573*/
9574        async fn invite_user(
9575            &self,
9576            request: tonic::Request<super::InviteUserRequest>,
9577        ) -> std::result::Result<
9578            tonic::Response<super::InviteUserResponse>,
9579            tonic::Status,
9580        >;
9581        /** Retrieve a user by ID within the organization.
9582 Self-lookup (empty user_id) is allowed for any authenticated user.
9583 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
9584*/
9585        async fn get_user(
9586            &self,
9587            request: tonic::Request<super::GetUserRequest>,
9588        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
9589        /** List all users in the organization with pagination.
9590 Authorization: Requires PERMISSION_MEMBERS_READ.
9591*/
9592        async fn list_users(
9593            &self,
9594            request: tonic::Request<super::ListUsersRequest>,
9595        ) -> std::result::Result<
9596            tonic::Response<super::ListUsersResponse>,
9597            tonic::Status,
9598        >;
9599        /** Change a user's role within the organization.
9600 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9601*/
9602        async fn update_user_role(
9603            &self,
9604            request: tonic::Request<super::UpdateUserRoleRequest>,
9605        ) -> std::result::Result<
9606            tonic::Response<super::UpdateUserRoleResponse>,
9607            tonic::Status,
9608        >;
9609        /** Deactivate a user within the organization.
9610 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9611*/
9612        async fn deactivate_user(
9613            &self,
9614            request: tonic::Request<super::DeactivateUserRequest>,
9615        ) -> std::result::Result<
9616            tonic::Response<super::DeactivateUserResponse>,
9617            tonic::Status,
9618        >;
9619        /** Reactivate a deactivated user, restoring their status to INVITED.
9620 The user must complete the invite link flow again to become ACTIVE.
9621 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9622*/
9623        async fn reactivate_user(
9624            &self,
9625            request: tonic::Request<super::ReactivateUserRequest>,
9626        ) -> std::result::Result<
9627            tonic::Response<super::ReactivateUserResponse>,
9628            tonic::Status,
9629        >;
9630        /** Revoke an invitation for a user who has not yet completed registration.
9631 Hard-deletes the user record (INVITED users have no data to preserve).
9632 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9633*/
9634        async fn revoke_invite(
9635            &self,
9636            request: tonic::Request<super::RevokeInviteRequest>,
9637        ) -> std::result::Result<
9638            tonic::Response<super::RevokeInviteResponse>,
9639            tonic::Status,
9640        >;
9641        /** Update a user's profile attributes (department, title, etc.).
9642 Self-update (empty user_id or matching JWT sub) requires no special permission.
9643 Updating another user requires PERMISSION_MEMBERS_MANAGE.
9644*/
9645        async fn update_user_profile(
9646            &self,
9647            request: tonic::Request<super::UpdateUserProfileRequest>,
9648        ) -> std::result::Result<
9649            tonic::Response<super::UpdateUserProfileResponse>,
9650            tonic::Status,
9651        >;
9652        /** Retrieve the caller's platform settings (theme, etc.).
9653 Authorization: Any authenticated user (self-only).
9654*/
9655        async fn get_user_settings(
9656            &self,
9657            request: tonic::Request<super::GetUserSettingsRequest>,
9658        ) -> std::result::Result<
9659            tonic::Response<super::GetUserSettingsResponse>,
9660            tonic::Status,
9661        >;
9662        /** Update the caller's platform settings.
9663 Only fields with non-default values are applied; others are left unchanged.
9664 Authorization: Any authenticated user (self-only).
9665*/
9666        async fn update_user_settings(
9667            &self,
9668            request: tonic::Request<super::UpdateUserSettingsRequest>,
9669        ) -> std::result::Result<
9670            tonic::Response<super::UpdateUserSettingsResponse>,
9671            tonic::Status,
9672        >;
9673        /** Invite multiple users to the organization in a single call.
9674 Emails are deduplicated. Each email is processed independently — individual
9675 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
9676 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9677*/
9678        async fn bulk_invite_users(
9679            &self,
9680            request: tonic::Request<super::BulkInviteUsersRequest>,
9681        ) -> std::result::Result<
9682            tonic::Response<super::BulkInviteUsersResponse>,
9683            tonic::Status,
9684        >;
9685        /** Confirm passkey enrollment after client-side WebAuthn registration.
9686 Verifies the caller has at least one registered credential server-side,
9687 then marks the user as passkey-enrolled in the identity provider.
9688 Authorization: Any authenticated user (self-only, no permission required).
9689*/
9690        async fn confirm_passkey_enrollment(
9691            &self,
9692            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
9693        ) -> std::result::Result<
9694            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
9695            tonic::Status,
9696        >;
9697        /** Update the data governance region for a user. Triggers a data migration
9698 workflow if the region changed. Admin-only operation.
9699 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9700*/
9701        async fn update_user_region(
9702            &self,
9703            request: tonic::Request<super::UpdateUserRegionRequest>,
9704        ) -> std::result::Result<
9705            tonic::Response<super::UpdateUserRegionResponse>,
9706            tonic::Status,
9707        >;
9708    }
9709    /** Manages members (users) within an organization.
9710 All RPCs operate within the caller's org (extracted from JWT).
9711*/
9712    #[derive(Debug)]
9713    pub struct MemberServiceServer<T> {
9714        inner: Arc<T>,
9715        accept_compression_encodings: EnabledCompressionEncodings,
9716        send_compression_encodings: EnabledCompressionEncodings,
9717        max_decoding_message_size: Option<usize>,
9718        max_encoding_message_size: Option<usize>,
9719    }
9720    impl<T> MemberServiceServer<T> {
9721        pub fn new(inner: T) -> Self {
9722            Self::from_arc(Arc::new(inner))
9723        }
9724        pub fn from_arc(inner: Arc<T>) -> Self {
9725            Self {
9726                inner,
9727                accept_compression_encodings: Default::default(),
9728                send_compression_encodings: Default::default(),
9729                max_decoding_message_size: None,
9730                max_encoding_message_size: None,
9731            }
9732        }
9733        pub fn with_interceptor<F>(
9734            inner: T,
9735            interceptor: F,
9736        ) -> InterceptedService<Self, F>
9737        where
9738            F: tonic::service::Interceptor,
9739        {
9740            InterceptedService::new(Self::new(inner), interceptor)
9741        }
9742        /// Enable decompressing requests with the given encoding.
9743        #[must_use]
9744        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9745            self.accept_compression_encodings.enable(encoding);
9746            self
9747        }
9748        /// Compress responses with the given encoding, if the client supports it.
9749        #[must_use]
9750        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9751            self.send_compression_encodings.enable(encoding);
9752            self
9753        }
9754        /// Limits the maximum size of a decoded message.
9755        ///
9756        /// Default: `4MB`
9757        #[must_use]
9758        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9759            self.max_decoding_message_size = Some(limit);
9760            self
9761        }
9762        /// Limits the maximum size of an encoded message.
9763        ///
9764        /// Default: `usize::MAX`
9765        #[must_use]
9766        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9767            self.max_encoding_message_size = Some(limit);
9768            self
9769        }
9770    }
9771    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
9772    where
9773        T: MemberService,
9774        B: Body + std::marker::Send + 'static,
9775        B::Error: Into<StdError> + std::marker::Send + 'static,
9776    {
9777        type Response = http::Response<tonic::body::Body>;
9778        type Error = std::convert::Infallible;
9779        type Future = BoxFuture<Self::Response, Self::Error>;
9780        fn poll_ready(
9781            &mut self,
9782            _cx: &mut Context<'_>,
9783        ) -> Poll<std::result::Result<(), Self::Error>> {
9784            Poll::Ready(Ok(()))
9785        }
9786        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9787            match req.uri().path() {
9788                "/pidgr.v1.MemberService/InviteUser" => {
9789                    #[allow(non_camel_case_types)]
9790                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
9791                    impl<
9792                        T: MemberService,
9793                    > tonic::server::UnaryService<super::InviteUserRequest>
9794                    for InviteUserSvc<T> {
9795                        type Response = super::InviteUserResponse;
9796                        type Future = BoxFuture<
9797                            tonic::Response<Self::Response>,
9798                            tonic::Status,
9799                        >;
9800                        fn call(
9801                            &mut self,
9802                            request: tonic::Request<super::InviteUserRequest>,
9803                        ) -> Self::Future {
9804                            let inner = Arc::clone(&self.0);
9805                            let fut = async move {
9806                                <T as MemberService>::invite_user(&inner, request).await
9807                            };
9808                            Box::pin(fut)
9809                        }
9810                    }
9811                    let accept_compression_encodings = self.accept_compression_encodings;
9812                    let send_compression_encodings = self.send_compression_encodings;
9813                    let max_decoding_message_size = self.max_decoding_message_size;
9814                    let max_encoding_message_size = self.max_encoding_message_size;
9815                    let inner = self.inner.clone();
9816                    let fut = async move {
9817                        let method = InviteUserSvc(inner);
9818                        let codec = tonic_prost::ProstCodec::default();
9819                        let mut grpc = tonic::server::Grpc::new(codec)
9820                            .apply_compression_config(
9821                                accept_compression_encodings,
9822                                send_compression_encodings,
9823                            )
9824                            .apply_max_message_size_config(
9825                                max_decoding_message_size,
9826                                max_encoding_message_size,
9827                            );
9828                        let res = grpc.unary(method, req).await;
9829                        Ok(res)
9830                    };
9831                    Box::pin(fut)
9832                }
9833                "/pidgr.v1.MemberService/GetUser" => {
9834                    #[allow(non_camel_case_types)]
9835                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
9836                    impl<
9837                        T: MemberService,
9838                    > tonic::server::UnaryService<super::GetUserRequest>
9839                    for GetUserSvc<T> {
9840                        type Response = super::GetUserResponse;
9841                        type Future = BoxFuture<
9842                            tonic::Response<Self::Response>,
9843                            tonic::Status,
9844                        >;
9845                        fn call(
9846                            &mut self,
9847                            request: tonic::Request<super::GetUserRequest>,
9848                        ) -> Self::Future {
9849                            let inner = Arc::clone(&self.0);
9850                            let fut = async move {
9851                                <T as MemberService>::get_user(&inner, request).await
9852                            };
9853                            Box::pin(fut)
9854                        }
9855                    }
9856                    let accept_compression_encodings = self.accept_compression_encodings;
9857                    let send_compression_encodings = self.send_compression_encodings;
9858                    let max_decoding_message_size = self.max_decoding_message_size;
9859                    let max_encoding_message_size = self.max_encoding_message_size;
9860                    let inner = self.inner.clone();
9861                    let fut = async move {
9862                        let method = GetUserSvc(inner);
9863                        let codec = tonic_prost::ProstCodec::default();
9864                        let mut grpc = tonic::server::Grpc::new(codec)
9865                            .apply_compression_config(
9866                                accept_compression_encodings,
9867                                send_compression_encodings,
9868                            )
9869                            .apply_max_message_size_config(
9870                                max_decoding_message_size,
9871                                max_encoding_message_size,
9872                            );
9873                        let res = grpc.unary(method, req).await;
9874                        Ok(res)
9875                    };
9876                    Box::pin(fut)
9877                }
9878                "/pidgr.v1.MemberService/ListUsers" => {
9879                    #[allow(non_camel_case_types)]
9880                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
9881                    impl<
9882                        T: MemberService,
9883                    > tonic::server::UnaryService<super::ListUsersRequest>
9884                    for ListUsersSvc<T> {
9885                        type Response = super::ListUsersResponse;
9886                        type Future = BoxFuture<
9887                            tonic::Response<Self::Response>,
9888                            tonic::Status,
9889                        >;
9890                        fn call(
9891                            &mut self,
9892                            request: tonic::Request<super::ListUsersRequest>,
9893                        ) -> Self::Future {
9894                            let inner = Arc::clone(&self.0);
9895                            let fut = async move {
9896                                <T as MemberService>::list_users(&inner, request).await
9897                            };
9898                            Box::pin(fut)
9899                        }
9900                    }
9901                    let accept_compression_encodings = self.accept_compression_encodings;
9902                    let send_compression_encodings = self.send_compression_encodings;
9903                    let max_decoding_message_size = self.max_decoding_message_size;
9904                    let max_encoding_message_size = self.max_encoding_message_size;
9905                    let inner = self.inner.clone();
9906                    let fut = async move {
9907                        let method = ListUsersSvc(inner);
9908                        let codec = tonic_prost::ProstCodec::default();
9909                        let mut grpc = tonic::server::Grpc::new(codec)
9910                            .apply_compression_config(
9911                                accept_compression_encodings,
9912                                send_compression_encodings,
9913                            )
9914                            .apply_max_message_size_config(
9915                                max_decoding_message_size,
9916                                max_encoding_message_size,
9917                            );
9918                        let res = grpc.unary(method, req).await;
9919                        Ok(res)
9920                    };
9921                    Box::pin(fut)
9922                }
9923                "/pidgr.v1.MemberService/UpdateUserRole" => {
9924                    #[allow(non_camel_case_types)]
9925                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
9926                    impl<
9927                        T: MemberService,
9928                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
9929                    for UpdateUserRoleSvc<T> {
9930                        type Response = super::UpdateUserRoleResponse;
9931                        type Future = BoxFuture<
9932                            tonic::Response<Self::Response>,
9933                            tonic::Status,
9934                        >;
9935                        fn call(
9936                            &mut self,
9937                            request: tonic::Request<super::UpdateUserRoleRequest>,
9938                        ) -> Self::Future {
9939                            let inner = Arc::clone(&self.0);
9940                            let fut = async move {
9941                                <T as MemberService>::update_user_role(&inner, request)
9942                                    .await
9943                            };
9944                            Box::pin(fut)
9945                        }
9946                    }
9947                    let accept_compression_encodings = self.accept_compression_encodings;
9948                    let send_compression_encodings = self.send_compression_encodings;
9949                    let max_decoding_message_size = self.max_decoding_message_size;
9950                    let max_encoding_message_size = self.max_encoding_message_size;
9951                    let inner = self.inner.clone();
9952                    let fut = async move {
9953                        let method = UpdateUserRoleSvc(inner);
9954                        let codec = tonic_prost::ProstCodec::default();
9955                        let mut grpc = tonic::server::Grpc::new(codec)
9956                            .apply_compression_config(
9957                                accept_compression_encodings,
9958                                send_compression_encodings,
9959                            )
9960                            .apply_max_message_size_config(
9961                                max_decoding_message_size,
9962                                max_encoding_message_size,
9963                            );
9964                        let res = grpc.unary(method, req).await;
9965                        Ok(res)
9966                    };
9967                    Box::pin(fut)
9968                }
9969                "/pidgr.v1.MemberService/DeactivateUser" => {
9970                    #[allow(non_camel_case_types)]
9971                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
9972                    impl<
9973                        T: MemberService,
9974                    > tonic::server::UnaryService<super::DeactivateUserRequest>
9975                    for DeactivateUserSvc<T> {
9976                        type Response = super::DeactivateUserResponse;
9977                        type Future = BoxFuture<
9978                            tonic::Response<Self::Response>,
9979                            tonic::Status,
9980                        >;
9981                        fn call(
9982                            &mut self,
9983                            request: tonic::Request<super::DeactivateUserRequest>,
9984                        ) -> Self::Future {
9985                            let inner = Arc::clone(&self.0);
9986                            let fut = async move {
9987                                <T as MemberService>::deactivate_user(&inner, request).await
9988                            };
9989                            Box::pin(fut)
9990                        }
9991                    }
9992                    let accept_compression_encodings = self.accept_compression_encodings;
9993                    let send_compression_encodings = self.send_compression_encodings;
9994                    let max_decoding_message_size = self.max_decoding_message_size;
9995                    let max_encoding_message_size = self.max_encoding_message_size;
9996                    let inner = self.inner.clone();
9997                    let fut = async move {
9998                        let method = DeactivateUserSvc(inner);
9999                        let codec = tonic_prost::ProstCodec::default();
10000                        let mut grpc = tonic::server::Grpc::new(codec)
10001                            .apply_compression_config(
10002                                accept_compression_encodings,
10003                                send_compression_encodings,
10004                            )
10005                            .apply_max_message_size_config(
10006                                max_decoding_message_size,
10007                                max_encoding_message_size,
10008                            );
10009                        let res = grpc.unary(method, req).await;
10010                        Ok(res)
10011                    };
10012                    Box::pin(fut)
10013                }
10014                "/pidgr.v1.MemberService/ReactivateUser" => {
10015                    #[allow(non_camel_case_types)]
10016                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
10017                    impl<
10018                        T: MemberService,
10019                    > tonic::server::UnaryService<super::ReactivateUserRequest>
10020                    for ReactivateUserSvc<T> {
10021                        type Response = super::ReactivateUserResponse;
10022                        type Future = BoxFuture<
10023                            tonic::Response<Self::Response>,
10024                            tonic::Status,
10025                        >;
10026                        fn call(
10027                            &mut self,
10028                            request: tonic::Request<super::ReactivateUserRequest>,
10029                        ) -> Self::Future {
10030                            let inner = Arc::clone(&self.0);
10031                            let fut = async move {
10032                                <T as MemberService>::reactivate_user(&inner, request).await
10033                            };
10034                            Box::pin(fut)
10035                        }
10036                    }
10037                    let accept_compression_encodings = self.accept_compression_encodings;
10038                    let send_compression_encodings = self.send_compression_encodings;
10039                    let max_decoding_message_size = self.max_decoding_message_size;
10040                    let max_encoding_message_size = self.max_encoding_message_size;
10041                    let inner = self.inner.clone();
10042                    let fut = async move {
10043                        let method = ReactivateUserSvc(inner);
10044                        let codec = tonic_prost::ProstCodec::default();
10045                        let mut grpc = tonic::server::Grpc::new(codec)
10046                            .apply_compression_config(
10047                                accept_compression_encodings,
10048                                send_compression_encodings,
10049                            )
10050                            .apply_max_message_size_config(
10051                                max_decoding_message_size,
10052                                max_encoding_message_size,
10053                            );
10054                        let res = grpc.unary(method, req).await;
10055                        Ok(res)
10056                    };
10057                    Box::pin(fut)
10058                }
10059                "/pidgr.v1.MemberService/RevokeInvite" => {
10060                    #[allow(non_camel_case_types)]
10061                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
10062                    impl<
10063                        T: MemberService,
10064                    > tonic::server::UnaryService<super::RevokeInviteRequest>
10065                    for RevokeInviteSvc<T> {
10066                        type Response = super::RevokeInviteResponse;
10067                        type Future = BoxFuture<
10068                            tonic::Response<Self::Response>,
10069                            tonic::Status,
10070                        >;
10071                        fn call(
10072                            &mut self,
10073                            request: tonic::Request<super::RevokeInviteRequest>,
10074                        ) -> Self::Future {
10075                            let inner = Arc::clone(&self.0);
10076                            let fut = async move {
10077                                <T as MemberService>::revoke_invite(&inner, request).await
10078                            };
10079                            Box::pin(fut)
10080                        }
10081                    }
10082                    let accept_compression_encodings = self.accept_compression_encodings;
10083                    let send_compression_encodings = self.send_compression_encodings;
10084                    let max_decoding_message_size = self.max_decoding_message_size;
10085                    let max_encoding_message_size = self.max_encoding_message_size;
10086                    let inner = self.inner.clone();
10087                    let fut = async move {
10088                        let method = RevokeInviteSvc(inner);
10089                        let codec = tonic_prost::ProstCodec::default();
10090                        let mut grpc = tonic::server::Grpc::new(codec)
10091                            .apply_compression_config(
10092                                accept_compression_encodings,
10093                                send_compression_encodings,
10094                            )
10095                            .apply_max_message_size_config(
10096                                max_decoding_message_size,
10097                                max_encoding_message_size,
10098                            );
10099                        let res = grpc.unary(method, req).await;
10100                        Ok(res)
10101                    };
10102                    Box::pin(fut)
10103                }
10104                "/pidgr.v1.MemberService/UpdateUserProfile" => {
10105                    #[allow(non_camel_case_types)]
10106                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
10107                    impl<
10108                        T: MemberService,
10109                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
10110                    for UpdateUserProfileSvc<T> {
10111                        type Response = super::UpdateUserProfileResponse;
10112                        type Future = BoxFuture<
10113                            tonic::Response<Self::Response>,
10114                            tonic::Status,
10115                        >;
10116                        fn call(
10117                            &mut self,
10118                            request: tonic::Request<super::UpdateUserProfileRequest>,
10119                        ) -> Self::Future {
10120                            let inner = Arc::clone(&self.0);
10121                            let fut = async move {
10122                                <T as MemberService>::update_user_profile(&inner, request)
10123                                    .await
10124                            };
10125                            Box::pin(fut)
10126                        }
10127                    }
10128                    let accept_compression_encodings = self.accept_compression_encodings;
10129                    let send_compression_encodings = self.send_compression_encodings;
10130                    let max_decoding_message_size = self.max_decoding_message_size;
10131                    let max_encoding_message_size = self.max_encoding_message_size;
10132                    let inner = self.inner.clone();
10133                    let fut = async move {
10134                        let method = UpdateUserProfileSvc(inner);
10135                        let codec = tonic_prost::ProstCodec::default();
10136                        let mut grpc = tonic::server::Grpc::new(codec)
10137                            .apply_compression_config(
10138                                accept_compression_encodings,
10139                                send_compression_encodings,
10140                            )
10141                            .apply_max_message_size_config(
10142                                max_decoding_message_size,
10143                                max_encoding_message_size,
10144                            );
10145                        let res = grpc.unary(method, req).await;
10146                        Ok(res)
10147                    };
10148                    Box::pin(fut)
10149                }
10150                "/pidgr.v1.MemberService/GetUserSettings" => {
10151                    #[allow(non_camel_case_types)]
10152                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
10153                    impl<
10154                        T: MemberService,
10155                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
10156                    for GetUserSettingsSvc<T> {
10157                        type Response = super::GetUserSettingsResponse;
10158                        type Future = BoxFuture<
10159                            tonic::Response<Self::Response>,
10160                            tonic::Status,
10161                        >;
10162                        fn call(
10163                            &mut self,
10164                            request: tonic::Request<super::GetUserSettingsRequest>,
10165                        ) -> Self::Future {
10166                            let inner = Arc::clone(&self.0);
10167                            let fut = async move {
10168                                <T as MemberService>::get_user_settings(&inner, request)
10169                                    .await
10170                            };
10171                            Box::pin(fut)
10172                        }
10173                    }
10174                    let accept_compression_encodings = self.accept_compression_encodings;
10175                    let send_compression_encodings = self.send_compression_encodings;
10176                    let max_decoding_message_size = self.max_decoding_message_size;
10177                    let max_encoding_message_size = self.max_encoding_message_size;
10178                    let inner = self.inner.clone();
10179                    let fut = async move {
10180                        let method = GetUserSettingsSvc(inner);
10181                        let codec = tonic_prost::ProstCodec::default();
10182                        let mut grpc = tonic::server::Grpc::new(codec)
10183                            .apply_compression_config(
10184                                accept_compression_encodings,
10185                                send_compression_encodings,
10186                            )
10187                            .apply_max_message_size_config(
10188                                max_decoding_message_size,
10189                                max_encoding_message_size,
10190                            );
10191                        let res = grpc.unary(method, req).await;
10192                        Ok(res)
10193                    };
10194                    Box::pin(fut)
10195                }
10196                "/pidgr.v1.MemberService/UpdateUserSettings" => {
10197                    #[allow(non_camel_case_types)]
10198                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
10199                    impl<
10200                        T: MemberService,
10201                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
10202                    for UpdateUserSettingsSvc<T> {
10203                        type Response = super::UpdateUserSettingsResponse;
10204                        type Future = BoxFuture<
10205                            tonic::Response<Self::Response>,
10206                            tonic::Status,
10207                        >;
10208                        fn call(
10209                            &mut self,
10210                            request: tonic::Request<super::UpdateUserSettingsRequest>,
10211                        ) -> Self::Future {
10212                            let inner = Arc::clone(&self.0);
10213                            let fut = async move {
10214                                <T as MemberService>::update_user_settings(&inner, request)
10215                                    .await
10216                            };
10217                            Box::pin(fut)
10218                        }
10219                    }
10220                    let accept_compression_encodings = self.accept_compression_encodings;
10221                    let send_compression_encodings = self.send_compression_encodings;
10222                    let max_decoding_message_size = self.max_decoding_message_size;
10223                    let max_encoding_message_size = self.max_encoding_message_size;
10224                    let inner = self.inner.clone();
10225                    let fut = async move {
10226                        let method = UpdateUserSettingsSvc(inner);
10227                        let codec = tonic_prost::ProstCodec::default();
10228                        let mut grpc = tonic::server::Grpc::new(codec)
10229                            .apply_compression_config(
10230                                accept_compression_encodings,
10231                                send_compression_encodings,
10232                            )
10233                            .apply_max_message_size_config(
10234                                max_decoding_message_size,
10235                                max_encoding_message_size,
10236                            );
10237                        let res = grpc.unary(method, req).await;
10238                        Ok(res)
10239                    };
10240                    Box::pin(fut)
10241                }
10242                "/pidgr.v1.MemberService/BulkInviteUsers" => {
10243                    #[allow(non_camel_case_types)]
10244                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
10245                    impl<
10246                        T: MemberService,
10247                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
10248                    for BulkInviteUsersSvc<T> {
10249                        type Response = super::BulkInviteUsersResponse;
10250                        type Future = BoxFuture<
10251                            tonic::Response<Self::Response>,
10252                            tonic::Status,
10253                        >;
10254                        fn call(
10255                            &mut self,
10256                            request: tonic::Request<super::BulkInviteUsersRequest>,
10257                        ) -> Self::Future {
10258                            let inner = Arc::clone(&self.0);
10259                            let fut = async move {
10260                                <T as MemberService>::bulk_invite_users(&inner, request)
10261                                    .await
10262                            };
10263                            Box::pin(fut)
10264                        }
10265                    }
10266                    let accept_compression_encodings = self.accept_compression_encodings;
10267                    let send_compression_encodings = self.send_compression_encodings;
10268                    let max_decoding_message_size = self.max_decoding_message_size;
10269                    let max_encoding_message_size = self.max_encoding_message_size;
10270                    let inner = self.inner.clone();
10271                    let fut = async move {
10272                        let method = BulkInviteUsersSvc(inner);
10273                        let codec = tonic_prost::ProstCodec::default();
10274                        let mut grpc = tonic::server::Grpc::new(codec)
10275                            .apply_compression_config(
10276                                accept_compression_encodings,
10277                                send_compression_encodings,
10278                            )
10279                            .apply_max_message_size_config(
10280                                max_decoding_message_size,
10281                                max_encoding_message_size,
10282                            );
10283                        let res = grpc.unary(method, req).await;
10284                        Ok(res)
10285                    };
10286                    Box::pin(fut)
10287                }
10288                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
10289                    #[allow(non_camel_case_types)]
10290                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
10291                    impl<
10292                        T: MemberService,
10293                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
10294                    for ConfirmPasskeyEnrollmentSvc<T> {
10295                        type Response = super::ConfirmPasskeyEnrollmentResponse;
10296                        type Future = BoxFuture<
10297                            tonic::Response<Self::Response>,
10298                            tonic::Status,
10299                        >;
10300                        fn call(
10301                            &mut self,
10302                            request: tonic::Request<
10303                                super::ConfirmPasskeyEnrollmentRequest,
10304                            >,
10305                        ) -> Self::Future {
10306                            let inner = Arc::clone(&self.0);
10307                            let fut = async move {
10308                                <T as MemberService>::confirm_passkey_enrollment(
10309                                        &inner,
10310                                        request,
10311                                    )
10312                                    .await
10313                            };
10314                            Box::pin(fut)
10315                        }
10316                    }
10317                    let accept_compression_encodings = self.accept_compression_encodings;
10318                    let send_compression_encodings = self.send_compression_encodings;
10319                    let max_decoding_message_size = self.max_decoding_message_size;
10320                    let max_encoding_message_size = self.max_encoding_message_size;
10321                    let inner = self.inner.clone();
10322                    let fut = async move {
10323                        let method = ConfirmPasskeyEnrollmentSvc(inner);
10324                        let codec = tonic_prost::ProstCodec::default();
10325                        let mut grpc = tonic::server::Grpc::new(codec)
10326                            .apply_compression_config(
10327                                accept_compression_encodings,
10328                                send_compression_encodings,
10329                            )
10330                            .apply_max_message_size_config(
10331                                max_decoding_message_size,
10332                                max_encoding_message_size,
10333                            );
10334                        let res = grpc.unary(method, req).await;
10335                        Ok(res)
10336                    };
10337                    Box::pin(fut)
10338                }
10339                "/pidgr.v1.MemberService/UpdateUserRegion" => {
10340                    #[allow(non_camel_case_types)]
10341                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
10342                    impl<
10343                        T: MemberService,
10344                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
10345                    for UpdateUserRegionSvc<T> {
10346                        type Response = super::UpdateUserRegionResponse;
10347                        type Future = BoxFuture<
10348                            tonic::Response<Self::Response>,
10349                            tonic::Status,
10350                        >;
10351                        fn call(
10352                            &mut self,
10353                            request: tonic::Request<super::UpdateUserRegionRequest>,
10354                        ) -> Self::Future {
10355                            let inner = Arc::clone(&self.0);
10356                            let fut = async move {
10357                                <T as MemberService>::update_user_region(&inner, request)
10358                                    .await
10359                            };
10360                            Box::pin(fut)
10361                        }
10362                    }
10363                    let accept_compression_encodings = self.accept_compression_encodings;
10364                    let send_compression_encodings = self.send_compression_encodings;
10365                    let max_decoding_message_size = self.max_decoding_message_size;
10366                    let max_encoding_message_size = self.max_encoding_message_size;
10367                    let inner = self.inner.clone();
10368                    let fut = async move {
10369                        let method = UpdateUserRegionSvc(inner);
10370                        let codec = tonic_prost::ProstCodec::default();
10371                        let mut grpc = tonic::server::Grpc::new(codec)
10372                            .apply_compression_config(
10373                                accept_compression_encodings,
10374                                send_compression_encodings,
10375                            )
10376                            .apply_max_message_size_config(
10377                                max_decoding_message_size,
10378                                max_encoding_message_size,
10379                            );
10380                        let res = grpc.unary(method, req).await;
10381                        Ok(res)
10382                    };
10383                    Box::pin(fut)
10384                }
10385                _ => {
10386                    Box::pin(async move {
10387                        let mut response = http::Response::new(
10388                            tonic::body::Body::default(),
10389                        );
10390                        let headers = response.headers_mut();
10391                        headers
10392                            .insert(
10393                                tonic::Status::GRPC_STATUS,
10394                                (tonic::Code::Unimplemented as i32).into(),
10395                            );
10396                        headers
10397                            .insert(
10398                                http::header::CONTENT_TYPE,
10399                                tonic::metadata::GRPC_CONTENT_TYPE,
10400                            );
10401                        Ok(response)
10402                    })
10403                }
10404            }
10405        }
10406    }
10407    impl<T> Clone for MemberServiceServer<T> {
10408        fn clone(&self) -> Self {
10409            let inner = self.inner.clone();
10410            Self {
10411                inner,
10412                accept_compression_encodings: self.accept_compression_encodings,
10413                send_compression_encodings: self.send_compression_encodings,
10414                max_decoding_message_size: self.max_decoding_message_size,
10415                max_encoding_message_size: self.max_encoding_message_size,
10416            }
10417        }
10418    }
10419    /// Generated gRPC service name
10420    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
10421    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
10422        const NAME: &'static str = SERVICE_NAME;
10423    }
10424}
10425/// Generated client implementations.
10426pub mod org_security_keys_service_client {
10427    #![allow(
10428        unused_variables,
10429        dead_code,
10430        missing_docs,
10431        clippy::wildcard_imports,
10432        clippy::let_unit_value,
10433    )]
10434    use tonic::codegen::*;
10435    use tonic::codegen::http::Uri;
10436    /** OrgSecurityKeysService exposes per-org secret key material to internal
10437 services that need it for HMAC computation, signature verification, or
10438 envelope-key derivation.
10439
10440 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
10441 material. The server MUST require a client certificate from a known
10442 internal service (allowlisted by subject DN) and MUST reject any request
10443 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
10444
10445 Callers (today: pidgr-integrations) cache returned peppers in-process
10446 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
10447 keep dispatch hot-path latency bounded.
10448*/
10449    #[derive(Debug, Clone)]
10450    pub struct OrgSecurityKeysServiceClient<T> {
10451        inner: tonic::client::Grpc<T>,
10452    }
10453    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
10454        /// Attempt to create a new client by connecting to a given endpoint.
10455        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10456        where
10457            D: TryInto<tonic::transport::Endpoint>,
10458            D::Error: Into<StdError>,
10459        {
10460            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10461            Ok(Self::new(conn))
10462        }
10463    }
10464    impl<T> OrgSecurityKeysServiceClient<T>
10465    where
10466        T: tonic::client::GrpcService<tonic::body::Body>,
10467        T::Error: Into<StdError>,
10468        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10469        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10470    {
10471        pub fn new(inner: T) -> Self {
10472            let inner = tonic::client::Grpc::new(inner);
10473            Self { inner }
10474        }
10475        pub fn with_origin(inner: T, origin: Uri) -> Self {
10476            let inner = tonic::client::Grpc::with_origin(inner, origin);
10477            Self { inner }
10478        }
10479        pub fn with_interceptor<F>(
10480            inner: T,
10481            interceptor: F,
10482        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
10483        where
10484            F: tonic::service::Interceptor,
10485            T::ResponseBody: Default,
10486            T: tonic::codegen::Service<
10487                http::Request<tonic::body::Body>,
10488                Response = http::Response<
10489                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10490                >,
10491            >,
10492            <T as tonic::codegen::Service<
10493                http::Request<tonic::body::Body>,
10494            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10495        {
10496            OrgSecurityKeysServiceClient::new(
10497                InterceptedService::new(inner, interceptor),
10498            )
10499        }
10500        /// Compress requests with the given encoding.
10501        ///
10502        /// This requires the server to support it otherwise it might respond with an
10503        /// error.
10504        #[must_use]
10505        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10506            self.inner = self.inner.send_compressed(encoding);
10507            self
10508        }
10509        /// Enable decompressing responses.
10510        #[must_use]
10511        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10512            self.inner = self.inner.accept_compressed(encoding);
10513            self
10514        }
10515        /// Limits the maximum size of a decoded message.
10516        ///
10517        /// Default: `4MB`
10518        #[must_use]
10519        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10520            self.inner = self.inner.max_decoding_message_size(limit);
10521            self
10522        }
10523        /// Limits the maximum size of an encoded message.
10524        ///
10525        /// Default: `usize::MAX`
10526        #[must_use]
10527        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10528            self.inner = self.inner.max_encoding_message_size(limit);
10529            self
10530        }
10531        /** Return all non-retired pepper versions for one (org_id, purpose). Used
10532 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
10533 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
10534*/
10535        pub async fn get_peppers(
10536            &mut self,
10537            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
10538        ) -> std::result::Result<
10539            tonic::Response<super::GetPeppersResponse>,
10540            tonic::Status,
10541        > {
10542            self.inner
10543                .ready()
10544                .await
10545                .map_err(|e| {
10546                    tonic::Status::unknown(
10547                        format!("Service was not ready: {}", e.into()),
10548                    )
10549                })?;
10550            let codec = tonic_prost::ProstCodec::default();
10551            let path = http::uri::PathAndQuery::from_static(
10552                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
10553            );
10554            let mut req = request.into_request();
10555            req.extensions_mut()
10556                .insert(
10557                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
10558                );
10559            self.inner.unary(req, path, codec).await
10560        }
10561    }
10562}
10563/// Generated server implementations.
10564pub mod org_security_keys_service_server {
10565    #![allow(
10566        unused_variables,
10567        dead_code,
10568        missing_docs,
10569        clippy::wildcard_imports,
10570        clippy::let_unit_value,
10571    )]
10572    use tonic::codegen::*;
10573    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
10574    #[async_trait]
10575    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
10576        /** Return all non-retired pepper versions for one (org_id, purpose). Used
10577 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
10578 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
10579*/
10580        async fn get_peppers(
10581            &self,
10582            request: tonic::Request<super::GetPeppersRequest>,
10583        ) -> std::result::Result<
10584            tonic::Response<super::GetPeppersResponse>,
10585            tonic::Status,
10586        >;
10587    }
10588    /** OrgSecurityKeysService exposes per-org secret key material to internal
10589 services that need it for HMAC computation, signature verification, or
10590 envelope-key derivation.
10591
10592 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
10593 material. The server MUST require a client certificate from a known
10594 internal service (allowlisted by subject DN) and MUST reject any request
10595 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
10596
10597 Callers (today: pidgr-integrations) cache returned peppers in-process
10598 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
10599 keep dispatch hot-path latency bounded.
10600*/
10601    #[derive(Debug)]
10602    pub struct OrgSecurityKeysServiceServer<T> {
10603        inner: Arc<T>,
10604        accept_compression_encodings: EnabledCompressionEncodings,
10605        send_compression_encodings: EnabledCompressionEncodings,
10606        max_decoding_message_size: Option<usize>,
10607        max_encoding_message_size: Option<usize>,
10608    }
10609    impl<T> OrgSecurityKeysServiceServer<T> {
10610        pub fn new(inner: T) -> Self {
10611            Self::from_arc(Arc::new(inner))
10612        }
10613        pub fn from_arc(inner: Arc<T>) -> Self {
10614            Self {
10615                inner,
10616                accept_compression_encodings: Default::default(),
10617                send_compression_encodings: Default::default(),
10618                max_decoding_message_size: None,
10619                max_encoding_message_size: None,
10620            }
10621        }
10622        pub fn with_interceptor<F>(
10623            inner: T,
10624            interceptor: F,
10625        ) -> InterceptedService<Self, F>
10626        where
10627            F: tonic::service::Interceptor,
10628        {
10629            InterceptedService::new(Self::new(inner), interceptor)
10630        }
10631        /// Enable decompressing requests with the given encoding.
10632        #[must_use]
10633        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10634            self.accept_compression_encodings.enable(encoding);
10635            self
10636        }
10637        /// Compress responses with the given encoding, if the client supports it.
10638        #[must_use]
10639        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10640            self.send_compression_encodings.enable(encoding);
10641            self
10642        }
10643        /// Limits the maximum size of a decoded message.
10644        ///
10645        /// Default: `4MB`
10646        #[must_use]
10647        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10648            self.max_decoding_message_size = Some(limit);
10649            self
10650        }
10651        /// Limits the maximum size of an encoded message.
10652        ///
10653        /// Default: `usize::MAX`
10654        #[must_use]
10655        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10656            self.max_encoding_message_size = Some(limit);
10657            self
10658        }
10659    }
10660    impl<T, B> tonic::codegen::Service<http::Request<B>>
10661    for OrgSecurityKeysServiceServer<T>
10662    where
10663        T: OrgSecurityKeysService,
10664        B: Body + std::marker::Send + 'static,
10665        B::Error: Into<StdError> + std::marker::Send + 'static,
10666    {
10667        type Response = http::Response<tonic::body::Body>;
10668        type Error = std::convert::Infallible;
10669        type Future = BoxFuture<Self::Response, Self::Error>;
10670        fn poll_ready(
10671            &mut self,
10672            _cx: &mut Context<'_>,
10673        ) -> Poll<std::result::Result<(), Self::Error>> {
10674            Poll::Ready(Ok(()))
10675        }
10676        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10677            match req.uri().path() {
10678                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
10679                    #[allow(non_camel_case_types)]
10680                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
10681                    impl<
10682                        T: OrgSecurityKeysService,
10683                    > tonic::server::UnaryService<super::GetPeppersRequest>
10684                    for GetPeppersSvc<T> {
10685                        type Response = super::GetPeppersResponse;
10686                        type Future = BoxFuture<
10687                            tonic::Response<Self::Response>,
10688                            tonic::Status,
10689                        >;
10690                        fn call(
10691                            &mut self,
10692                            request: tonic::Request<super::GetPeppersRequest>,
10693                        ) -> Self::Future {
10694                            let inner = Arc::clone(&self.0);
10695                            let fut = async move {
10696                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
10697                                    .await
10698                            };
10699                            Box::pin(fut)
10700                        }
10701                    }
10702                    let accept_compression_encodings = self.accept_compression_encodings;
10703                    let send_compression_encodings = self.send_compression_encodings;
10704                    let max_decoding_message_size = self.max_decoding_message_size;
10705                    let max_encoding_message_size = self.max_encoding_message_size;
10706                    let inner = self.inner.clone();
10707                    let fut = async move {
10708                        let method = GetPeppersSvc(inner);
10709                        let codec = tonic_prost::ProstCodec::default();
10710                        let mut grpc = tonic::server::Grpc::new(codec)
10711                            .apply_compression_config(
10712                                accept_compression_encodings,
10713                                send_compression_encodings,
10714                            )
10715                            .apply_max_message_size_config(
10716                                max_decoding_message_size,
10717                                max_encoding_message_size,
10718                            );
10719                        let res = grpc.unary(method, req).await;
10720                        Ok(res)
10721                    };
10722                    Box::pin(fut)
10723                }
10724                _ => {
10725                    Box::pin(async move {
10726                        let mut response = http::Response::new(
10727                            tonic::body::Body::default(),
10728                        );
10729                        let headers = response.headers_mut();
10730                        headers
10731                            .insert(
10732                                tonic::Status::GRPC_STATUS,
10733                                (tonic::Code::Unimplemented as i32).into(),
10734                            );
10735                        headers
10736                            .insert(
10737                                http::header::CONTENT_TYPE,
10738                                tonic::metadata::GRPC_CONTENT_TYPE,
10739                            );
10740                        Ok(response)
10741                    })
10742                }
10743            }
10744        }
10745    }
10746    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
10747        fn clone(&self) -> Self {
10748            let inner = self.inner.clone();
10749            Self {
10750                inner,
10751                accept_compression_encodings: self.accept_compression_encodings,
10752                send_compression_encodings: self.send_compression_encodings,
10753                max_decoding_message_size: self.max_decoding_message_size,
10754                max_encoding_message_size: self.max_encoding_message_size,
10755            }
10756        }
10757    }
10758    /// Generated gRPC service name
10759    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
10760    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
10761        const NAME: &'static str = SERVICE_NAME;
10762    }
10763}
10764/// Generated client implementations.
10765pub mod organization_service_client {
10766    #![allow(
10767        unused_variables,
10768        dead_code,
10769        missing_docs,
10770        clippy::wildcard_imports,
10771        clippy::let_unit_value,
10772    )]
10773    use tonic::codegen::*;
10774    use tonic::codegen::http::Uri;
10775    /** Manages organizations (tenants) in the Pidgr platform.
10776 Most RPCs operate within the caller's org (extracted from JWT).
10777 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
10778*/
10779    #[derive(Debug, Clone)]
10780    pub struct OrganizationServiceClient<T> {
10781        inner: tonic::client::Grpc<T>,
10782    }
10783    impl OrganizationServiceClient<tonic::transport::Channel> {
10784        /// Attempt to create a new client by connecting to a given endpoint.
10785        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10786        where
10787            D: TryInto<tonic::transport::Endpoint>,
10788            D::Error: Into<StdError>,
10789        {
10790            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10791            Ok(Self::new(conn))
10792        }
10793    }
10794    impl<T> OrganizationServiceClient<T>
10795    where
10796        T: tonic::client::GrpcService<tonic::body::Body>,
10797        T::Error: Into<StdError>,
10798        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10799        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10800    {
10801        pub fn new(inner: T) -> Self {
10802            let inner = tonic::client::Grpc::new(inner);
10803            Self { inner }
10804        }
10805        pub fn with_origin(inner: T, origin: Uri) -> Self {
10806            let inner = tonic::client::Grpc::with_origin(inner, origin);
10807            Self { inner }
10808        }
10809        pub fn with_interceptor<F>(
10810            inner: T,
10811            interceptor: F,
10812        ) -> OrganizationServiceClient<InterceptedService<T, F>>
10813        where
10814            F: tonic::service::Interceptor,
10815            T::ResponseBody: Default,
10816            T: tonic::codegen::Service<
10817                http::Request<tonic::body::Body>,
10818                Response = http::Response<
10819                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10820                >,
10821            >,
10822            <T as tonic::codegen::Service<
10823                http::Request<tonic::body::Body>,
10824            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10825        {
10826            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
10827        }
10828        /// Compress requests with the given encoding.
10829        ///
10830        /// This requires the server to support it otherwise it might respond with an
10831        /// error.
10832        #[must_use]
10833        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10834            self.inner = self.inner.send_compressed(encoding);
10835            self
10836        }
10837        /// Enable decompressing responses.
10838        #[must_use]
10839        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10840            self.inner = self.inner.accept_compressed(encoding);
10841            self
10842        }
10843        /// Limits the maximum size of a decoded message.
10844        ///
10845        /// Default: `4MB`
10846        #[must_use]
10847        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10848            self.inner = self.inner.max_decoding_message_size(limit);
10849            self
10850        }
10851        /// Limits the maximum size of an encoded message.
10852        ///
10853        /// Default: `usize::MAX`
10854        #[must_use]
10855        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10856            self.inner = self.inner.max_encoding_message_size(limit);
10857            self
10858        }
10859        /** Create a new organization. JWT auth only — the caller becomes the initial
10860 admin. Add further admins via CreateInviteLink.
10861 Authorization: Authenticated user (no specific permission required).
10862*/
10863        pub async fn create_organization(
10864            &mut self,
10865            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
10866        ) -> std::result::Result<
10867            tonic::Response<super::CreateOrganizationResponse>,
10868            tonic::Status,
10869        > {
10870            self.inner
10871                .ready()
10872                .await
10873                .map_err(|e| {
10874                    tonic::Status::unknown(
10875                        format!("Service was not ready: {}", e.into()),
10876                    )
10877                })?;
10878            let codec = tonic_prost::ProstCodec::default();
10879            let path = http::uri::PathAndQuery::from_static(
10880                "/pidgr.v1.OrganizationService/CreateOrganization",
10881            );
10882            let mut req = request.into_request();
10883            req.extensions_mut()
10884                .insert(
10885                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
10886                );
10887            self.inner.unary(req, path, codec).await
10888        }
10889        /** Retrieve the organization for the authenticated user.
10890 Authorization: Requires PERMISSION_ORG_READ.
10891*/
10892        pub async fn get_organization(
10893            &mut self,
10894            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
10895        ) -> std::result::Result<
10896            tonic::Response<super::GetOrganizationResponse>,
10897            tonic::Status,
10898        > {
10899            self.inner
10900                .ready()
10901                .await
10902                .map_err(|e| {
10903                    tonic::Status::unknown(
10904                        format!("Service was not ready: {}", e.into()),
10905                    )
10906                })?;
10907            let codec = tonic_prost::ProstCodec::default();
10908            let path = http::uri::PathAndQuery::from_static(
10909                "/pidgr.v1.OrganizationService/GetOrganization",
10910            );
10911            let mut req = request.into_request();
10912            req.extensions_mut()
10913                .insert(
10914                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
10915                );
10916            self.inner.unary(req, path, codec).await
10917        }
10918        /** Update organization settings (name, default workflow, industry, company size).
10919 Authorization: Requires PERMISSION_ORG_WRITE.
10920*/
10921        pub async fn update_organization(
10922            &mut self,
10923            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
10924        ) -> std::result::Result<
10925            tonic::Response<super::UpdateOrganizationResponse>,
10926            tonic::Status,
10927        > {
10928            self.inner
10929                .ready()
10930                .await
10931                .map_err(|e| {
10932                    tonic::Status::unknown(
10933                        format!("Service was not ready: {}", e.into()),
10934                    )
10935                })?;
10936            let codec = tonic_prost::ProstCodec::default();
10937            let path = http::uri::PathAndQuery::from_static(
10938                "/pidgr.v1.OrganizationService/UpdateOrganization",
10939            );
10940            let mut req = request.into_request();
10941            req.extensions_mut()
10942                .insert(
10943                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
10944                );
10945            self.inner.unary(req, path, codec).await
10946        }
10947        /** Replace all SSO attribute mappings for the organization.
10948 Authorization: Requires PERMISSION_ORG_WRITE.
10949*/
10950        pub async fn update_sso_attribute_mappings(
10951            &mut self,
10952            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
10953        ) -> std::result::Result<
10954            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
10955            tonic::Status,
10956        > {
10957            self.inner
10958                .ready()
10959                .await
10960                .map_err(|e| {
10961                    tonic::Status::unknown(
10962                        format!("Service was not ready: {}", e.into()),
10963                    )
10964                })?;
10965            let codec = tonic_prost::ProstCodec::default();
10966            let path = http::uri::PathAndQuery::from_static(
10967                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
10968            );
10969            let mut req = request.into_request();
10970            req.extensions_mut()
10971                .insert(
10972                    GrpcMethod::new(
10973                        "pidgr.v1.OrganizationService",
10974                        "UpdateSsoAttributeMappings",
10975                    ),
10976                );
10977            self.inner.unary(req, path, codec).await
10978        }
10979        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
10980 Authorization: Requires PERMISSION_PRIVACY_WRITE.
10981*/
10982        pub async fn rotate_analytics_salt(
10983            &mut self,
10984            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
10985        ) -> std::result::Result<
10986            tonic::Response<super::RotateAnalyticsSaltResponse>,
10987            tonic::Status,
10988        > {
10989            self.inner
10990                .ready()
10991                .await
10992                .map_err(|e| {
10993                    tonic::Status::unknown(
10994                        format!("Service was not ready: {}", e.into()),
10995                    )
10996                })?;
10997            let codec = tonic_prost::ProstCodec::default();
10998            let path = http::uri::PathAndQuery::from_static(
10999                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11000            );
11001            let mut req = request.into_request();
11002            req.extensions_mut()
11003                .insert(
11004                    GrpcMethod::new(
11005                        "pidgr.v1.OrganizationService",
11006                        "RotateAnalyticsSalt",
11007                    ),
11008                );
11009            self.inner.unary(req, path, codec).await
11010        }
11011        /** Update the differential privacy epsilon parameter.
11012 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11013*/
11014        pub async fn update_analytics_epsilon(
11015            &mut self,
11016            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
11017        ) -> std::result::Result<
11018            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11019            tonic::Status,
11020        > {
11021            self.inner
11022                .ready()
11023                .await
11024                .map_err(|e| {
11025                    tonic::Status::unknown(
11026                        format!("Service was not ready: {}", e.into()),
11027                    )
11028                })?;
11029            let codec = tonic_prost::ProstCodec::default();
11030            let path = http::uri::PathAndQuery::from_static(
11031                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
11032            );
11033            let mut req = request.into_request();
11034            req.extensions_mut()
11035                .insert(
11036                    GrpcMethod::new(
11037                        "pidgr.v1.OrganizationService",
11038                        "UpdateAnalyticsEpsilon",
11039                    ),
11040                );
11041            self.inner.unary(req, path, codec).await
11042        }
11043        /** Create a sandbox organization for testing configurations.
11044 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
11045 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
11046 per user to prevent abuse.
11047*/
11048        pub async fn create_sandbox_organization(
11049            &mut self,
11050            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
11051        ) -> std::result::Result<
11052            tonic::Response<super::CreateSandboxOrganizationResponse>,
11053            tonic::Status,
11054        > {
11055            self.inner
11056                .ready()
11057                .await
11058                .map_err(|e| {
11059                    tonic::Status::unknown(
11060                        format!("Service was not ready: {}", e.into()),
11061                    )
11062                })?;
11063            let codec = tonic_prost::ProstCodec::default();
11064            let path = http::uri::PathAndQuery::from_static(
11065                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
11066            );
11067            let mut req = request.into_request();
11068            req.extensions_mut()
11069                .insert(
11070                    GrpcMethod::new(
11071                        "pidgr.v1.OrganizationService",
11072                        "CreateSandboxOrganization",
11073                    ),
11074                );
11075            self.inner.unary(req, path, codec).await
11076        }
11077        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
11078 which handles cleanup across DB, Cognito, S3, Temporal, and regional
11079 content stores.
11080 Authorization: Super admin of the target sandbox OR its creator.
11081*/
11082        pub async fn delete_sandbox_organization(
11083            &mut self,
11084            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
11085        ) -> std::result::Result<
11086            tonic::Response<super::DeleteSandboxOrganizationResponse>,
11087            tonic::Status,
11088        > {
11089            self.inner
11090                .ready()
11091                .await
11092                .map_err(|e| {
11093                    tonic::Status::unknown(
11094                        format!("Service was not ready: {}", e.into()),
11095                    )
11096                })?;
11097            let codec = tonic_prost::ProstCodec::default();
11098            let path = http::uri::PathAndQuery::from_static(
11099                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
11100            );
11101            let mut req = request.into_request();
11102            req.extensions_mut()
11103                .insert(
11104                    GrpcMethod::new(
11105                        "pidgr.v1.OrganizationService",
11106                        "DeleteSandboxOrganization",
11107                    ),
11108                );
11109            self.inner.unary(req, path, codec).await
11110        }
11111        /** List bootstrap fixtures available for seeding new organizations. The
11112 catalog is backend-owned; admin UI populates the "seed initial data"
11113 control or dropdown from this response.
11114 Authorization: Any authenticated user.
11115*/
11116        pub async fn list_sandbox_fixtures(
11117            &mut self,
11118            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
11119        ) -> std::result::Result<
11120            tonic::Response<super::ListSandboxFixturesResponse>,
11121            tonic::Status,
11122        > {
11123            self.inner
11124                .ready()
11125                .await
11126                .map_err(|e| {
11127                    tonic::Status::unknown(
11128                        format!("Service was not ready: {}", e.into()),
11129                    )
11130                })?;
11131            let codec = tonic_prost::ProstCodec::default();
11132            let path = http::uri::PathAndQuery::from_static(
11133                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
11134            );
11135            let mut req = request.into_request();
11136            req.extensions_mut()
11137                .insert(
11138                    GrpcMethod::new(
11139                        "pidgr.v1.OrganizationService",
11140                        "ListSandboxFixtures",
11141                    ),
11142                );
11143            self.inner.unary(req, path, codec).await
11144        }
11145        /** List all organizations the authenticated user belongs to.
11146 Org-exempt: callable without org context (only requires valid JWT).
11147 Used by the admin org switcher to discover available orgs.
11148 Excludes expired sandbox organizations.
11149 Authorization: Authenticated user (no specific permission required).
11150*/
11151        pub async fn list_user_organizations(
11152            &mut self,
11153            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
11154        ) -> std::result::Result<
11155            tonic::Response<super::ListUserOrganizationsResponse>,
11156            tonic::Status,
11157        > {
11158            self.inner
11159                .ready()
11160                .await
11161                .map_err(|e| {
11162                    tonic::Status::unknown(
11163                        format!("Service was not ready: {}", e.into()),
11164                    )
11165                })?;
11166            let codec = tonic_prost::ProstCodec::default();
11167            let path = http::uri::PathAndQuery::from_static(
11168                "/pidgr.v1.OrganizationService/ListUserOrganizations",
11169            );
11170            let mut req = request.into_request();
11171            req.extensions_mut()
11172                .insert(
11173                    GrpcMethod::new(
11174                        "pidgr.v1.OrganizationService",
11175                        "ListUserOrganizations",
11176                    ),
11177                );
11178            self.inner.unary(req, path, codec).await
11179        }
11180        /** List only the sandbox organizations the authenticated user belongs to.
11181 Org-exempt: callable without org context. The admin UI's /sandboxes
11182 management page is the primary consumer — it's a user-level surface
11183 rather than org-scoped, so this RPC is user-scoped too.
11184 Excludes already-expired sandboxes (pending cleanup).
11185 Authorization: Authenticated user (no specific permission required).
11186*/
11187        pub async fn list_user_sandboxes(
11188            &mut self,
11189            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
11190        ) -> std::result::Result<
11191            tonic::Response<super::ListUserSandboxesResponse>,
11192            tonic::Status,
11193        > {
11194            self.inner
11195                .ready()
11196                .await
11197                .map_err(|e| {
11198                    tonic::Status::unknown(
11199                        format!("Service was not ready: {}", e.into()),
11200                    )
11201                })?;
11202            let codec = tonic_prost::ProstCodec::default();
11203            let path = http::uri::PathAndQuery::from_static(
11204                "/pidgr.v1.OrganizationService/ListUserSandboxes",
11205            );
11206            let mut req = request.into_request();
11207            req.extensions_mut()
11208                .insert(
11209                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
11210                );
11211            self.inner.unary(req, path, codec).await
11212        }
11213    }
11214}
11215/// Generated server implementations.
11216pub mod organization_service_server {
11217    #![allow(
11218        unused_variables,
11219        dead_code,
11220        missing_docs,
11221        clippy::wildcard_imports,
11222        clippy::let_unit_value,
11223    )]
11224    use tonic::codegen::*;
11225    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
11226    #[async_trait]
11227    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
11228        /** Create a new organization. JWT auth only — the caller becomes the initial
11229 admin. Add further admins via CreateInviteLink.
11230 Authorization: Authenticated user (no specific permission required).
11231*/
11232        async fn create_organization(
11233            &self,
11234            request: tonic::Request<super::CreateOrganizationRequest>,
11235        ) -> std::result::Result<
11236            tonic::Response<super::CreateOrganizationResponse>,
11237            tonic::Status,
11238        >;
11239        /** Retrieve the organization for the authenticated user.
11240 Authorization: Requires PERMISSION_ORG_READ.
11241*/
11242        async fn get_organization(
11243            &self,
11244            request: tonic::Request<super::GetOrganizationRequest>,
11245        ) -> std::result::Result<
11246            tonic::Response<super::GetOrganizationResponse>,
11247            tonic::Status,
11248        >;
11249        /** Update organization settings (name, default workflow, industry, company size).
11250 Authorization: Requires PERMISSION_ORG_WRITE.
11251*/
11252        async fn update_organization(
11253            &self,
11254            request: tonic::Request<super::UpdateOrganizationRequest>,
11255        ) -> std::result::Result<
11256            tonic::Response<super::UpdateOrganizationResponse>,
11257            tonic::Status,
11258        >;
11259        /** Replace all SSO attribute mappings for the organization.
11260 Authorization: Requires PERMISSION_ORG_WRITE.
11261*/
11262        async fn update_sso_attribute_mappings(
11263            &self,
11264            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
11265        ) -> std::result::Result<
11266            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11267            tonic::Status,
11268        >;
11269        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11270 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11271*/
11272        async fn rotate_analytics_salt(
11273            &self,
11274            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
11275        ) -> std::result::Result<
11276            tonic::Response<super::RotateAnalyticsSaltResponse>,
11277            tonic::Status,
11278        >;
11279        /** Update the differential privacy epsilon parameter.
11280 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11281*/
11282        async fn update_analytics_epsilon(
11283            &self,
11284            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
11285        ) -> std::result::Result<
11286            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11287            tonic::Status,
11288        >;
11289        /** Create a sandbox organization for testing configurations.
11290 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
11291 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
11292 per user to prevent abuse.
11293*/
11294        async fn create_sandbox_organization(
11295            &self,
11296            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
11297        ) -> std::result::Result<
11298            tonic::Response<super::CreateSandboxOrganizationResponse>,
11299            tonic::Status,
11300        >;
11301        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
11302 which handles cleanup across DB, Cognito, S3, Temporal, and regional
11303 content stores.
11304 Authorization: Super admin of the target sandbox OR its creator.
11305*/
11306        async fn delete_sandbox_organization(
11307            &self,
11308            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
11309        ) -> std::result::Result<
11310            tonic::Response<super::DeleteSandboxOrganizationResponse>,
11311            tonic::Status,
11312        >;
11313        /** List bootstrap fixtures available for seeding new organizations. The
11314 catalog is backend-owned; admin UI populates the "seed initial data"
11315 control or dropdown from this response.
11316 Authorization: Any authenticated user.
11317*/
11318        async fn list_sandbox_fixtures(
11319            &self,
11320            request: tonic::Request<super::ListSandboxFixturesRequest>,
11321        ) -> std::result::Result<
11322            tonic::Response<super::ListSandboxFixturesResponse>,
11323            tonic::Status,
11324        >;
11325        /** List all organizations the authenticated user belongs to.
11326 Org-exempt: callable without org context (only requires valid JWT).
11327 Used by the admin org switcher to discover available orgs.
11328 Excludes expired sandbox organizations.
11329 Authorization: Authenticated user (no specific permission required).
11330*/
11331        async fn list_user_organizations(
11332            &self,
11333            request: tonic::Request<super::ListUserOrganizationsRequest>,
11334        ) -> std::result::Result<
11335            tonic::Response<super::ListUserOrganizationsResponse>,
11336            tonic::Status,
11337        >;
11338        /** List only the sandbox organizations the authenticated user belongs to.
11339 Org-exempt: callable without org context. The admin UI's /sandboxes
11340 management page is the primary consumer — it's a user-level surface
11341 rather than org-scoped, so this RPC is user-scoped too.
11342 Excludes already-expired sandboxes (pending cleanup).
11343 Authorization: Authenticated user (no specific permission required).
11344*/
11345        async fn list_user_sandboxes(
11346            &self,
11347            request: tonic::Request<super::ListUserSandboxesRequest>,
11348        ) -> std::result::Result<
11349            tonic::Response<super::ListUserSandboxesResponse>,
11350            tonic::Status,
11351        >;
11352    }
11353    /** Manages organizations (tenants) in the Pidgr platform.
11354 Most RPCs operate within the caller's org (extracted from JWT).
11355 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11356*/
11357    #[derive(Debug)]
11358    pub struct OrganizationServiceServer<T> {
11359        inner: Arc<T>,
11360        accept_compression_encodings: EnabledCompressionEncodings,
11361        send_compression_encodings: EnabledCompressionEncodings,
11362        max_decoding_message_size: Option<usize>,
11363        max_encoding_message_size: Option<usize>,
11364    }
11365    impl<T> OrganizationServiceServer<T> {
11366        pub fn new(inner: T) -> Self {
11367            Self::from_arc(Arc::new(inner))
11368        }
11369        pub fn from_arc(inner: Arc<T>) -> Self {
11370            Self {
11371                inner,
11372                accept_compression_encodings: Default::default(),
11373                send_compression_encodings: Default::default(),
11374                max_decoding_message_size: None,
11375                max_encoding_message_size: None,
11376            }
11377        }
11378        pub fn with_interceptor<F>(
11379            inner: T,
11380            interceptor: F,
11381        ) -> InterceptedService<Self, F>
11382        where
11383            F: tonic::service::Interceptor,
11384        {
11385            InterceptedService::new(Self::new(inner), interceptor)
11386        }
11387        /// Enable decompressing requests with the given encoding.
11388        #[must_use]
11389        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11390            self.accept_compression_encodings.enable(encoding);
11391            self
11392        }
11393        /// Compress responses with the given encoding, if the client supports it.
11394        #[must_use]
11395        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11396            self.send_compression_encodings.enable(encoding);
11397            self
11398        }
11399        /// Limits the maximum size of a decoded message.
11400        ///
11401        /// Default: `4MB`
11402        #[must_use]
11403        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11404            self.max_decoding_message_size = Some(limit);
11405            self
11406        }
11407        /// Limits the maximum size of an encoded message.
11408        ///
11409        /// Default: `usize::MAX`
11410        #[must_use]
11411        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11412            self.max_encoding_message_size = Some(limit);
11413            self
11414        }
11415    }
11416    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
11417    where
11418        T: OrganizationService,
11419        B: Body + std::marker::Send + 'static,
11420        B::Error: Into<StdError> + std::marker::Send + 'static,
11421    {
11422        type Response = http::Response<tonic::body::Body>;
11423        type Error = std::convert::Infallible;
11424        type Future = BoxFuture<Self::Response, Self::Error>;
11425        fn poll_ready(
11426            &mut self,
11427            _cx: &mut Context<'_>,
11428        ) -> Poll<std::result::Result<(), Self::Error>> {
11429            Poll::Ready(Ok(()))
11430        }
11431        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11432            match req.uri().path() {
11433                "/pidgr.v1.OrganizationService/CreateOrganization" => {
11434                    #[allow(non_camel_case_types)]
11435                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
11436                    impl<
11437                        T: OrganizationService,
11438                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
11439                    for CreateOrganizationSvc<T> {
11440                        type Response = super::CreateOrganizationResponse;
11441                        type Future = BoxFuture<
11442                            tonic::Response<Self::Response>,
11443                            tonic::Status,
11444                        >;
11445                        fn call(
11446                            &mut self,
11447                            request: tonic::Request<super::CreateOrganizationRequest>,
11448                        ) -> Self::Future {
11449                            let inner = Arc::clone(&self.0);
11450                            let fut = async move {
11451                                <T as OrganizationService>::create_organization(
11452                                        &inner,
11453                                        request,
11454                                    )
11455                                    .await
11456                            };
11457                            Box::pin(fut)
11458                        }
11459                    }
11460                    let accept_compression_encodings = self.accept_compression_encodings;
11461                    let send_compression_encodings = self.send_compression_encodings;
11462                    let max_decoding_message_size = self.max_decoding_message_size;
11463                    let max_encoding_message_size = self.max_encoding_message_size;
11464                    let inner = self.inner.clone();
11465                    let fut = async move {
11466                        let method = CreateOrganizationSvc(inner);
11467                        let codec = tonic_prost::ProstCodec::default();
11468                        let mut grpc = tonic::server::Grpc::new(codec)
11469                            .apply_compression_config(
11470                                accept_compression_encodings,
11471                                send_compression_encodings,
11472                            )
11473                            .apply_max_message_size_config(
11474                                max_decoding_message_size,
11475                                max_encoding_message_size,
11476                            );
11477                        let res = grpc.unary(method, req).await;
11478                        Ok(res)
11479                    };
11480                    Box::pin(fut)
11481                }
11482                "/pidgr.v1.OrganizationService/GetOrganization" => {
11483                    #[allow(non_camel_case_types)]
11484                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
11485                    impl<
11486                        T: OrganizationService,
11487                    > tonic::server::UnaryService<super::GetOrganizationRequest>
11488                    for GetOrganizationSvc<T> {
11489                        type Response = super::GetOrganizationResponse;
11490                        type Future = BoxFuture<
11491                            tonic::Response<Self::Response>,
11492                            tonic::Status,
11493                        >;
11494                        fn call(
11495                            &mut self,
11496                            request: tonic::Request<super::GetOrganizationRequest>,
11497                        ) -> Self::Future {
11498                            let inner = Arc::clone(&self.0);
11499                            let fut = async move {
11500                                <T as OrganizationService>::get_organization(
11501                                        &inner,
11502                                        request,
11503                                    )
11504                                    .await
11505                            };
11506                            Box::pin(fut)
11507                        }
11508                    }
11509                    let accept_compression_encodings = self.accept_compression_encodings;
11510                    let send_compression_encodings = self.send_compression_encodings;
11511                    let max_decoding_message_size = self.max_decoding_message_size;
11512                    let max_encoding_message_size = self.max_encoding_message_size;
11513                    let inner = self.inner.clone();
11514                    let fut = async move {
11515                        let method = GetOrganizationSvc(inner);
11516                        let codec = tonic_prost::ProstCodec::default();
11517                        let mut grpc = tonic::server::Grpc::new(codec)
11518                            .apply_compression_config(
11519                                accept_compression_encodings,
11520                                send_compression_encodings,
11521                            )
11522                            .apply_max_message_size_config(
11523                                max_decoding_message_size,
11524                                max_encoding_message_size,
11525                            );
11526                        let res = grpc.unary(method, req).await;
11527                        Ok(res)
11528                    };
11529                    Box::pin(fut)
11530                }
11531                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
11532                    #[allow(non_camel_case_types)]
11533                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
11534                    impl<
11535                        T: OrganizationService,
11536                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
11537                    for UpdateOrganizationSvc<T> {
11538                        type Response = super::UpdateOrganizationResponse;
11539                        type Future = BoxFuture<
11540                            tonic::Response<Self::Response>,
11541                            tonic::Status,
11542                        >;
11543                        fn call(
11544                            &mut self,
11545                            request: tonic::Request<super::UpdateOrganizationRequest>,
11546                        ) -> Self::Future {
11547                            let inner = Arc::clone(&self.0);
11548                            let fut = async move {
11549                                <T as OrganizationService>::update_organization(
11550                                        &inner,
11551                                        request,
11552                                    )
11553                                    .await
11554                            };
11555                            Box::pin(fut)
11556                        }
11557                    }
11558                    let accept_compression_encodings = self.accept_compression_encodings;
11559                    let send_compression_encodings = self.send_compression_encodings;
11560                    let max_decoding_message_size = self.max_decoding_message_size;
11561                    let max_encoding_message_size = self.max_encoding_message_size;
11562                    let inner = self.inner.clone();
11563                    let fut = async move {
11564                        let method = UpdateOrganizationSvc(inner);
11565                        let codec = tonic_prost::ProstCodec::default();
11566                        let mut grpc = tonic::server::Grpc::new(codec)
11567                            .apply_compression_config(
11568                                accept_compression_encodings,
11569                                send_compression_encodings,
11570                            )
11571                            .apply_max_message_size_config(
11572                                max_decoding_message_size,
11573                                max_encoding_message_size,
11574                            );
11575                        let res = grpc.unary(method, req).await;
11576                        Ok(res)
11577                    };
11578                    Box::pin(fut)
11579                }
11580                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
11581                    #[allow(non_camel_case_types)]
11582                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
11583                        pub Arc<T>,
11584                    );
11585                    impl<
11586                        T: OrganizationService,
11587                    > tonic::server::UnaryService<
11588                        super::UpdateSsoAttributeMappingsRequest,
11589                    > for UpdateSsoAttributeMappingsSvc<T> {
11590                        type Response = super::UpdateSsoAttributeMappingsResponse;
11591                        type Future = BoxFuture<
11592                            tonic::Response<Self::Response>,
11593                            tonic::Status,
11594                        >;
11595                        fn call(
11596                            &mut self,
11597                            request: tonic::Request<
11598                                super::UpdateSsoAttributeMappingsRequest,
11599                            >,
11600                        ) -> Self::Future {
11601                            let inner = Arc::clone(&self.0);
11602                            let fut = async move {
11603                                <T as OrganizationService>::update_sso_attribute_mappings(
11604                                        &inner,
11605                                        request,
11606                                    )
11607                                    .await
11608                            };
11609                            Box::pin(fut)
11610                        }
11611                    }
11612                    let accept_compression_encodings = self.accept_compression_encodings;
11613                    let send_compression_encodings = self.send_compression_encodings;
11614                    let max_decoding_message_size = self.max_decoding_message_size;
11615                    let max_encoding_message_size = self.max_encoding_message_size;
11616                    let inner = self.inner.clone();
11617                    let fut = async move {
11618                        let method = UpdateSsoAttributeMappingsSvc(inner);
11619                        let codec = tonic_prost::ProstCodec::default();
11620                        let mut grpc = tonic::server::Grpc::new(codec)
11621                            .apply_compression_config(
11622                                accept_compression_encodings,
11623                                send_compression_encodings,
11624                            )
11625                            .apply_max_message_size_config(
11626                                max_decoding_message_size,
11627                                max_encoding_message_size,
11628                            );
11629                        let res = grpc.unary(method, req).await;
11630                        Ok(res)
11631                    };
11632                    Box::pin(fut)
11633                }
11634                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
11635                    #[allow(non_camel_case_types)]
11636                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
11637                    impl<
11638                        T: OrganizationService,
11639                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
11640                    for RotateAnalyticsSaltSvc<T> {
11641                        type Response = super::RotateAnalyticsSaltResponse;
11642                        type Future = BoxFuture<
11643                            tonic::Response<Self::Response>,
11644                            tonic::Status,
11645                        >;
11646                        fn call(
11647                            &mut self,
11648                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
11649                        ) -> Self::Future {
11650                            let inner = Arc::clone(&self.0);
11651                            let fut = async move {
11652                                <T as OrganizationService>::rotate_analytics_salt(
11653                                        &inner,
11654                                        request,
11655                                    )
11656                                    .await
11657                            };
11658                            Box::pin(fut)
11659                        }
11660                    }
11661                    let accept_compression_encodings = self.accept_compression_encodings;
11662                    let send_compression_encodings = self.send_compression_encodings;
11663                    let max_decoding_message_size = self.max_decoding_message_size;
11664                    let max_encoding_message_size = self.max_encoding_message_size;
11665                    let inner = self.inner.clone();
11666                    let fut = async move {
11667                        let method = RotateAnalyticsSaltSvc(inner);
11668                        let codec = tonic_prost::ProstCodec::default();
11669                        let mut grpc = tonic::server::Grpc::new(codec)
11670                            .apply_compression_config(
11671                                accept_compression_encodings,
11672                                send_compression_encodings,
11673                            )
11674                            .apply_max_message_size_config(
11675                                max_decoding_message_size,
11676                                max_encoding_message_size,
11677                            );
11678                        let res = grpc.unary(method, req).await;
11679                        Ok(res)
11680                    };
11681                    Box::pin(fut)
11682                }
11683                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
11684                    #[allow(non_camel_case_types)]
11685                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
11686                    impl<
11687                        T: OrganizationService,
11688                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
11689                    for UpdateAnalyticsEpsilonSvc<T> {
11690                        type Response = super::UpdateAnalyticsEpsilonResponse;
11691                        type Future = BoxFuture<
11692                            tonic::Response<Self::Response>,
11693                            tonic::Status,
11694                        >;
11695                        fn call(
11696                            &mut self,
11697                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
11698                        ) -> Self::Future {
11699                            let inner = Arc::clone(&self.0);
11700                            let fut = async move {
11701                                <T as OrganizationService>::update_analytics_epsilon(
11702                                        &inner,
11703                                        request,
11704                                    )
11705                                    .await
11706                            };
11707                            Box::pin(fut)
11708                        }
11709                    }
11710                    let accept_compression_encodings = self.accept_compression_encodings;
11711                    let send_compression_encodings = self.send_compression_encodings;
11712                    let max_decoding_message_size = self.max_decoding_message_size;
11713                    let max_encoding_message_size = self.max_encoding_message_size;
11714                    let inner = self.inner.clone();
11715                    let fut = async move {
11716                        let method = UpdateAnalyticsEpsilonSvc(inner);
11717                        let codec = tonic_prost::ProstCodec::default();
11718                        let mut grpc = tonic::server::Grpc::new(codec)
11719                            .apply_compression_config(
11720                                accept_compression_encodings,
11721                                send_compression_encodings,
11722                            )
11723                            .apply_max_message_size_config(
11724                                max_decoding_message_size,
11725                                max_encoding_message_size,
11726                            );
11727                        let res = grpc.unary(method, req).await;
11728                        Ok(res)
11729                    };
11730                    Box::pin(fut)
11731                }
11732                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
11733                    #[allow(non_camel_case_types)]
11734                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
11735                        pub Arc<T>,
11736                    );
11737                    impl<
11738                        T: OrganizationService,
11739                    > tonic::server::UnaryService<
11740                        super::CreateSandboxOrganizationRequest,
11741                    > for CreateSandboxOrganizationSvc<T> {
11742                        type Response = super::CreateSandboxOrganizationResponse;
11743                        type Future = BoxFuture<
11744                            tonic::Response<Self::Response>,
11745                            tonic::Status,
11746                        >;
11747                        fn call(
11748                            &mut self,
11749                            request: tonic::Request<
11750                                super::CreateSandboxOrganizationRequest,
11751                            >,
11752                        ) -> Self::Future {
11753                            let inner = Arc::clone(&self.0);
11754                            let fut = async move {
11755                                <T as OrganizationService>::create_sandbox_organization(
11756                                        &inner,
11757                                        request,
11758                                    )
11759                                    .await
11760                            };
11761                            Box::pin(fut)
11762                        }
11763                    }
11764                    let accept_compression_encodings = self.accept_compression_encodings;
11765                    let send_compression_encodings = self.send_compression_encodings;
11766                    let max_decoding_message_size = self.max_decoding_message_size;
11767                    let max_encoding_message_size = self.max_encoding_message_size;
11768                    let inner = self.inner.clone();
11769                    let fut = async move {
11770                        let method = CreateSandboxOrganizationSvc(inner);
11771                        let codec = tonic_prost::ProstCodec::default();
11772                        let mut grpc = tonic::server::Grpc::new(codec)
11773                            .apply_compression_config(
11774                                accept_compression_encodings,
11775                                send_compression_encodings,
11776                            )
11777                            .apply_max_message_size_config(
11778                                max_decoding_message_size,
11779                                max_encoding_message_size,
11780                            );
11781                        let res = grpc.unary(method, req).await;
11782                        Ok(res)
11783                    };
11784                    Box::pin(fut)
11785                }
11786                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
11787                    #[allow(non_camel_case_types)]
11788                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
11789                        pub Arc<T>,
11790                    );
11791                    impl<
11792                        T: OrganizationService,
11793                    > tonic::server::UnaryService<
11794                        super::DeleteSandboxOrganizationRequest,
11795                    > for DeleteSandboxOrganizationSvc<T> {
11796                        type Response = super::DeleteSandboxOrganizationResponse;
11797                        type Future = BoxFuture<
11798                            tonic::Response<Self::Response>,
11799                            tonic::Status,
11800                        >;
11801                        fn call(
11802                            &mut self,
11803                            request: tonic::Request<
11804                                super::DeleteSandboxOrganizationRequest,
11805                            >,
11806                        ) -> Self::Future {
11807                            let inner = Arc::clone(&self.0);
11808                            let fut = async move {
11809                                <T as OrganizationService>::delete_sandbox_organization(
11810                                        &inner,
11811                                        request,
11812                                    )
11813                                    .await
11814                            };
11815                            Box::pin(fut)
11816                        }
11817                    }
11818                    let accept_compression_encodings = self.accept_compression_encodings;
11819                    let send_compression_encodings = self.send_compression_encodings;
11820                    let max_decoding_message_size = self.max_decoding_message_size;
11821                    let max_encoding_message_size = self.max_encoding_message_size;
11822                    let inner = self.inner.clone();
11823                    let fut = async move {
11824                        let method = DeleteSandboxOrganizationSvc(inner);
11825                        let codec = tonic_prost::ProstCodec::default();
11826                        let mut grpc = tonic::server::Grpc::new(codec)
11827                            .apply_compression_config(
11828                                accept_compression_encodings,
11829                                send_compression_encodings,
11830                            )
11831                            .apply_max_message_size_config(
11832                                max_decoding_message_size,
11833                                max_encoding_message_size,
11834                            );
11835                        let res = grpc.unary(method, req).await;
11836                        Ok(res)
11837                    };
11838                    Box::pin(fut)
11839                }
11840                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
11841                    #[allow(non_camel_case_types)]
11842                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
11843                    impl<
11844                        T: OrganizationService,
11845                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
11846                    for ListSandboxFixturesSvc<T> {
11847                        type Response = super::ListSandboxFixturesResponse;
11848                        type Future = BoxFuture<
11849                            tonic::Response<Self::Response>,
11850                            tonic::Status,
11851                        >;
11852                        fn call(
11853                            &mut self,
11854                            request: tonic::Request<super::ListSandboxFixturesRequest>,
11855                        ) -> Self::Future {
11856                            let inner = Arc::clone(&self.0);
11857                            let fut = async move {
11858                                <T as OrganizationService>::list_sandbox_fixtures(
11859                                        &inner,
11860                                        request,
11861                                    )
11862                                    .await
11863                            };
11864                            Box::pin(fut)
11865                        }
11866                    }
11867                    let accept_compression_encodings = self.accept_compression_encodings;
11868                    let send_compression_encodings = self.send_compression_encodings;
11869                    let max_decoding_message_size = self.max_decoding_message_size;
11870                    let max_encoding_message_size = self.max_encoding_message_size;
11871                    let inner = self.inner.clone();
11872                    let fut = async move {
11873                        let method = ListSandboxFixturesSvc(inner);
11874                        let codec = tonic_prost::ProstCodec::default();
11875                        let mut grpc = tonic::server::Grpc::new(codec)
11876                            .apply_compression_config(
11877                                accept_compression_encodings,
11878                                send_compression_encodings,
11879                            )
11880                            .apply_max_message_size_config(
11881                                max_decoding_message_size,
11882                                max_encoding_message_size,
11883                            );
11884                        let res = grpc.unary(method, req).await;
11885                        Ok(res)
11886                    };
11887                    Box::pin(fut)
11888                }
11889                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
11890                    #[allow(non_camel_case_types)]
11891                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
11892                    impl<
11893                        T: OrganizationService,
11894                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
11895                    for ListUserOrganizationsSvc<T> {
11896                        type Response = super::ListUserOrganizationsResponse;
11897                        type Future = BoxFuture<
11898                            tonic::Response<Self::Response>,
11899                            tonic::Status,
11900                        >;
11901                        fn call(
11902                            &mut self,
11903                            request: tonic::Request<super::ListUserOrganizationsRequest>,
11904                        ) -> Self::Future {
11905                            let inner = Arc::clone(&self.0);
11906                            let fut = async move {
11907                                <T as OrganizationService>::list_user_organizations(
11908                                        &inner,
11909                                        request,
11910                                    )
11911                                    .await
11912                            };
11913                            Box::pin(fut)
11914                        }
11915                    }
11916                    let accept_compression_encodings = self.accept_compression_encodings;
11917                    let send_compression_encodings = self.send_compression_encodings;
11918                    let max_decoding_message_size = self.max_decoding_message_size;
11919                    let max_encoding_message_size = self.max_encoding_message_size;
11920                    let inner = self.inner.clone();
11921                    let fut = async move {
11922                        let method = ListUserOrganizationsSvc(inner);
11923                        let codec = tonic_prost::ProstCodec::default();
11924                        let mut grpc = tonic::server::Grpc::new(codec)
11925                            .apply_compression_config(
11926                                accept_compression_encodings,
11927                                send_compression_encodings,
11928                            )
11929                            .apply_max_message_size_config(
11930                                max_decoding_message_size,
11931                                max_encoding_message_size,
11932                            );
11933                        let res = grpc.unary(method, req).await;
11934                        Ok(res)
11935                    };
11936                    Box::pin(fut)
11937                }
11938                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
11939                    #[allow(non_camel_case_types)]
11940                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
11941                    impl<
11942                        T: OrganizationService,
11943                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
11944                    for ListUserSandboxesSvc<T> {
11945                        type Response = super::ListUserSandboxesResponse;
11946                        type Future = BoxFuture<
11947                            tonic::Response<Self::Response>,
11948                            tonic::Status,
11949                        >;
11950                        fn call(
11951                            &mut self,
11952                            request: tonic::Request<super::ListUserSandboxesRequest>,
11953                        ) -> Self::Future {
11954                            let inner = Arc::clone(&self.0);
11955                            let fut = async move {
11956                                <T as OrganizationService>::list_user_sandboxes(
11957                                        &inner,
11958                                        request,
11959                                    )
11960                                    .await
11961                            };
11962                            Box::pin(fut)
11963                        }
11964                    }
11965                    let accept_compression_encodings = self.accept_compression_encodings;
11966                    let send_compression_encodings = self.send_compression_encodings;
11967                    let max_decoding_message_size = self.max_decoding_message_size;
11968                    let max_encoding_message_size = self.max_encoding_message_size;
11969                    let inner = self.inner.clone();
11970                    let fut = async move {
11971                        let method = ListUserSandboxesSvc(inner);
11972                        let codec = tonic_prost::ProstCodec::default();
11973                        let mut grpc = tonic::server::Grpc::new(codec)
11974                            .apply_compression_config(
11975                                accept_compression_encodings,
11976                                send_compression_encodings,
11977                            )
11978                            .apply_max_message_size_config(
11979                                max_decoding_message_size,
11980                                max_encoding_message_size,
11981                            );
11982                        let res = grpc.unary(method, req).await;
11983                        Ok(res)
11984                    };
11985                    Box::pin(fut)
11986                }
11987                _ => {
11988                    Box::pin(async move {
11989                        let mut response = http::Response::new(
11990                            tonic::body::Body::default(),
11991                        );
11992                        let headers = response.headers_mut();
11993                        headers
11994                            .insert(
11995                                tonic::Status::GRPC_STATUS,
11996                                (tonic::Code::Unimplemented as i32).into(),
11997                            );
11998                        headers
11999                            .insert(
12000                                http::header::CONTENT_TYPE,
12001                                tonic::metadata::GRPC_CONTENT_TYPE,
12002                            );
12003                        Ok(response)
12004                    })
12005                }
12006            }
12007        }
12008    }
12009    impl<T> Clone for OrganizationServiceServer<T> {
12010        fn clone(&self) -> Self {
12011            let inner = self.inner.clone();
12012            Self {
12013                inner,
12014                accept_compression_encodings: self.accept_compression_encodings,
12015                send_compression_encodings: self.send_compression_encodings,
12016                max_decoding_message_size: self.max_decoding_message_size,
12017                max_encoding_message_size: self.max_encoding_message_size,
12018            }
12019        }
12020    }
12021    /// Generated gRPC service name
12022    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
12023    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
12024        const NAME: &'static str = SERVICE_NAME;
12025    }
12026}
12027/// Generated client implementations.
12028pub mod render_service_client {
12029    #![allow(
12030        unused_variables,
12031        dead_code,
12032        missing_docs,
12033        clippy::wildcard_imports,
12034        clippy::let_unit_value,
12035    )]
12036    use tonic::codegen::*;
12037    use tonic::codegen::http::Uri;
12038    /** Internal service for batch template rendering.
12039*/
12040    #[derive(Debug, Clone)]
12041    pub struct RenderServiceClient<T> {
12042        inner: tonic::client::Grpc<T>,
12043    }
12044    impl RenderServiceClient<tonic::transport::Channel> {
12045        /// Attempt to create a new client by connecting to a given endpoint.
12046        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12047        where
12048            D: TryInto<tonic::transport::Endpoint>,
12049            D::Error: Into<StdError>,
12050        {
12051            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12052            Ok(Self::new(conn))
12053        }
12054    }
12055    impl<T> RenderServiceClient<T>
12056    where
12057        T: tonic::client::GrpcService<tonic::body::Body>,
12058        T::Error: Into<StdError>,
12059        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12060        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12061    {
12062        pub fn new(inner: T) -> Self {
12063            let inner = tonic::client::Grpc::new(inner);
12064            Self { inner }
12065        }
12066        pub fn with_origin(inner: T, origin: Uri) -> Self {
12067            let inner = tonic::client::Grpc::with_origin(inner, origin);
12068            Self { inner }
12069        }
12070        pub fn with_interceptor<F>(
12071            inner: T,
12072            interceptor: F,
12073        ) -> RenderServiceClient<InterceptedService<T, F>>
12074        where
12075            F: tonic::service::Interceptor,
12076            T::ResponseBody: Default,
12077            T: tonic::codegen::Service<
12078                http::Request<tonic::body::Body>,
12079                Response = http::Response<
12080                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12081                >,
12082            >,
12083            <T as tonic::codegen::Service<
12084                http::Request<tonic::body::Body>,
12085            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12086        {
12087            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
12088        }
12089        /// Compress requests with the given encoding.
12090        ///
12091        /// This requires the server to support it otherwise it might respond with an
12092        /// error.
12093        #[must_use]
12094        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12095            self.inner = self.inner.send_compressed(encoding);
12096            self
12097        }
12098        /// Enable decompressing responses.
12099        #[must_use]
12100        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12101            self.inner = self.inner.accept_compressed(encoding);
12102            self
12103        }
12104        /// Limits the maximum size of a decoded message.
12105        ///
12106        /// Default: `4MB`
12107        #[must_use]
12108        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12109            self.inner = self.inner.max_decoding_message_size(limit);
12110            self
12111        }
12112        /// Limits the maximum size of an encoded message.
12113        ///
12114        /// Default: `usize::MAX`
12115        #[must_use]
12116        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12117            self.inner = self.inner.max_encoding_message_size(limit);
12118            self
12119        }
12120        /** Render a template for multiple users, streaming results as each completes.
12121 Authorization: Internal server-to-server only. Not exposed to external clients.
12122*/
12123        pub async fn render_batch(
12124            &mut self,
12125            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
12126        ) -> std::result::Result<
12127            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
12128            tonic::Status,
12129        > {
12130            self.inner
12131                .ready()
12132                .await
12133                .map_err(|e| {
12134                    tonic::Status::unknown(
12135                        format!("Service was not ready: {}", e.into()),
12136                    )
12137                })?;
12138            let codec = tonic_prost::ProstCodec::default();
12139            let path = http::uri::PathAndQuery::from_static(
12140                "/pidgr.v1.RenderService/RenderBatch",
12141            );
12142            let mut req = request.into_request();
12143            req.extensions_mut()
12144                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
12145            self.inner.server_streaming(req, path, codec).await
12146        }
12147    }
12148}
12149/// Generated server implementations.
12150pub mod render_service_server {
12151    #![allow(
12152        unused_variables,
12153        dead_code,
12154        missing_docs,
12155        clippy::wildcard_imports,
12156        clippy::let_unit_value,
12157    )]
12158    use tonic::codegen::*;
12159    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
12160    #[async_trait]
12161    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
12162        /// Server streaming response type for the RenderBatch method.
12163        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
12164                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
12165            >
12166            + std::marker::Send
12167            + 'static;
12168        /** Render a template for multiple users, streaming results as each completes.
12169 Authorization: Internal server-to-server only. Not exposed to external clients.
12170*/
12171        async fn render_batch(
12172            &self,
12173            request: tonic::Request<super::RenderBatchRequest>,
12174        ) -> std::result::Result<
12175            tonic::Response<Self::RenderBatchStream>,
12176            tonic::Status,
12177        >;
12178    }
12179    /** Internal service for batch template rendering.
12180*/
12181    #[derive(Debug)]
12182    pub struct RenderServiceServer<T> {
12183        inner: Arc<T>,
12184        accept_compression_encodings: EnabledCompressionEncodings,
12185        send_compression_encodings: EnabledCompressionEncodings,
12186        max_decoding_message_size: Option<usize>,
12187        max_encoding_message_size: Option<usize>,
12188    }
12189    impl<T> RenderServiceServer<T> {
12190        pub fn new(inner: T) -> Self {
12191            Self::from_arc(Arc::new(inner))
12192        }
12193        pub fn from_arc(inner: Arc<T>) -> Self {
12194            Self {
12195                inner,
12196                accept_compression_encodings: Default::default(),
12197                send_compression_encodings: Default::default(),
12198                max_decoding_message_size: None,
12199                max_encoding_message_size: None,
12200            }
12201        }
12202        pub fn with_interceptor<F>(
12203            inner: T,
12204            interceptor: F,
12205        ) -> InterceptedService<Self, F>
12206        where
12207            F: tonic::service::Interceptor,
12208        {
12209            InterceptedService::new(Self::new(inner), interceptor)
12210        }
12211        /// Enable decompressing requests with the given encoding.
12212        #[must_use]
12213        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12214            self.accept_compression_encodings.enable(encoding);
12215            self
12216        }
12217        /// Compress responses with the given encoding, if the client supports it.
12218        #[must_use]
12219        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12220            self.send_compression_encodings.enable(encoding);
12221            self
12222        }
12223        /// Limits the maximum size of a decoded message.
12224        ///
12225        /// Default: `4MB`
12226        #[must_use]
12227        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12228            self.max_decoding_message_size = Some(limit);
12229            self
12230        }
12231        /// Limits the maximum size of an encoded message.
12232        ///
12233        /// Default: `usize::MAX`
12234        #[must_use]
12235        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12236            self.max_encoding_message_size = Some(limit);
12237            self
12238        }
12239    }
12240    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
12241    where
12242        T: RenderService,
12243        B: Body + std::marker::Send + 'static,
12244        B::Error: Into<StdError> + std::marker::Send + 'static,
12245    {
12246        type Response = http::Response<tonic::body::Body>;
12247        type Error = std::convert::Infallible;
12248        type Future = BoxFuture<Self::Response, Self::Error>;
12249        fn poll_ready(
12250            &mut self,
12251            _cx: &mut Context<'_>,
12252        ) -> Poll<std::result::Result<(), Self::Error>> {
12253            Poll::Ready(Ok(()))
12254        }
12255        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12256            match req.uri().path() {
12257                "/pidgr.v1.RenderService/RenderBatch" => {
12258                    #[allow(non_camel_case_types)]
12259                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
12260                    impl<
12261                        T: RenderService,
12262                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
12263                    for RenderBatchSvc<T> {
12264                        type Response = super::RenderBatchResponse;
12265                        type ResponseStream = T::RenderBatchStream;
12266                        type Future = BoxFuture<
12267                            tonic::Response<Self::ResponseStream>,
12268                            tonic::Status,
12269                        >;
12270                        fn call(
12271                            &mut self,
12272                            request: tonic::Request<super::RenderBatchRequest>,
12273                        ) -> Self::Future {
12274                            let inner = Arc::clone(&self.0);
12275                            let fut = async move {
12276                                <T as RenderService>::render_batch(&inner, request).await
12277                            };
12278                            Box::pin(fut)
12279                        }
12280                    }
12281                    let accept_compression_encodings = self.accept_compression_encodings;
12282                    let send_compression_encodings = self.send_compression_encodings;
12283                    let max_decoding_message_size = self.max_decoding_message_size;
12284                    let max_encoding_message_size = self.max_encoding_message_size;
12285                    let inner = self.inner.clone();
12286                    let fut = async move {
12287                        let method = RenderBatchSvc(inner);
12288                        let codec = tonic_prost::ProstCodec::default();
12289                        let mut grpc = tonic::server::Grpc::new(codec)
12290                            .apply_compression_config(
12291                                accept_compression_encodings,
12292                                send_compression_encodings,
12293                            )
12294                            .apply_max_message_size_config(
12295                                max_decoding_message_size,
12296                                max_encoding_message_size,
12297                            );
12298                        let res = grpc.server_streaming(method, req).await;
12299                        Ok(res)
12300                    };
12301                    Box::pin(fut)
12302                }
12303                _ => {
12304                    Box::pin(async move {
12305                        let mut response = http::Response::new(
12306                            tonic::body::Body::default(),
12307                        );
12308                        let headers = response.headers_mut();
12309                        headers
12310                            .insert(
12311                                tonic::Status::GRPC_STATUS,
12312                                (tonic::Code::Unimplemented as i32).into(),
12313                            );
12314                        headers
12315                            .insert(
12316                                http::header::CONTENT_TYPE,
12317                                tonic::metadata::GRPC_CONTENT_TYPE,
12318                            );
12319                        Ok(response)
12320                    })
12321                }
12322            }
12323        }
12324    }
12325    impl<T> Clone for RenderServiceServer<T> {
12326        fn clone(&self) -> Self {
12327            let inner = self.inner.clone();
12328            Self {
12329                inner,
12330                accept_compression_encodings: self.accept_compression_encodings,
12331                send_compression_encodings: self.send_compression_encodings,
12332                max_decoding_message_size: self.max_decoding_message_size,
12333                max_encoding_message_size: self.max_encoding_message_size,
12334            }
12335        }
12336    }
12337    /// Generated gRPC service name
12338    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
12339    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
12340        const NAME: &'static str = SERVICE_NAME;
12341    }
12342}
12343/// Generated client implementations.
12344pub mod replay_service_client {
12345    #![allow(
12346        unused_variables,
12347        dead_code,
12348        missing_docs,
12349        clippy::wildcard_imports,
12350        clippy::let_unit_value,
12351    )]
12352    use tonic::codegen::*;
12353    use tonic::codegen::http::Uri;
12354    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
12355 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
12356*/
12357    #[derive(Debug, Clone)]
12358    pub struct ReplayServiceClient<T> {
12359        inner: tonic::client::Grpc<T>,
12360    }
12361    impl ReplayServiceClient<tonic::transport::Channel> {
12362        /// Attempt to create a new client by connecting to a given endpoint.
12363        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12364        where
12365            D: TryInto<tonic::transport::Endpoint>,
12366            D::Error: Into<StdError>,
12367        {
12368            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12369            Ok(Self::new(conn))
12370        }
12371    }
12372    impl<T> ReplayServiceClient<T>
12373    where
12374        T: tonic::client::GrpcService<tonic::body::Body>,
12375        T::Error: Into<StdError>,
12376        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12377        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12378    {
12379        pub fn new(inner: T) -> Self {
12380            let inner = tonic::client::Grpc::new(inner);
12381            Self { inner }
12382        }
12383        pub fn with_origin(inner: T, origin: Uri) -> Self {
12384            let inner = tonic::client::Grpc::with_origin(inner, origin);
12385            Self { inner }
12386        }
12387        pub fn with_interceptor<F>(
12388            inner: T,
12389            interceptor: F,
12390        ) -> ReplayServiceClient<InterceptedService<T, F>>
12391        where
12392            F: tonic::service::Interceptor,
12393            T::ResponseBody: Default,
12394            T: tonic::codegen::Service<
12395                http::Request<tonic::body::Body>,
12396                Response = http::Response<
12397                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12398                >,
12399            >,
12400            <T as tonic::codegen::Service<
12401                http::Request<tonic::body::Body>,
12402            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12403        {
12404            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
12405        }
12406        /// Compress requests with the given encoding.
12407        ///
12408        /// This requires the server to support it otherwise it might respond with an
12409        /// error.
12410        #[must_use]
12411        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12412            self.inner = self.inner.send_compressed(encoding);
12413            self
12414        }
12415        /// Enable decompressing responses.
12416        #[must_use]
12417        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12418            self.inner = self.inner.accept_compressed(encoding);
12419            self
12420        }
12421        /// Limits the maximum size of a decoded message.
12422        ///
12423        /// Default: `4MB`
12424        #[must_use]
12425        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12426            self.inner = self.inner.max_decoding_message_size(limit);
12427            self
12428        }
12429        /// Limits the maximum size of an encoded message.
12430        ///
12431        /// Default: `usize::MAX`
12432        #[must_use]
12433        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12434            self.inner = self.inner.max_encoding_message_size(limit);
12435            self
12436        }
12437        /** List recent session recordings with optional campaign and time range filters.
12438 Authorization: Requires CAMPAIGNS_READ permission.
12439*/
12440        pub async fn list_session_recordings(
12441            &mut self,
12442            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
12443        ) -> std::result::Result<
12444            tonic::Response<super::ListSessionRecordingsResponse>,
12445            tonic::Status,
12446        > {
12447            self.inner
12448                .ready()
12449                .await
12450                .map_err(|e| {
12451                    tonic::Status::unknown(
12452                        format!("Service was not ready: {}", e.into()),
12453                    )
12454                })?;
12455            let codec = tonic_prost::ProstCodec::default();
12456            let path = http::uri::PathAndQuery::from_static(
12457                "/pidgr.v1.ReplayService/ListSessionRecordings",
12458            );
12459            let mut req = request.into_request();
12460            req.extensions_mut()
12461                .insert(
12462                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
12463                );
12464            self.inner.unary(req, path, codec).await
12465        }
12466        /** Fetch the full rrweb snapshot data for a single recording.
12467 Authorization: Requires CAMPAIGNS_READ permission.
12468*/
12469        pub async fn get_session_snapshots(
12470            &mut self,
12471            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
12472        ) -> std::result::Result<
12473            tonic::Response<super::GetSessionSnapshotsResponse>,
12474            tonic::Status,
12475        > {
12476            self.inner
12477                .ready()
12478                .await
12479                .map_err(|e| {
12480                    tonic::Status::unknown(
12481                        format!("Service was not ready: {}", e.into()),
12482                    )
12483                })?;
12484            let codec = tonic_prost::ProstCodec::default();
12485            let path = http::uri::PathAndQuery::from_static(
12486                "/pidgr.v1.ReplayService/GetSessionSnapshots",
12487            );
12488            let mut req = request.into_request();
12489            req.extensions_mut()
12490                .insert(
12491                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
12492                );
12493            self.inner.unary(req, path, codec).await
12494        }
12495    }
12496}
12497/// Generated server implementations.
12498pub mod replay_service_server {
12499    #![allow(
12500        unused_variables,
12501        dead_code,
12502        missing_docs,
12503        clippy::wildcard_imports,
12504        clippy::let_unit_value,
12505    )]
12506    use tonic::codegen::*;
12507    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
12508    #[async_trait]
12509    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
12510        /** List recent session recordings with optional campaign and time range filters.
12511 Authorization: Requires CAMPAIGNS_READ permission.
12512*/
12513        async fn list_session_recordings(
12514            &self,
12515            request: tonic::Request<super::ListSessionRecordingsRequest>,
12516        ) -> std::result::Result<
12517            tonic::Response<super::ListSessionRecordingsResponse>,
12518            tonic::Status,
12519        >;
12520        /** Fetch the full rrweb snapshot data for a single recording.
12521 Authorization: Requires CAMPAIGNS_READ permission.
12522*/
12523        async fn get_session_snapshots(
12524            &self,
12525            request: tonic::Request<super::GetSessionSnapshotsRequest>,
12526        ) -> std::result::Result<
12527            tonic::Response<super::GetSessionSnapshotsResponse>,
12528            tonic::Status,
12529        >;
12530    }
12531    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
12532 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
12533*/
12534    #[derive(Debug)]
12535    pub struct ReplayServiceServer<T> {
12536        inner: Arc<T>,
12537        accept_compression_encodings: EnabledCompressionEncodings,
12538        send_compression_encodings: EnabledCompressionEncodings,
12539        max_decoding_message_size: Option<usize>,
12540        max_encoding_message_size: Option<usize>,
12541    }
12542    impl<T> ReplayServiceServer<T> {
12543        pub fn new(inner: T) -> Self {
12544            Self::from_arc(Arc::new(inner))
12545        }
12546        pub fn from_arc(inner: Arc<T>) -> Self {
12547            Self {
12548                inner,
12549                accept_compression_encodings: Default::default(),
12550                send_compression_encodings: Default::default(),
12551                max_decoding_message_size: None,
12552                max_encoding_message_size: None,
12553            }
12554        }
12555        pub fn with_interceptor<F>(
12556            inner: T,
12557            interceptor: F,
12558        ) -> InterceptedService<Self, F>
12559        where
12560            F: tonic::service::Interceptor,
12561        {
12562            InterceptedService::new(Self::new(inner), interceptor)
12563        }
12564        /// Enable decompressing requests with the given encoding.
12565        #[must_use]
12566        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12567            self.accept_compression_encodings.enable(encoding);
12568            self
12569        }
12570        /// Compress responses with the given encoding, if the client supports it.
12571        #[must_use]
12572        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12573            self.send_compression_encodings.enable(encoding);
12574            self
12575        }
12576        /// Limits the maximum size of a decoded message.
12577        ///
12578        /// Default: `4MB`
12579        #[must_use]
12580        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12581            self.max_decoding_message_size = Some(limit);
12582            self
12583        }
12584        /// Limits the maximum size of an encoded message.
12585        ///
12586        /// Default: `usize::MAX`
12587        #[must_use]
12588        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12589            self.max_encoding_message_size = Some(limit);
12590            self
12591        }
12592    }
12593    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
12594    where
12595        T: ReplayService,
12596        B: Body + std::marker::Send + 'static,
12597        B::Error: Into<StdError> + std::marker::Send + 'static,
12598    {
12599        type Response = http::Response<tonic::body::Body>;
12600        type Error = std::convert::Infallible;
12601        type Future = BoxFuture<Self::Response, Self::Error>;
12602        fn poll_ready(
12603            &mut self,
12604            _cx: &mut Context<'_>,
12605        ) -> Poll<std::result::Result<(), Self::Error>> {
12606            Poll::Ready(Ok(()))
12607        }
12608        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12609            match req.uri().path() {
12610                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
12611                    #[allow(non_camel_case_types)]
12612                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
12613                    impl<
12614                        T: ReplayService,
12615                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
12616                    for ListSessionRecordingsSvc<T> {
12617                        type Response = super::ListSessionRecordingsResponse;
12618                        type Future = BoxFuture<
12619                            tonic::Response<Self::Response>,
12620                            tonic::Status,
12621                        >;
12622                        fn call(
12623                            &mut self,
12624                            request: tonic::Request<super::ListSessionRecordingsRequest>,
12625                        ) -> Self::Future {
12626                            let inner = Arc::clone(&self.0);
12627                            let fut = async move {
12628                                <T as ReplayService>::list_session_recordings(
12629                                        &inner,
12630                                        request,
12631                                    )
12632                                    .await
12633                            };
12634                            Box::pin(fut)
12635                        }
12636                    }
12637                    let accept_compression_encodings = self.accept_compression_encodings;
12638                    let send_compression_encodings = self.send_compression_encodings;
12639                    let max_decoding_message_size = self.max_decoding_message_size;
12640                    let max_encoding_message_size = self.max_encoding_message_size;
12641                    let inner = self.inner.clone();
12642                    let fut = async move {
12643                        let method = ListSessionRecordingsSvc(inner);
12644                        let codec = tonic_prost::ProstCodec::default();
12645                        let mut grpc = tonic::server::Grpc::new(codec)
12646                            .apply_compression_config(
12647                                accept_compression_encodings,
12648                                send_compression_encodings,
12649                            )
12650                            .apply_max_message_size_config(
12651                                max_decoding_message_size,
12652                                max_encoding_message_size,
12653                            );
12654                        let res = grpc.unary(method, req).await;
12655                        Ok(res)
12656                    };
12657                    Box::pin(fut)
12658                }
12659                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
12660                    #[allow(non_camel_case_types)]
12661                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
12662                    impl<
12663                        T: ReplayService,
12664                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
12665                    for GetSessionSnapshotsSvc<T> {
12666                        type Response = super::GetSessionSnapshotsResponse;
12667                        type Future = BoxFuture<
12668                            tonic::Response<Self::Response>,
12669                            tonic::Status,
12670                        >;
12671                        fn call(
12672                            &mut self,
12673                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
12674                        ) -> Self::Future {
12675                            let inner = Arc::clone(&self.0);
12676                            let fut = async move {
12677                                <T as ReplayService>::get_session_snapshots(&inner, request)
12678                                    .await
12679                            };
12680                            Box::pin(fut)
12681                        }
12682                    }
12683                    let accept_compression_encodings = self.accept_compression_encodings;
12684                    let send_compression_encodings = self.send_compression_encodings;
12685                    let max_decoding_message_size = self.max_decoding_message_size;
12686                    let max_encoding_message_size = self.max_encoding_message_size;
12687                    let inner = self.inner.clone();
12688                    let fut = async move {
12689                        let method = GetSessionSnapshotsSvc(inner);
12690                        let codec = tonic_prost::ProstCodec::default();
12691                        let mut grpc = tonic::server::Grpc::new(codec)
12692                            .apply_compression_config(
12693                                accept_compression_encodings,
12694                                send_compression_encodings,
12695                            )
12696                            .apply_max_message_size_config(
12697                                max_decoding_message_size,
12698                                max_encoding_message_size,
12699                            );
12700                        let res = grpc.unary(method, req).await;
12701                        Ok(res)
12702                    };
12703                    Box::pin(fut)
12704                }
12705                _ => {
12706                    Box::pin(async move {
12707                        let mut response = http::Response::new(
12708                            tonic::body::Body::default(),
12709                        );
12710                        let headers = response.headers_mut();
12711                        headers
12712                            .insert(
12713                                tonic::Status::GRPC_STATUS,
12714                                (tonic::Code::Unimplemented as i32).into(),
12715                            );
12716                        headers
12717                            .insert(
12718                                http::header::CONTENT_TYPE,
12719                                tonic::metadata::GRPC_CONTENT_TYPE,
12720                            );
12721                        Ok(response)
12722                    })
12723                }
12724            }
12725        }
12726    }
12727    impl<T> Clone for ReplayServiceServer<T> {
12728        fn clone(&self) -> Self {
12729            let inner = self.inner.clone();
12730            Self {
12731                inner,
12732                accept_compression_encodings: self.accept_compression_encodings,
12733                send_compression_encodings: self.send_compression_encodings,
12734                max_decoding_message_size: self.max_decoding_message_size,
12735                max_encoding_message_size: self.max_encoding_message_size,
12736            }
12737        }
12738    }
12739    /// Generated gRPC service name
12740    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
12741    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
12742        const NAME: &'static str = SERVICE_NAME;
12743    }
12744}
12745/// Generated client implementations.
12746pub mod role_service_client {
12747    #![allow(
12748        unused_variables,
12749        dead_code,
12750        missing_docs,
12751        clippy::wildcard_imports,
12752        clippy::let_unit_value,
12753    )]
12754    use tonic::codegen::*;
12755    use tonic::codegen::http::Uri;
12756    /** Manages roles and their permissions within an organization.
12757 All RPCs operate within the caller's org (extracted from JWT).
12758*/
12759    #[derive(Debug, Clone)]
12760    pub struct RoleServiceClient<T> {
12761        inner: tonic::client::Grpc<T>,
12762    }
12763    impl RoleServiceClient<tonic::transport::Channel> {
12764        /// Attempt to create a new client by connecting to a given endpoint.
12765        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12766        where
12767            D: TryInto<tonic::transport::Endpoint>,
12768            D::Error: Into<StdError>,
12769        {
12770            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12771            Ok(Self::new(conn))
12772        }
12773    }
12774    impl<T> RoleServiceClient<T>
12775    where
12776        T: tonic::client::GrpcService<tonic::body::Body>,
12777        T::Error: Into<StdError>,
12778        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12779        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12780    {
12781        pub fn new(inner: T) -> Self {
12782            let inner = tonic::client::Grpc::new(inner);
12783            Self { inner }
12784        }
12785        pub fn with_origin(inner: T, origin: Uri) -> Self {
12786            let inner = tonic::client::Grpc::with_origin(inner, origin);
12787            Self { inner }
12788        }
12789        pub fn with_interceptor<F>(
12790            inner: T,
12791            interceptor: F,
12792        ) -> RoleServiceClient<InterceptedService<T, F>>
12793        where
12794            F: tonic::service::Interceptor,
12795            T::ResponseBody: Default,
12796            T: tonic::codegen::Service<
12797                http::Request<tonic::body::Body>,
12798                Response = http::Response<
12799                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12800                >,
12801            >,
12802            <T as tonic::codegen::Service<
12803                http::Request<tonic::body::Body>,
12804            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12805        {
12806            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
12807        }
12808        /// Compress requests with the given encoding.
12809        ///
12810        /// This requires the server to support it otherwise it might respond with an
12811        /// error.
12812        #[must_use]
12813        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12814            self.inner = self.inner.send_compressed(encoding);
12815            self
12816        }
12817        /// Enable decompressing responses.
12818        #[must_use]
12819        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12820            self.inner = self.inner.accept_compressed(encoding);
12821            self
12822        }
12823        /// Limits the maximum size of a decoded message.
12824        ///
12825        /// Default: `4MB`
12826        #[must_use]
12827        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12828            self.inner = self.inner.max_decoding_message_size(limit);
12829            self
12830        }
12831        /// Limits the maximum size of an encoded message.
12832        ///
12833        /// Default: `usize::MAX`
12834        #[must_use]
12835        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12836            self.inner = self.inner.max_encoding_message_size(limit);
12837            self
12838        }
12839        /** List all roles in the organization with their permission sets.
12840 Authorization: Requires PERMISSION_ORG_READ.
12841*/
12842        pub async fn list_roles(
12843            &mut self,
12844            request: impl tonic::IntoRequest<super::ListRolesRequest>,
12845        ) -> std::result::Result<
12846            tonic::Response<super::ListRolesResponse>,
12847            tonic::Status,
12848        > {
12849            self.inner
12850                .ready()
12851                .await
12852                .map_err(|e| {
12853                    tonic::Status::unknown(
12854                        format!("Service was not ready: {}", e.into()),
12855                    )
12856                })?;
12857            let codec = tonic_prost::ProstCodec::default();
12858            let path = http::uri::PathAndQuery::from_static(
12859                "/pidgr.v1.RoleService/ListRoles",
12860            );
12861            let mut req = request.into_request();
12862            req.extensions_mut()
12863                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
12864            self.inner.unary(req, path, codec).await
12865        }
12866        /** Create a new custom role with a name and initial permissions.
12867 Slug is auto-generated from the name and immutable after creation.
12868 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
12869*/
12870        pub async fn create_role(
12871            &mut self,
12872            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
12873        ) -> std::result::Result<
12874            tonic::Response<super::CreateRoleResponse>,
12875            tonic::Status,
12876        > {
12877            self.inner
12878                .ready()
12879                .await
12880                .map_err(|e| {
12881                    tonic::Status::unknown(
12882                        format!("Service was not ready: {}", e.into()),
12883                    )
12884                })?;
12885            let codec = tonic_prost::ProstCodec::default();
12886            let path = http::uri::PathAndQuery::from_static(
12887                "/pidgr.v1.RoleService/CreateRole",
12888            );
12889            let mut req = request.into_request();
12890            req.extensions_mut()
12891                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
12892            self.inner.unary(req, path, codec).await
12893        }
12894        /** Update a role's name and/or permissions.
12895 System roles (is_system=true) cannot be updated.
12896 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
12897*/
12898        pub async fn update_role(
12899            &mut self,
12900            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
12901        ) -> std::result::Result<
12902            tonic::Response<super::UpdateRoleResponse>,
12903            tonic::Status,
12904        > {
12905            self.inner
12906                .ready()
12907                .await
12908                .map_err(|e| {
12909                    tonic::Status::unknown(
12910                        format!("Service was not ready: {}", e.into()),
12911                    )
12912                })?;
12913            let codec = tonic_prost::ProstCodec::default();
12914            let path = http::uri::PathAndQuery::from_static(
12915                "/pidgr.v1.RoleService/UpdateRole",
12916            );
12917            let mut req = request.into_request();
12918            req.extensions_mut()
12919                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
12920            self.inner.unary(req, path, codec).await
12921        }
12922        /** Delete a role. Fails if any users are assigned to it.
12923 System roles (is_system=true) cannot be deleted.
12924 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
12925*/
12926        pub async fn delete_role(
12927            &mut self,
12928            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
12929        ) -> std::result::Result<
12930            tonic::Response<super::DeleteRoleResponse>,
12931            tonic::Status,
12932        > {
12933            self.inner
12934                .ready()
12935                .await
12936                .map_err(|e| {
12937                    tonic::Status::unknown(
12938                        format!("Service was not ready: {}", e.into()),
12939                    )
12940                })?;
12941            let codec = tonic_prost::ProstCodec::default();
12942            let path = http::uri::PathAndQuery::from_static(
12943                "/pidgr.v1.RoleService/DeleteRole",
12944            );
12945            let mut req = request.into_request();
12946            req.extensions_mut()
12947                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
12948            self.inner.unary(req, path, codec).await
12949        }
12950    }
12951}
12952/// Generated server implementations.
12953pub mod role_service_server {
12954    #![allow(
12955        unused_variables,
12956        dead_code,
12957        missing_docs,
12958        clippy::wildcard_imports,
12959        clippy::let_unit_value,
12960    )]
12961    use tonic::codegen::*;
12962    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
12963    #[async_trait]
12964    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
12965        /** List all roles in the organization with their permission sets.
12966 Authorization: Requires PERMISSION_ORG_READ.
12967*/
12968        async fn list_roles(
12969            &self,
12970            request: tonic::Request<super::ListRolesRequest>,
12971        ) -> std::result::Result<
12972            tonic::Response<super::ListRolesResponse>,
12973            tonic::Status,
12974        >;
12975        /** Create a new custom role with a name and initial permissions.
12976 Slug is auto-generated from the name and immutable after creation.
12977 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
12978*/
12979        async fn create_role(
12980            &self,
12981            request: tonic::Request<super::CreateRoleRequest>,
12982        ) -> std::result::Result<
12983            tonic::Response<super::CreateRoleResponse>,
12984            tonic::Status,
12985        >;
12986        /** Update a role's name and/or permissions.
12987 System roles (is_system=true) cannot be updated.
12988 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
12989*/
12990        async fn update_role(
12991            &self,
12992            request: tonic::Request<super::UpdateRoleRequest>,
12993        ) -> std::result::Result<
12994            tonic::Response<super::UpdateRoleResponse>,
12995            tonic::Status,
12996        >;
12997        /** Delete a role. Fails if any users are assigned to it.
12998 System roles (is_system=true) cannot be deleted.
12999 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13000*/
13001        async fn delete_role(
13002            &self,
13003            request: tonic::Request<super::DeleteRoleRequest>,
13004        ) -> std::result::Result<
13005            tonic::Response<super::DeleteRoleResponse>,
13006            tonic::Status,
13007        >;
13008    }
13009    /** Manages roles and their permissions within an organization.
13010 All RPCs operate within the caller's org (extracted from JWT).
13011*/
13012    #[derive(Debug)]
13013    pub struct RoleServiceServer<T> {
13014        inner: Arc<T>,
13015        accept_compression_encodings: EnabledCompressionEncodings,
13016        send_compression_encodings: EnabledCompressionEncodings,
13017        max_decoding_message_size: Option<usize>,
13018        max_encoding_message_size: Option<usize>,
13019    }
13020    impl<T> RoleServiceServer<T> {
13021        pub fn new(inner: T) -> Self {
13022            Self::from_arc(Arc::new(inner))
13023        }
13024        pub fn from_arc(inner: Arc<T>) -> Self {
13025            Self {
13026                inner,
13027                accept_compression_encodings: Default::default(),
13028                send_compression_encodings: Default::default(),
13029                max_decoding_message_size: None,
13030                max_encoding_message_size: None,
13031            }
13032        }
13033        pub fn with_interceptor<F>(
13034            inner: T,
13035            interceptor: F,
13036        ) -> InterceptedService<Self, F>
13037        where
13038            F: tonic::service::Interceptor,
13039        {
13040            InterceptedService::new(Self::new(inner), interceptor)
13041        }
13042        /// Enable decompressing requests with the given encoding.
13043        #[must_use]
13044        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13045            self.accept_compression_encodings.enable(encoding);
13046            self
13047        }
13048        /// Compress responses with the given encoding, if the client supports it.
13049        #[must_use]
13050        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13051            self.send_compression_encodings.enable(encoding);
13052            self
13053        }
13054        /// Limits the maximum size of a decoded message.
13055        ///
13056        /// Default: `4MB`
13057        #[must_use]
13058        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13059            self.max_decoding_message_size = Some(limit);
13060            self
13061        }
13062        /// Limits the maximum size of an encoded message.
13063        ///
13064        /// Default: `usize::MAX`
13065        #[must_use]
13066        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13067            self.max_encoding_message_size = Some(limit);
13068            self
13069        }
13070    }
13071    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
13072    where
13073        T: RoleService,
13074        B: Body + std::marker::Send + 'static,
13075        B::Error: Into<StdError> + std::marker::Send + 'static,
13076    {
13077        type Response = http::Response<tonic::body::Body>;
13078        type Error = std::convert::Infallible;
13079        type Future = BoxFuture<Self::Response, Self::Error>;
13080        fn poll_ready(
13081            &mut self,
13082            _cx: &mut Context<'_>,
13083        ) -> Poll<std::result::Result<(), Self::Error>> {
13084            Poll::Ready(Ok(()))
13085        }
13086        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13087            match req.uri().path() {
13088                "/pidgr.v1.RoleService/ListRoles" => {
13089                    #[allow(non_camel_case_types)]
13090                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
13091                    impl<
13092                        T: RoleService,
13093                    > tonic::server::UnaryService<super::ListRolesRequest>
13094                    for ListRolesSvc<T> {
13095                        type Response = super::ListRolesResponse;
13096                        type Future = BoxFuture<
13097                            tonic::Response<Self::Response>,
13098                            tonic::Status,
13099                        >;
13100                        fn call(
13101                            &mut self,
13102                            request: tonic::Request<super::ListRolesRequest>,
13103                        ) -> Self::Future {
13104                            let inner = Arc::clone(&self.0);
13105                            let fut = async move {
13106                                <T as RoleService>::list_roles(&inner, request).await
13107                            };
13108                            Box::pin(fut)
13109                        }
13110                    }
13111                    let accept_compression_encodings = self.accept_compression_encodings;
13112                    let send_compression_encodings = self.send_compression_encodings;
13113                    let max_decoding_message_size = self.max_decoding_message_size;
13114                    let max_encoding_message_size = self.max_encoding_message_size;
13115                    let inner = self.inner.clone();
13116                    let fut = async move {
13117                        let method = ListRolesSvc(inner);
13118                        let codec = tonic_prost::ProstCodec::default();
13119                        let mut grpc = tonic::server::Grpc::new(codec)
13120                            .apply_compression_config(
13121                                accept_compression_encodings,
13122                                send_compression_encodings,
13123                            )
13124                            .apply_max_message_size_config(
13125                                max_decoding_message_size,
13126                                max_encoding_message_size,
13127                            );
13128                        let res = grpc.unary(method, req).await;
13129                        Ok(res)
13130                    };
13131                    Box::pin(fut)
13132                }
13133                "/pidgr.v1.RoleService/CreateRole" => {
13134                    #[allow(non_camel_case_types)]
13135                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
13136                    impl<
13137                        T: RoleService,
13138                    > tonic::server::UnaryService<super::CreateRoleRequest>
13139                    for CreateRoleSvc<T> {
13140                        type Response = super::CreateRoleResponse;
13141                        type Future = BoxFuture<
13142                            tonic::Response<Self::Response>,
13143                            tonic::Status,
13144                        >;
13145                        fn call(
13146                            &mut self,
13147                            request: tonic::Request<super::CreateRoleRequest>,
13148                        ) -> Self::Future {
13149                            let inner = Arc::clone(&self.0);
13150                            let fut = async move {
13151                                <T as RoleService>::create_role(&inner, request).await
13152                            };
13153                            Box::pin(fut)
13154                        }
13155                    }
13156                    let accept_compression_encodings = self.accept_compression_encodings;
13157                    let send_compression_encodings = self.send_compression_encodings;
13158                    let max_decoding_message_size = self.max_decoding_message_size;
13159                    let max_encoding_message_size = self.max_encoding_message_size;
13160                    let inner = self.inner.clone();
13161                    let fut = async move {
13162                        let method = CreateRoleSvc(inner);
13163                        let codec = tonic_prost::ProstCodec::default();
13164                        let mut grpc = tonic::server::Grpc::new(codec)
13165                            .apply_compression_config(
13166                                accept_compression_encodings,
13167                                send_compression_encodings,
13168                            )
13169                            .apply_max_message_size_config(
13170                                max_decoding_message_size,
13171                                max_encoding_message_size,
13172                            );
13173                        let res = grpc.unary(method, req).await;
13174                        Ok(res)
13175                    };
13176                    Box::pin(fut)
13177                }
13178                "/pidgr.v1.RoleService/UpdateRole" => {
13179                    #[allow(non_camel_case_types)]
13180                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
13181                    impl<
13182                        T: RoleService,
13183                    > tonic::server::UnaryService<super::UpdateRoleRequest>
13184                    for UpdateRoleSvc<T> {
13185                        type Response = super::UpdateRoleResponse;
13186                        type Future = BoxFuture<
13187                            tonic::Response<Self::Response>,
13188                            tonic::Status,
13189                        >;
13190                        fn call(
13191                            &mut self,
13192                            request: tonic::Request<super::UpdateRoleRequest>,
13193                        ) -> Self::Future {
13194                            let inner = Arc::clone(&self.0);
13195                            let fut = async move {
13196                                <T as RoleService>::update_role(&inner, request).await
13197                            };
13198                            Box::pin(fut)
13199                        }
13200                    }
13201                    let accept_compression_encodings = self.accept_compression_encodings;
13202                    let send_compression_encodings = self.send_compression_encodings;
13203                    let max_decoding_message_size = self.max_decoding_message_size;
13204                    let max_encoding_message_size = self.max_encoding_message_size;
13205                    let inner = self.inner.clone();
13206                    let fut = async move {
13207                        let method = UpdateRoleSvc(inner);
13208                        let codec = tonic_prost::ProstCodec::default();
13209                        let mut grpc = tonic::server::Grpc::new(codec)
13210                            .apply_compression_config(
13211                                accept_compression_encodings,
13212                                send_compression_encodings,
13213                            )
13214                            .apply_max_message_size_config(
13215                                max_decoding_message_size,
13216                                max_encoding_message_size,
13217                            );
13218                        let res = grpc.unary(method, req).await;
13219                        Ok(res)
13220                    };
13221                    Box::pin(fut)
13222                }
13223                "/pidgr.v1.RoleService/DeleteRole" => {
13224                    #[allow(non_camel_case_types)]
13225                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
13226                    impl<
13227                        T: RoleService,
13228                    > tonic::server::UnaryService<super::DeleteRoleRequest>
13229                    for DeleteRoleSvc<T> {
13230                        type Response = super::DeleteRoleResponse;
13231                        type Future = BoxFuture<
13232                            tonic::Response<Self::Response>,
13233                            tonic::Status,
13234                        >;
13235                        fn call(
13236                            &mut self,
13237                            request: tonic::Request<super::DeleteRoleRequest>,
13238                        ) -> Self::Future {
13239                            let inner = Arc::clone(&self.0);
13240                            let fut = async move {
13241                                <T as RoleService>::delete_role(&inner, request).await
13242                            };
13243                            Box::pin(fut)
13244                        }
13245                    }
13246                    let accept_compression_encodings = self.accept_compression_encodings;
13247                    let send_compression_encodings = self.send_compression_encodings;
13248                    let max_decoding_message_size = self.max_decoding_message_size;
13249                    let max_encoding_message_size = self.max_encoding_message_size;
13250                    let inner = self.inner.clone();
13251                    let fut = async move {
13252                        let method = DeleteRoleSvc(inner);
13253                        let codec = tonic_prost::ProstCodec::default();
13254                        let mut grpc = tonic::server::Grpc::new(codec)
13255                            .apply_compression_config(
13256                                accept_compression_encodings,
13257                                send_compression_encodings,
13258                            )
13259                            .apply_max_message_size_config(
13260                                max_decoding_message_size,
13261                                max_encoding_message_size,
13262                            );
13263                        let res = grpc.unary(method, req).await;
13264                        Ok(res)
13265                    };
13266                    Box::pin(fut)
13267                }
13268                _ => {
13269                    Box::pin(async move {
13270                        let mut response = http::Response::new(
13271                            tonic::body::Body::default(),
13272                        );
13273                        let headers = response.headers_mut();
13274                        headers
13275                            .insert(
13276                                tonic::Status::GRPC_STATUS,
13277                                (tonic::Code::Unimplemented as i32).into(),
13278                            );
13279                        headers
13280                            .insert(
13281                                http::header::CONTENT_TYPE,
13282                                tonic::metadata::GRPC_CONTENT_TYPE,
13283                            );
13284                        Ok(response)
13285                    })
13286                }
13287            }
13288        }
13289    }
13290    impl<T> Clone for RoleServiceServer<T> {
13291        fn clone(&self) -> Self {
13292            let inner = self.inner.clone();
13293            Self {
13294                inner,
13295                accept_compression_encodings: self.accept_compression_encodings,
13296                send_compression_encodings: self.send_compression_encodings,
13297                max_decoding_message_size: self.max_decoding_message_size,
13298                max_encoding_message_size: self.max_encoding_message_size,
13299            }
13300        }
13301    }
13302    /// Generated gRPC service name
13303    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
13304    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
13305        const NAME: &'static str = SERVICE_NAME;
13306    }
13307}
13308/// Generated client implementations.
13309pub mod sso_service_client {
13310    #![allow(
13311        unused_variables,
13312        dead_code,
13313        missing_docs,
13314        clippy::wildcard_imports,
13315        clippy::let_unit_value,
13316    )]
13317    use tonic::codegen::*;
13318    use tonic::codegen::http::Uri;
13319    /** Manages SSO identity provider configuration for organizations.
13320*/
13321    #[derive(Debug, Clone)]
13322    pub struct SsoServiceClient<T> {
13323        inner: tonic::client::Grpc<T>,
13324    }
13325    impl SsoServiceClient<tonic::transport::Channel> {
13326        /// Attempt to create a new client by connecting to a given endpoint.
13327        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13328        where
13329            D: TryInto<tonic::transport::Endpoint>,
13330            D::Error: Into<StdError>,
13331        {
13332            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13333            Ok(Self::new(conn))
13334        }
13335    }
13336    impl<T> SsoServiceClient<T>
13337    where
13338        T: tonic::client::GrpcService<tonic::body::Body>,
13339        T::Error: Into<StdError>,
13340        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13341        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13342    {
13343        pub fn new(inner: T) -> Self {
13344            let inner = tonic::client::Grpc::new(inner);
13345            Self { inner }
13346        }
13347        pub fn with_origin(inner: T, origin: Uri) -> Self {
13348            let inner = tonic::client::Grpc::with_origin(inner, origin);
13349            Self { inner }
13350        }
13351        pub fn with_interceptor<F>(
13352            inner: T,
13353            interceptor: F,
13354        ) -> SsoServiceClient<InterceptedService<T, F>>
13355        where
13356            F: tonic::service::Interceptor,
13357            T::ResponseBody: Default,
13358            T: tonic::codegen::Service<
13359                http::Request<tonic::body::Body>,
13360                Response = http::Response<
13361                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13362                >,
13363            >,
13364            <T as tonic::codegen::Service<
13365                http::Request<tonic::body::Body>,
13366            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13367        {
13368            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
13369        }
13370        /// Compress requests with the given encoding.
13371        ///
13372        /// This requires the server to support it otherwise it might respond with an
13373        /// error.
13374        #[must_use]
13375        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13376            self.inner = self.inner.send_compressed(encoding);
13377            self
13378        }
13379        /// Enable decompressing responses.
13380        #[must_use]
13381        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13382            self.inner = self.inner.accept_compressed(encoding);
13383            self
13384        }
13385        /// Limits the maximum size of a decoded message.
13386        ///
13387        /// Default: `4MB`
13388        #[must_use]
13389        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13390            self.inner = self.inner.max_decoding_message_size(limit);
13391            self
13392        }
13393        /// Limits the maximum size of an encoded message.
13394        ///
13395        /// Default: `usize::MAX`
13396        #[must_use]
13397        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13398            self.inner = self.inner.max_encoding_message_size(limit);
13399            self
13400        }
13401        /** Check if an email domain has SSO configured.
13402 This is a pre-authentication endpoint — no JWT required.
13403 Authorization: None (public).
13404*/
13405        pub async fn check_sso_by_domain(
13406            &mut self,
13407            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
13408        ) -> std::result::Result<
13409            tonic::Response<super::CheckSsoByDomainResponse>,
13410            tonic::Status,
13411        > {
13412            self.inner
13413                .ready()
13414                .await
13415                .map_err(|e| {
13416                    tonic::Status::unknown(
13417                        format!("Service was not ready: {}", e.into()),
13418                    )
13419                })?;
13420            let codec = tonic_prost::ProstCodec::default();
13421            let path = http::uri::PathAndQuery::from_static(
13422                "/pidgr.v1.SSOService/CheckSSOByDomain",
13423            );
13424            let mut req = request.into_request();
13425            req.extensions_mut()
13426                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
13427            self.inner.unary(req, path, codec).await
13428        }
13429        /** Create an SSO provider for the organization.
13430 Validates the metadata URL before saving.
13431 Creates the corresponding identity provider in the auth service.
13432 Authorization: Requires PERMISSION_ORG_WRITE.
13433*/
13434        pub async fn create_sso_provider(
13435            &mut self,
13436            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
13437        ) -> std::result::Result<
13438            tonic::Response<super::CreateSsoProviderResponse>,
13439            tonic::Status,
13440        > {
13441            self.inner
13442                .ready()
13443                .await
13444                .map_err(|e| {
13445                    tonic::Status::unknown(
13446                        format!("Service was not ready: {}", e.into()),
13447                    )
13448                })?;
13449            let codec = tonic_prost::ProstCodec::default();
13450            let path = http::uri::PathAndQuery::from_static(
13451                "/pidgr.v1.SSOService/CreateSSOProvider",
13452            );
13453            let mut req = request.into_request();
13454            req.extensions_mut()
13455                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
13456            self.inner.unary(req, path, codec).await
13457        }
13458        /** Get the organization's SSO provider configuration.
13459 Authorization: Requires PERMISSION_ORG_READ.
13460*/
13461        pub async fn get_sso_provider(
13462            &mut self,
13463            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
13464        ) -> std::result::Result<
13465            tonic::Response<super::GetSsoProviderResponse>,
13466            tonic::Status,
13467        > {
13468            self.inner
13469                .ready()
13470                .await
13471                .map_err(|e| {
13472                    tonic::Status::unknown(
13473                        format!("Service was not ready: {}", e.into()),
13474                    )
13475                })?;
13476            let codec = tonic_prost::ProstCodec::default();
13477            let path = http::uri::PathAndQuery::from_static(
13478                "/pidgr.v1.SSOService/GetSSOProvider",
13479            );
13480            let mut req = request.into_request();
13481            req.extensions_mut()
13482                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
13483            self.inner.unary(req, path, codec).await
13484        }
13485        /** Delete the organization's SSO provider.
13486 Deletes the corresponding identity provider from the auth service.
13487 Users with that domain fall back to passkey/OTP.
13488 Authorization: Requires PERMISSION_ORG_WRITE.
13489*/
13490        pub async fn delete_sso_provider(
13491            &mut self,
13492            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
13493        ) -> std::result::Result<
13494            tonic::Response<super::DeleteSsoProviderResponse>,
13495            tonic::Status,
13496        > {
13497            self.inner
13498                .ready()
13499                .await
13500                .map_err(|e| {
13501                    tonic::Status::unknown(
13502                        format!("Service was not ready: {}", e.into()),
13503                    )
13504                })?;
13505            let codec = tonic_prost::ProstCodec::default();
13506            let path = http::uri::PathAndQuery::from_static(
13507                "/pidgr.v1.SSOService/DeleteSSOProvider",
13508            );
13509            let mut req = request.into_request();
13510            req.extensions_mut()
13511                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
13512            self.inner.unary(req, path, codec).await
13513        }
13514    }
13515}
13516/// Generated server implementations.
13517pub mod sso_service_server {
13518    #![allow(
13519        unused_variables,
13520        dead_code,
13521        missing_docs,
13522        clippy::wildcard_imports,
13523        clippy::let_unit_value,
13524    )]
13525    use tonic::codegen::*;
13526    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
13527    #[async_trait]
13528    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
13529        /** Check if an email domain has SSO configured.
13530 This is a pre-authentication endpoint — no JWT required.
13531 Authorization: None (public).
13532*/
13533        async fn check_sso_by_domain(
13534            &self,
13535            request: tonic::Request<super::CheckSsoByDomainRequest>,
13536        ) -> std::result::Result<
13537            tonic::Response<super::CheckSsoByDomainResponse>,
13538            tonic::Status,
13539        >;
13540        /** Create an SSO provider for the organization.
13541 Validates the metadata URL before saving.
13542 Creates the corresponding identity provider in the auth service.
13543 Authorization: Requires PERMISSION_ORG_WRITE.
13544*/
13545        async fn create_sso_provider(
13546            &self,
13547            request: tonic::Request<super::CreateSsoProviderRequest>,
13548        ) -> std::result::Result<
13549            tonic::Response<super::CreateSsoProviderResponse>,
13550            tonic::Status,
13551        >;
13552        /** Get the organization's SSO provider configuration.
13553 Authorization: Requires PERMISSION_ORG_READ.
13554*/
13555        async fn get_sso_provider(
13556            &self,
13557            request: tonic::Request<super::GetSsoProviderRequest>,
13558        ) -> std::result::Result<
13559            tonic::Response<super::GetSsoProviderResponse>,
13560            tonic::Status,
13561        >;
13562        /** Delete the organization's SSO provider.
13563 Deletes the corresponding identity provider from the auth service.
13564 Users with that domain fall back to passkey/OTP.
13565 Authorization: Requires PERMISSION_ORG_WRITE.
13566*/
13567        async fn delete_sso_provider(
13568            &self,
13569            request: tonic::Request<super::DeleteSsoProviderRequest>,
13570        ) -> std::result::Result<
13571            tonic::Response<super::DeleteSsoProviderResponse>,
13572            tonic::Status,
13573        >;
13574    }
13575    /** Manages SSO identity provider configuration for organizations.
13576*/
13577    #[derive(Debug)]
13578    pub struct SsoServiceServer<T> {
13579        inner: Arc<T>,
13580        accept_compression_encodings: EnabledCompressionEncodings,
13581        send_compression_encodings: EnabledCompressionEncodings,
13582        max_decoding_message_size: Option<usize>,
13583        max_encoding_message_size: Option<usize>,
13584    }
13585    impl<T> SsoServiceServer<T> {
13586        pub fn new(inner: T) -> Self {
13587            Self::from_arc(Arc::new(inner))
13588        }
13589        pub fn from_arc(inner: Arc<T>) -> Self {
13590            Self {
13591                inner,
13592                accept_compression_encodings: Default::default(),
13593                send_compression_encodings: Default::default(),
13594                max_decoding_message_size: None,
13595                max_encoding_message_size: None,
13596            }
13597        }
13598        pub fn with_interceptor<F>(
13599            inner: T,
13600            interceptor: F,
13601        ) -> InterceptedService<Self, F>
13602        where
13603            F: tonic::service::Interceptor,
13604        {
13605            InterceptedService::new(Self::new(inner), interceptor)
13606        }
13607        /// Enable decompressing requests with the given encoding.
13608        #[must_use]
13609        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13610            self.accept_compression_encodings.enable(encoding);
13611            self
13612        }
13613        /// Compress responses with the given encoding, if the client supports it.
13614        #[must_use]
13615        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13616            self.send_compression_encodings.enable(encoding);
13617            self
13618        }
13619        /// Limits the maximum size of a decoded message.
13620        ///
13621        /// Default: `4MB`
13622        #[must_use]
13623        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13624            self.max_decoding_message_size = Some(limit);
13625            self
13626        }
13627        /// Limits the maximum size of an encoded message.
13628        ///
13629        /// Default: `usize::MAX`
13630        #[must_use]
13631        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13632            self.max_encoding_message_size = Some(limit);
13633            self
13634        }
13635    }
13636    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
13637    where
13638        T: SsoService,
13639        B: Body + std::marker::Send + 'static,
13640        B::Error: Into<StdError> + std::marker::Send + 'static,
13641    {
13642        type Response = http::Response<tonic::body::Body>;
13643        type Error = std::convert::Infallible;
13644        type Future = BoxFuture<Self::Response, Self::Error>;
13645        fn poll_ready(
13646            &mut self,
13647            _cx: &mut Context<'_>,
13648        ) -> Poll<std::result::Result<(), Self::Error>> {
13649            Poll::Ready(Ok(()))
13650        }
13651        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13652            match req.uri().path() {
13653                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
13654                    #[allow(non_camel_case_types)]
13655                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
13656                    impl<
13657                        T: SsoService,
13658                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
13659                    for CheckSSOByDomainSvc<T> {
13660                        type Response = super::CheckSsoByDomainResponse;
13661                        type Future = BoxFuture<
13662                            tonic::Response<Self::Response>,
13663                            tonic::Status,
13664                        >;
13665                        fn call(
13666                            &mut self,
13667                            request: tonic::Request<super::CheckSsoByDomainRequest>,
13668                        ) -> Self::Future {
13669                            let inner = Arc::clone(&self.0);
13670                            let fut = async move {
13671                                <T as SsoService>::check_sso_by_domain(&inner, request)
13672                                    .await
13673                            };
13674                            Box::pin(fut)
13675                        }
13676                    }
13677                    let accept_compression_encodings = self.accept_compression_encodings;
13678                    let send_compression_encodings = self.send_compression_encodings;
13679                    let max_decoding_message_size = self.max_decoding_message_size;
13680                    let max_encoding_message_size = self.max_encoding_message_size;
13681                    let inner = self.inner.clone();
13682                    let fut = async move {
13683                        let method = CheckSSOByDomainSvc(inner);
13684                        let codec = tonic_prost::ProstCodec::default();
13685                        let mut grpc = tonic::server::Grpc::new(codec)
13686                            .apply_compression_config(
13687                                accept_compression_encodings,
13688                                send_compression_encodings,
13689                            )
13690                            .apply_max_message_size_config(
13691                                max_decoding_message_size,
13692                                max_encoding_message_size,
13693                            );
13694                        let res = grpc.unary(method, req).await;
13695                        Ok(res)
13696                    };
13697                    Box::pin(fut)
13698                }
13699                "/pidgr.v1.SSOService/CreateSSOProvider" => {
13700                    #[allow(non_camel_case_types)]
13701                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
13702                    impl<
13703                        T: SsoService,
13704                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
13705                    for CreateSSOProviderSvc<T> {
13706                        type Response = super::CreateSsoProviderResponse;
13707                        type Future = BoxFuture<
13708                            tonic::Response<Self::Response>,
13709                            tonic::Status,
13710                        >;
13711                        fn call(
13712                            &mut self,
13713                            request: tonic::Request<super::CreateSsoProviderRequest>,
13714                        ) -> Self::Future {
13715                            let inner = Arc::clone(&self.0);
13716                            let fut = async move {
13717                                <T as SsoService>::create_sso_provider(&inner, request)
13718                                    .await
13719                            };
13720                            Box::pin(fut)
13721                        }
13722                    }
13723                    let accept_compression_encodings = self.accept_compression_encodings;
13724                    let send_compression_encodings = self.send_compression_encodings;
13725                    let max_decoding_message_size = self.max_decoding_message_size;
13726                    let max_encoding_message_size = self.max_encoding_message_size;
13727                    let inner = self.inner.clone();
13728                    let fut = async move {
13729                        let method = CreateSSOProviderSvc(inner);
13730                        let codec = tonic_prost::ProstCodec::default();
13731                        let mut grpc = tonic::server::Grpc::new(codec)
13732                            .apply_compression_config(
13733                                accept_compression_encodings,
13734                                send_compression_encodings,
13735                            )
13736                            .apply_max_message_size_config(
13737                                max_decoding_message_size,
13738                                max_encoding_message_size,
13739                            );
13740                        let res = grpc.unary(method, req).await;
13741                        Ok(res)
13742                    };
13743                    Box::pin(fut)
13744                }
13745                "/pidgr.v1.SSOService/GetSSOProvider" => {
13746                    #[allow(non_camel_case_types)]
13747                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
13748                    impl<
13749                        T: SsoService,
13750                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
13751                    for GetSSOProviderSvc<T> {
13752                        type Response = super::GetSsoProviderResponse;
13753                        type Future = BoxFuture<
13754                            tonic::Response<Self::Response>,
13755                            tonic::Status,
13756                        >;
13757                        fn call(
13758                            &mut self,
13759                            request: tonic::Request<super::GetSsoProviderRequest>,
13760                        ) -> Self::Future {
13761                            let inner = Arc::clone(&self.0);
13762                            let fut = async move {
13763                                <T as SsoService>::get_sso_provider(&inner, request).await
13764                            };
13765                            Box::pin(fut)
13766                        }
13767                    }
13768                    let accept_compression_encodings = self.accept_compression_encodings;
13769                    let send_compression_encodings = self.send_compression_encodings;
13770                    let max_decoding_message_size = self.max_decoding_message_size;
13771                    let max_encoding_message_size = self.max_encoding_message_size;
13772                    let inner = self.inner.clone();
13773                    let fut = async move {
13774                        let method = GetSSOProviderSvc(inner);
13775                        let codec = tonic_prost::ProstCodec::default();
13776                        let mut grpc = tonic::server::Grpc::new(codec)
13777                            .apply_compression_config(
13778                                accept_compression_encodings,
13779                                send_compression_encodings,
13780                            )
13781                            .apply_max_message_size_config(
13782                                max_decoding_message_size,
13783                                max_encoding_message_size,
13784                            );
13785                        let res = grpc.unary(method, req).await;
13786                        Ok(res)
13787                    };
13788                    Box::pin(fut)
13789                }
13790                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
13791                    #[allow(non_camel_case_types)]
13792                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
13793                    impl<
13794                        T: SsoService,
13795                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
13796                    for DeleteSSOProviderSvc<T> {
13797                        type Response = super::DeleteSsoProviderResponse;
13798                        type Future = BoxFuture<
13799                            tonic::Response<Self::Response>,
13800                            tonic::Status,
13801                        >;
13802                        fn call(
13803                            &mut self,
13804                            request: tonic::Request<super::DeleteSsoProviderRequest>,
13805                        ) -> Self::Future {
13806                            let inner = Arc::clone(&self.0);
13807                            let fut = async move {
13808                                <T as SsoService>::delete_sso_provider(&inner, request)
13809                                    .await
13810                            };
13811                            Box::pin(fut)
13812                        }
13813                    }
13814                    let accept_compression_encodings = self.accept_compression_encodings;
13815                    let send_compression_encodings = self.send_compression_encodings;
13816                    let max_decoding_message_size = self.max_decoding_message_size;
13817                    let max_encoding_message_size = self.max_encoding_message_size;
13818                    let inner = self.inner.clone();
13819                    let fut = async move {
13820                        let method = DeleteSSOProviderSvc(inner);
13821                        let codec = tonic_prost::ProstCodec::default();
13822                        let mut grpc = tonic::server::Grpc::new(codec)
13823                            .apply_compression_config(
13824                                accept_compression_encodings,
13825                                send_compression_encodings,
13826                            )
13827                            .apply_max_message_size_config(
13828                                max_decoding_message_size,
13829                                max_encoding_message_size,
13830                            );
13831                        let res = grpc.unary(method, req).await;
13832                        Ok(res)
13833                    };
13834                    Box::pin(fut)
13835                }
13836                _ => {
13837                    Box::pin(async move {
13838                        let mut response = http::Response::new(
13839                            tonic::body::Body::default(),
13840                        );
13841                        let headers = response.headers_mut();
13842                        headers
13843                            .insert(
13844                                tonic::Status::GRPC_STATUS,
13845                                (tonic::Code::Unimplemented as i32).into(),
13846                            );
13847                        headers
13848                            .insert(
13849                                http::header::CONTENT_TYPE,
13850                                tonic::metadata::GRPC_CONTENT_TYPE,
13851                            );
13852                        Ok(response)
13853                    })
13854                }
13855            }
13856        }
13857    }
13858    impl<T> Clone for SsoServiceServer<T> {
13859        fn clone(&self) -> Self {
13860            let inner = self.inner.clone();
13861            Self {
13862                inner,
13863                accept_compression_encodings: self.accept_compression_encodings,
13864                send_compression_encodings: self.send_compression_encodings,
13865                max_decoding_message_size: self.max_decoding_message_size,
13866                max_encoding_message_size: self.max_encoding_message_size,
13867            }
13868        }
13869    }
13870    /// Generated gRPC service name
13871    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
13872    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
13873        const NAME: &'static str = SERVICE_NAME;
13874    }
13875}
13876/// Generated client implementations.
13877pub mod team_service_client {
13878    #![allow(
13879        unused_variables,
13880        dead_code,
13881        missing_docs,
13882        clippy::wildcard_imports,
13883        clippy::let_unit_value,
13884    )]
13885    use tonic::codegen::*;
13886    use tonic::codegen::http::Uri;
13887    /** Manages organizational teams (departments, divisions) within an organization.
13888 Teams represent the organizational structure and can serve as sender identity.
13889 All RPCs operate within the caller's org (extracted from JWT).
13890*/
13891    #[derive(Debug, Clone)]
13892    pub struct TeamServiceClient<T> {
13893        inner: tonic::client::Grpc<T>,
13894    }
13895    impl TeamServiceClient<tonic::transport::Channel> {
13896        /// Attempt to create a new client by connecting to a given endpoint.
13897        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13898        where
13899            D: TryInto<tonic::transport::Endpoint>,
13900            D::Error: Into<StdError>,
13901        {
13902            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13903            Ok(Self::new(conn))
13904        }
13905    }
13906    impl<T> TeamServiceClient<T>
13907    where
13908        T: tonic::client::GrpcService<tonic::body::Body>,
13909        T::Error: Into<StdError>,
13910        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13911        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13912    {
13913        pub fn new(inner: T) -> Self {
13914            let inner = tonic::client::Grpc::new(inner);
13915            Self { inner }
13916        }
13917        pub fn with_origin(inner: T, origin: Uri) -> Self {
13918            let inner = tonic::client::Grpc::with_origin(inner, origin);
13919            Self { inner }
13920        }
13921        pub fn with_interceptor<F>(
13922            inner: T,
13923            interceptor: F,
13924        ) -> TeamServiceClient<InterceptedService<T, F>>
13925        where
13926            F: tonic::service::Interceptor,
13927            T::ResponseBody: Default,
13928            T: tonic::codegen::Service<
13929                http::Request<tonic::body::Body>,
13930                Response = http::Response<
13931                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13932                >,
13933            >,
13934            <T as tonic::codegen::Service<
13935                http::Request<tonic::body::Body>,
13936            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13937        {
13938            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
13939        }
13940        /// Compress requests with the given encoding.
13941        ///
13942        /// This requires the server to support it otherwise it might respond with an
13943        /// error.
13944        #[must_use]
13945        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13946            self.inner = self.inner.send_compressed(encoding);
13947            self
13948        }
13949        /// Enable decompressing responses.
13950        #[must_use]
13951        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13952            self.inner = self.inner.accept_compressed(encoding);
13953            self
13954        }
13955        /// Limits the maximum size of a decoded message.
13956        ///
13957        /// Default: `4MB`
13958        #[must_use]
13959        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13960            self.inner = self.inner.max_decoding_message_size(limit);
13961            self
13962        }
13963        /// Limits the maximum size of an encoded message.
13964        ///
13965        /// Default: `usize::MAX`
13966        #[must_use]
13967        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13968            self.inner = self.inner.max_encoding_message_size(limit);
13969            self
13970        }
13971        /** Create a new team in the organization.
13972 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
13973*/
13974        pub async fn create_team(
13975            &mut self,
13976            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
13977        ) -> std::result::Result<
13978            tonic::Response<super::CreateTeamResponse>,
13979            tonic::Status,
13980        > {
13981            self.inner
13982                .ready()
13983                .await
13984                .map_err(|e| {
13985                    tonic::Status::unknown(
13986                        format!("Service was not ready: {}", e.into()),
13987                    )
13988                })?;
13989            let codec = tonic_prost::ProstCodec::default();
13990            let path = http::uri::PathAndQuery::from_static(
13991                "/pidgr.v1.TeamService/CreateTeam",
13992            );
13993            let mut req = request.into_request();
13994            req.extensions_mut()
13995                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
13996            self.inner.unary(req, path, codec).await
13997        }
13998        /** Retrieve a team by ID.
13999 Authorization: Caller must be a member of the team, or have
14000 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14001*/
14002        pub async fn get_team(
14003            &mut self,
14004            request: impl tonic::IntoRequest<super::GetTeamRequest>,
14005        ) -> std::result::Result<
14006            tonic::Response<super::GetTeamResponse>,
14007            tonic::Status,
14008        > {
14009            self.inner
14010                .ready()
14011                .await
14012                .map_err(|e| {
14013                    tonic::Status::unknown(
14014                        format!("Service was not ready: {}", e.into()),
14015                    )
14016                })?;
14017            let codec = tonic_prost::ProstCodec::default();
14018            let path = http::uri::PathAndQuery::from_static(
14019                "/pidgr.v1.TeamService/GetTeam",
14020            );
14021            let mut req = request.into_request();
14022            req.extensions_mut()
14023                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
14024            self.inner.unary(req, path, codec).await
14025        }
14026        /** List teams in the organization with pagination.
14027 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
14028*/
14029        pub async fn list_teams(
14030            &mut self,
14031            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
14032        ) -> std::result::Result<
14033            tonic::Response<super::ListTeamsResponse>,
14034            tonic::Status,
14035        > {
14036            self.inner
14037                .ready()
14038                .await
14039                .map_err(|e| {
14040                    tonic::Status::unknown(
14041                        format!("Service was not ready: {}", e.into()),
14042                    )
14043                })?;
14044            let codec = tonic_prost::ProstCodec::default();
14045            let path = http::uri::PathAndQuery::from_static(
14046                "/pidgr.v1.TeamService/ListTeams",
14047            );
14048            let mut req = request.into_request();
14049            req.extensions_mut()
14050                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
14051            self.inner.unary(req, path, codec).await
14052        }
14053        /** Update a team's name and/or description.
14054 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14055*/
14056        pub async fn update_team(
14057            &mut self,
14058            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
14059        ) -> std::result::Result<
14060            tonic::Response<super::UpdateTeamResponse>,
14061            tonic::Status,
14062        > {
14063            self.inner
14064                .ready()
14065                .await
14066                .map_err(|e| {
14067                    tonic::Status::unknown(
14068                        format!("Service was not ready: {}", e.into()),
14069                    )
14070                })?;
14071            let codec = tonic_prost::ProstCodec::default();
14072            let path = http::uri::PathAndQuery::from_static(
14073                "/pidgr.v1.TeamService/UpdateTeam",
14074            );
14075            let mut req = request.into_request();
14076            req.extensions_mut()
14077                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
14078            self.inner.unary(req, path, codec).await
14079        }
14080        /** Delete a team and all its membership records. Default teams cannot be deleted.
14081 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14082*/
14083        pub async fn delete_team(
14084            &mut self,
14085            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
14086        ) -> std::result::Result<
14087            tonic::Response<super::DeleteTeamResponse>,
14088            tonic::Status,
14089        > {
14090            self.inner
14091                .ready()
14092                .await
14093                .map_err(|e| {
14094                    tonic::Status::unknown(
14095                        format!("Service was not ready: {}", e.into()),
14096                    )
14097                })?;
14098            let codec = tonic_prost::ProstCodec::default();
14099            let path = http::uri::PathAndQuery::from_static(
14100                "/pidgr.v1.TeamService/DeleteTeam",
14101            );
14102            let mut req = request.into_request();
14103            req.extensions_mut()
14104                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
14105            self.inner.unary(req, path, codec).await
14106        }
14107        /** Add one or more users to a team (idempotent).
14108 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14109*/
14110        pub async fn add_team_members(
14111            &mut self,
14112            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
14113        ) -> std::result::Result<
14114            tonic::Response<super::AddTeamMembersResponse>,
14115            tonic::Status,
14116        > {
14117            self.inner
14118                .ready()
14119                .await
14120                .map_err(|e| {
14121                    tonic::Status::unknown(
14122                        format!("Service was not ready: {}", e.into()),
14123                    )
14124                })?;
14125            let codec = tonic_prost::ProstCodec::default();
14126            let path = http::uri::PathAndQuery::from_static(
14127                "/pidgr.v1.TeamService/AddTeamMembers",
14128            );
14129            let mut req = request.into_request();
14130            req.extensions_mut()
14131                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
14132            self.inner.unary(req, path, codec).await
14133        }
14134        /** Remove one or more users from a team (idempotent).
14135 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14136*/
14137        pub async fn remove_team_members(
14138            &mut self,
14139            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
14140        ) -> std::result::Result<
14141            tonic::Response<super::RemoveTeamMembersResponse>,
14142            tonic::Status,
14143        > {
14144            self.inner
14145                .ready()
14146                .await
14147                .map_err(|e| {
14148                    tonic::Status::unknown(
14149                        format!("Service was not ready: {}", e.into()),
14150                    )
14151                })?;
14152            let codec = tonic_prost::ProstCodec::default();
14153            let path = http::uri::PathAndQuery::from_static(
14154                "/pidgr.v1.TeamService/RemoveTeamMembers",
14155            );
14156            let mut req = request.into_request();
14157            req.extensions_mut()
14158                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
14159            self.inner.unary(req, path, codec).await
14160        }
14161        /** List members of a team with pagination.
14162 Authorization: Caller must be a member of the team, or have
14163 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14164*/
14165        pub async fn list_team_members(
14166            &mut self,
14167            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
14168        ) -> std::result::Result<
14169            tonic::Response<super::ListTeamMembersResponse>,
14170            tonic::Status,
14171        > {
14172            self.inner
14173                .ready()
14174                .await
14175                .map_err(|e| {
14176                    tonic::Status::unknown(
14177                        format!("Service was not ready: {}", e.into()),
14178                    )
14179                })?;
14180            let codec = tonic_prost::ProstCodec::default();
14181            let path = http::uri::PathAndQuery::from_static(
14182                "/pidgr.v1.TeamService/ListTeamMembers",
14183            );
14184            let mut req = request.into_request();
14185            req.extensions_mut()
14186                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
14187            self.inner.unary(req, path, codec).await
14188        }
14189    }
14190}
14191/// Generated server implementations.
14192pub mod team_service_server {
14193    #![allow(
14194        unused_variables,
14195        dead_code,
14196        missing_docs,
14197        clippy::wildcard_imports,
14198        clippy::let_unit_value,
14199    )]
14200    use tonic::codegen::*;
14201    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
14202    #[async_trait]
14203    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
14204        /** Create a new team in the organization.
14205 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
14206*/
14207        async fn create_team(
14208            &self,
14209            request: tonic::Request<super::CreateTeamRequest>,
14210        ) -> std::result::Result<
14211            tonic::Response<super::CreateTeamResponse>,
14212            tonic::Status,
14213        >;
14214        /** Retrieve a team by ID.
14215 Authorization: Caller must be a member of the team, or have
14216 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14217*/
14218        async fn get_team(
14219            &self,
14220            request: tonic::Request<super::GetTeamRequest>,
14221        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
14222        /** List teams in the organization with pagination.
14223 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
14224*/
14225        async fn list_teams(
14226            &self,
14227            request: tonic::Request<super::ListTeamsRequest>,
14228        ) -> std::result::Result<
14229            tonic::Response<super::ListTeamsResponse>,
14230            tonic::Status,
14231        >;
14232        /** Update a team's name and/or description.
14233 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14234*/
14235        async fn update_team(
14236            &self,
14237            request: tonic::Request<super::UpdateTeamRequest>,
14238        ) -> std::result::Result<
14239            tonic::Response<super::UpdateTeamResponse>,
14240            tonic::Status,
14241        >;
14242        /** Delete a team and all its membership records. Default teams cannot be deleted.
14243 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14244*/
14245        async fn delete_team(
14246            &self,
14247            request: tonic::Request<super::DeleteTeamRequest>,
14248        ) -> std::result::Result<
14249            tonic::Response<super::DeleteTeamResponse>,
14250            tonic::Status,
14251        >;
14252        /** Add one or more users to a team (idempotent).
14253 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14254*/
14255        async fn add_team_members(
14256            &self,
14257            request: tonic::Request<super::AddTeamMembersRequest>,
14258        ) -> std::result::Result<
14259            tonic::Response<super::AddTeamMembersResponse>,
14260            tonic::Status,
14261        >;
14262        /** Remove one or more users from a team (idempotent).
14263 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14264*/
14265        async fn remove_team_members(
14266            &self,
14267            request: tonic::Request<super::RemoveTeamMembersRequest>,
14268        ) -> std::result::Result<
14269            tonic::Response<super::RemoveTeamMembersResponse>,
14270            tonic::Status,
14271        >;
14272        /** List members of a team with pagination.
14273 Authorization: Caller must be a member of the team, or have
14274 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14275*/
14276        async fn list_team_members(
14277            &self,
14278            request: tonic::Request<super::ListTeamMembersRequest>,
14279        ) -> std::result::Result<
14280            tonic::Response<super::ListTeamMembersResponse>,
14281            tonic::Status,
14282        >;
14283    }
14284    /** Manages organizational teams (departments, divisions) within an organization.
14285 Teams represent the organizational structure and can serve as sender identity.
14286 All RPCs operate within the caller's org (extracted from JWT).
14287*/
14288    #[derive(Debug)]
14289    pub struct TeamServiceServer<T> {
14290        inner: Arc<T>,
14291        accept_compression_encodings: EnabledCompressionEncodings,
14292        send_compression_encodings: EnabledCompressionEncodings,
14293        max_decoding_message_size: Option<usize>,
14294        max_encoding_message_size: Option<usize>,
14295    }
14296    impl<T> TeamServiceServer<T> {
14297        pub fn new(inner: T) -> Self {
14298            Self::from_arc(Arc::new(inner))
14299        }
14300        pub fn from_arc(inner: Arc<T>) -> Self {
14301            Self {
14302                inner,
14303                accept_compression_encodings: Default::default(),
14304                send_compression_encodings: Default::default(),
14305                max_decoding_message_size: None,
14306                max_encoding_message_size: None,
14307            }
14308        }
14309        pub fn with_interceptor<F>(
14310            inner: T,
14311            interceptor: F,
14312        ) -> InterceptedService<Self, F>
14313        where
14314            F: tonic::service::Interceptor,
14315        {
14316            InterceptedService::new(Self::new(inner), interceptor)
14317        }
14318        /// Enable decompressing requests with the given encoding.
14319        #[must_use]
14320        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14321            self.accept_compression_encodings.enable(encoding);
14322            self
14323        }
14324        /// Compress responses with the given encoding, if the client supports it.
14325        #[must_use]
14326        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14327            self.send_compression_encodings.enable(encoding);
14328            self
14329        }
14330        /// Limits the maximum size of a decoded message.
14331        ///
14332        /// Default: `4MB`
14333        #[must_use]
14334        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14335            self.max_decoding_message_size = Some(limit);
14336            self
14337        }
14338        /// Limits the maximum size of an encoded message.
14339        ///
14340        /// Default: `usize::MAX`
14341        #[must_use]
14342        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14343            self.max_encoding_message_size = Some(limit);
14344            self
14345        }
14346    }
14347    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
14348    where
14349        T: TeamService,
14350        B: Body + std::marker::Send + 'static,
14351        B::Error: Into<StdError> + std::marker::Send + 'static,
14352    {
14353        type Response = http::Response<tonic::body::Body>;
14354        type Error = std::convert::Infallible;
14355        type Future = BoxFuture<Self::Response, Self::Error>;
14356        fn poll_ready(
14357            &mut self,
14358            _cx: &mut Context<'_>,
14359        ) -> Poll<std::result::Result<(), Self::Error>> {
14360            Poll::Ready(Ok(()))
14361        }
14362        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14363            match req.uri().path() {
14364                "/pidgr.v1.TeamService/CreateTeam" => {
14365                    #[allow(non_camel_case_types)]
14366                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
14367                    impl<
14368                        T: TeamService,
14369                    > tonic::server::UnaryService<super::CreateTeamRequest>
14370                    for CreateTeamSvc<T> {
14371                        type Response = super::CreateTeamResponse;
14372                        type Future = BoxFuture<
14373                            tonic::Response<Self::Response>,
14374                            tonic::Status,
14375                        >;
14376                        fn call(
14377                            &mut self,
14378                            request: tonic::Request<super::CreateTeamRequest>,
14379                        ) -> Self::Future {
14380                            let inner = Arc::clone(&self.0);
14381                            let fut = async move {
14382                                <T as TeamService>::create_team(&inner, request).await
14383                            };
14384                            Box::pin(fut)
14385                        }
14386                    }
14387                    let accept_compression_encodings = self.accept_compression_encodings;
14388                    let send_compression_encodings = self.send_compression_encodings;
14389                    let max_decoding_message_size = self.max_decoding_message_size;
14390                    let max_encoding_message_size = self.max_encoding_message_size;
14391                    let inner = self.inner.clone();
14392                    let fut = async move {
14393                        let method = CreateTeamSvc(inner);
14394                        let codec = tonic_prost::ProstCodec::default();
14395                        let mut grpc = tonic::server::Grpc::new(codec)
14396                            .apply_compression_config(
14397                                accept_compression_encodings,
14398                                send_compression_encodings,
14399                            )
14400                            .apply_max_message_size_config(
14401                                max_decoding_message_size,
14402                                max_encoding_message_size,
14403                            );
14404                        let res = grpc.unary(method, req).await;
14405                        Ok(res)
14406                    };
14407                    Box::pin(fut)
14408                }
14409                "/pidgr.v1.TeamService/GetTeam" => {
14410                    #[allow(non_camel_case_types)]
14411                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
14412                    impl<
14413                        T: TeamService,
14414                    > tonic::server::UnaryService<super::GetTeamRequest>
14415                    for GetTeamSvc<T> {
14416                        type Response = super::GetTeamResponse;
14417                        type Future = BoxFuture<
14418                            tonic::Response<Self::Response>,
14419                            tonic::Status,
14420                        >;
14421                        fn call(
14422                            &mut self,
14423                            request: tonic::Request<super::GetTeamRequest>,
14424                        ) -> Self::Future {
14425                            let inner = Arc::clone(&self.0);
14426                            let fut = async move {
14427                                <T as TeamService>::get_team(&inner, request).await
14428                            };
14429                            Box::pin(fut)
14430                        }
14431                    }
14432                    let accept_compression_encodings = self.accept_compression_encodings;
14433                    let send_compression_encodings = self.send_compression_encodings;
14434                    let max_decoding_message_size = self.max_decoding_message_size;
14435                    let max_encoding_message_size = self.max_encoding_message_size;
14436                    let inner = self.inner.clone();
14437                    let fut = async move {
14438                        let method = GetTeamSvc(inner);
14439                        let codec = tonic_prost::ProstCodec::default();
14440                        let mut grpc = tonic::server::Grpc::new(codec)
14441                            .apply_compression_config(
14442                                accept_compression_encodings,
14443                                send_compression_encodings,
14444                            )
14445                            .apply_max_message_size_config(
14446                                max_decoding_message_size,
14447                                max_encoding_message_size,
14448                            );
14449                        let res = grpc.unary(method, req).await;
14450                        Ok(res)
14451                    };
14452                    Box::pin(fut)
14453                }
14454                "/pidgr.v1.TeamService/ListTeams" => {
14455                    #[allow(non_camel_case_types)]
14456                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
14457                    impl<
14458                        T: TeamService,
14459                    > tonic::server::UnaryService<super::ListTeamsRequest>
14460                    for ListTeamsSvc<T> {
14461                        type Response = super::ListTeamsResponse;
14462                        type Future = BoxFuture<
14463                            tonic::Response<Self::Response>,
14464                            tonic::Status,
14465                        >;
14466                        fn call(
14467                            &mut self,
14468                            request: tonic::Request<super::ListTeamsRequest>,
14469                        ) -> Self::Future {
14470                            let inner = Arc::clone(&self.0);
14471                            let fut = async move {
14472                                <T as TeamService>::list_teams(&inner, request).await
14473                            };
14474                            Box::pin(fut)
14475                        }
14476                    }
14477                    let accept_compression_encodings = self.accept_compression_encodings;
14478                    let send_compression_encodings = self.send_compression_encodings;
14479                    let max_decoding_message_size = self.max_decoding_message_size;
14480                    let max_encoding_message_size = self.max_encoding_message_size;
14481                    let inner = self.inner.clone();
14482                    let fut = async move {
14483                        let method = ListTeamsSvc(inner);
14484                        let codec = tonic_prost::ProstCodec::default();
14485                        let mut grpc = tonic::server::Grpc::new(codec)
14486                            .apply_compression_config(
14487                                accept_compression_encodings,
14488                                send_compression_encodings,
14489                            )
14490                            .apply_max_message_size_config(
14491                                max_decoding_message_size,
14492                                max_encoding_message_size,
14493                            );
14494                        let res = grpc.unary(method, req).await;
14495                        Ok(res)
14496                    };
14497                    Box::pin(fut)
14498                }
14499                "/pidgr.v1.TeamService/UpdateTeam" => {
14500                    #[allow(non_camel_case_types)]
14501                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
14502                    impl<
14503                        T: TeamService,
14504                    > tonic::server::UnaryService<super::UpdateTeamRequest>
14505                    for UpdateTeamSvc<T> {
14506                        type Response = super::UpdateTeamResponse;
14507                        type Future = BoxFuture<
14508                            tonic::Response<Self::Response>,
14509                            tonic::Status,
14510                        >;
14511                        fn call(
14512                            &mut self,
14513                            request: tonic::Request<super::UpdateTeamRequest>,
14514                        ) -> Self::Future {
14515                            let inner = Arc::clone(&self.0);
14516                            let fut = async move {
14517                                <T as TeamService>::update_team(&inner, request).await
14518                            };
14519                            Box::pin(fut)
14520                        }
14521                    }
14522                    let accept_compression_encodings = self.accept_compression_encodings;
14523                    let send_compression_encodings = self.send_compression_encodings;
14524                    let max_decoding_message_size = self.max_decoding_message_size;
14525                    let max_encoding_message_size = self.max_encoding_message_size;
14526                    let inner = self.inner.clone();
14527                    let fut = async move {
14528                        let method = UpdateTeamSvc(inner);
14529                        let codec = tonic_prost::ProstCodec::default();
14530                        let mut grpc = tonic::server::Grpc::new(codec)
14531                            .apply_compression_config(
14532                                accept_compression_encodings,
14533                                send_compression_encodings,
14534                            )
14535                            .apply_max_message_size_config(
14536                                max_decoding_message_size,
14537                                max_encoding_message_size,
14538                            );
14539                        let res = grpc.unary(method, req).await;
14540                        Ok(res)
14541                    };
14542                    Box::pin(fut)
14543                }
14544                "/pidgr.v1.TeamService/DeleteTeam" => {
14545                    #[allow(non_camel_case_types)]
14546                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
14547                    impl<
14548                        T: TeamService,
14549                    > tonic::server::UnaryService<super::DeleteTeamRequest>
14550                    for DeleteTeamSvc<T> {
14551                        type Response = super::DeleteTeamResponse;
14552                        type Future = BoxFuture<
14553                            tonic::Response<Self::Response>,
14554                            tonic::Status,
14555                        >;
14556                        fn call(
14557                            &mut self,
14558                            request: tonic::Request<super::DeleteTeamRequest>,
14559                        ) -> Self::Future {
14560                            let inner = Arc::clone(&self.0);
14561                            let fut = async move {
14562                                <T as TeamService>::delete_team(&inner, request).await
14563                            };
14564                            Box::pin(fut)
14565                        }
14566                    }
14567                    let accept_compression_encodings = self.accept_compression_encodings;
14568                    let send_compression_encodings = self.send_compression_encodings;
14569                    let max_decoding_message_size = self.max_decoding_message_size;
14570                    let max_encoding_message_size = self.max_encoding_message_size;
14571                    let inner = self.inner.clone();
14572                    let fut = async move {
14573                        let method = DeleteTeamSvc(inner);
14574                        let codec = tonic_prost::ProstCodec::default();
14575                        let mut grpc = tonic::server::Grpc::new(codec)
14576                            .apply_compression_config(
14577                                accept_compression_encodings,
14578                                send_compression_encodings,
14579                            )
14580                            .apply_max_message_size_config(
14581                                max_decoding_message_size,
14582                                max_encoding_message_size,
14583                            );
14584                        let res = grpc.unary(method, req).await;
14585                        Ok(res)
14586                    };
14587                    Box::pin(fut)
14588                }
14589                "/pidgr.v1.TeamService/AddTeamMembers" => {
14590                    #[allow(non_camel_case_types)]
14591                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
14592                    impl<
14593                        T: TeamService,
14594                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
14595                    for AddTeamMembersSvc<T> {
14596                        type Response = super::AddTeamMembersResponse;
14597                        type Future = BoxFuture<
14598                            tonic::Response<Self::Response>,
14599                            tonic::Status,
14600                        >;
14601                        fn call(
14602                            &mut self,
14603                            request: tonic::Request<super::AddTeamMembersRequest>,
14604                        ) -> Self::Future {
14605                            let inner = Arc::clone(&self.0);
14606                            let fut = async move {
14607                                <T as TeamService>::add_team_members(&inner, request).await
14608                            };
14609                            Box::pin(fut)
14610                        }
14611                    }
14612                    let accept_compression_encodings = self.accept_compression_encodings;
14613                    let send_compression_encodings = self.send_compression_encodings;
14614                    let max_decoding_message_size = self.max_decoding_message_size;
14615                    let max_encoding_message_size = self.max_encoding_message_size;
14616                    let inner = self.inner.clone();
14617                    let fut = async move {
14618                        let method = AddTeamMembersSvc(inner);
14619                        let codec = tonic_prost::ProstCodec::default();
14620                        let mut grpc = tonic::server::Grpc::new(codec)
14621                            .apply_compression_config(
14622                                accept_compression_encodings,
14623                                send_compression_encodings,
14624                            )
14625                            .apply_max_message_size_config(
14626                                max_decoding_message_size,
14627                                max_encoding_message_size,
14628                            );
14629                        let res = grpc.unary(method, req).await;
14630                        Ok(res)
14631                    };
14632                    Box::pin(fut)
14633                }
14634                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
14635                    #[allow(non_camel_case_types)]
14636                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
14637                    impl<
14638                        T: TeamService,
14639                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
14640                    for RemoveTeamMembersSvc<T> {
14641                        type Response = super::RemoveTeamMembersResponse;
14642                        type Future = BoxFuture<
14643                            tonic::Response<Self::Response>,
14644                            tonic::Status,
14645                        >;
14646                        fn call(
14647                            &mut self,
14648                            request: tonic::Request<super::RemoveTeamMembersRequest>,
14649                        ) -> Self::Future {
14650                            let inner = Arc::clone(&self.0);
14651                            let fut = async move {
14652                                <T as TeamService>::remove_team_members(&inner, request)
14653                                    .await
14654                            };
14655                            Box::pin(fut)
14656                        }
14657                    }
14658                    let accept_compression_encodings = self.accept_compression_encodings;
14659                    let send_compression_encodings = self.send_compression_encodings;
14660                    let max_decoding_message_size = self.max_decoding_message_size;
14661                    let max_encoding_message_size = self.max_encoding_message_size;
14662                    let inner = self.inner.clone();
14663                    let fut = async move {
14664                        let method = RemoveTeamMembersSvc(inner);
14665                        let codec = tonic_prost::ProstCodec::default();
14666                        let mut grpc = tonic::server::Grpc::new(codec)
14667                            .apply_compression_config(
14668                                accept_compression_encodings,
14669                                send_compression_encodings,
14670                            )
14671                            .apply_max_message_size_config(
14672                                max_decoding_message_size,
14673                                max_encoding_message_size,
14674                            );
14675                        let res = grpc.unary(method, req).await;
14676                        Ok(res)
14677                    };
14678                    Box::pin(fut)
14679                }
14680                "/pidgr.v1.TeamService/ListTeamMembers" => {
14681                    #[allow(non_camel_case_types)]
14682                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
14683                    impl<
14684                        T: TeamService,
14685                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
14686                    for ListTeamMembersSvc<T> {
14687                        type Response = super::ListTeamMembersResponse;
14688                        type Future = BoxFuture<
14689                            tonic::Response<Self::Response>,
14690                            tonic::Status,
14691                        >;
14692                        fn call(
14693                            &mut self,
14694                            request: tonic::Request<super::ListTeamMembersRequest>,
14695                        ) -> Self::Future {
14696                            let inner = Arc::clone(&self.0);
14697                            let fut = async move {
14698                                <T as TeamService>::list_team_members(&inner, request).await
14699                            };
14700                            Box::pin(fut)
14701                        }
14702                    }
14703                    let accept_compression_encodings = self.accept_compression_encodings;
14704                    let send_compression_encodings = self.send_compression_encodings;
14705                    let max_decoding_message_size = self.max_decoding_message_size;
14706                    let max_encoding_message_size = self.max_encoding_message_size;
14707                    let inner = self.inner.clone();
14708                    let fut = async move {
14709                        let method = ListTeamMembersSvc(inner);
14710                        let codec = tonic_prost::ProstCodec::default();
14711                        let mut grpc = tonic::server::Grpc::new(codec)
14712                            .apply_compression_config(
14713                                accept_compression_encodings,
14714                                send_compression_encodings,
14715                            )
14716                            .apply_max_message_size_config(
14717                                max_decoding_message_size,
14718                                max_encoding_message_size,
14719                            );
14720                        let res = grpc.unary(method, req).await;
14721                        Ok(res)
14722                    };
14723                    Box::pin(fut)
14724                }
14725                _ => {
14726                    Box::pin(async move {
14727                        let mut response = http::Response::new(
14728                            tonic::body::Body::default(),
14729                        );
14730                        let headers = response.headers_mut();
14731                        headers
14732                            .insert(
14733                                tonic::Status::GRPC_STATUS,
14734                                (tonic::Code::Unimplemented as i32).into(),
14735                            );
14736                        headers
14737                            .insert(
14738                                http::header::CONTENT_TYPE,
14739                                tonic::metadata::GRPC_CONTENT_TYPE,
14740                            );
14741                        Ok(response)
14742                    })
14743                }
14744            }
14745        }
14746    }
14747    impl<T> Clone for TeamServiceServer<T> {
14748        fn clone(&self) -> Self {
14749            let inner = self.inner.clone();
14750            Self {
14751                inner,
14752                accept_compression_encodings: self.accept_compression_encodings,
14753                send_compression_encodings: self.send_compression_encodings,
14754                max_decoding_message_size: self.max_decoding_message_size,
14755                max_encoding_message_size: self.max_encoding_message_size,
14756            }
14757        }
14758    }
14759    /// Generated gRPC service name
14760    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
14761    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
14762        const NAME: &'static str = SERVICE_NAME;
14763    }
14764}
14765/// Generated client implementations.
14766pub mod template_service_client {
14767    #![allow(
14768        unused_variables,
14769        dead_code,
14770        missing_docs,
14771        clippy::wildcard_imports,
14772        clippy::let_unit_value,
14773    )]
14774    use tonic::codegen::*;
14775    use tonic::codegen::http::Uri;
14776    /** Manages versioned message templates used by campaigns.
14777 Templates are append-only — updates create new versions while preserving history.
14778*/
14779    #[derive(Debug, Clone)]
14780    pub struct TemplateServiceClient<T> {
14781        inner: tonic::client::Grpc<T>,
14782    }
14783    impl TemplateServiceClient<tonic::transport::Channel> {
14784        /// Attempt to create a new client by connecting to a given endpoint.
14785        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14786        where
14787            D: TryInto<tonic::transport::Endpoint>,
14788            D::Error: Into<StdError>,
14789        {
14790            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14791            Ok(Self::new(conn))
14792        }
14793    }
14794    impl<T> TemplateServiceClient<T>
14795    where
14796        T: tonic::client::GrpcService<tonic::body::Body>,
14797        T::Error: Into<StdError>,
14798        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14799        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14800    {
14801        pub fn new(inner: T) -> Self {
14802            let inner = tonic::client::Grpc::new(inner);
14803            Self { inner }
14804        }
14805        pub fn with_origin(inner: T, origin: Uri) -> Self {
14806            let inner = tonic::client::Grpc::with_origin(inner, origin);
14807            Self { inner }
14808        }
14809        pub fn with_interceptor<F>(
14810            inner: T,
14811            interceptor: F,
14812        ) -> TemplateServiceClient<InterceptedService<T, F>>
14813        where
14814            F: tonic::service::Interceptor,
14815            T::ResponseBody: Default,
14816            T: tonic::codegen::Service<
14817                http::Request<tonic::body::Body>,
14818                Response = http::Response<
14819                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14820                >,
14821            >,
14822            <T as tonic::codegen::Service<
14823                http::Request<tonic::body::Body>,
14824            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14825        {
14826            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
14827        }
14828        /// Compress requests with the given encoding.
14829        ///
14830        /// This requires the server to support it otherwise it might respond with an
14831        /// error.
14832        #[must_use]
14833        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14834            self.inner = self.inner.send_compressed(encoding);
14835            self
14836        }
14837        /// Enable decompressing responses.
14838        #[must_use]
14839        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14840            self.inner = self.inner.accept_compressed(encoding);
14841            self
14842        }
14843        /// Limits the maximum size of a decoded message.
14844        ///
14845        /// Default: `4MB`
14846        #[must_use]
14847        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14848            self.inner = self.inner.max_decoding_message_size(limit);
14849            self
14850        }
14851        /// Limits the maximum size of an encoded message.
14852        ///
14853        /// Default: `usize::MAX`
14854        #[must_use]
14855        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14856            self.inner = self.inner.max_encoding_message_size(limit);
14857            self
14858        }
14859        /** Create a new template with a body and variable definitions.
14860 Authorization: Requires MANAGER+ role.
14861*/
14862        pub async fn create_template(
14863            &mut self,
14864            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
14865        ) -> std::result::Result<
14866            tonic::Response<super::CreateTemplateResponse>,
14867            tonic::Status,
14868        > {
14869            self.inner
14870                .ready()
14871                .await
14872                .map_err(|e| {
14873                    tonic::Status::unknown(
14874                        format!("Service was not ready: {}", e.into()),
14875                    )
14876                })?;
14877            let codec = tonic_prost::ProstCodec::default();
14878            let path = http::uri::PathAndQuery::from_static(
14879                "/pidgr.v1.TemplateService/CreateTemplate",
14880            );
14881            let mut req = request.into_request();
14882            req.extensions_mut()
14883                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
14884            self.inner.unary(req, path, codec).await
14885        }
14886        /** Update an existing template, creating a new version.
14887 Authorization: Requires MANAGER+ role.
14888*/
14889        pub async fn update_template(
14890            &mut self,
14891            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
14892        ) -> std::result::Result<
14893            tonic::Response<super::UpdateTemplateResponse>,
14894            tonic::Status,
14895        > {
14896            self.inner
14897                .ready()
14898                .await
14899                .map_err(|e| {
14900                    tonic::Status::unknown(
14901                        format!("Service was not ready: {}", e.into()),
14902                    )
14903                })?;
14904            let codec = tonic_prost::ProstCodec::default();
14905            let path = http::uri::PathAndQuery::from_static(
14906                "/pidgr.v1.TemplateService/UpdateTemplate",
14907            );
14908            let mut req = request.into_request();
14909            req.extensions_mut()
14910                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
14911            self.inner.unary(req, path, codec).await
14912        }
14913        /** Retrieve a specific template by ID and optional version.
14914 Authorization: Authenticated user within the organization.
14915*/
14916        pub async fn get_template(
14917            &mut self,
14918            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
14919        ) -> std::result::Result<
14920            tonic::Response<super::GetTemplateResponse>,
14921            tonic::Status,
14922        > {
14923            self.inner
14924                .ready()
14925                .await
14926                .map_err(|e| {
14927                    tonic::Status::unknown(
14928                        format!("Service was not ready: {}", e.into()),
14929                    )
14930                })?;
14931            let codec = tonic_prost::ProstCodec::default();
14932            let path = http::uri::PathAndQuery::from_static(
14933                "/pidgr.v1.TemplateService/GetTemplate",
14934            );
14935            let mut req = request.into_request();
14936            req.extensions_mut()
14937                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
14938            self.inner.unary(req, path, codec).await
14939        }
14940        /** List all templates for the organization with pagination.
14941 Authorization: Authenticated user within the organization.
14942*/
14943        pub async fn list_templates(
14944            &mut self,
14945            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
14946        ) -> std::result::Result<
14947            tonic::Response<super::ListTemplatesResponse>,
14948            tonic::Status,
14949        > {
14950            self.inner
14951                .ready()
14952                .await
14953                .map_err(|e| {
14954                    tonic::Status::unknown(
14955                        format!("Service was not ready: {}", e.into()),
14956                    )
14957                })?;
14958            let codec = tonic_prost::ProstCodec::default();
14959            let path = http::uri::PathAndQuery::from_static(
14960                "/pidgr.v1.TemplateService/ListTemplates",
14961            );
14962            let mut req = request.into_request();
14963            req.extensions_mut()
14964                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
14965            self.inner.unary(req, path, codec).await
14966        }
14967        /** Create a locale-specific translation of a template.
14968 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
14969*/
14970        pub async fn create_template_translation(
14971            &mut self,
14972            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
14973        ) -> std::result::Result<
14974            tonic::Response<super::CreateTemplateTranslationResponse>,
14975            tonic::Status,
14976        > {
14977            self.inner
14978                .ready()
14979                .await
14980                .map_err(|e| {
14981                    tonic::Status::unknown(
14982                        format!("Service was not ready: {}", e.into()),
14983                    )
14984                })?;
14985            let codec = tonic_prost::ProstCodec::default();
14986            let path = http::uri::PathAndQuery::from_static(
14987                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
14988            );
14989            let mut req = request.into_request();
14990            req.extensions_mut()
14991                .insert(
14992                    GrpcMethod::new(
14993                        "pidgr.v1.TemplateService",
14994                        "CreateTemplateTranslation",
14995                    ),
14996                );
14997            self.inner.unary(req, path, codec).await
14998        }
14999        /** Update an existing template translation.
15000 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15001*/
15002        pub async fn update_template_translation(
15003            &mut self,
15004            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
15005        ) -> std::result::Result<
15006            tonic::Response<super::UpdateTemplateTranslationResponse>,
15007            tonic::Status,
15008        > {
15009            self.inner
15010                .ready()
15011                .await
15012                .map_err(|e| {
15013                    tonic::Status::unknown(
15014                        format!("Service was not ready: {}", e.into()),
15015                    )
15016                })?;
15017            let codec = tonic_prost::ProstCodec::default();
15018            let path = http::uri::PathAndQuery::from_static(
15019                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
15020            );
15021            let mut req = request.into_request();
15022            req.extensions_mut()
15023                .insert(
15024                    GrpcMethod::new(
15025                        "pidgr.v1.TemplateService",
15026                        "UpdateTemplateTranslation",
15027                    ),
15028                );
15029            self.inner.unary(req, path, codec).await
15030        }
15031        /** List all translations for a template version.
15032 Authorization: Requires PERMISSION_TEMPLATES_READ.
15033*/
15034        pub async fn list_template_translations(
15035            &mut self,
15036            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
15037        ) -> std::result::Result<
15038            tonic::Response<super::ListTemplateTranslationsResponse>,
15039            tonic::Status,
15040        > {
15041            self.inner
15042                .ready()
15043                .await
15044                .map_err(|e| {
15045                    tonic::Status::unknown(
15046                        format!("Service was not ready: {}", e.into()),
15047                    )
15048                })?;
15049            let codec = tonic_prost::ProstCodec::default();
15050            let path = http::uri::PathAndQuery::from_static(
15051                "/pidgr.v1.TemplateService/ListTemplateTranslations",
15052            );
15053            let mut req = request.into_request();
15054            req.extensions_mut()
15055                .insert(
15056                    GrpcMethod::new(
15057                        "pidgr.v1.TemplateService",
15058                        "ListTemplateTranslations",
15059                    ),
15060                );
15061            self.inner.unary(req, path, codec).await
15062        }
15063        /** Approve a template translation for use in campaigns.
15064 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
15065*/
15066        pub async fn approve_template_translation(
15067            &mut self,
15068            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
15069        ) -> std::result::Result<
15070            tonic::Response<super::ApproveTemplateTranslationResponse>,
15071            tonic::Status,
15072        > {
15073            self.inner
15074                .ready()
15075                .await
15076                .map_err(|e| {
15077                    tonic::Status::unknown(
15078                        format!("Service was not ready: {}", e.into()),
15079                    )
15080                })?;
15081            let codec = tonic_prost::ProstCodec::default();
15082            let path = http::uri::PathAndQuery::from_static(
15083                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
15084            );
15085            let mut req = request.into_request();
15086            req.extensions_mut()
15087                .insert(
15088                    GrpcMethod::new(
15089                        "pidgr.v1.TemplateService",
15090                        "ApproveTemplateTranslation",
15091                    ),
15092                );
15093            self.inner.unary(req, path, codec).await
15094        }
15095    }
15096}
15097/// Generated server implementations.
15098pub mod template_service_server {
15099    #![allow(
15100        unused_variables,
15101        dead_code,
15102        missing_docs,
15103        clippy::wildcard_imports,
15104        clippy::let_unit_value,
15105    )]
15106    use tonic::codegen::*;
15107    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
15108    #[async_trait]
15109    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
15110        /** Create a new template with a body and variable definitions.
15111 Authorization: Requires MANAGER+ role.
15112*/
15113        async fn create_template(
15114            &self,
15115            request: tonic::Request<super::CreateTemplateRequest>,
15116        ) -> std::result::Result<
15117            tonic::Response<super::CreateTemplateResponse>,
15118            tonic::Status,
15119        >;
15120        /** Update an existing template, creating a new version.
15121 Authorization: Requires MANAGER+ role.
15122*/
15123        async fn update_template(
15124            &self,
15125            request: tonic::Request<super::UpdateTemplateRequest>,
15126        ) -> std::result::Result<
15127            tonic::Response<super::UpdateTemplateResponse>,
15128            tonic::Status,
15129        >;
15130        /** Retrieve a specific template by ID and optional version.
15131 Authorization: Authenticated user within the organization.
15132*/
15133        async fn get_template(
15134            &self,
15135            request: tonic::Request<super::GetTemplateRequest>,
15136        ) -> std::result::Result<
15137            tonic::Response<super::GetTemplateResponse>,
15138            tonic::Status,
15139        >;
15140        /** List all templates for the organization with pagination.
15141 Authorization: Authenticated user within the organization.
15142*/
15143        async fn list_templates(
15144            &self,
15145            request: tonic::Request<super::ListTemplatesRequest>,
15146        ) -> std::result::Result<
15147            tonic::Response<super::ListTemplatesResponse>,
15148            tonic::Status,
15149        >;
15150        /** Create a locale-specific translation of a template.
15151 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15152*/
15153        async fn create_template_translation(
15154            &self,
15155            request: tonic::Request<super::CreateTemplateTranslationRequest>,
15156        ) -> std::result::Result<
15157            tonic::Response<super::CreateTemplateTranslationResponse>,
15158            tonic::Status,
15159        >;
15160        /** Update an existing template translation.
15161 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15162*/
15163        async fn update_template_translation(
15164            &self,
15165            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
15166        ) -> std::result::Result<
15167            tonic::Response<super::UpdateTemplateTranslationResponse>,
15168            tonic::Status,
15169        >;
15170        /** List all translations for a template version.
15171 Authorization: Requires PERMISSION_TEMPLATES_READ.
15172*/
15173        async fn list_template_translations(
15174            &self,
15175            request: tonic::Request<super::ListTemplateTranslationsRequest>,
15176        ) -> std::result::Result<
15177            tonic::Response<super::ListTemplateTranslationsResponse>,
15178            tonic::Status,
15179        >;
15180        /** Approve a template translation for use in campaigns.
15181 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
15182*/
15183        async fn approve_template_translation(
15184            &self,
15185            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
15186        ) -> std::result::Result<
15187            tonic::Response<super::ApproveTemplateTranslationResponse>,
15188            tonic::Status,
15189        >;
15190    }
15191    /** Manages versioned message templates used by campaigns.
15192 Templates are append-only — updates create new versions while preserving history.
15193*/
15194    #[derive(Debug)]
15195    pub struct TemplateServiceServer<T> {
15196        inner: Arc<T>,
15197        accept_compression_encodings: EnabledCompressionEncodings,
15198        send_compression_encodings: EnabledCompressionEncodings,
15199        max_decoding_message_size: Option<usize>,
15200        max_encoding_message_size: Option<usize>,
15201    }
15202    impl<T> TemplateServiceServer<T> {
15203        pub fn new(inner: T) -> Self {
15204            Self::from_arc(Arc::new(inner))
15205        }
15206        pub fn from_arc(inner: Arc<T>) -> Self {
15207            Self {
15208                inner,
15209                accept_compression_encodings: Default::default(),
15210                send_compression_encodings: Default::default(),
15211                max_decoding_message_size: None,
15212                max_encoding_message_size: None,
15213            }
15214        }
15215        pub fn with_interceptor<F>(
15216            inner: T,
15217            interceptor: F,
15218        ) -> InterceptedService<Self, F>
15219        where
15220            F: tonic::service::Interceptor,
15221        {
15222            InterceptedService::new(Self::new(inner), interceptor)
15223        }
15224        /// Enable decompressing requests with the given encoding.
15225        #[must_use]
15226        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15227            self.accept_compression_encodings.enable(encoding);
15228            self
15229        }
15230        /// Compress responses with the given encoding, if the client supports it.
15231        #[must_use]
15232        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15233            self.send_compression_encodings.enable(encoding);
15234            self
15235        }
15236        /// Limits the maximum size of a decoded message.
15237        ///
15238        /// Default: `4MB`
15239        #[must_use]
15240        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15241            self.max_decoding_message_size = Some(limit);
15242            self
15243        }
15244        /// Limits the maximum size of an encoded message.
15245        ///
15246        /// Default: `usize::MAX`
15247        #[must_use]
15248        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15249            self.max_encoding_message_size = Some(limit);
15250            self
15251        }
15252    }
15253    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
15254    where
15255        T: TemplateService,
15256        B: Body + std::marker::Send + 'static,
15257        B::Error: Into<StdError> + std::marker::Send + 'static,
15258    {
15259        type Response = http::Response<tonic::body::Body>;
15260        type Error = std::convert::Infallible;
15261        type Future = BoxFuture<Self::Response, Self::Error>;
15262        fn poll_ready(
15263            &mut self,
15264            _cx: &mut Context<'_>,
15265        ) -> Poll<std::result::Result<(), Self::Error>> {
15266            Poll::Ready(Ok(()))
15267        }
15268        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15269            match req.uri().path() {
15270                "/pidgr.v1.TemplateService/CreateTemplate" => {
15271                    #[allow(non_camel_case_types)]
15272                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
15273                    impl<
15274                        T: TemplateService,
15275                    > tonic::server::UnaryService<super::CreateTemplateRequest>
15276                    for CreateTemplateSvc<T> {
15277                        type Response = super::CreateTemplateResponse;
15278                        type Future = BoxFuture<
15279                            tonic::Response<Self::Response>,
15280                            tonic::Status,
15281                        >;
15282                        fn call(
15283                            &mut self,
15284                            request: tonic::Request<super::CreateTemplateRequest>,
15285                        ) -> Self::Future {
15286                            let inner = Arc::clone(&self.0);
15287                            let fut = async move {
15288                                <T as TemplateService>::create_template(&inner, request)
15289                                    .await
15290                            };
15291                            Box::pin(fut)
15292                        }
15293                    }
15294                    let accept_compression_encodings = self.accept_compression_encodings;
15295                    let send_compression_encodings = self.send_compression_encodings;
15296                    let max_decoding_message_size = self.max_decoding_message_size;
15297                    let max_encoding_message_size = self.max_encoding_message_size;
15298                    let inner = self.inner.clone();
15299                    let fut = async move {
15300                        let method = CreateTemplateSvc(inner);
15301                        let codec = tonic_prost::ProstCodec::default();
15302                        let mut grpc = tonic::server::Grpc::new(codec)
15303                            .apply_compression_config(
15304                                accept_compression_encodings,
15305                                send_compression_encodings,
15306                            )
15307                            .apply_max_message_size_config(
15308                                max_decoding_message_size,
15309                                max_encoding_message_size,
15310                            );
15311                        let res = grpc.unary(method, req).await;
15312                        Ok(res)
15313                    };
15314                    Box::pin(fut)
15315                }
15316                "/pidgr.v1.TemplateService/UpdateTemplate" => {
15317                    #[allow(non_camel_case_types)]
15318                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
15319                    impl<
15320                        T: TemplateService,
15321                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
15322                    for UpdateTemplateSvc<T> {
15323                        type Response = super::UpdateTemplateResponse;
15324                        type Future = BoxFuture<
15325                            tonic::Response<Self::Response>,
15326                            tonic::Status,
15327                        >;
15328                        fn call(
15329                            &mut self,
15330                            request: tonic::Request<super::UpdateTemplateRequest>,
15331                        ) -> Self::Future {
15332                            let inner = Arc::clone(&self.0);
15333                            let fut = async move {
15334                                <T as TemplateService>::update_template(&inner, request)
15335                                    .await
15336                            };
15337                            Box::pin(fut)
15338                        }
15339                    }
15340                    let accept_compression_encodings = self.accept_compression_encodings;
15341                    let send_compression_encodings = self.send_compression_encodings;
15342                    let max_decoding_message_size = self.max_decoding_message_size;
15343                    let max_encoding_message_size = self.max_encoding_message_size;
15344                    let inner = self.inner.clone();
15345                    let fut = async move {
15346                        let method = UpdateTemplateSvc(inner);
15347                        let codec = tonic_prost::ProstCodec::default();
15348                        let mut grpc = tonic::server::Grpc::new(codec)
15349                            .apply_compression_config(
15350                                accept_compression_encodings,
15351                                send_compression_encodings,
15352                            )
15353                            .apply_max_message_size_config(
15354                                max_decoding_message_size,
15355                                max_encoding_message_size,
15356                            );
15357                        let res = grpc.unary(method, req).await;
15358                        Ok(res)
15359                    };
15360                    Box::pin(fut)
15361                }
15362                "/pidgr.v1.TemplateService/GetTemplate" => {
15363                    #[allow(non_camel_case_types)]
15364                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
15365                    impl<
15366                        T: TemplateService,
15367                    > tonic::server::UnaryService<super::GetTemplateRequest>
15368                    for GetTemplateSvc<T> {
15369                        type Response = super::GetTemplateResponse;
15370                        type Future = BoxFuture<
15371                            tonic::Response<Self::Response>,
15372                            tonic::Status,
15373                        >;
15374                        fn call(
15375                            &mut self,
15376                            request: tonic::Request<super::GetTemplateRequest>,
15377                        ) -> Self::Future {
15378                            let inner = Arc::clone(&self.0);
15379                            let fut = async move {
15380                                <T as TemplateService>::get_template(&inner, request).await
15381                            };
15382                            Box::pin(fut)
15383                        }
15384                    }
15385                    let accept_compression_encodings = self.accept_compression_encodings;
15386                    let send_compression_encodings = self.send_compression_encodings;
15387                    let max_decoding_message_size = self.max_decoding_message_size;
15388                    let max_encoding_message_size = self.max_encoding_message_size;
15389                    let inner = self.inner.clone();
15390                    let fut = async move {
15391                        let method = GetTemplateSvc(inner);
15392                        let codec = tonic_prost::ProstCodec::default();
15393                        let mut grpc = tonic::server::Grpc::new(codec)
15394                            .apply_compression_config(
15395                                accept_compression_encodings,
15396                                send_compression_encodings,
15397                            )
15398                            .apply_max_message_size_config(
15399                                max_decoding_message_size,
15400                                max_encoding_message_size,
15401                            );
15402                        let res = grpc.unary(method, req).await;
15403                        Ok(res)
15404                    };
15405                    Box::pin(fut)
15406                }
15407                "/pidgr.v1.TemplateService/ListTemplates" => {
15408                    #[allow(non_camel_case_types)]
15409                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
15410                    impl<
15411                        T: TemplateService,
15412                    > tonic::server::UnaryService<super::ListTemplatesRequest>
15413                    for ListTemplatesSvc<T> {
15414                        type Response = super::ListTemplatesResponse;
15415                        type Future = BoxFuture<
15416                            tonic::Response<Self::Response>,
15417                            tonic::Status,
15418                        >;
15419                        fn call(
15420                            &mut self,
15421                            request: tonic::Request<super::ListTemplatesRequest>,
15422                        ) -> Self::Future {
15423                            let inner = Arc::clone(&self.0);
15424                            let fut = async move {
15425                                <T as TemplateService>::list_templates(&inner, request)
15426                                    .await
15427                            };
15428                            Box::pin(fut)
15429                        }
15430                    }
15431                    let accept_compression_encodings = self.accept_compression_encodings;
15432                    let send_compression_encodings = self.send_compression_encodings;
15433                    let max_decoding_message_size = self.max_decoding_message_size;
15434                    let max_encoding_message_size = self.max_encoding_message_size;
15435                    let inner = self.inner.clone();
15436                    let fut = async move {
15437                        let method = ListTemplatesSvc(inner);
15438                        let codec = tonic_prost::ProstCodec::default();
15439                        let mut grpc = tonic::server::Grpc::new(codec)
15440                            .apply_compression_config(
15441                                accept_compression_encodings,
15442                                send_compression_encodings,
15443                            )
15444                            .apply_max_message_size_config(
15445                                max_decoding_message_size,
15446                                max_encoding_message_size,
15447                            );
15448                        let res = grpc.unary(method, req).await;
15449                        Ok(res)
15450                    };
15451                    Box::pin(fut)
15452                }
15453                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
15454                    #[allow(non_camel_case_types)]
15455                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
15456                    impl<
15457                        T: TemplateService,
15458                    > tonic::server::UnaryService<
15459                        super::CreateTemplateTranslationRequest,
15460                    > for CreateTemplateTranslationSvc<T> {
15461                        type Response = super::CreateTemplateTranslationResponse;
15462                        type Future = BoxFuture<
15463                            tonic::Response<Self::Response>,
15464                            tonic::Status,
15465                        >;
15466                        fn call(
15467                            &mut self,
15468                            request: tonic::Request<
15469                                super::CreateTemplateTranslationRequest,
15470                            >,
15471                        ) -> Self::Future {
15472                            let inner = Arc::clone(&self.0);
15473                            let fut = async move {
15474                                <T as TemplateService>::create_template_translation(
15475                                        &inner,
15476                                        request,
15477                                    )
15478                                    .await
15479                            };
15480                            Box::pin(fut)
15481                        }
15482                    }
15483                    let accept_compression_encodings = self.accept_compression_encodings;
15484                    let send_compression_encodings = self.send_compression_encodings;
15485                    let max_decoding_message_size = self.max_decoding_message_size;
15486                    let max_encoding_message_size = self.max_encoding_message_size;
15487                    let inner = self.inner.clone();
15488                    let fut = async move {
15489                        let method = CreateTemplateTranslationSvc(inner);
15490                        let codec = tonic_prost::ProstCodec::default();
15491                        let mut grpc = tonic::server::Grpc::new(codec)
15492                            .apply_compression_config(
15493                                accept_compression_encodings,
15494                                send_compression_encodings,
15495                            )
15496                            .apply_max_message_size_config(
15497                                max_decoding_message_size,
15498                                max_encoding_message_size,
15499                            );
15500                        let res = grpc.unary(method, req).await;
15501                        Ok(res)
15502                    };
15503                    Box::pin(fut)
15504                }
15505                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
15506                    #[allow(non_camel_case_types)]
15507                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
15508                    impl<
15509                        T: TemplateService,
15510                    > tonic::server::UnaryService<
15511                        super::UpdateTemplateTranslationRequest,
15512                    > for UpdateTemplateTranslationSvc<T> {
15513                        type Response = super::UpdateTemplateTranslationResponse;
15514                        type Future = BoxFuture<
15515                            tonic::Response<Self::Response>,
15516                            tonic::Status,
15517                        >;
15518                        fn call(
15519                            &mut self,
15520                            request: tonic::Request<
15521                                super::UpdateTemplateTranslationRequest,
15522                            >,
15523                        ) -> Self::Future {
15524                            let inner = Arc::clone(&self.0);
15525                            let fut = async move {
15526                                <T as TemplateService>::update_template_translation(
15527                                        &inner,
15528                                        request,
15529                                    )
15530                                    .await
15531                            };
15532                            Box::pin(fut)
15533                        }
15534                    }
15535                    let accept_compression_encodings = self.accept_compression_encodings;
15536                    let send_compression_encodings = self.send_compression_encodings;
15537                    let max_decoding_message_size = self.max_decoding_message_size;
15538                    let max_encoding_message_size = self.max_encoding_message_size;
15539                    let inner = self.inner.clone();
15540                    let fut = async move {
15541                        let method = UpdateTemplateTranslationSvc(inner);
15542                        let codec = tonic_prost::ProstCodec::default();
15543                        let mut grpc = tonic::server::Grpc::new(codec)
15544                            .apply_compression_config(
15545                                accept_compression_encodings,
15546                                send_compression_encodings,
15547                            )
15548                            .apply_max_message_size_config(
15549                                max_decoding_message_size,
15550                                max_encoding_message_size,
15551                            );
15552                        let res = grpc.unary(method, req).await;
15553                        Ok(res)
15554                    };
15555                    Box::pin(fut)
15556                }
15557                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
15558                    #[allow(non_camel_case_types)]
15559                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
15560                    impl<
15561                        T: TemplateService,
15562                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
15563                    for ListTemplateTranslationsSvc<T> {
15564                        type Response = super::ListTemplateTranslationsResponse;
15565                        type Future = BoxFuture<
15566                            tonic::Response<Self::Response>,
15567                            tonic::Status,
15568                        >;
15569                        fn call(
15570                            &mut self,
15571                            request: tonic::Request<
15572                                super::ListTemplateTranslationsRequest,
15573                            >,
15574                        ) -> Self::Future {
15575                            let inner = Arc::clone(&self.0);
15576                            let fut = async move {
15577                                <T as TemplateService>::list_template_translations(
15578                                        &inner,
15579                                        request,
15580                                    )
15581                                    .await
15582                            };
15583                            Box::pin(fut)
15584                        }
15585                    }
15586                    let accept_compression_encodings = self.accept_compression_encodings;
15587                    let send_compression_encodings = self.send_compression_encodings;
15588                    let max_decoding_message_size = self.max_decoding_message_size;
15589                    let max_encoding_message_size = self.max_encoding_message_size;
15590                    let inner = self.inner.clone();
15591                    let fut = async move {
15592                        let method = ListTemplateTranslationsSvc(inner);
15593                        let codec = tonic_prost::ProstCodec::default();
15594                        let mut grpc = tonic::server::Grpc::new(codec)
15595                            .apply_compression_config(
15596                                accept_compression_encodings,
15597                                send_compression_encodings,
15598                            )
15599                            .apply_max_message_size_config(
15600                                max_decoding_message_size,
15601                                max_encoding_message_size,
15602                            );
15603                        let res = grpc.unary(method, req).await;
15604                        Ok(res)
15605                    };
15606                    Box::pin(fut)
15607                }
15608                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
15609                    #[allow(non_camel_case_types)]
15610                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
15611                    impl<
15612                        T: TemplateService,
15613                    > tonic::server::UnaryService<
15614                        super::ApproveTemplateTranslationRequest,
15615                    > for ApproveTemplateTranslationSvc<T> {
15616                        type Response = super::ApproveTemplateTranslationResponse;
15617                        type Future = BoxFuture<
15618                            tonic::Response<Self::Response>,
15619                            tonic::Status,
15620                        >;
15621                        fn call(
15622                            &mut self,
15623                            request: tonic::Request<
15624                                super::ApproveTemplateTranslationRequest,
15625                            >,
15626                        ) -> Self::Future {
15627                            let inner = Arc::clone(&self.0);
15628                            let fut = async move {
15629                                <T as TemplateService>::approve_template_translation(
15630                                        &inner,
15631                                        request,
15632                                    )
15633                                    .await
15634                            };
15635                            Box::pin(fut)
15636                        }
15637                    }
15638                    let accept_compression_encodings = self.accept_compression_encodings;
15639                    let send_compression_encodings = self.send_compression_encodings;
15640                    let max_decoding_message_size = self.max_decoding_message_size;
15641                    let max_encoding_message_size = self.max_encoding_message_size;
15642                    let inner = self.inner.clone();
15643                    let fut = async move {
15644                        let method = ApproveTemplateTranslationSvc(inner);
15645                        let codec = tonic_prost::ProstCodec::default();
15646                        let mut grpc = tonic::server::Grpc::new(codec)
15647                            .apply_compression_config(
15648                                accept_compression_encodings,
15649                                send_compression_encodings,
15650                            )
15651                            .apply_max_message_size_config(
15652                                max_decoding_message_size,
15653                                max_encoding_message_size,
15654                            );
15655                        let res = grpc.unary(method, req).await;
15656                        Ok(res)
15657                    };
15658                    Box::pin(fut)
15659                }
15660                _ => {
15661                    Box::pin(async move {
15662                        let mut response = http::Response::new(
15663                            tonic::body::Body::default(),
15664                        );
15665                        let headers = response.headers_mut();
15666                        headers
15667                            .insert(
15668                                tonic::Status::GRPC_STATUS,
15669                                (tonic::Code::Unimplemented as i32).into(),
15670                            );
15671                        headers
15672                            .insert(
15673                                http::header::CONTENT_TYPE,
15674                                tonic::metadata::GRPC_CONTENT_TYPE,
15675                            );
15676                        Ok(response)
15677                    })
15678                }
15679            }
15680        }
15681    }
15682    impl<T> Clone for TemplateServiceServer<T> {
15683        fn clone(&self) -> Self {
15684            let inner = self.inner.clone();
15685            Self {
15686                inner,
15687                accept_compression_encodings: self.accept_compression_encodings,
15688                send_compression_encodings: self.send_compression_encodings,
15689                max_decoding_message_size: self.max_decoding_message_size,
15690                max_encoding_message_size: self.max_encoding_message_size,
15691            }
15692        }
15693    }
15694    /// Generated gRPC service name
15695    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
15696    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
15697        const NAME: &'static str = SERVICE_NAME;
15698    }
15699}
15700/// Generated client implementations.
15701pub mod token_service_client {
15702    #![allow(
15703        unused_variables,
15704        dead_code,
15705        missing_docs,
15706        clippy::wildcard_imports,
15707        clippy::let_unit_value,
15708    )]
15709    use tonic::codegen::*;
15710    use tonic::codegen::http::Uri;
15711    /** HMAC-signed deeplink-token signing and validation.
15712
15713 Deeplink tokens carry the (campaign, recipient, step) tuple that
15714 authorizes a third-party-channel deeplink
15715 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
15716 pidgr-api with a per-org HMAC key managed by the platform's key store;
15717 rotation is automatic with a 7-day overlap window so callers do not
15718 have to coordinate.
15719*/
15720    #[derive(Debug, Clone)]
15721    pub struct TokenServiceClient<T> {
15722        inner: tonic::client::Grpc<T>,
15723    }
15724    impl TokenServiceClient<tonic::transport::Channel> {
15725        /// Attempt to create a new client by connecting to a given endpoint.
15726        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15727        where
15728            D: TryInto<tonic::transport::Endpoint>,
15729            D::Error: Into<StdError>,
15730        {
15731            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15732            Ok(Self::new(conn))
15733        }
15734    }
15735    impl<T> TokenServiceClient<T>
15736    where
15737        T: tonic::client::GrpcService<tonic::body::Body>,
15738        T::Error: Into<StdError>,
15739        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15740        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15741    {
15742        pub fn new(inner: T) -> Self {
15743            let inner = tonic::client::Grpc::new(inner);
15744            Self { inner }
15745        }
15746        pub fn with_origin(inner: T, origin: Uri) -> Self {
15747            let inner = tonic::client::Grpc::with_origin(inner, origin);
15748            Self { inner }
15749        }
15750        pub fn with_interceptor<F>(
15751            inner: T,
15752            interceptor: F,
15753        ) -> TokenServiceClient<InterceptedService<T, F>>
15754        where
15755            F: tonic::service::Interceptor,
15756            T::ResponseBody: Default,
15757            T: tonic::codegen::Service<
15758                http::Request<tonic::body::Body>,
15759                Response = http::Response<
15760                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15761                >,
15762            >,
15763            <T as tonic::codegen::Service<
15764                http::Request<tonic::body::Body>,
15765            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15766        {
15767            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
15768        }
15769        /// Compress requests with the given encoding.
15770        ///
15771        /// This requires the server to support it otherwise it might respond with an
15772        /// error.
15773        #[must_use]
15774        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15775            self.inner = self.inner.send_compressed(encoding);
15776            self
15777        }
15778        /// Enable decompressing responses.
15779        #[must_use]
15780        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15781            self.inner = self.inner.accept_compressed(encoding);
15782            self
15783        }
15784        /// Limits the maximum size of a decoded message.
15785        ///
15786        /// Default: `4MB`
15787        #[must_use]
15788        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15789            self.inner = self.inner.max_decoding_message_size(limit);
15790            self
15791        }
15792        /// Limits the maximum size of an encoded message.
15793        ///
15794        /// Default: `usize::MAX`
15795        #[must_use]
15796        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15797            self.inner = self.inner.max_encoding_message_size(limit);
15798            self
15799        }
15800        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
15801 the dispatch layer assembling a deeplink during message
15802 composition).
15803*/
15804        pub async fn sign_deeplink_token(
15805            &mut self,
15806            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
15807        ) -> std::result::Result<
15808            tonic::Response<super::SignDeeplinkTokenResponse>,
15809            tonic::Status,
15810        > {
15811            self.inner
15812                .ready()
15813                .await
15814                .map_err(|e| {
15815                    tonic::Status::unknown(
15816                        format!("Service was not ready: {}", e.into()),
15817                    )
15818                })?;
15819            let codec = tonic_prost::ProstCodec::default();
15820            let path = http::uri::PathAndQuery::from_static(
15821                "/pidgr.v1.TokenService/SignDeeplinkToken",
15822            );
15823            let mut req = request.into_request();
15824            req.extensions_mut()
15825                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
15826            self.inner.unary(req, path, codec).await
15827        }
15828        /** Validate a deeplink token. Authorization: unauthenticated (caller
15829 is the native app validating before showing the auth gate). The
15830 token IS the lookup key; valid responses carry the decoded payload.
15831*/
15832        pub async fn validate_deeplink_token(
15833            &mut self,
15834            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
15835        ) -> std::result::Result<
15836            tonic::Response<super::ValidateDeeplinkTokenResponse>,
15837            tonic::Status,
15838        > {
15839            self.inner
15840                .ready()
15841                .await
15842                .map_err(|e| {
15843                    tonic::Status::unknown(
15844                        format!("Service was not ready: {}", e.into()),
15845                    )
15846                })?;
15847            let codec = tonic_prost::ProstCodec::default();
15848            let path = http::uri::PathAndQuery::from_static(
15849                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
15850            );
15851            let mut req = request.into_request();
15852            req.extensions_mut()
15853                .insert(
15854                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
15855                );
15856            self.inner.unary(req, path, codec).await
15857        }
15858    }
15859}
15860/// Generated server implementations.
15861pub mod token_service_server {
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    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
15871    #[async_trait]
15872    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
15873        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
15874 the dispatch layer assembling a deeplink during message
15875 composition).
15876*/
15877        async fn sign_deeplink_token(
15878            &self,
15879            request: tonic::Request<super::SignDeeplinkTokenRequest>,
15880        ) -> std::result::Result<
15881            tonic::Response<super::SignDeeplinkTokenResponse>,
15882            tonic::Status,
15883        >;
15884        /** Validate a deeplink token. Authorization: unauthenticated (caller
15885 is the native app validating before showing the auth gate). The
15886 token IS the lookup key; valid responses carry the decoded payload.
15887*/
15888        async fn validate_deeplink_token(
15889            &self,
15890            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
15891        ) -> std::result::Result<
15892            tonic::Response<super::ValidateDeeplinkTokenResponse>,
15893            tonic::Status,
15894        >;
15895    }
15896    /** HMAC-signed deeplink-token signing and validation.
15897
15898 Deeplink tokens carry the (campaign, recipient, step) tuple that
15899 authorizes a third-party-channel deeplink
15900 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
15901 pidgr-api with a per-org HMAC key managed by the platform's key store;
15902 rotation is automatic with a 7-day overlap window so callers do not
15903 have to coordinate.
15904*/
15905    #[derive(Debug)]
15906    pub struct TokenServiceServer<T> {
15907        inner: Arc<T>,
15908        accept_compression_encodings: EnabledCompressionEncodings,
15909        send_compression_encodings: EnabledCompressionEncodings,
15910        max_decoding_message_size: Option<usize>,
15911        max_encoding_message_size: Option<usize>,
15912    }
15913    impl<T> TokenServiceServer<T> {
15914        pub fn new(inner: T) -> Self {
15915            Self::from_arc(Arc::new(inner))
15916        }
15917        pub fn from_arc(inner: Arc<T>) -> Self {
15918            Self {
15919                inner,
15920                accept_compression_encodings: Default::default(),
15921                send_compression_encodings: Default::default(),
15922                max_decoding_message_size: None,
15923                max_encoding_message_size: None,
15924            }
15925        }
15926        pub fn with_interceptor<F>(
15927            inner: T,
15928            interceptor: F,
15929        ) -> InterceptedService<Self, F>
15930        where
15931            F: tonic::service::Interceptor,
15932        {
15933            InterceptedService::new(Self::new(inner), interceptor)
15934        }
15935        /// Enable decompressing requests with the given encoding.
15936        #[must_use]
15937        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15938            self.accept_compression_encodings.enable(encoding);
15939            self
15940        }
15941        /// Compress responses with the given encoding, if the client supports it.
15942        #[must_use]
15943        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15944            self.send_compression_encodings.enable(encoding);
15945            self
15946        }
15947        /// Limits the maximum size of a decoded message.
15948        ///
15949        /// Default: `4MB`
15950        #[must_use]
15951        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15952            self.max_decoding_message_size = Some(limit);
15953            self
15954        }
15955        /// Limits the maximum size of an encoded message.
15956        ///
15957        /// Default: `usize::MAX`
15958        #[must_use]
15959        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15960            self.max_encoding_message_size = Some(limit);
15961            self
15962        }
15963    }
15964    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
15965    where
15966        T: TokenService,
15967        B: Body + std::marker::Send + 'static,
15968        B::Error: Into<StdError> + std::marker::Send + 'static,
15969    {
15970        type Response = http::Response<tonic::body::Body>;
15971        type Error = std::convert::Infallible;
15972        type Future = BoxFuture<Self::Response, Self::Error>;
15973        fn poll_ready(
15974            &mut self,
15975            _cx: &mut Context<'_>,
15976        ) -> Poll<std::result::Result<(), Self::Error>> {
15977            Poll::Ready(Ok(()))
15978        }
15979        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15980            match req.uri().path() {
15981                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
15982                    #[allow(non_camel_case_types)]
15983                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
15984                    impl<
15985                        T: TokenService,
15986                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
15987                    for SignDeeplinkTokenSvc<T> {
15988                        type Response = super::SignDeeplinkTokenResponse;
15989                        type Future = BoxFuture<
15990                            tonic::Response<Self::Response>,
15991                            tonic::Status,
15992                        >;
15993                        fn call(
15994                            &mut self,
15995                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
15996                        ) -> Self::Future {
15997                            let inner = Arc::clone(&self.0);
15998                            let fut = async move {
15999                                <T as TokenService>::sign_deeplink_token(&inner, request)
16000                                    .await
16001                            };
16002                            Box::pin(fut)
16003                        }
16004                    }
16005                    let accept_compression_encodings = self.accept_compression_encodings;
16006                    let send_compression_encodings = self.send_compression_encodings;
16007                    let max_decoding_message_size = self.max_decoding_message_size;
16008                    let max_encoding_message_size = self.max_encoding_message_size;
16009                    let inner = self.inner.clone();
16010                    let fut = async move {
16011                        let method = SignDeeplinkTokenSvc(inner);
16012                        let codec = tonic_prost::ProstCodec::default();
16013                        let mut grpc = tonic::server::Grpc::new(codec)
16014                            .apply_compression_config(
16015                                accept_compression_encodings,
16016                                send_compression_encodings,
16017                            )
16018                            .apply_max_message_size_config(
16019                                max_decoding_message_size,
16020                                max_encoding_message_size,
16021                            );
16022                        let res = grpc.unary(method, req).await;
16023                        Ok(res)
16024                    };
16025                    Box::pin(fut)
16026                }
16027                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
16028                    #[allow(non_camel_case_types)]
16029                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16030                    impl<
16031                        T: TokenService,
16032                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
16033                    for ValidateDeeplinkTokenSvc<T> {
16034                        type Response = super::ValidateDeeplinkTokenResponse;
16035                        type Future = BoxFuture<
16036                            tonic::Response<Self::Response>,
16037                            tonic::Status,
16038                        >;
16039                        fn call(
16040                            &mut self,
16041                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16042                        ) -> Self::Future {
16043                            let inner = Arc::clone(&self.0);
16044                            let fut = async move {
16045                                <T as TokenService>::validate_deeplink_token(
16046                                        &inner,
16047                                        request,
16048                                    )
16049                                    .await
16050                            };
16051                            Box::pin(fut)
16052                        }
16053                    }
16054                    let accept_compression_encodings = self.accept_compression_encodings;
16055                    let send_compression_encodings = self.send_compression_encodings;
16056                    let max_decoding_message_size = self.max_decoding_message_size;
16057                    let max_encoding_message_size = self.max_encoding_message_size;
16058                    let inner = self.inner.clone();
16059                    let fut = async move {
16060                        let method = ValidateDeeplinkTokenSvc(inner);
16061                        let codec = tonic_prost::ProstCodec::default();
16062                        let mut grpc = tonic::server::Grpc::new(codec)
16063                            .apply_compression_config(
16064                                accept_compression_encodings,
16065                                send_compression_encodings,
16066                            )
16067                            .apply_max_message_size_config(
16068                                max_decoding_message_size,
16069                                max_encoding_message_size,
16070                            );
16071                        let res = grpc.unary(method, req).await;
16072                        Ok(res)
16073                    };
16074                    Box::pin(fut)
16075                }
16076                _ => {
16077                    Box::pin(async move {
16078                        let mut response = http::Response::new(
16079                            tonic::body::Body::default(),
16080                        );
16081                        let headers = response.headers_mut();
16082                        headers
16083                            .insert(
16084                                tonic::Status::GRPC_STATUS,
16085                                (tonic::Code::Unimplemented as i32).into(),
16086                            );
16087                        headers
16088                            .insert(
16089                                http::header::CONTENT_TYPE,
16090                                tonic::metadata::GRPC_CONTENT_TYPE,
16091                            );
16092                        Ok(response)
16093                    })
16094                }
16095            }
16096        }
16097    }
16098    impl<T> Clone for TokenServiceServer<T> {
16099        fn clone(&self) -> Self {
16100            let inner = self.inner.clone();
16101            Self {
16102                inner,
16103                accept_compression_encodings: self.accept_compression_encodings,
16104                send_compression_encodings: self.send_compression_encodings,
16105                max_decoding_message_size: self.max_decoding_message_size,
16106                max_encoding_message_size: self.max_encoding_message_size,
16107            }
16108        }
16109    }
16110    /// Generated gRPC service name
16111    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
16112    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
16113        const NAME: &'static str = SERVICE_NAME;
16114    }
16115}