Skip to main content

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

1// @generated
2/// Generated client implementations.
3pub mod action_service_client {
4    #![allow(
5        unused_variables,
6        dead_code,
7        missing_docs,
8        clippy::wildcard_imports,
9        clippy::let_unit_value,
10    )]
11    use tonic::codegen::*;
12    use tonic::codegen::http::Uri;
13    /** Handles user actions on delivered messages.
14 Actions drive workflow progression (e.g. ACK completes a wait step).
15*/
16    #[derive(Debug, Clone)]
17    pub struct ActionServiceClient<T> {
18        inner: tonic::client::Grpc<T>,
19    }
20    impl ActionServiceClient<tonic::transport::Channel> {
21        /// Attempt to create a new client by connecting to a given endpoint.
22        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
23        where
24            D: TryInto<tonic::transport::Endpoint>,
25            D::Error: Into<StdError>,
26        {
27            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
28            Ok(Self::new(conn))
29        }
30    }
31    impl<T> ActionServiceClient<T>
32    where
33        T: tonic::client::GrpcService<tonic::body::Body>,
34        T::Error: Into<StdError>,
35        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
36        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
37    {
38        pub fn new(inner: T) -> Self {
39            let inner = tonic::client::Grpc::new(inner);
40            Self { inner }
41        }
42        pub fn with_origin(inner: T, origin: Uri) -> Self {
43            let inner = tonic::client::Grpc::with_origin(inner, origin);
44            Self { inner }
45        }
46        pub fn with_interceptor<F>(
47            inner: T,
48            interceptor: F,
49        ) -> ActionServiceClient<InterceptedService<T, F>>
50        where
51            F: tonic::service::Interceptor,
52            T::ResponseBody: Default,
53            T: tonic::codegen::Service<
54                http::Request<tonic::body::Body>,
55                Response = http::Response<
56                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
57                >,
58            >,
59            <T as tonic::codegen::Service<
60                http::Request<tonic::body::Body>,
61            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
62        {
63            ActionServiceClient::new(InterceptedService::new(inner, interceptor))
64        }
65        /// Compress requests with the given encoding.
66        ///
67        /// This requires the server to support it otherwise it might respond with an
68        /// error.
69        #[must_use]
70        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
71            self.inner = self.inner.send_compressed(encoding);
72            self
73        }
74        /// Enable decompressing responses.
75        #[must_use]
76        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
77            self.inner = self.inner.accept_compressed(encoding);
78            self
79        }
80        /// Limits the maximum size of a decoded message.
81        ///
82        /// Default: `4MB`
83        #[must_use]
84        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
85            self.inner = self.inner.max_decoding_message_size(limit);
86            self
87        }
88        /// Limits the maximum size of an encoded message.
89        ///
90        /// Default: `usize::MAX`
91        #[must_use]
92        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
93            self.inner = self.inner.max_encoding_message_size(limit);
94            self
95        }
96        /** Submit an action for a specific delivery, advancing the campaign workflow.
97 Backend MUST verify the authenticated user is the delivery recipient.
98*/
99        pub async fn submit_action(
100            &mut self,
101            request: impl tonic::IntoRequest<super::SubmitActionRequest>,
102        ) -> std::result::Result<
103            tonic::Response<super::SubmitActionResponse>,
104            tonic::Status,
105        > {
106            self.inner
107                .ready()
108                .await
109                .map_err(|e| {
110                    tonic::Status::unknown(
111                        format!("Service was not ready: {}", e.into()),
112                    )
113                })?;
114            let codec = tonic_prost::ProstCodec::default();
115            let path = http::uri::PathAndQuery::from_static(
116                "/pidgr.v1.ActionService/SubmitAction",
117            );
118            let mut req = request.into_request();
119            req.extensions_mut()
120                .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
121            self.inner.unary(req, path, codec).await
122        }
123    }
124}
125/// Generated server implementations.
126pub mod action_service_server {
127    #![allow(
128        unused_variables,
129        dead_code,
130        missing_docs,
131        clippy::wildcard_imports,
132        clippy::let_unit_value,
133    )]
134    use tonic::codegen::*;
135    /// Generated trait containing gRPC methods that should be implemented for use with ActionServiceServer.
136    #[async_trait]
137    pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
138        /** Submit an action for a specific delivery, advancing the campaign workflow.
139 Backend MUST verify the authenticated user is the delivery recipient.
140*/
141        async fn submit_action(
142            &self,
143            request: tonic::Request<super::SubmitActionRequest>,
144        ) -> std::result::Result<
145            tonic::Response<super::SubmitActionResponse>,
146            tonic::Status,
147        >;
148    }
149    /** Handles user actions on delivered messages.
150 Actions drive workflow progression (e.g. ACK completes a wait step).
151*/
152    #[derive(Debug)]
153    pub struct ActionServiceServer<T> {
154        inner: Arc<T>,
155        accept_compression_encodings: EnabledCompressionEncodings,
156        send_compression_encodings: EnabledCompressionEncodings,
157        max_decoding_message_size: Option<usize>,
158        max_encoding_message_size: Option<usize>,
159    }
160    impl<T> ActionServiceServer<T> {
161        pub fn new(inner: T) -> Self {
162            Self::from_arc(Arc::new(inner))
163        }
164        pub fn from_arc(inner: Arc<T>) -> Self {
165            Self {
166                inner,
167                accept_compression_encodings: Default::default(),
168                send_compression_encodings: Default::default(),
169                max_decoding_message_size: None,
170                max_encoding_message_size: None,
171            }
172        }
173        pub fn with_interceptor<F>(
174            inner: T,
175            interceptor: F,
176        ) -> InterceptedService<Self, F>
177        where
178            F: tonic::service::Interceptor,
179        {
180            InterceptedService::new(Self::new(inner), interceptor)
181        }
182        /// Enable decompressing requests with the given encoding.
183        #[must_use]
184        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
185            self.accept_compression_encodings.enable(encoding);
186            self
187        }
188        /// Compress responses with the given encoding, if the client supports it.
189        #[must_use]
190        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
191            self.send_compression_encodings.enable(encoding);
192            self
193        }
194        /// Limits the maximum size of a decoded message.
195        ///
196        /// Default: `4MB`
197        #[must_use]
198        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
199            self.max_decoding_message_size = Some(limit);
200            self
201        }
202        /// Limits the maximum size of an encoded message.
203        ///
204        /// Default: `usize::MAX`
205        #[must_use]
206        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
207            self.max_encoding_message_size = Some(limit);
208            self
209        }
210    }
211    impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
212    where
213        T: ActionService,
214        B: Body + std::marker::Send + 'static,
215        B::Error: Into<StdError> + std::marker::Send + 'static,
216    {
217        type Response = http::Response<tonic::body::Body>;
218        type Error = std::convert::Infallible;
219        type Future = BoxFuture<Self::Response, Self::Error>;
220        fn poll_ready(
221            &mut self,
222            _cx: &mut Context<'_>,
223        ) -> Poll<std::result::Result<(), Self::Error>> {
224            Poll::Ready(Ok(()))
225        }
226        fn call(&mut self, req: http::Request<B>) -> Self::Future {
227            match req.uri().path() {
228                "/pidgr.v1.ActionService/SubmitAction" => {
229                    #[allow(non_camel_case_types)]
230                    struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
231                    impl<
232                        T: ActionService,
233                    > tonic::server::UnaryService<super::SubmitActionRequest>
234                    for SubmitActionSvc<T> {
235                        type Response = super::SubmitActionResponse;
236                        type Future = BoxFuture<
237                            tonic::Response<Self::Response>,
238                            tonic::Status,
239                        >;
240                        fn call(
241                            &mut self,
242                            request: tonic::Request<super::SubmitActionRequest>,
243                        ) -> Self::Future {
244                            let inner = Arc::clone(&self.0);
245                            let fut = async move {
246                                <T as ActionService>::submit_action(&inner, request).await
247                            };
248                            Box::pin(fut)
249                        }
250                    }
251                    let accept_compression_encodings = self.accept_compression_encodings;
252                    let send_compression_encodings = self.send_compression_encodings;
253                    let max_decoding_message_size = self.max_decoding_message_size;
254                    let max_encoding_message_size = self.max_encoding_message_size;
255                    let inner = self.inner.clone();
256                    let fut = async move {
257                        let method = SubmitActionSvc(inner);
258                        let codec = tonic_prost::ProstCodec::default();
259                        let mut grpc = tonic::server::Grpc::new(codec)
260                            .apply_compression_config(
261                                accept_compression_encodings,
262                                send_compression_encodings,
263                            )
264                            .apply_max_message_size_config(
265                                max_decoding_message_size,
266                                max_encoding_message_size,
267                            );
268                        let res = grpc.unary(method, req).await;
269                        Ok(res)
270                    };
271                    Box::pin(fut)
272                }
273                _ => {
274                    Box::pin(async move {
275                        let mut response = http::Response::new(
276                            tonic::body::Body::default(),
277                        );
278                        let headers = response.headers_mut();
279                        headers
280                            .insert(
281                                tonic::Status::GRPC_STATUS,
282                                (tonic::Code::Unimplemented as i32).into(),
283                            );
284                        headers
285                            .insert(
286                                http::header::CONTENT_TYPE,
287                                tonic::metadata::GRPC_CONTENT_TYPE,
288                            );
289                        Ok(response)
290                    })
291                }
292            }
293        }
294    }
295    impl<T> Clone for ActionServiceServer<T> {
296        fn clone(&self) -> Self {
297            let inner = self.inner.clone();
298            Self {
299                inner,
300                accept_compression_encodings: self.accept_compression_encodings,
301                send_compression_encodings: self.send_compression_encodings,
302                max_decoding_message_size: self.max_decoding_message_size,
303                max_encoding_message_size: self.max_encoding_message_size,
304            }
305        }
306    }
307    /// Generated gRPC service name
308    pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
309    impl<T> tonic::server::NamedService for ActionServiceServer<T> {
310        const NAME: &'static str = SERVICE_NAME;
311    }
312}
313/// Generated client implementations.
314pub mod channel_events_service_client {
315    #![allow(
316        unused_variables,
317        dead_code,
318        missing_docs,
319        clippy::wildcard_imports,
320        clippy::let_unit_value,
321    )]
322    use tonic::codegen::*;
323    use tonic::codegen::http::Uri;
324    /** ChannelEventsService records third-party channel dispatch events into the
325 platform's append-only audit table. Intended for internal-service callers
326 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
327*/
328    #[derive(Debug, Clone)]
329    pub struct ChannelEventsServiceClient<T> {
330        inner: tonic::client::Grpc<T>,
331    }
332    impl ChannelEventsServiceClient<tonic::transport::Channel> {
333        /// Attempt to create a new client by connecting to a given endpoint.
334        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
335        where
336            D: TryInto<tonic::transport::Endpoint>,
337            D::Error: Into<StdError>,
338        {
339            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
340            Ok(Self::new(conn))
341        }
342    }
343    impl<T> ChannelEventsServiceClient<T>
344    where
345        T: tonic::client::GrpcService<tonic::body::Body>,
346        T::Error: Into<StdError>,
347        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
348        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
349    {
350        pub fn new(inner: T) -> Self {
351            let inner = tonic::client::Grpc::new(inner);
352            Self { inner }
353        }
354        pub fn with_origin(inner: T, origin: Uri) -> Self {
355            let inner = tonic::client::Grpc::with_origin(inner, origin);
356            Self { inner }
357        }
358        pub fn with_interceptor<F>(
359            inner: T,
360            interceptor: F,
361        ) -> ChannelEventsServiceClient<InterceptedService<T, F>>
362        where
363            F: tonic::service::Interceptor,
364            T::ResponseBody: Default,
365            T: tonic::codegen::Service<
366                http::Request<tonic::body::Body>,
367                Response = http::Response<
368                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
369                >,
370            >,
371            <T as tonic::codegen::Service<
372                http::Request<tonic::body::Body>,
373            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
374        {
375            ChannelEventsServiceClient::new(InterceptedService::new(inner, interceptor))
376        }
377        /// Compress requests with the given encoding.
378        ///
379        /// This requires the server to support it otherwise it might respond with an
380        /// error.
381        #[must_use]
382        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
383            self.inner = self.inner.send_compressed(encoding);
384            self
385        }
386        /// Enable decompressing responses.
387        #[must_use]
388        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
389            self.inner = self.inner.accept_compressed(encoding);
390            self
391        }
392        /// Limits the maximum size of a decoded message.
393        ///
394        /// Default: `4MB`
395        #[must_use]
396        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
397            self.inner = self.inner.max_decoding_message_size(limit);
398            self
399        }
400        /// Limits the maximum size of an encoded message.
401        ///
402        /// Default: `usize::MAX`
403        #[must_use]
404        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
405            self.inner = self.inner.max_encoding_message_size(limit);
406            self
407        }
408        /** Record a single channel event. Returns accepted=false reason="duplicate"
409 when the partial unique index rejects (caller treats as already-recorded,
410 not as an error).
411*/
412        pub async fn record_channel_event(
413            &mut self,
414            request: impl tonic::IntoRequest<super::RecordChannelEventRequest>,
415        ) -> std::result::Result<
416            tonic::Response<super::RecordChannelEventResponse>,
417            tonic::Status,
418        > {
419            self.inner
420                .ready()
421                .await
422                .map_err(|e| {
423                    tonic::Status::unknown(
424                        format!("Service was not ready: {}", e.into()),
425                    )
426                })?;
427            let codec = tonic_prost::ProstCodec::default();
428            let path = http::uri::PathAndQuery::from_static(
429                "/pidgr.v1.ChannelEventsService/RecordChannelEvent",
430            );
431            let mut req = request.into_request();
432            req.extensions_mut()
433                .insert(
434                    GrpcMethod::new(
435                        "pidgr.v1.ChannelEventsService",
436                        "RecordChannelEvent",
437                    ),
438                );
439            self.inner.unary(req, path, codec).await
440        }
441        /** Record N events in one round-trip. Used by webhook ingress when a
442 provider delivers multiple state transitions in one payload (e.g. a
443 batched delivery report). Best-effort per-row.
444*/
445        pub async fn record_channel_event_batch(
446            &mut self,
447            request: impl tonic::IntoRequest<super::RecordChannelEventBatchRequest>,
448        ) -> std::result::Result<
449            tonic::Response<super::RecordChannelEventBatchResponse>,
450            tonic::Status,
451        > {
452            self.inner
453                .ready()
454                .await
455                .map_err(|e| {
456                    tonic::Status::unknown(
457                        format!("Service was not ready: {}", e.into()),
458                    )
459                })?;
460            let codec = tonic_prost::ProstCodec::default();
461            let path = http::uri::PathAndQuery::from_static(
462                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch",
463            );
464            let mut req = request.into_request();
465            req.extensions_mut()
466                .insert(
467                    GrpcMethod::new(
468                        "pidgr.v1.ChannelEventsService",
469                        "RecordChannelEventBatch",
470                    ),
471                );
472            self.inner.unary(req, path, codec).await
473        }
474    }
475}
476/// Generated server implementations.
477pub mod channel_events_service_server {
478    #![allow(
479        unused_variables,
480        dead_code,
481        missing_docs,
482        clippy::wildcard_imports,
483        clippy::let_unit_value,
484    )]
485    use tonic::codegen::*;
486    /// Generated trait containing gRPC methods that should be implemented for use with ChannelEventsServiceServer.
487    #[async_trait]
488    pub trait ChannelEventsService: std::marker::Send + std::marker::Sync + 'static {
489        /** Record a single channel event. Returns accepted=false reason="duplicate"
490 when the partial unique index rejects (caller treats as already-recorded,
491 not as an error).
492*/
493        async fn record_channel_event(
494            &self,
495            request: tonic::Request<super::RecordChannelEventRequest>,
496        ) -> std::result::Result<
497            tonic::Response<super::RecordChannelEventResponse>,
498            tonic::Status,
499        >;
500        /** Record N events in one round-trip. Used by webhook ingress when a
501 provider delivers multiple state transitions in one payload (e.g. a
502 batched delivery report). Best-effort per-row.
503*/
504        async fn record_channel_event_batch(
505            &self,
506            request: tonic::Request<super::RecordChannelEventBatchRequest>,
507        ) -> std::result::Result<
508            tonic::Response<super::RecordChannelEventBatchResponse>,
509            tonic::Status,
510        >;
511    }
512    /** ChannelEventsService records third-party channel dispatch events into the
513 platform's append-only audit table. Intended for internal-service callers
514 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
515*/
516    #[derive(Debug)]
517    pub struct ChannelEventsServiceServer<T> {
518        inner: Arc<T>,
519        accept_compression_encodings: EnabledCompressionEncodings,
520        send_compression_encodings: EnabledCompressionEncodings,
521        max_decoding_message_size: Option<usize>,
522        max_encoding_message_size: Option<usize>,
523    }
524    impl<T> ChannelEventsServiceServer<T> {
525        pub fn new(inner: T) -> Self {
526            Self::from_arc(Arc::new(inner))
527        }
528        pub fn from_arc(inner: Arc<T>) -> Self {
529            Self {
530                inner,
531                accept_compression_encodings: Default::default(),
532                send_compression_encodings: Default::default(),
533                max_decoding_message_size: None,
534                max_encoding_message_size: None,
535            }
536        }
537        pub fn with_interceptor<F>(
538            inner: T,
539            interceptor: F,
540        ) -> InterceptedService<Self, F>
541        where
542            F: tonic::service::Interceptor,
543        {
544            InterceptedService::new(Self::new(inner), interceptor)
545        }
546        /// Enable decompressing requests with the given encoding.
547        #[must_use]
548        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
549            self.accept_compression_encodings.enable(encoding);
550            self
551        }
552        /// Compress responses with the given encoding, if the client supports it.
553        #[must_use]
554        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
555            self.send_compression_encodings.enable(encoding);
556            self
557        }
558        /// Limits the maximum size of a decoded message.
559        ///
560        /// Default: `4MB`
561        #[must_use]
562        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
563            self.max_decoding_message_size = Some(limit);
564            self
565        }
566        /// Limits the maximum size of an encoded message.
567        ///
568        /// Default: `usize::MAX`
569        #[must_use]
570        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
571            self.max_encoding_message_size = Some(limit);
572            self
573        }
574    }
575    impl<T, B> tonic::codegen::Service<http::Request<B>>
576    for ChannelEventsServiceServer<T>
577    where
578        T: ChannelEventsService,
579        B: Body + std::marker::Send + 'static,
580        B::Error: Into<StdError> + std::marker::Send + 'static,
581    {
582        type Response = http::Response<tonic::body::Body>;
583        type Error = std::convert::Infallible;
584        type Future = BoxFuture<Self::Response, Self::Error>;
585        fn poll_ready(
586            &mut self,
587            _cx: &mut Context<'_>,
588        ) -> Poll<std::result::Result<(), Self::Error>> {
589            Poll::Ready(Ok(()))
590        }
591        fn call(&mut self, req: http::Request<B>) -> Self::Future {
592            match req.uri().path() {
593                "/pidgr.v1.ChannelEventsService/RecordChannelEvent" => {
594                    #[allow(non_camel_case_types)]
595                    struct RecordChannelEventSvc<T: ChannelEventsService>(pub Arc<T>);
596                    impl<
597                        T: ChannelEventsService,
598                    > tonic::server::UnaryService<super::RecordChannelEventRequest>
599                    for RecordChannelEventSvc<T> {
600                        type Response = super::RecordChannelEventResponse;
601                        type Future = BoxFuture<
602                            tonic::Response<Self::Response>,
603                            tonic::Status,
604                        >;
605                        fn call(
606                            &mut self,
607                            request: tonic::Request<super::RecordChannelEventRequest>,
608                        ) -> Self::Future {
609                            let inner = Arc::clone(&self.0);
610                            let fut = async move {
611                                <T as ChannelEventsService>::record_channel_event(
612                                        &inner,
613                                        request,
614                                    )
615                                    .await
616                            };
617                            Box::pin(fut)
618                        }
619                    }
620                    let accept_compression_encodings = self.accept_compression_encodings;
621                    let send_compression_encodings = self.send_compression_encodings;
622                    let max_decoding_message_size = self.max_decoding_message_size;
623                    let max_encoding_message_size = self.max_encoding_message_size;
624                    let inner = self.inner.clone();
625                    let fut = async move {
626                        let method = RecordChannelEventSvc(inner);
627                        let codec = tonic_prost::ProstCodec::default();
628                        let mut grpc = tonic::server::Grpc::new(codec)
629                            .apply_compression_config(
630                                accept_compression_encodings,
631                                send_compression_encodings,
632                            )
633                            .apply_max_message_size_config(
634                                max_decoding_message_size,
635                                max_encoding_message_size,
636                            );
637                        let res = grpc.unary(method, req).await;
638                        Ok(res)
639                    };
640                    Box::pin(fut)
641                }
642                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch" => {
643                    #[allow(non_camel_case_types)]
644                    struct RecordChannelEventBatchSvc<T: ChannelEventsService>(
645                        pub Arc<T>,
646                    );
647                    impl<
648                        T: ChannelEventsService,
649                    > tonic::server::UnaryService<super::RecordChannelEventBatchRequest>
650                    for RecordChannelEventBatchSvc<T> {
651                        type Response = super::RecordChannelEventBatchResponse;
652                        type Future = BoxFuture<
653                            tonic::Response<Self::Response>,
654                            tonic::Status,
655                        >;
656                        fn call(
657                            &mut self,
658                            request: tonic::Request<
659                                super::RecordChannelEventBatchRequest,
660                            >,
661                        ) -> Self::Future {
662                            let inner = Arc::clone(&self.0);
663                            let fut = async move {
664                                <T as ChannelEventsService>::record_channel_event_batch(
665                                        &inner,
666                                        request,
667                                    )
668                                    .await
669                            };
670                            Box::pin(fut)
671                        }
672                    }
673                    let accept_compression_encodings = self.accept_compression_encodings;
674                    let send_compression_encodings = self.send_compression_encodings;
675                    let max_decoding_message_size = self.max_decoding_message_size;
676                    let max_encoding_message_size = self.max_encoding_message_size;
677                    let inner = self.inner.clone();
678                    let fut = async move {
679                        let method = RecordChannelEventBatchSvc(inner);
680                        let codec = tonic_prost::ProstCodec::default();
681                        let mut grpc = tonic::server::Grpc::new(codec)
682                            .apply_compression_config(
683                                accept_compression_encodings,
684                                send_compression_encodings,
685                            )
686                            .apply_max_message_size_config(
687                                max_decoding_message_size,
688                                max_encoding_message_size,
689                            );
690                        let res = grpc.unary(method, req).await;
691                        Ok(res)
692                    };
693                    Box::pin(fut)
694                }
695                _ => {
696                    Box::pin(async move {
697                        let mut response = http::Response::new(
698                            tonic::body::Body::default(),
699                        );
700                        let headers = response.headers_mut();
701                        headers
702                            .insert(
703                                tonic::Status::GRPC_STATUS,
704                                (tonic::Code::Unimplemented as i32).into(),
705                            );
706                        headers
707                            .insert(
708                                http::header::CONTENT_TYPE,
709                                tonic::metadata::GRPC_CONTENT_TYPE,
710                            );
711                        Ok(response)
712                    })
713                }
714            }
715        }
716    }
717    impl<T> Clone for ChannelEventsServiceServer<T> {
718        fn clone(&self) -> Self {
719            let inner = self.inner.clone();
720            Self {
721                inner,
722                accept_compression_encodings: self.accept_compression_encodings,
723                send_compression_encodings: self.send_compression_encodings,
724                max_decoding_message_size: self.max_decoding_message_size,
725                max_encoding_message_size: self.max_encoding_message_size,
726            }
727        }
728    }
729    /// Generated gRPC service name
730    pub const SERVICE_NAME: &str = "pidgr.v1.ChannelEventsService";
731    impl<T> tonic::server::NamedService for ChannelEventsServiceServer<T> {
732        const NAME: &'static str = SERVICE_NAME;
733    }
734}
735/// Generated client implementations.
736pub mod api_key_service_client {
737    #![allow(
738        unused_variables,
739        dead_code,
740        missing_docs,
741        clippy::wildcard_imports,
742        clippy::let_unit_value,
743    )]
744    use tonic::codegen::*;
745    use tonic::codegen::http::Uri;
746    /** Manages scoped API keys for programmatic access.
747 All RPCs operate within the caller's org (extracted from JWT).
748*/
749    #[derive(Debug, Clone)]
750    pub struct ApiKeyServiceClient<T> {
751        inner: tonic::client::Grpc<T>,
752    }
753    impl ApiKeyServiceClient<tonic::transport::Channel> {
754        /// Attempt to create a new client by connecting to a given endpoint.
755        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
756        where
757            D: TryInto<tonic::transport::Endpoint>,
758            D::Error: Into<StdError>,
759        {
760            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
761            Ok(Self::new(conn))
762        }
763    }
764    impl<T> ApiKeyServiceClient<T>
765    where
766        T: tonic::client::GrpcService<tonic::body::Body>,
767        T::Error: Into<StdError>,
768        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
769        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
770    {
771        pub fn new(inner: T) -> Self {
772            let inner = tonic::client::Grpc::new(inner);
773            Self { inner }
774        }
775        pub fn with_origin(inner: T, origin: Uri) -> Self {
776            let inner = tonic::client::Grpc::with_origin(inner, origin);
777            Self { inner }
778        }
779        pub fn with_interceptor<F>(
780            inner: T,
781            interceptor: F,
782        ) -> ApiKeyServiceClient<InterceptedService<T, F>>
783        where
784            F: tonic::service::Interceptor,
785            T::ResponseBody: Default,
786            T: tonic::codegen::Service<
787                http::Request<tonic::body::Body>,
788                Response = http::Response<
789                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
790                >,
791            >,
792            <T as tonic::codegen::Service<
793                http::Request<tonic::body::Body>,
794            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
795        {
796            ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
797        }
798        /// Compress requests with the given encoding.
799        ///
800        /// This requires the server to support it otherwise it might respond with an
801        /// error.
802        #[must_use]
803        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
804            self.inner = self.inner.send_compressed(encoding);
805            self
806        }
807        /// Enable decompressing responses.
808        #[must_use]
809        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
810            self.inner = self.inner.accept_compressed(encoding);
811            self
812        }
813        /// Limits the maximum size of a decoded message.
814        ///
815        /// Default: `4MB`
816        #[must_use]
817        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
818            self.inner = self.inner.max_decoding_message_size(limit);
819            self
820        }
821        /// Limits the maximum size of an encoded message.
822        ///
823        /// Default: `usize::MAX`
824        #[must_use]
825        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
826            self.inner = self.inner.max_encoding_message_size(limit);
827            self
828        }
829        /** Create a new scoped API key with specific permissions.
830 The full secret key is only returned in the response — store it securely.
831 Authorization: Requires PERMISSION_ORG_WRITE.
832*/
833        pub async fn create_api_key(
834            &mut self,
835            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
836        ) -> std::result::Result<
837            tonic::Response<super::CreateApiKeyResponse>,
838            tonic::Status,
839        > {
840            self.inner
841                .ready()
842                .await
843                .map_err(|e| {
844                    tonic::Status::unknown(
845                        format!("Service was not ready: {}", e.into()),
846                    )
847                })?;
848            let codec = tonic_prost::ProstCodec::default();
849            let path = http::uri::PathAndQuery::from_static(
850                "/pidgr.v1.ApiKeyService/CreateApiKey",
851            );
852            let mut req = request.into_request();
853            req.extensions_mut()
854                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
855            self.inner.unary(req, path, codec).await
856        }
857        /** List all active API keys in the organization (metadata only, no secrets).
858 Authorization: Requires PERMISSION_ORG_READ.
859*/
860        pub async fn list_api_keys(
861            &mut self,
862            request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
863        ) -> std::result::Result<
864            tonic::Response<super::ListApiKeysResponse>,
865            tonic::Status,
866        > {
867            self.inner
868                .ready()
869                .await
870                .map_err(|e| {
871                    tonic::Status::unknown(
872                        format!("Service was not ready: {}", e.into()),
873                    )
874                })?;
875            let codec = tonic_prost::ProstCodec::default();
876            let path = http::uri::PathAndQuery::from_static(
877                "/pidgr.v1.ApiKeyService/ListApiKeys",
878            );
879            let mut req = request.into_request();
880            req.extensions_mut()
881                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
882            self.inner.unary(req, path, codec).await
883        }
884        /** Revoke an API key. The key becomes immediately unusable.
885 Authorization: Requires PERMISSION_ORG_WRITE.
886*/
887        pub async fn revoke_api_key(
888            &mut self,
889            request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
890        ) -> std::result::Result<
891            tonic::Response<super::RevokeApiKeyResponse>,
892            tonic::Status,
893        > {
894            self.inner
895                .ready()
896                .await
897                .map_err(|e| {
898                    tonic::Status::unknown(
899                        format!("Service was not ready: {}", e.into()),
900                    )
901                })?;
902            let codec = tonic_prost::ProstCodec::default();
903            let path = http::uri::PathAndQuery::from_static(
904                "/pidgr.v1.ApiKeyService/RevokeApiKey",
905            );
906            let mut req = request.into_request();
907            req.extensions_mut()
908                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
909            self.inner.unary(req, path, codec).await
910        }
911    }
912}
913/// Generated server implementations.
914pub mod api_key_service_server {
915    #![allow(
916        unused_variables,
917        dead_code,
918        missing_docs,
919        clippy::wildcard_imports,
920        clippy::let_unit_value,
921    )]
922    use tonic::codegen::*;
923    /// Generated trait containing gRPC methods that should be implemented for use with ApiKeyServiceServer.
924    #[async_trait]
925    pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
926        /** Create a new scoped API key with specific permissions.
927 The full secret key is only returned in the response — store it securely.
928 Authorization: Requires PERMISSION_ORG_WRITE.
929*/
930        async fn create_api_key(
931            &self,
932            request: tonic::Request<super::CreateApiKeyRequest>,
933        ) -> std::result::Result<
934            tonic::Response<super::CreateApiKeyResponse>,
935            tonic::Status,
936        >;
937        /** List all active API keys in the organization (metadata only, no secrets).
938 Authorization: Requires PERMISSION_ORG_READ.
939*/
940        async fn list_api_keys(
941            &self,
942            request: tonic::Request<super::ListApiKeysRequest>,
943        ) -> std::result::Result<
944            tonic::Response<super::ListApiKeysResponse>,
945            tonic::Status,
946        >;
947        /** Revoke an API key. The key becomes immediately unusable.
948 Authorization: Requires PERMISSION_ORG_WRITE.
949*/
950        async fn revoke_api_key(
951            &self,
952            request: tonic::Request<super::RevokeApiKeyRequest>,
953        ) -> std::result::Result<
954            tonic::Response<super::RevokeApiKeyResponse>,
955            tonic::Status,
956        >;
957    }
958    /** Manages scoped API keys for programmatic access.
959 All RPCs operate within the caller's org (extracted from JWT).
960*/
961    #[derive(Debug)]
962    pub struct ApiKeyServiceServer<T> {
963        inner: Arc<T>,
964        accept_compression_encodings: EnabledCompressionEncodings,
965        send_compression_encodings: EnabledCompressionEncodings,
966        max_decoding_message_size: Option<usize>,
967        max_encoding_message_size: Option<usize>,
968    }
969    impl<T> ApiKeyServiceServer<T> {
970        pub fn new(inner: T) -> Self {
971            Self::from_arc(Arc::new(inner))
972        }
973        pub fn from_arc(inner: Arc<T>) -> Self {
974            Self {
975                inner,
976                accept_compression_encodings: Default::default(),
977                send_compression_encodings: Default::default(),
978                max_decoding_message_size: None,
979                max_encoding_message_size: None,
980            }
981        }
982        pub fn with_interceptor<F>(
983            inner: T,
984            interceptor: F,
985        ) -> InterceptedService<Self, F>
986        where
987            F: tonic::service::Interceptor,
988        {
989            InterceptedService::new(Self::new(inner), interceptor)
990        }
991        /// Enable decompressing requests with the given encoding.
992        #[must_use]
993        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
994            self.accept_compression_encodings.enable(encoding);
995            self
996        }
997        /// Compress responses with the given encoding, if the client supports it.
998        #[must_use]
999        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1000            self.send_compression_encodings.enable(encoding);
1001            self
1002        }
1003        /// Limits the maximum size of a decoded message.
1004        ///
1005        /// Default: `4MB`
1006        #[must_use]
1007        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1008            self.max_decoding_message_size = Some(limit);
1009            self
1010        }
1011        /// Limits the maximum size of an encoded message.
1012        ///
1013        /// Default: `usize::MAX`
1014        #[must_use]
1015        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1016            self.max_encoding_message_size = Some(limit);
1017            self
1018        }
1019    }
1020    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1021    where
1022        T: ApiKeyService,
1023        B: Body + std::marker::Send + 'static,
1024        B::Error: Into<StdError> + std::marker::Send + 'static,
1025    {
1026        type Response = http::Response<tonic::body::Body>;
1027        type Error = std::convert::Infallible;
1028        type Future = BoxFuture<Self::Response, Self::Error>;
1029        fn poll_ready(
1030            &mut self,
1031            _cx: &mut Context<'_>,
1032        ) -> Poll<std::result::Result<(), Self::Error>> {
1033            Poll::Ready(Ok(()))
1034        }
1035        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1036            match req.uri().path() {
1037                "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1038                    #[allow(non_camel_case_types)]
1039                    struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1040                    impl<
1041                        T: ApiKeyService,
1042                    > tonic::server::UnaryService<super::CreateApiKeyRequest>
1043                    for CreateApiKeySvc<T> {
1044                        type Response = super::CreateApiKeyResponse;
1045                        type Future = BoxFuture<
1046                            tonic::Response<Self::Response>,
1047                            tonic::Status,
1048                        >;
1049                        fn call(
1050                            &mut self,
1051                            request: tonic::Request<super::CreateApiKeyRequest>,
1052                        ) -> Self::Future {
1053                            let inner = Arc::clone(&self.0);
1054                            let fut = async move {
1055                                <T as ApiKeyService>::create_api_key(&inner, request).await
1056                            };
1057                            Box::pin(fut)
1058                        }
1059                    }
1060                    let accept_compression_encodings = self.accept_compression_encodings;
1061                    let send_compression_encodings = self.send_compression_encodings;
1062                    let max_decoding_message_size = self.max_decoding_message_size;
1063                    let max_encoding_message_size = self.max_encoding_message_size;
1064                    let inner = self.inner.clone();
1065                    let fut = async move {
1066                        let method = CreateApiKeySvc(inner);
1067                        let codec = tonic_prost::ProstCodec::default();
1068                        let mut grpc = tonic::server::Grpc::new(codec)
1069                            .apply_compression_config(
1070                                accept_compression_encodings,
1071                                send_compression_encodings,
1072                            )
1073                            .apply_max_message_size_config(
1074                                max_decoding_message_size,
1075                                max_encoding_message_size,
1076                            );
1077                        let res = grpc.unary(method, req).await;
1078                        Ok(res)
1079                    };
1080                    Box::pin(fut)
1081                }
1082                "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1083                    #[allow(non_camel_case_types)]
1084                    struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1085                    impl<
1086                        T: ApiKeyService,
1087                    > tonic::server::UnaryService<super::ListApiKeysRequest>
1088                    for ListApiKeysSvc<T> {
1089                        type Response = super::ListApiKeysResponse;
1090                        type Future = BoxFuture<
1091                            tonic::Response<Self::Response>,
1092                            tonic::Status,
1093                        >;
1094                        fn call(
1095                            &mut self,
1096                            request: tonic::Request<super::ListApiKeysRequest>,
1097                        ) -> Self::Future {
1098                            let inner = Arc::clone(&self.0);
1099                            let fut = async move {
1100                                <T as ApiKeyService>::list_api_keys(&inner, request).await
1101                            };
1102                            Box::pin(fut)
1103                        }
1104                    }
1105                    let accept_compression_encodings = self.accept_compression_encodings;
1106                    let send_compression_encodings = self.send_compression_encodings;
1107                    let max_decoding_message_size = self.max_decoding_message_size;
1108                    let max_encoding_message_size = self.max_encoding_message_size;
1109                    let inner = self.inner.clone();
1110                    let fut = async move {
1111                        let method = ListApiKeysSvc(inner);
1112                        let codec = tonic_prost::ProstCodec::default();
1113                        let mut grpc = tonic::server::Grpc::new(codec)
1114                            .apply_compression_config(
1115                                accept_compression_encodings,
1116                                send_compression_encodings,
1117                            )
1118                            .apply_max_message_size_config(
1119                                max_decoding_message_size,
1120                                max_encoding_message_size,
1121                            );
1122                        let res = grpc.unary(method, req).await;
1123                        Ok(res)
1124                    };
1125                    Box::pin(fut)
1126                }
1127                "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1128                    #[allow(non_camel_case_types)]
1129                    struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1130                    impl<
1131                        T: ApiKeyService,
1132                    > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1133                    for RevokeApiKeySvc<T> {
1134                        type Response = super::RevokeApiKeyResponse;
1135                        type Future = BoxFuture<
1136                            tonic::Response<Self::Response>,
1137                            tonic::Status,
1138                        >;
1139                        fn call(
1140                            &mut self,
1141                            request: tonic::Request<super::RevokeApiKeyRequest>,
1142                        ) -> Self::Future {
1143                            let inner = Arc::clone(&self.0);
1144                            let fut = async move {
1145                                <T as ApiKeyService>::revoke_api_key(&inner, request).await
1146                            };
1147                            Box::pin(fut)
1148                        }
1149                    }
1150                    let accept_compression_encodings = self.accept_compression_encodings;
1151                    let send_compression_encodings = self.send_compression_encodings;
1152                    let max_decoding_message_size = self.max_decoding_message_size;
1153                    let max_encoding_message_size = self.max_encoding_message_size;
1154                    let inner = self.inner.clone();
1155                    let fut = async move {
1156                        let method = RevokeApiKeySvc(inner);
1157                        let codec = tonic_prost::ProstCodec::default();
1158                        let mut grpc = tonic::server::Grpc::new(codec)
1159                            .apply_compression_config(
1160                                accept_compression_encodings,
1161                                send_compression_encodings,
1162                            )
1163                            .apply_max_message_size_config(
1164                                max_decoding_message_size,
1165                                max_encoding_message_size,
1166                            );
1167                        let res = grpc.unary(method, req).await;
1168                        Ok(res)
1169                    };
1170                    Box::pin(fut)
1171                }
1172                _ => {
1173                    Box::pin(async move {
1174                        let mut response = http::Response::new(
1175                            tonic::body::Body::default(),
1176                        );
1177                        let headers = response.headers_mut();
1178                        headers
1179                            .insert(
1180                                tonic::Status::GRPC_STATUS,
1181                                (tonic::Code::Unimplemented as i32).into(),
1182                            );
1183                        headers
1184                            .insert(
1185                                http::header::CONTENT_TYPE,
1186                                tonic::metadata::GRPC_CONTENT_TYPE,
1187                            );
1188                        Ok(response)
1189                    })
1190                }
1191            }
1192        }
1193    }
1194    impl<T> Clone for ApiKeyServiceServer<T> {
1195        fn clone(&self) -> Self {
1196            let inner = self.inner.clone();
1197            Self {
1198                inner,
1199                accept_compression_encodings: self.accept_compression_encodings,
1200                send_compression_encodings: self.send_compression_encodings,
1201                max_decoding_message_size: self.max_decoding_message_size,
1202                max_encoding_message_size: self.max_encoding_message_size,
1203            }
1204        }
1205    }
1206    /// Generated gRPC service name
1207    pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1208    impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1209        const NAME: &'static str = SERVICE_NAME;
1210    }
1211}
1212/// Generated client implementations.
1213pub mod privacy_service_client {
1214    #![allow(
1215        unused_variables,
1216        dead_code,
1217        missing_docs,
1218        clippy::wildcard_imports,
1219        clippy::let_unit_value,
1220    )]
1221    use tonic::codegen::*;
1222    use tonic::codegen::http::Uri;
1223    /** PrivacyService handles GDPR/LGPD data subject rights.
1224 All RPCs extract org_id from the JWT — it is never in request messages.
1225*/
1226    #[derive(Debug, Clone)]
1227    pub struct PrivacyServiceClient<T> {
1228        inner: tonic::client::Grpc<T>,
1229    }
1230    impl PrivacyServiceClient<tonic::transport::Channel> {
1231        /// Attempt to create a new client by connecting to a given endpoint.
1232        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1233        where
1234            D: TryInto<tonic::transport::Endpoint>,
1235            D::Error: Into<StdError>,
1236        {
1237            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1238            Ok(Self::new(conn))
1239        }
1240    }
1241    impl<T> PrivacyServiceClient<T>
1242    where
1243        T: tonic::client::GrpcService<tonic::body::Body>,
1244        T::Error: Into<StdError>,
1245        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1246        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1247    {
1248        pub fn new(inner: T) -> Self {
1249            let inner = tonic::client::Grpc::new(inner);
1250            Self { inner }
1251        }
1252        pub fn with_origin(inner: T, origin: Uri) -> Self {
1253            let inner = tonic::client::Grpc::with_origin(inner, origin);
1254            Self { inner }
1255        }
1256        pub fn with_interceptor<F>(
1257            inner: T,
1258            interceptor: F,
1259        ) -> PrivacyServiceClient<InterceptedService<T, F>>
1260        where
1261            F: tonic::service::Interceptor,
1262            T::ResponseBody: Default,
1263            T: tonic::codegen::Service<
1264                http::Request<tonic::body::Body>,
1265                Response = http::Response<
1266                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1267                >,
1268            >,
1269            <T as tonic::codegen::Service<
1270                http::Request<tonic::body::Body>,
1271            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1272        {
1273            PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1274        }
1275        /// Compress requests with the given encoding.
1276        ///
1277        /// This requires the server to support it otherwise it might respond with an
1278        /// error.
1279        #[must_use]
1280        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1281            self.inner = self.inner.send_compressed(encoding);
1282            self
1283        }
1284        /// Enable decompressing responses.
1285        #[must_use]
1286        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1287            self.inner = self.inner.accept_compressed(encoding);
1288            self
1289        }
1290        /// Limits the maximum size of a decoded message.
1291        ///
1292        /// Default: `4MB`
1293        #[must_use]
1294        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1295            self.inner = self.inner.max_decoding_message_size(limit);
1296            self
1297        }
1298        /// Limits the maximum size of an encoded message.
1299        ///
1300        /// Default: `usize::MAX`
1301        #[must_use]
1302        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1303            self.inner = self.inner.max_encoding_message_size(limit);
1304            self
1305        }
1306        /** Export all personal data associated with a user as a downloadable ZIP.
1307 Async operation — returns immediately with PENDING status, sends push
1308 notification when the export is ready.
1309 Auth: Requires JWT. Callable by the user themselves or an org admin.
1310*/
1311        pub async fn export_user_data(
1312            &mut self,
1313            request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1314        ) -> std::result::Result<
1315            tonic::Response<super::ExportUserDataResponse>,
1316            tonic::Status,
1317        > {
1318            self.inner
1319                .ready()
1320                .await
1321                .map_err(|e| {
1322                    tonic::Status::unknown(
1323                        format!("Service was not ready: {}", e.into()),
1324                    )
1325                })?;
1326            let codec = tonic_prost::ProstCodec::default();
1327            let path = http::uri::PathAndQuery::from_static(
1328                "/pidgr.v1.PrivacyService/ExportUserData",
1329            );
1330            let mut req = request.into_request();
1331            req.extensions_mut()
1332                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1333            self.inner.unary(req, path, codec).await
1334        }
1335        /** Export all data associated with the calling organization as an encrypted
1336 bundle (GDPR Art. 20). The workflow assembles org configuration, users,
1337 campaigns, deliveries, and audit events; the bundle is delivered via a
1338 pre-signed S3 URL. Async operation — returns immediately with PENDING
1339 status and an export_id to poll.
1340 Auth: Requires JWT. Org admin only.
1341*/
1342        pub async fn export_org_data(
1343            &mut self,
1344            request: impl tonic::IntoRequest<super::ExportOrgDataRequest>,
1345        ) -> std::result::Result<
1346            tonic::Response<super::ExportOrgDataResponse>,
1347            tonic::Status,
1348        > {
1349            self.inner
1350                .ready()
1351                .await
1352                .map_err(|e| {
1353                    tonic::Status::unknown(
1354                        format!("Service was not ready: {}", e.into()),
1355                    )
1356                })?;
1357            let codec = tonic_prost::ProstCodec::default();
1358            let path = http::uri::PathAndQuery::from_static(
1359                "/pidgr.v1.PrivacyService/ExportOrgData",
1360            );
1361            let mut req = request.into_request();
1362            req.extensions_mut()
1363                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportOrgData"));
1364            self.inner.unary(req, path, codec).await
1365        }
1366        /** Delete or anonymize all personal data associated with a user.
1367 Deletion has a 30-day grace period during which processing is restricted
1368 and the request can be cancelled. After 30 days, deletion is irreversible.
1369 Auth: Requires JWT. Admin only.
1370*/
1371        pub async fn delete_user_data(
1372            &mut self,
1373            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1374        ) -> std::result::Result<
1375            tonic::Response<super::DeleteUserDataResponse>,
1376            tonic::Status,
1377        > {
1378            self.inner
1379                .ready()
1380                .await
1381                .map_err(|e| {
1382                    tonic::Status::unknown(
1383                        format!("Service was not ready: {}", e.into()),
1384                    )
1385                })?;
1386            let codec = tonic_prost::ProstCodec::default();
1387            let path = http::uri::PathAndQuery::from_static(
1388                "/pidgr.v1.PrivacyService/DeleteUserData",
1389            );
1390            let mut req = request.into_request();
1391            req.extensions_mut()
1392                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1393            self.inner.unary(req, path, codec).await
1394        }
1395        /** Correct personal data for a user. Propagates corrections to all stored
1396 locations (profile, delivery records, analytics metadata).
1397 Auth: Requires JWT. Callable by the user themselves or an org admin.
1398*/
1399        pub async fn rectify_user_data(
1400            &mut self,
1401            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1402        ) -> std::result::Result<
1403            tonic::Response<super::RectifyUserDataResponse>,
1404            tonic::Status,
1405        > {
1406            self.inner
1407                .ready()
1408                .await
1409                .map_err(|e| {
1410                    tonic::Status::unknown(
1411                        format!("Service was not ready: {}", e.into()),
1412                    )
1413                })?;
1414            let codec = tonic_prost::ProstCodec::default();
1415            let path = http::uri::PathAndQuery::from_static(
1416                "/pidgr.v1.PrivacyService/RectifyUserData",
1417            );
1418            let mut req = request.into_request();
1419            req.extensions_mut()
1420                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1421            self.inner.unary(req, path, codec).await
1422        }
1423        /** Restrict or unrestrict processing for a user. When restricted, the API
1424 skips this user in campaigns, analytics, and session replay.
1425 Auth: Requires JWT. Admin only.
1426*/
1427        pub async fn restrict_processing(
1428            &mut self,
1429            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1430        ) -> std::result::Result<
1431            tonic::Response<super::RestrictProcessingResponse>,
1432            tonic::Status,
1433        > {
1434            self.inner
1435                .ready()
1436                .await
1437                .map_err(|e| {
1438                    tonic::Status::unknown(
1439                        format!("Service was not ready: {}", e.into()),
1440                    )
1441                })?;
1442            let codec = tonic_prost::ProstCodec::default();
1443            let path = http::uri::PathAndQuery::from_static(
1444                "/pidgr.v1.PrivacyService/RestrictProcessing",
1445            );
1446            let mut req = request.into_request();
1447            req.extensions_mut()
1448                .insert(
1449                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1450                );
1451            self.inner.unary(req, path, codec).await
1452        }
1453        /** Confirm whether personal data exists for a user and list data categories.
1454 LGPD-specific: confirmação de existência (Art. 18, I).
1455 Auth: Requires JWT. Admin only.
1456*/
1457        pub async fn get_data_existence_confirmation(
1458            &mut self,
1459            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1460        ) -> std::result::Result<
1461            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1462            tonic::Status,
1463        > {
1464            self.inner
1465                .ready()
1466                .await
1467                .map_err(|e| {
1468                    tonic::Status::unknown(
1469                        format!("Service was not ready: {}", e.into()),
1470                    )
1471                })?;
1472            let codec = tonic_prost::ProstCodec::default();
1473            let path = http::uri::PathAndQuery::from_static(
1474                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1475            );
1476            let mut req = request.into_request();
1477            req.extensions_mut()
1478                .insert(
1479                    GrpcMethod::new(
1480                        "pidgr.v1.PrivacyService",
1481                        "GetDataExistenceConfirmation",
1482                    ),
1483                );
1484            self.inner.unary(req, path, codec).await
1485        }
1486        /** List privacy requests for the organization, with optional filters.
1487 Used by the admin UI to show scheduled deletions table.
1488 Auth: Requires JWT. Admin only.
1489*/
1490        pub async fn list_privacy_requests(
1491            &mut self,
1492            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1493        ) -> std::result::Result<
1494            tonic::Response<super::ListPrivacyRequestsResponse>,
1495            tonic::Status,
1496        > {
1497            self.inner
1498                .ready()
1499                .await
1500                .map_err(|e| {
1501                    tonic::Status::unknown(
1502                        format!("Service was not ready: {}", e.into()),
1503                    )
1504                })?;
1505            let codec = tonic_prost::ProstCodec::default();
1506            let path = http::uri::PathAndQuery::from_static(
1507                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1508            );
1509            let mut req = request.into_request();
1510            req.extensions_mut()
1511                .insert(
1512                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1513                );
1514            self.inner.unary(req, path, codec).await
1515        }
1516        /** Cancel a pending deletion request. Reactivates the user and aborts
1517 the deletion workflow. Only valid during the 30-day grace period.
1518 Auth: Requires JWT. Admin only.
1519*/
1520        pub async fn cancel_deletion(
1521            &mut self,
1522            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1523        ) -> std::result::Result<
1524            tonic::Response<super::CancelDeletionResponse>,
1525            tonic::Status,
1526        > {
1527            self.inner
1528                .ready()
1529                .await
1530                .map_err(|e| {
1531                    tonic::Status::unknown(
1532                        format!("Service was not ready: {}", e.into()),
1533                    )
1534                })?;
1535            let codec = tonic_prost::ProstCodec::default();
1536            let path = http::uri::PathAndQuery::from_static(
1537                "/pidgr.v1.PrivacyService/CancelDeletion",
1538            );
1539            let mut req = request.into_request();
1540            req.extensions_mut()
1541                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1542            self.inner.unary(req, path, codec).await
1543        }
1544        /** Skip the grace period and delete immediately. Signals the deletion
1545 workflow to proceed without waiting for the 30-day timer.
1546 Auth: Requires JWT. Admin only.
1547*/
1548        pub async fn immediate_delete(
1549            &mut self,
1550            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1551        ) -> std::result::Result<
1552            tonic::Response<super::ImmediateDeleteResponse>,
1553            tonic::Status,
1554        > {
1555            self.inner
1556                .ready()
1557                .await
1558                .map_err(|e| {
1559                    tonic::Status::unknown(
1560                        format!("Service was not ready: {}", e.into()),
1561                    )
1562                })?;
1563            let codec = tonic_prost::ProstCodec::default();
1564            let path = http::uri::PathAndQuery::from_static(
1565                "/pidgr.v1.PrivacyService/ImmediateDelete",
1566            );
1567            let mut req = request.into_request();
1568            req.extensions_mut()
1569                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1570            self.inner.unary(req, path, codec).await
1571        }
1572        /** List the calling user's own privacy requests (export, rectify).
1573 The server extracts user_id from the JWT — no admin permission required.
1574 Auth: Requires JWT. Any authenticated user.
1575*/
1576        pub async fn list_my_privacy_requests(
1577            &mut self,
1578            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1579        ) -> std::result::Result<
1580            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1581            tonic::Status,
1582        > {
1583            self.inner
1584                .ready()
1585                .await
1586                .map_err(|e| {
1587                    tonic::Status::unknown(
1588                        format!("Service was not ready: {}", e.into()),
1589                    )
1590                })?;
1591            let codec = tonic_prost::ProstCodec::default();
1592            let path = http::uri::PathAndQuery::from_static(
1593                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1594            );
1595            let mut req = request.into_request();
1596            req.extensions_mut()
1597                .insert(
1598                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1599                );
1600            self.inner.unary(req, path, codec).await
1601        }
1602        /** List security incidents that touched the calling organization, newest
1603 first. Read-only org-facing subset of the staff incident queue — used by
1604 the admin breach feed (GDPR Art. 33/34 transparency).
1605 Auth: Requires JWT. Admin only.
1606*/
1607        pub async fn list_org_security_incidents(
1608            &mut self,
1609            request: impl tonic::IntoRequest<super::ListOrgSecurityIncidentsRequest>,
1610        ) -> std::result::Result<
1611            tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1612            tonic::Status,
1613        > {
1614            self.inner
1615                .ready()
1616                .await
1617                .map_err(|e| {
1618                    tonic::Status::unknown(
1619                        format!("Service was not ready: {}", e.into()),
1620                    )
1621                })?;
1622            let codec = tonic_prost::ProstCodec::default();
1623            let path = http::uri::PathAndQuery::from_static(
1624                "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents",
1625            );
1626            let mut req = request.into_request();
1627            req.extensions_mut()
1628                .insert(
1629                    GrpcMethod::new(
1630                        "pidgr.v1.PrivacyService",
1631                        "ListOrgSecurityIncidents",
1632                    ),
1633                );
1634            self.inner.unary(req, path, codec).await
1635        }
1636    }
1637}
1638/// Generated server implementations.
1639pub mod privacy_service_server {
1640    #![allow(
1641        unused_variables,
1642        dead_code,
1643        missing_docs,
1644        clippy::wildcard_imports,
1645        clippy::let_unit_value,
1646    )]
1647    use tonic::codegen::*;
1648    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
1649    #[async_trait]
1650    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1651        /** Export all personal data associated with a user as a downloadable ZIP.
1652 Async operation — returns immediately with PENDING status, sends push
1653 notification when the export is ready.
1654 Auth: Requires JWT. Callable by the user themselves or an org admin.
1655*/
1656        async fn export_user_data(
1657            &self,
1658            request: tonic::Request<super::ExportUserDataRequest>,
1659        ) -> std::result::Result<
1660            tonic::Response<super::ExportUserDataResponse>,
1661            tonic::Status,
1662        >;
1663        /** Export all data associated with the calling organization as an encrypted
1664 bundle (GDPR Art. 20). The workflow assembles org configuration, users,
1665 campaigns, deliveries, and audit events; the bundle is delivered via a
1666 pre-signed S3 URL. Async operation — returns immediately with PENDING
1667 status and an export_id to poll.
1668 Auth: Requires JWT. Org admin only.
1669*/
1670        async fn export_org_data(
1671            &self,
1672            request: tonic::Request<super::ExportOrgDataRequest>,
1673        ) -> std::result::Result<
1674            tonic::Response<super::ExportOrgDataResponse>,
1675            tonic::Status,
1676        >;
1677        /** Delete or anonymize all personal data associated with a user.
1678 Deletion has a 30-day grace period during which processing is restricted
1679 and the request can be cancelled. After 30 days, deletion is irreversible.
1680 Auth: Requires JWT. Admin only.
1681*/
1682        async fn delete_user_data(
1683            &self,
1684            request: tonic::Request<super::DeleteUserDataRequest>,
1685        ) -> std::result::Result<
1686            tonic::Response<super::DeleteUserDataResponse>,
1687            tonic::Status,
1688        >;
1689        /** Correct personal data for a user. Propagates corrections to all stored
1690 locations (profile, delivery records, analytics metadata).
1691 Auth: Requires JWT. Callable by the user themselves or an org admin.
1692*/
1693        async fn rectify_user_data(
1694            &self,
1695            request: tonic::Request<super::RectifyUserDataRequest>,
1696        ) -> std::result::Result<
1697            tonic::Response<super::RectifyUserDataResponse>,
1698            tonic::Status,
1699        >;
1700        /** Restrict or unrestrict processing for a user. When restricted, the API
1701 skips this user in campaigns, analytics, and session replay.
1702 Auth: Requires JWT. Admin only.
1703*/
1704        async fn restrict_processing(
1705            &self,
1706            request: tonic::Request<super::RestrictProcessingRequest>,
1707        ) -> std::result::Result<
1708            tonic::Response<super::RestrictProcessingResponse>,
1709            tonic::Status,
1710        >;
1711        /** Confirm whether personal data exists for a user and list data categories.
1712 LGPD-specific: confirmação de existência (Art. 18, I).
1713 Auth: Requires JWT. Admin only.
1714*/
1715        async fn get_data_existence_confirmation(
1716            &self,
1717            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1718        ) -> std::result::Result<
1719            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1720            tonic::Status,
1721        >;
1722        /** List privacy requests for the organization, with optional filters.
1723 Used by the admin UI to show scheduled deletions table.
1724 Auth: Requires JWT. Admin only.
1725*/
1726        async fn list_privacy_requests(
1727            &self,
1728            request: tonic::Request<super::ListPrivacyRequestsRequest>,
1729        ) -> std::result::Result<
1730            tonic::Response<super::ListPrivacyRequestsResponse>,
1731            tonic::Status,
1732        >;
1733        /** Cancel a pending deletion request. Reactivates the user and aborts
1734 the deletion workflow. Only valid during the 30-day grace period.
1735 Auth: Requires JWT. Admin only.
1736*/
1737        async fn cancel_deletion(
1738            &self,
1739            request: tonic::Request<super::CancelDeletionRequest>,
1740        ) -> std::result::Result<
1741            tonic::Response<super::CancelDeletionResponse>,
1742            tonic::Status,
1743        >;
1744        /** Skip the grace period and delete immediately. Signals the deletion
1745 workflow to proceed without waiting for the 30-day timer.
1746 Auth: Requires JWT. Admin only.
1747*/
1748        async fn immediate_delete(
1749            &self,
1750            request: tonic::Request<super::ImmediateDeleteRequest>,
1751        ) -> std::result::Result<
1752            tonic::Response<super::ImmediateDeleteResponse>,
1753            tonic::Status,
1754        >;
1755        /** List the calling user's own privacy requests (export, rectify).
1756 The server extracts user_id from the JWT — no admin permission required.
1757 Auth: Requires JWT. Any authenticated user.
1758*/
1759        async fn list_my_privacy_requests(
1760            &self,
1761            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1762        ) -> std::result::Result<
1763            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1764            tonic::Status,
1765        >;
1766        /** List security incidents that touched the calling organization, newest
1767 first. Read-only org-facing subset of the staff incident queue — used by
1768 the admin breach feed (GDPR Art. 33/34 transparency).
1769 Auth: Requires JWT. Admin only.
1770*/
1771        async fn list_org_security_incidents(
1772            &self,
1773            request: tonic::Request<super::ListOrgSecurityIncidentsRequest>,
1774        ) -> std::result::Result<
1775            tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1776            tonic::Status,
1777        >;
1778    }
1779    /** PrivacyService handles GDPR/LGPD data subject rights.
1780 All RPCs extract org_id from the JWT — it is never in request messages.
1781*/
1782    #[derive(Debug)]
1783    pub struct PrivacyServiceServer<T> {
1784        inner: Arc<T>,
1785        accept_compression_encodings: EnabledCompressionEncodings,
1786        send_compression_encodings: EnabledCompressionEncodings,
1787        max_decoding_message_size: Option<usize>,
1788        max_encoding_message_size: Option<usize>,
1789    }
1790    impl<T> PrivacyServiceServer<T> {
1791        pub fn new(inner: T) -> Self {
1792            Self::from_arc(Arc::new(inner))
1793        }
1794        pub fn from_arc(inner: Arc<T>) -> Self {
1795            Self {
1796                inner,
1797                accept_compression_encodings: Default::default(),
1798                send_compression_encodings: Default::default(),
1799                max_decoding_message_size: None,
1800                max_encoding_message_size: None,
1801            }
1802        }
1803        pub fn with_interceptor<F>(
1804            inner: T,
1805            interceptor: F,
1806        ) -> InterceptedService<Self, F>
1807        where
1808            F: tonic::service::Interceptor,
1809        {
1810            InterceptedService::new(Self::new(inner), interceptor)
1811        }
1812        /// Enable decompressing requests with the given encoding.
1813        #[must_use]
1814        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1815            self.accept_compression_encodings.enable(encoding);
1816            self
1817        }
1818        /// Compress responses with the given encoding, if the client supports it.
1819        #[must_use]
1820        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1821            self.send_compression_encodings.enable(encoding);
1822            self
1823        }
1824        /// Limits the maximum size of a decoded message.
1825        ///
1826        /// Default: `4MB`
1827        #[must_use]
1828        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1829            self.max_decoding_message_size = Some(limit);
1830            self
1831        }
1832        /// Limits the maximum size of an encoded message.
1833        ///
1834        /// Default: `usize::MAX`
1835        #[must_use]
1836        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1837            self.max_encoding_message_size = Some(limit);
1838            self
1839        }
1840    }
1841    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1842    where
1843        T: PrivacyService,
1844        B: Body + std::marker::Send + 'static,
1845        B::Error: Into<StdError> + std::marker::Send + 'static,
1846    {
1847        type Response = http::Response<tonic::body::Body>;
1848        type Error = std::convert::Infallible;
1849        type Future = BoxFuture<Self::Response, Self::Error>;
1850        fn poll_ready(
1851            &mut self,
1852            _cx: &mut Context<'_>,
1853        ) -> Poll<std::result::Result<(), Self::Error>> {
1854            Poll::Ready(Ok(()))
1855        }
1856        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1857            match req.uri().path() {
1858                "/pidgr.v1.PrivacyService/ExportUserData" => {
1859                    #[allow(non_camel_case_types)]
1860                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1861                    impl<
1862                        T: PrivacyService,
1863                    > tonic::server::UnaryService<super::ExportUserDataRequest>
1864                    for ExportUserDataSvc<T> {
1865                        type Response = super::ExportUserDataResponse;
1866                        type Future = BoxFuture<
1867                            tonic::Response<Self::Response>,
1868                            tonic::Status,
1869                        >;
1870                        fn call(
1871                            &mut self,
1872                            request: tonic::Request<super::ExportUserDataRequest>,
1873                        ) -> Self::Future {
1874                            let inner = Arc::clone(&self.0);
1875                            let fut = async move {
1876                                <T as PrivacyService>::export_user_data(&inner, request)
1877                                    .await
1878                            };
1879                            Box::pin(fut)
1880                        }
1881                    }
1882                    let accept_compression_encodings = self.accept_compression_encodings;
1883                    let send_compression_encodings = self.send_compression_encodings;
1884                    let max_decoding_message_size = self.max_decoding_message_size;
1885                    let max_encoding_message_size = self.max_encoding_message_size;
1886                    let inner = self.inner.clone();
1887                    let fut = async move {
1888                        let method = ExportUserDataSvc(inner);
1889                        let codec = tonic_prost::ProstCodec::default();
1890                        let mut grpc = tonic::server::Grpc::new(codec)
1891                            .apply_compression_config(
1892                                accept_compression_encodings,
1893                                send_compression_encodings,
1894                            )
1895                            .apply_max_message_size_config(
1896                                max_decoding_message_size,
1897                                max_encoding_message_size,
1898                            );
1899                        let res = grpc.unary(method, req).await;
1900                        Ok(res)
1901                    };
1902                    Box::pin(fut)
1903                }
1904                "/pidgr.v1.PrivacyService/ExportOrgData" => {
1905                    #[allow(non_camel_case_types)]
1906                    struct ExportOrgDataSvc<T: PrivacyService>(pub Arc<T>);
1907                    impl<
1908                        T: PrivacyService,
1909                    > tonic::server::UnaryService<super::ExportOrgDataRequest>
1910                    for ExportOrgDataSvc<T> {
1911                        type Response = super::ExportOrgDataResponse;
1912                        type Future = BoxFuture<
1913                            tonic::Response<Self::Response>,
1914                            tonic::Status,
1915                        >;
1916                        fn call(
1917                            &mut self,
1918                            request: tonic::Request<super::ExportOrgDataRequest>,
1919                        ) -> Self::Future {
1920                            let inner = Arc::clone(&self.0);
1921                            let fut = async move {
1922                                <T as PrivacyService>::export_org_data(&inner, request)
1923                                    .await
1924                            };
1925                            Box::pin(fut)
1926                        }
1927                    }
1928                    let accept_compression_encodings = self.accept_compression_encodings;
1929                    let send_compression_encodings = self.send_compression_encodings;
1930                    let max_decoding_message_size = self.max_decoding_message_size;
1931                    let max_encoding_message_size = self.max_encoding_message_size;
1932                    let inner = self.inner.clone();
1933                    let fut = async move {
1934                        let method = ExportOrgDataSvc(inner);
1935                        let codec = tonic_prost::ProstCodec::default();
1936                        let mut grpc = tonic::server::Grpc::new(codec)
1937                            .apply_compression_config(
1938                                accept_compression_encodings,
1939                                send_compression_encodings,
1940                            )
1941                            .apply_max_message_size_config(
1942                                max_decoding_message_size,
1943                                max_encoding_message_size,
1944                            );
1945                        let res = grpc.unary(method, req).await;
1946                        Ok(res)
1947                    };
1948                    Box::pin(fut)
1949                }
1950                "/pidgr.v1.PrivacyService/DeleteUserData" => {
1951                    #[allow(non_camel_case_types)]
1952                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1953                    impl<
1954                        T: PrivacyService,
1955                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
1956                    for DeleteUserDataSvc<T> {
1957                        type Response = super::DeleteUserDataResponse;
1958                        type Future = BoxFuture<
1959                            tonic::Response<Self::Response>,
1960                            tonic::Status,
1961                        >;
1962                        fn call(
1963                            &mut self,
1964                            request: tonic::Request<super::DeleteUserDataRequest>,
1965                        ) -> Self::Future {
1966                            let inner = Arc::clone(&self.0);
1967                            let fut = async move {
1968                                <T as PrivacyService>::delete_user_data(&inner, request)
1969                                    .await
1970                            };
1971                            Box::pin(fut)
1972                        }
1973                    }
1974                    let accept_compression_encodings = self.accept_compression_encodings;
1975                    let send_compression_encodings = self.send_compression_encodings;
1976                    let max_decoding_message_size = self.max_decoding_message_size;
1977                    let max_encoding_message_size = self.max_encoding_message_size;
1978                    let inner = self.inner.clone();
1979                    let fut = async move {
1980                        let method = DeleteUserDataSvc(inner);
1981                        let codec = tonic_prost::ProstCodec::default();
1982                        let mut grpc = tonic::server::Grpc::new(codec)
1983                            .apply_compression_config(
1984                                accept_compression_encodings,
1985                                send_compression_encodings,
1986                            )
1987                            .apply_max_message_size_config(
1988                                max_decoding_message_size,
1989                                max_encoding_message_size,
1990                            );
1991                        let res = grpc.unary(method, req).await;
1992                        Ok(res)
1993                    };
1994                    Box::pin(fut)
1995                }
1996                "/pidgr.v1.PrivacyService/RectifyUserData" => {
1997                    #[allow(non_camel_case_types)]
1998                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1999                    impl<
2000                        T: PrivacyService,
2001                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
2002                    for RectifyUserDataSvc<T> {
2003                        type Response = super::RectifyUserDataResponse;
2004                        type Future = BoxFuture<
2005                            tonic::Response<Self::Response>,
2006                            tonic::Status,
2007                        >;
2008                        fn call(
2009                            &mut self,
2010                            request: tonic::Request<super::RectifyUserDataRequest>,
2011                        ) -> Self::Future {
2012                            let inner = Arc::clone(&self.0);
2013                            let fut = async move {
2014                                <T as PrivacyService>::rectify_user_data(&inner, request)
2015                                    .await
2016                            };
2017                            Box::pin(fut)
2018                        }
2019                    }
2020                    let accept_compression_encodings = self.accept_compression_encodings;
2021                    let send_compression_encodings = self.send_compression_encodings;
2022                    let max_decoding_message_size = self.max_decoding_message_size;
2023                    let max_encoding_message_size = self.max_encoding_message_size;
2024                    let inner = self.inner.clone();
2025                    let fut = async move {
2026                        let method = RectifyUserDataSvc(inner);
2027                        let codec = tonic_prost::ProstCodec::default();
2028                        let mut grpc = tonic::server::Grpc::new(codec)
2029                            .apply_compression_config(
2030                                accept_compression_encodings,
2031                                send_compression_encodings,
2032                            )
2033                            .apply_max_message_size_config(
2034                                max_decoding_message_size,
2035                                max_encoding_message_size,
2036                            );
2037                        let res = grpc.unary(method, req).await;
2038                        Ok(res)
2039                    };
2040                    Box::pin(fut)
2041                }
2042                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
2043                    #[allow(non_camel_case_types)]
2044                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
2045                    impl<
2046                        T: PrivacyService,
2047                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
2048                    for RestrictProcessingSvc<T> {
2049                        type Response = super::RestrictProcessingResponse;
2050                        type Future = BoxFuture<
2051                            tonic::Response<Self::Response>,
2052                            tonic::Status,
2053                        >;
2054                        fn call(
2055                            &mut self,
2056                            request: tonic::Request<super::RestrictProcessingRequest>,
2057                        ) -> Self::Future {
2058                            let inner = Arc::clone(&self.0);
2059                            let fut = async move {
2060                                <T as PrivacyService>::restrict_processing(&inner, request)
2061                                    .await
2062                            };
2063                            Box::pin(fut)
2064                        }
2065                    }
2066                    let accept_compression_encodings = self.accept_compression_encodings;
2067                    let send_compression_encodings = self.send_compression_encodings;
2068                    let max_decoding_message_size = self.max_decoding_message_size;
2069                    let max_encoding_message_size = self.max_encoding_message_size;
2070                    let inner = self.inner.clone();
2071                    let fut = async move {
2072                        let method = RestrictProcessingSvc(inner);
2073                        let codec = tonic_prost::ProstCodec::default();
2074                        let mut grpc = tonic::server::Grpc::new(codec)
2075                            .apply_compression_config(
2076                                accept_compression_encodings,
2077                                send_compression_encodings,
2078                            )
2079                            .apply_max_message_size_config(
2080                                max_decoding_message_size,
2081                                max_encoding_message_size,
2082                            );
2083                        let res = grpc.unary(method, req).await;
2084                        Ok(res)
2085                    };
2086                    Box::pin(fut)
2087                }
2088                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2089                    #[allow(non_camel_case_types)]
2090                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2091                        pub Arc<T>,
2092                    );
2093                    impl<
2094                        T: PrivacyService,
2095                    > tonic::server::UnaryService<
2096                        super::GetDataExistenceConfirmationRequest,
2097                    > for GetDataExistenceConfirmationSvc<T> {
2098                        type Response = super::GetDataExistenceConfirmationResponse;
2099                        type Future = BoxFuture<
2100                            tonic::Response<Self::Response>,
2101                            tonic::Status,
2102                        >;
2103                        fn call(
2104                            &mut self,
2105                            request: tonic::Request<
2106                                super::GetDataExistenceConfirmationRequest,
2107                            >,
2108                        ) -> Self::Future {
2109                            let inner = Arc::clone(&self.0);
2110                            let fut = async move {
2111                                <T as PrivacyService>::get_data_existence_confirmation(
2112                                        &inner,
2113                                        request,
2114                                    )
2115                                    .await
2116                            };
2117                            Box::pin(fut)
2118                        }
2119                    }
2120                    let accept_compression_encodings = self.accept_compression_encodings;
2121                    let send_compression_encodings = self.send_compression_encodings;
2122                    let max_decoding_message_size = self.max_decoding_message_size;
2123                    let max_encoding_message_size = self.max_encoding_message_size;
2124                    let inner = self.inner.clone();
2125                    let fut = async move {
2126                        let method = GetDataExistenceConfirmationSvc(inner);
2127                        let codec = tonic_prost::ProstCodec::default();
2128                        let mut grpc = tonic::server::Grpc::new(codec)
2129                            .apply_compression_config(
2130                                accept_compression_encodings,
2131                                send_compression_encodings,
2132                            )
2133                            .apply_max_message_size_config(
2134                                max_decoding_message_size,
2135                                max_encoding_message_size,
2136                            );
2137                        let res = grpc.unary(method, req).await;
2138                        Ok(res)
2139                    };
2140                    Box::pin(fut)
2141                }
2142                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2143                    #[allow(non_camel_case_types)]
2144                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2145                    impl<
2146                        T: PrivacyService,
2147                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2148                    for ListPrivacyRequestsSvc<T> {
2149                        type Response = super::ListPrivacyRequestsResponse;
2150                        type Future = BoxFuture<
2151                            tonic::Response<Self::Response>,
2152                            tonic::Status,
2153                        >;
2154                        fn call(
2155                            &mut self,
2156                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2157                        ) -> Self::Future {
2158                            let inner = Arc::clone(&self.0);
2159                            let fut = async move {
2160                                <T as PrivacyService>::list_privacy_requests(
2161                                        &inner,
2162                                        request,
2163                                    )
2164                                    .await
2165                            };
2166                            Box::pin(fut)
2167                        }
2168                    }
2169                    let accept_compression_encodings = self.accept_compression_encodings;
2170                    let send_compression_encodings = self.send_compression_encodings;
2171                    let max_decoding_message_size = self.max_decoding_message_size;
2172                    let max_encoding_message_size = self.max_encoding_message_size;
2173                    let inner = self.inner.clone();
2174                    let fut = async move {
2175                        let method = ListPrivacyRequestsSvc(inner);
2176                        let codec = tonic_prost::ProstCodec::default();
2177                        let mut grpc = tonic::server::Grpc::new(codec)
2178                            .apply_compression_config(
2179                                accept_compression_encodings,
2180                                send_compression_encodings,
2181                            )
2182                            .apply_max_message_size_config(
2183                                max_decoding_message_size,
2184                                max_encoding_message_size,
2185                            );
2186                        let res = grpc.unary(method, req).await;
2187                        Ok(res)
2188                    };
2189                    Box::pin(fut)
2190                }
2191                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2192                    #[allow(non_camel_case_types)]
2193                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2194                    impl<
2195                        T: PrivacyService,
2196                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2197                    for CancelDeletionSvc<T> {
2198                        type Response = super::CancelDeletionResponse;
2199                        type Future = BoxFuture<
2200                            tonic::Response<Self::Response>,
2201                            tonic::Status,
2202                        >;
2203                        fn call(
2204                            &mut self,
2205                            request: tonic::Request<super::CancelDeletionRequest>,
2206                        ) -> Self::Future {
2207                            let inner = Arc::clone(&self.0);
2208                            let fut = async move {
2209                                <T as PrivacyService>::cancel_deletion(&inner, request)
2210                                    .await
2211                            };
2212                            Box::pin(fut)
2213                        }
2214                    }
2215                    let accept_compression_encodings = self.accept_compression_encodings;
2216                    let send_compression_encodings = self.send_compression_encodings;
2217                    let max_decoding_message_size = self.max_decoding_message_size;
2218                    let max_encoding_message_size = self.max_encoding_message_size;
2219                    let inner = self.inner.clone();
2220                    let fut = async move {
2221                        let method = CancelDeletionSvc(inner);
2222                        let codec = tonic_prost::ProstCodec::default();
2223                        let mut grpc = tonic::server::Grpc::new(codec)
2224                            .apply_compression_config(
2225                                accept_compression_encodings,
2226                                send_compression_encodings,
2227                            )
2228                            .apply_max_message_size_config(
2229                                max_decoding_message_size,
2230                                max_encoding_message_size,
2231                            );
2232                        let res = grpc.unary(method, req).await;
2233                        Ok(res)
2234                    };
2235                    Box::pin(fut)
2236                }
2237                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2238                    #[allow(non_camel_case_types)]
2239                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2240                    impl<
2241                        T: PrivacyService,
2242                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2243                    for ImmediateDeleteSvc<T> {
2244                        type Response = super::ImmediateDeleteResponse;
2245                        type Future = BoxFuture<
2246                            tonic::Response<Self::Response>,
2247                            tonic::Status,
2248                        >;
2249                        fn call(
2250                            &mut self,
2251                            request: tonic::Request<super::ImmediateDeleteRequest>,
2252                        ) -> Self::Future {
2253                            let inner = Arc::clone(&self.0);
2254                            let fut = async move {
2255                                <T as PrivacyService>::immediate_delete(&inner, request)
2256                                    .await
2257                            };
2258                            Box::pin(fut)
2259                        }
2260                    }
2261                    let accept_compression_encodings = self.accept_compression_encodings;
2262                    let send_compression_encodings = self.send_compression_encodings;
2263                    let max_decoding_message_size = self.max_decoding_message_size;
2264                    let max_encoding_message_size = self.max_encoding_message_size;
2265                    let inner = self.inner.clone();
2266                    let fut = async move {
2267                        let method = ImmediateDeleteSvc(inner);
2268                        let codec = tonic_prost::ProstCodec::default();
2269                        let mut grpc = tonic::server::Grpc::new(codec)
2270                            .apply_compression_config(
2271                                accept_compression_encodings,
2272                                send_compression_encodings,
2273                            )
2274                            .apply_max_message_size_config(
2275                                max_decoding_message_size,
2276                                max_encoding_message_size,
2277                            );
2278                        let res = grpc.unary(method, req).await;
2279                        Ok(res)
2280                    };
2281                    Box::pin(fut)
2282                }
2283                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2284                    #[allow(non_camel_case_types)]
2285                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2286                    impl<
2287                        T: PrivacyService,
2288                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2289                    for ListMyPrivacyRequestsSvc<T> {
2290                        type Response = super::ListMyPrivacyRequestsResponse;
2291                        type Future = BoxFuture<
2292                            tonic::Response<Self::Response>,
2293                            tonic::Status,
2294                        >;
2295                        fn call(
2296                            &mut self,
2297                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2298                        ) -> Self::Future {
2299                            let inner = Arc::clone(&self.0);
2300                            let fut = async move {
2301                                <T as PrivacyService>::list_my_privacy_requests(
2302                                        &inner,
2303                                        request,
2304                                    )
2305                                    .await
2306                            };
2307                            Box::pin(fut)
2308                        }
2309                    }
2310                    let accept_compression_encodings = self.accept_compression_encodings;
2311                    let send_compression_encodings = self.send_compression_encodings;
2312                    let max_decoding_message_size = self.max_decoding_message_size;
2313                    let max_encoding_message_size = self.max_encoding_message_size;
2314                    let inner = self.inner.clone();
2315                    let fut = async move {
2316                        let method = ListMyPrivacyRequestsSvc(inner);
2317                        let codec = tonic_prost::ProstCodec::default();
2318                        let mut grpc = tonic::server::Grpc::new(codec)
2319                            .apply_compression_config(
2320                                accept_compression_encodings,
2321                                send_compression_encodings,
2322                            )
2323                            .apply_max_message_size_config(
2324                                max_decoding_message_size,
2325                                max_encoding_message_size,
2326                            );
2327                        let res = grpc.unary(method, req).await;
2328                        Ok(res)
2329                    };
2330                    Box::pin(fut)
2331                }
2332                "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents" => {
2333                    #[allow(non_camel_case_types)]
2334                    struct ListOrgSecurityIncidentsSvc<T: PrivacyService>(pub Arc<T>);
2335                    impl<
2336                        T: PrivacyService,
2337                    > tonic::server::UnaryService<super::ListOrgSecurityIncidentsRequest>
2338                    for ListOrgSecurityIncidentsSvc<T> {
2339                        type Response = super::ListOrgSecurityIncidentsResponse;
2340                        type Future = BoxFuture<
2341                            tonic::Response<Self::Response>,
2342                            tonic::Status,
2343                        >;
2344                        fn call(
2345                            &mut self,
2346                            request: tonic::Request<
2347                                super::ListOrgSecurityIncidentsRequest,
2348                            >,
2349                        ) -> Self::Future {
2350                            let inner = Arc::clone(&self.0);
2351                            let fut = async move {
2352                                <T as PrivacyService>::list_org_security_incidents(
2353                                        &inner,
2354                                        request,
2355                                    )
2356                                    .await
2357                            };
2358                            Box::pin(fut)
2359                        }
2360                    }
2361                    let accept_compression_encodings = self.accept_compression_encodings;
2362                    let send_compression_encodings = self.send_compression_encodings;
2363                    let max_decoding_message_size = self.max_decoding_message_size;
2364                    let max_encoding_message_size = self.max_encoding_message_size;
2365                    let inner = self.inner.clone();
2366                    let fut = async move {
2367                        let method = ListOrgSecurityIncidentsSvc(inner);
2368                        let codec = tonic_prost::ProstCodec::default();
2369                        let mut grpc = tonic::server::Grpc::new(codec)
2370                            .apply_compression_config(
2371                                accept_compression_encodings,
2372                                send_compression_encodings,
2373                            )
2374                            .apply_max_message_size_config(
2375                                max_decoding_message_size,
2376                                max_encoding_message_size,
2377                            );
2378                        let res = grpc.unary(method, req).await;
2379                        Ok(res)
2380                    };
2381                    Box::pin(fut)
2382                }
2383                _ => {
2384                    Box::pin(async move {
2385                        let mut response = http::Response::new(
2386                            tonic::body::Body::default(),
2387                        );
2388                        let headers = response.headers_mut();
2389                        headers
2390                            .insert(
2391                                tonic::Status::GRPC_STATUS,
2392                                (tonic::Code::Unimplemented as i32).into(),
2393                            );
2394                        headers
2395                            .insert(
2396                                http::header::CONTENT_TYPE,
2397                                tonic::metadata::GRPC_CONTENT_TYPE,
2398                            );
2399                        Ok(response)
2400                    })
2401                }
2402            }
2403        }
2404    }
2405    impl<T> Clone for PrivacyServiceServer<T> {
2406        fn clone(&self) -> Self {
2407            let inner = self.inner.clone();
2408            Self {
2409                inner,
2410                accept_compression_encodings: self.accept_compression_encodings,
2411                send_compression_encodings: self.send_compression_encodings,
2412                max_decoding_message_size: self.max_decoding_message_size,
2413                max_encoding_message_size: self.max_encoding_message_size,
2414            }
2415        }
2416    }
2417    /// Generated gRPC service name
2418    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2419    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2420        const NAME: &'static str = SERVICE_NAME;
2421    }
2422}
2423/// Generated client implementations.
2424pub mod audit_service_client {
2425    #![allow(
2426        unused_variables,
2427        dead_code,
2428        missing_docs,
2429        clippy::wildcard_imports,
2430        clippy::let_unit_value,
2431    )]
2432    use tonic::codegen::*;
2433    use tonic::codegen::http::Uri;
2434    /** AuditService provides read access to the append-only audit trail, plus an
2435 internal-mTLS-only Append RPC for sibling services that need to record
2436 their own audit events into the shared trail.
2437
2438 All read RPCs extract org_id from the JWT — it is never in request
2439 messages. The Append RPC carries org_id explicitly because it is
2440 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2441*/
2442    #[derive(Debug, Clone)]
2443    pub struct AuditServiceClient<T> {
2444        inner: tonic::client::Grpc<T>,
2445    }
2446    impl AuditServiceClient<tonic::transport::Channel> {
2447        /// Attempt to create a new client by connecting to a given endpoint.
2448        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2449        where
2450            D: TryInto<tonic::transport::Endpoint>,
2451            D::Error: Into<StdError>,
2452        {
2453            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2454            Ok(Self::new(conn))
2455        }
2456    }
2457    impl<T> AuditServiceClient<T>
2458    where
2459        T: tonic::client::GrpcService<tonic::body::Body>,
2460        T::Error: Into<StdError>,
2461        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2462        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2463    {
2464        pub fn new(inner: T) -> Self {
2465            let inner = tonic::client::Grpc::new(inner);
2466            Self { inner }
2467        }
2468        pub fn with_origin(inner: T, origin: Uri) -> Self {
2469            let inner = tonic::client::Grpc::with_origin(inner, origin);
2470            Self { inner }
2471        }
2472        pub fn with_interceptor<F>(
2473            inner: T,
2474            interceptor: F,
2475        ) -> AuditServiceClient<InterceptedService<T, F>>
2476        where
2477            F: tonic::service::Interceptor,
2478            T::ResponseBody: Default,
2479            T: tonic::codegen::Service<
2480                http::Request<tonic::body::Body>,
2481                Response = http::Response<
2482                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2483                >,
2484            >,
2485            <T as tonic::codegen::Service<
2486                http::Request<tonic::body::Body>,
2487            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2488        {
2489            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2490        }
2491        /// Compress requests with the given encoding.
2492        ///
2493        /// This requires the server to support it otherwise it might respond with an
2494        /// error.
2495        #[must_use]
2496        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2497            self.inner = self.inner.send_compressed(encoding);
2498            self
2499        }
2500        /// Enable decompressing responses.
2501        #[must_use]
2502        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2503            self.inner = self.inner.accept_compressed(encoding);
2504            self
2505        }
2506        /// Limits the maximum size of a decoded message.
2507        ///
2508        /// Default: `4MB`
2509        #[must_use]
2510        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2511            self.inner = self.inner.max_decoding_message_size(limit);
2512            self
2513        }
2514        /// Limits the maximum size of an encoded message.
2515        ///
2516        /// Default: `usize::MAX`
2517        #[must_use]
2518        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2519            self.inner = self.inner.max_encoding_message_size(limit);
2520            self
2521        }
2522        /** List audit events with optional filtering by event type, actor, and date range.
2523 Results are ordered by created_at descending (newest first).
2524 Auth: Requires JWT. Admin only.
2525*/
2526        pub async fn list_audit_events(
2527            &mut self,
2528            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2529        ) -> std::result::Result<
2530            tonic::Response<super::ListAuditEventsResponse>,
2531            tonic::Status,
2532        > {
2533            self.inner
2534                .ready()
2535                .await
2536                .map_err(|e| {
2537                    tonic::Status::unknown(
2538                        format!("Service was not ready: {}", e.into()),
2539                    )
2540                })?;
2541            let codec = tonic_prost::ProstCodec::default();
2542            let path = http::uri::PathAndQuery::from_static(
2543                "/pidgr.v1.AuditService/ListAuditEvents",
2544            );
2545            let mut req = request.into_request();
2546            req.extensions_mut()
2547                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2548            self.inner.unary(req, path, codec).await
2549        }
2550        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2551 Creates a persistent record and starts an async Temporal workflow.
2552 Auth: Requires JWT. Admin only.
2553*/
2554        pub async fn export_audit_trail(
2555            &mut self,
2556            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2557        ) -> std::result::Result<
2558            tonic::Response<super::ExportAuditTrailResponse>,
2559            tonic::Status,
2560        > {
2561            self.inner
2562                .ready()
2563                .await
2564                .map_err(|e| {
2565                    tonic::Status::unknown(
2566                        format!("Service was not ready: {}", e.into()),
2567                    )
2568                })?;
2569            let codec = tonic_prost::ProstCodec::default();
2570            let path = http::uri::PathAndQuery::from_static(
2571                "/pidgr.v1.AuditService/ExportAuditTrail",
2572            );
2573            let mut req = request.into_request();
2574            req.extensions_mut()
2575                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2576            self.inner.unary(req, path, codec).await
2577        }
2578        /** List audit export history for the organization.
2579 Auth: Requires JWT. Admin only.
2580*/
2581        pub async fn list_audit_exports(
2582            &mut self,
2583            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2584        ) -> std::result::Result<
2585            tonic::Response<super::ListAuditExportsResponse>,
2586            tonic::Status,
2587        > {
2588            self.inner
2589                .ready()
2590                .await
2591                .map_err(|e| {
2592                    tonic::Status::unknown(
2593                        format!("Service was not ready: {}", e.into()),
2594                    )
2595                })?;
2596            let codec = tonic_prost::ProstCodec::default();
2597            let path = http::uri::PathAndQuery::from_static(
2598                "/pidgr.v1.AuditService/ListAuditExports",
2599            );
2600            let mut req = request.into_request();
2601            req.extensions_mut()
2602                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2603            self.inner.unary(req, path, codec).await
2604        }
2605        /** Append one audit event to the trail. Used by sibling services
2606 (pidgr-integrations, future internal services) to record GDPR-relevant
2607 events that originate outside pidgr-api.
2608
2609 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2610 presents only a JWT. The server MUST allowlist callers by their mTLS
2611 client-certificate subject DN.
2612*/
2613        pub async fn append(
2614            &mut self,
2615            request: impl tonic::IntoRequest<super::AppendRequest>,
2616        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status> {
2617            self.inner
2618                .ready()
2619                .await
2620                .map_err(|e| {
2621                    tonic::Status::unknown(
2622                        format!("Service was not ready: {}", e.into()),
2623                    )
2624                })?;
2625            let codec = tonic_prost::ProstCodec::default();
2626            let path = http::uri::PathAndQuery::from_static(
2627                "/pidgr.v1.AuditService/Append",
2628            );
2629            let mut req = request.into_request();
2630            req.extensions_mut()
2631                .insert(GrpcMethod::new("pidgr.v1.AuditService", "Append"));
2632            self.inner.unary(req, path, codec).await
2633        }
2634    }
2635}
2636/// Generated server implementations.
2637pub mod audit_service_server {
2638    #![allow(
2639        unused_variables,
2640        dead_code,
2641        missing_docs,
2642        clippy::wildcard_imports,
2643        clippy::let_unit_value,
2644    )]
2645    use tonic::codegen::*;
2646    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2647    #[async_trait]
2648    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2649        /** List audit events with optional filtering by event type, actor, and date range.
2650 Results are ordered by created_at descending (newest first).
2651 Auth: Requires JWT. Admin only.
2652*/
2653        async fn list_audit_events(
2654            &self,
2655            request: tonic::Request<super::ListAuditEventsRequest>,
2656        ) -> std::result::Result<
2657            tonic::Response<super::ListAuditEventsResponse>,
2658            tonic::Status,
2659        >;
2660        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2661 Creates a persistent record and starts an async Temporal workflow.
2662 Auth: Requires JWT. Admin only.
2663*/
2664        async fn export_audit_trail(
2665            &self,
2666            request: tonic::Request<super::ExportAuditTrailRequest>,
2667        ) -> std::result::Result<
2668            tonic::Response<super::ExportAuditTrailResponse>,
2669            tonic::Status,
2670        >;
2671        /** List audit export history for the organization.
2672 Auth: Requires JWT. Admin only.
2673*/
2674        async fn list_audit_exports(
2675            &self,
2676            request: tonic::Request<super::ListAuditExportsRequest>,
2677        ) -> std::result::Result<
2678            tonic::Response<super::ListAuditExportsResponse>,
2679            tonic::Status,
2680        >;
2681        /** Append one audit event to the trail. Used by sibling services
2682 (pidgr-integrations, future internal services) to record GDPR-relevant
2683 events that originate outside pidgr-api.
2684
2685 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2686 presents only a JWT. The server MUST allowlist callers by their mTLS
2687 client-certificate subject DN.
2688*/
2689        async fn append(
2690            &self,
2691            request: tonic::Request<super::AppendRequest>,
2692        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
2693    }
2694    /** AuditService provides read access to the append-only audit trail, plus an
2695 internal-mTLS-only Append RPC for sibling services that need to record
2696 their own audit events into the shared trail.
2697
2698 All read RPCs extract org_id from the JWT — it is never in request
2699 messages. The Append RPC carries org_id explicitly because it is
2700 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2701*/
2702    #[derive(Debug)]
2703    pub struct AuditServiceServer<T> {
2704        inner: Arc<T>,
2705        accept_compression_encodings: EnabledCompressionEncodings,
2706        send_compression_encodings: EnabledCompressionEncodings,
2707        max_decoding_message_size: Option<usize>,
2708        max_encoding_message_size: Option<usize>,
2709    }
2710    impl<T> AuditServiceServer<T> {
2711        pub fn new(inner: T) -> Self {
2712            Self::from_arc(Arc::new(inner))
2713        }
2714        pub fn from_arc(inner: Arc<T>) -> Self {
2715            Self {
2716                inner,
2717                accept_compression_encodings: Default::default(),
2718                send_compression_encodings: Default::default(),
2719                max_decoding_message_size: None,
2720                max_encoding_message_size: None,
2721            }
2722        }
2723        pub fn with_interceptor<F>(
2724            inner: T,
2725            interceptor: F,
2726        ) -> InterceptedService<Self, F>
2727        where
2728            F: tonic::service::Interceptor,
2729        {
2730            InterceptedService::new(Self::new(inner), interceptor)
2731        }
2732        /// Enable decompressing requests with the given encoding.
2733        #[must_use]
2734        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2735            self.accept_compression_encodings.enable(encoding);
2736            self
2737        }
2738        /// Compress responses with the given encoding, if the client supports it.
2739        #[must_use]
2740        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2741            self.send_compression_encodings.enable(encoding);
2742            self
2743        }
2744        /// Limits the maximum size of a decoded message.
2745        ///
2746        /// Default: `4MB`
2747        #[must_use]
2748        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2749            self.max_decoding_message_size = Some(limit);
2750            self
2751        }
2752        /// Limits the maximum size of an encoded message.
2753        ///
2754        /// Default: `usize::MAX`
2755        #[must_use]
2756        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2757            self.max_encoding_message_size = Some(limit);
2758            self
2759        }
2760    }
2761    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2762    where
2763        T: AuditService,
2764        B: Body + std::marker::Send + 'static,
2765        B::Error: Into<StdError> + std::marker::Send + 'static,
2766    {
2767        type Response = http::Response<tonic::body::Body>;
2768        type Error = std::convert::Infallible;
2769        type Future = BoxFuture<Self::Response, Self::Error>;
2770        fn poll_ready(
2771            &mut self,
2772            _cx: &mut Context<'_>,
2773        ) -> Poll<std::result::Result<(), Self::Error>> {
2774            Poll::Ready(Ok(()))
2775        }
2776        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2777            match req.uri().path() {
2778                "/pidgr.v1.AuditService/ListAuditEvents" => {
2779                    #[allow(non_camel_case_types)]
2780                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2781                    impl<
2782                        T: AuditService,
2783                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
2784                    for ListAuditEventsSvc<T> {
2785                        type Response = super::ListAuditEventsResponse;
2786                        type Future = BoxFuture<
2787                            tonic::Response<Self::Response>,
2788                            tonic::Status,
2789                        >;
2790                        fn call(
2791                            &mut self,
2792                            request: tonic::Request<super::ListAuditEventsRequest>,
2793                        ) -> Self::Future {
2794                            let inner = Arc::clone(&self.0);
2795                            let fut = async move {
2796                                <T as AuditService>::list_audit_events(&inner, request)
2797                                    .await
2798                            };
2799                            Box::pin(fut)
2800                        }
2801                    }
2802                    let accept_compression_encodings = self.accept_compression_encodings;
2803                    let send_compression_encodings = self.send_compression_encodings;
2804                    let max_decoding_message_size = self.max_decoding_message_size;
2805                    let max_encoding_message_size = self.max_encoding_message_size;
2806                    let inner = self.inner.clone();
2807                    let fut = async move {
2808                        let method = ListAuditEventsSvc(inner);
2809                        let codec = tonic_prost::ProstCodec::default();
2810                        let mut grpc = tonic::server::Grpc::new(codec)
2811                            .apply_compression_config(
2812                                accept_compression_encodings,
2813                                send_compression_encodings,
2814                            )
2815                            .apply_max_message_size_config(
2816                                max_decoding_message_size,
2817                                max_encoding_message_size,
2818                            );
2819                        let res = grpc.unary(method, req).await;
2820                        Ok(res)
2821                    };
2822                    Box::pin(fut)
2823                }
2824                "/pidgr.v1.AuditService/ExportAuditTrail" => {
2825                    #[allow(non_camel_case_types)]
2826                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2827                    impl<
2828                        T: AuditService,
2829                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2830                    for ExportAuditTrailSvc<T> {
2831                        type Response = super::ExportAuditTrailResponse;
2832                        type Future = BoxFuture<
2833                            tonic::Response<Self::Response>,
2834                            tonic::Status,
2835                        >;
2836                        fn call(
2837                            &mut self,
2838                            request: tonic::Request<super::ExportAuditTrailRequest>,
2839                        ) -> Self::Future {
2840                            let inner = Arc::clone(&self.0);
2841                            let fut = async move {
2842                                <T as AuditService>::export_audit_trail(&inner, request)
2843                                    .await
2844                            };
2845                            Box::pin(fut)
2846                        }
2847                    }
2848                    let accept_compression_encodings = self.accept_compression_encodings;
2849                    let send_compression_encodings = self.send_compression_encodings;
2850                    let max_decoding_message_size = self.max_decoding_message_size;
2851                    let max_encoding_message_size = self.max_encoding_message_size;
2852                    let inner = self.inner.clone();
2853                    let fut = async move {
2854                        let method = ExportAuditTrailSvc(inner);
2855                        let codec = tonic_prost::ProstCodec::default();
2856                        let mut grpc = tonic::server::Grpc::new(codec)
2857                            .apply_compression_config(
2858                                accept_compression_encodings,
2859                                send_compression_encodings,
2860                            )
2861                            .apply_max_message_size_config(
2862                                max_decoding_message_size,
2863                                max_encoding_message_size,
2864                            );
2865                        let res = grpc.unary(method, req).await;
2866                        Ok(res)
2867                    };
2868                    Box::pin(fut)
2869                }
2870                "/pidgr.v1.AuditService/ListAuditExports" => {
2871                    #[allow(non_camel_case_types)]
2872                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2873                    impl<
2874                        T: AuditService,
2875                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
2876                    for ListAuditExportsSvc<T> {
2877                        type Response = super::ListAuditExportsResponse;
2878                        type Future = BoxFuture<
2879                            tonic::Response<Self::Response>,
2880                            tonic::Status,
2881                        >;
2882                        fn call(
2883                            &mut self,
2884                            request: tonic::Request<super::ListAuditExportsRequest>,
2885                        ) -> Self::Future {
2886                            let inner = Arc::clone(&self.0);
2887                            let fut = async move {
2888                                <T as AuditService>::list_audit_exports(&inner, request)
2889                                    .await
2890                            };
2891                            Box::pin(fut)
2892                        }
2893                    }
2894                    let accept_compression_encodings = self.accept_compression_encodings;
2895                    let send_compression_encodings = self.send_compression_encodings;
2896                    let max_decoding_message_size = self.max_decoding_message_size;
2897                    let max_encoding_message_size = self.max_encoding_message_size;
2898                    let inner = self.inner.clone();
2899                    let fut = async move {
2900                        let method = ListAuditExportsSvc(inner);
2901                        let codec = tonic_prost::ProstCodec::default();
2902                        let mut grpc = tonic::server::Grpc::new(codec)
2903                            .apply_compression_config(
2904                                accept_compression_encodings,
2905                                send_compression_encodings,
2906                            )
2907                            .apply_max_message_size_config(
2908                                max_decoding_message_size,
2909                                max_encoding_message_size,
2910                            );
2911                        let res = grpc.unary(method, req).await;
2912                        Ok(res)
2913                    };
2914                    Box::pin(fut)
2915                }
2916                "/pidgr.v1.AuditService/Append" => {
2917                    #[allow(non_camel_case_types)]
2918                    struct AppendSvc<T: AuditService>(pub Arc<T>);
2919                    impl<
2920                        T: AuditService,
2921                    > tonic::server::UnaryService<super::AppendRequest>
2922                    for AppendSvc<T> {
2923                        type Response = super::AppendResponse;
2924                        type Future = BoxFuture<
2925                            tonic::Response<Self::Response>,
2926                            tonic::Status,
2927                        >;
2928                        fn call(
2929                            &mut self,
2930                            request: tonic::Request<super::AppendRequest>,
2931                        ) -> Self::Future {
2932                            let inner = Arc::clone(&self.0);
2933                            let fut = async move {
2934                                <T as AuditService>::append(&inner, request).await
2935                            };
2936                            Box::pin(fut)
2937                        }
2938                    }
2939                    let accept_compression_encodings = self.accept_compression_encodings;
2940                    let send_compression_encodings = self.send_compression_encodings;
2941                    let max_decoding_message_size = self.max_decoding_message_size;
2942                    let max_encoding_message_size = self.max_encoding_message_size;
2943                    let inner = self.inner.clone();
2944                    let fut = async move {
2945                        let method = AppendSvc(inner);
2946                        let codec = tonic_prost::ProstCodec::default();
2947                        let mut grpc = tonic::server::Grpc::new(codec)
2948                            .apply_compression_config(
2949                                accept_compression_encodings,
2950                                send_compression_encodings,
2951                            )
2952                            .apply_max_message_size_config(
2953                                max_decoding_message_size,
2954                                max_encoding_message_size,
2955                            );
2956                        let res = grpc.unary(method, req).await;
2957                        Ok(res)
2958                    };
2959                    Box::pin(fut)
2960                }
2961                _ => {
2962                    Box::pin(async move {
2963                        let mut response = http::Response::new(
2964                            tonic::body::Body::default(),
2965                        );
2966                        let headers = response.headers_mut();
2967                        headers
2968                            .insert(
2969                                tonic::Status::GRPC_STATUS,
2970                                (tonic::Code::Unimplemented as i32).into(),
2971                            );
2972                        headers
2973                            .insert(
2974                                http::header::CONTENT_TYPE,
2975                                tonic::metadata::GRPC_CONTENT_TYPE,
2976                            );
2977                        Ok(response)
2978                    })
2979                }
2980            }
2981        }
2982    }
2983    impl<T> Clone for AuditServiceServer<T> {
2984        fn clone(&self) -> Self {
2985            let inner = self.inner.clone();
2986            Self {
2987                inner,
2988                accept_compression_encodings: self.accept_compression_encodings,
2989                send_compression_encodings: self.send_compression_encodings,
2990                max_decoding_message_size: self.max_decoding_message_size,
2991                max_encoding_message_size: self.max_encoding_message_size,
2992            }
2993        }
2994    }
2995    /// Generated gRPC service name
2996    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2997    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2998        const NAME: &'static str = SERVICE_NAME;
2999    }
3000}
3001/// Generated client implementations.
3002pub mod authorization_service_client {
3003    #![allow(
3004        unused_variables,
3005        dead_code,
3006        missing_docs,
3007        clippy::wildcard_imports,
3008        clippy::let_unit_value,
3009    )]
3010    use tonic::codegen::*;
3011    use tonic::codegen::http::Uri;
3012    /** AuthorizationService resolves the effective permission set for a principal
3013 so a resource server can make authorization decisions without owning the
3014 role and permission data itself.
3015
3016 AUTH: INTERNAL service-to-service only. This service is served by the core
3017 API and called by other backend services. It MUST NOT be exposed on the
3018 public ingress to JWT-authenticated end-user clients.
3019*/
3020    #[derive(Debug, Clone)]
3021    pub struct AuthorizationServiceClient<T> {
3022        inner: tonic::client::Grpc<T>,
3023    }
3024    impl AuthorizationServiceClient<tonic::transport::Channel> {
3025        /// Attempt to create a new client by connecting to a given endpoint.
3026        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3027        where
3028            D: TryInto<tonic::transport::Endpoint>,
3029            D::Error: Into<StdError>,
3030        {
3031            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3032            Ok(Self::new(conn))
3033        }
3034    }
3035    impl<T> AuthorizationServiceClient<T>
3036    where
3037        T: tonic::client::GrpcService<tonic::body::Body>,
3038        T::Error: Into<StdError>,
3039        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3040        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3041    {
3042        pub fn new(inner: T) -> Self {
3043            let inner = tonic::client::Grpc::new(inner);
3044            Self { inner }
3045        }
3046        pub fn with_origin(inner: T, origin: Uri) -> Self {
3047            let inner = tonic::client::Grpc::with_origin(inner, origin);
3048            Self { inner }
3049        }
3050        pub fn with_interceptor<F>(
3051            inner: T,
3052            interceptor: F,
3053        ) -> AuthorizationServiceClient<InterceptedService<T, F>>
3054        where
3055            F: tonic::service::Interceptor,
3056            T::ResponseBody: Default,
3057            T: tonic::codegen::Service<
3058                http::Request<tonic::body::Body>,
3059                Response = http::Response<
3060                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3061                >,
3062            >,
3063            <T as tonic::codegen::Service<
3064                http::Request<tonic::body::Body>,
3065            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3066        {
3067            AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor))
3068        }
3069        /// Compress requests with the given encoding.
3070        ///
3071        /// This requires the server to support it otherwise it might respond with an
3072        /// error.
3073        #[must_use]
3074        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3075            self.inner = self.inner.send_compressed(encoding);
3076            self
3077        }
3078        /// Enable decompressing responses.
3079        #[must_use]
3080        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3081            self.inner = self.inner.accept_compressed(encoding);
3082            self
3083        }
3084        /// Limits the maximum size of a decoded message.
3085        ///
3086        /// Default: `4MB`
3087        #[must_use]
3088        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3089            self.inner = self.inner.max_decoding_message_size(limit);
3090            self
3091        }
3092        /// Limits the maximum size of an encoded message.
3093        ///
3094        /// Default: `usize::MAX`
3095        #[must_use]
3096        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3097            self.inner = self.inner.max_encoding_message_size(limit);
3098            self
3099        }
3100        /** Resolve the effective permissions for one (subject, org, principal type).
3101*/
3102        pub async fn resolve_principal_permissions(
3103            &mut self,
3104            request: impl tonic::IntoRequest<super::ResolvePrincipalPermissionsRequest>,
3105        ) -> std::result::Result<
3106            tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3107            tonic::Status,
3108        > {
3109            self.inner
3110                .ready()
3111                .await
3112                .map_err(|e| {
3113                    tonic::Status::unknown(
3114                        format!("Service was not ready: {}", e.into()),
3115                    )
3116                })?;
3117            let codec = tonic_prost::ProstCodec::default();
3118            let path = http::uri::PathAndQuery::from_static(
3119                "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions",
3120            );
3121            let mut req = request.into_request();
3122            req.extensions_mut()
3123                .insert(
3124                    GrpcMethod::new(
3125                        "pidgr.v1.AuthorizationService",
3126                        "ResolvePrincipalPermissions",
3127                    ),
3128                );
3129            self.inner.unary(req, path, codec).await
3130        }
3131    }
3132}
3133/// Generated server implementations.
3134pub mod authorization_service_server {
3135    #![allow(
3136        unused_variables,
3137        dead_code,
3138        missing_docs,
3139        clippy::wildcard_imports,
3140        clippy::let_unit_value,
3141    )]
3142    use tonic::codegen::*;
3143    /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer.
3144    #[async_trait]
3145    pub trait AuthorizationService: std::marker::Send + std::marker::Sync + 'static {
3146        /** Resolve the effective permissions for one (subject, org, principal type).
3147*/
3148        async fn resolve_principal_permissions(
3149            &self,
3150            request: tonic::Request<super::ResolvePrincipalPermissionsRequest>,
3151        ) -> std::result::Result<
3152            tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3153            tonic::Status,
3154        >;
3155    }
3156    /** AuthorizationService resolves the effective permission set for a principal
3157 so a resource server can make authorization decisions without owning the
3158 role and permission data itself.
3159
3160 AUTH: INTERNAL service-to-service only. This service is served by the core
3161 API and called by other backend services. It MUST NOT be exposed on the
3162 public ingress to JWT-authenticated end-user clients.
3163*/
3164    #[derive(Debug)]
3165    pub struct AuthorizationServiceServer<T> {
3166        inner: Arc<T>,
3167        accept_compression_encodings: EnabledCompressionEncodings,
3168        send_compression_encodings: EnabledCompressionEncodings,
3169        max_decoding_message_size: Option<usize>,
3170        max_encoding_message_size: Option<usize>,
3171    }
3172    impl<T> AuthorizationServiceServer<T> {
3173        pub fn new(inner: T) -> Self {
3174            Self::from_arc(Arc::new(inner))
3175        }
3176        pub fn from_arc(inner: Arc<T>) -> Self {
3177            Self {
3178                inner,
3179                accept_compression_encodings: Default::default(),
3180                send_compression_encodings: Default::default(),
3181                max_decoding_message_size: None,
3182                max_encoding_message_size: None,
3183            }
3184        }
3185        pub fn with_interceptor<F>(
3186            inner: T,
3187            interceptor: F,
3188        ) -> InterceptedService<Self, F>
3189        where
3190            F: tonic::service::Interceptor,
3191        {
3192            InterceptedService::new(Self::new(inner), interceptor)
3193        }
3194        /// Enable decompressing requests with the given encoding.
3195        #[must_use]
3196        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3197            self.accept_compression_encodings.enable(encoding);
3198            self
3199        }
3200        /// Compress responses with the given encoding, if the client supports it.
3201        #[must_use]
3202        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3203            self.send_compression_encodings.enable(encoding);
3204            self
3205        }
3206        /// Limits the maximum size of a decoded message.
3207        ///
3208        /// Default: `4MB`
3209        #[must_use]
3210        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3211            self.max_decoding_message_size = Some(limit);
3212            self
3213        }
3214        /// Limits the maximum size of an encoded message.
3215        ///
3216        /// Default: `usize::MAX`
3217        #[must_use]
3218        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3219            self.max_encoding_message_size = Some(limit);
3220            self
3221        }
3222    }
3223    impl<T, B> tonic::codegen::Service<http::Request<B>>
3224    for AuthorizationServiceServer<T>
3225    where
3226        T: AuthorizationService,
3227        B: Body + std::marker::Send + 'static,
3228        B::Error: Into<StdError> + std::marker::Send + 'static,
3229    {
3230        type Response = http::Response<tonic::body::Body>;
3231        type Error = std::convert::Infallible;
3232        type Future = BoxFuture<Self::Response, Self::Error>;
3233        fn poll_ready(
3234            &mut self,
3235            _cx: &mut Context<'_>,
3236        ) -> Poll<std::result::Result<(), Self::Error>> {
3237            Poll::Ready(Ok(()))
3238        }
3239        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3240            match req.uri().path() {
3241                "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions" => {
3242                    #[allow(non_camel_case_types)]
3243                    struct ResolvePrincipalPermissionsSvc<T: AuthorizationService>(
3244                        pub Arc<T>,
3245                    );
3246                    impl<
3247                        T: AuthorizationService,
3248                    > tonic::server::UnaryService<
3249                        super::ResolvePrincipalPermissionsRequest,
3250                    > for ResolvePrincipalPermissionsSvc<T> {
3251                        type Response = super::ResolvePrincipalPermissionsResponse;
3252                        type Future = BoxFuture<
3253                            tonic::Response<Self::Response>,
3254                            tonic::Status,
3255                        >;
3256                        fn call(
3257                            &mut self,
3258                            request: tonic::Request<
3259                                super::ResolvePrincipalPermissionsRequest,
3260                            >,
3261                        ) -> Self::Future {
3262                            let inner = Arc::clone(&self.0);
3263                            let fut = async move {
3264                                <T as AuthorizationService>::resolve_principal_permissions(
3265                                        &inner,
3266                                        request,
3267                                    )
3268                                    .await
3269                            };
3270                            Box::pin(fut)
3271                        }
3272                    }
3273                    let accept_compression_encodings = self.accept_compression_encodings;
3274                    let send_compression_encodings = self.send_compression_encodings;
3275                    let max_decoding_message_size = self.max_decoding_message_size;
3276                    let max_encoding_message_size = self.max_encoding_message_size;
3277                    let inner = self.inner.clone();
3278                    let fut = async move {
3279                        let method = ResolvePrincipalPermissionsSvc(inner);
3280                        let codec = tonic_prost::ProstCodec::default();
3281                        let mut grpc = tonic::server::Grpc::new(codec)
3282                            .apply_compression_config(
3283                                accept_compression_encodings,
3284                                send_compression_encodings,
3285                            )
3286                            .apply_max_message_size_config(
3287                                max_decoding_message_size,
3288                                max_encoding_message_size,
3289                            );
3290                        let res = grpc.unary(method, req).await;
3291                        Ok(res)
3292                    };
3293                    Box::pin(fut)
3294                }
3295                _ => {
3296                    Box::pin(async move {
3297                        let mut response = http::Response::new(
3298                            tonic::body::Body::default(),
3299                        );
3300                        let headers = response.headers_mut();
3301                        headers
3302                            .insert(
3303                                tonic::Status::GRPC_STATUS,
3304                                (tonic::Code::Unimplemented as i32).into(),
3305                            );
3306                        headers
3307                            .insert(
3308                                http::header::CONTENT_TYPE,
3309                                tonic::metadata::GRPC_CONTENT_TYPE,
3310                            );
3311                        Ok(response)
3312                    })
3313                }
3314            }
3315        }
3316    }
3317    impl<T> Clone for AuthorizationServiceServer<T> {
3318        fn clone(&self) -> Self {
3319            let inner = self.inner.clone();
3320            Self {
3321                inner,
3322                accept_compression_encodings: self.accept_compression_encodings,
3323                send_compression_encodings: self.send_compression_encodings,
3324                max_decoding_message_size: self.max_decoding_message_size,
3325                max_encoding_message_size: self.max_encoding_message_size,
3326            }
3327        }
3328    }
3329    /// Generated gRPC service name
3330    pub const SERVICE_NAME: &str = "pidgr.v1.AuthorizationService";
3331    impl<T> tonic::server::NamedService for AuthorizationServiceServer<T> {
3332        const NAME: &'static str = SERVICE_NAME;
3333    }
3334}
3335/// Generated client implementations.
3336pub mod campaign_service_client {
3337    #![allow(
3338        unused_variables,
3339        dead_code,
3340        missing_docs,
3341        clippy::wildcard_imports,
3342        clippy::let_unit_value,
3343    )]
3344    use tonic::codegen::*;
3345    use tonic::codegen::http::Uri;
3346    /** Manages the full lifecycle of communication campaigns — creation,
3347 execution, monitoring, and cancellation.
3348*/
3349    #[derive(Debug, Clone)]
3350    pub struct CampaignServiceClient<T> {
3351        inner: tonic::client::Grpc<T>,
3352    }
3353    impl CampaignServiceClient<tonic::transport::Channel> {
3354        /// Attempt to create a new client by connecting to a given endpoint.
3355        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3356        where
3357            D: TryInto<tonic::transport::Endpoint>,
3358            D::Error: Into<StdError>,
3359        {
3360            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3361            Ok(Self::new(conn))
3362        }
3363    }
3364    impl<T> CampaignServiceClient<T>
3365    where
3366        T: tonic::client::GrpcService<tonic::body::Body>,
3367        T::Error: Into<StdError>,
3368        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3369        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3370    {
3371        pub fn new(inner: T) -> Self {
3372            let inner = tonic::client::Grpc::new(inner);
3373            Self { inner }
3374        }
3375        pub fn with_origin(inner: T, origin: Uri) -> Self {
3376            let inner = tonic::client::Grpc::with_origin(inner, origin);
3377            Self { inner }
3378        }
3379        pub fn with_interceptor<F>(
3380            inner: T,
3381            interceptor: F,
3382        ) -> CampaignServiceClient<InterceptedService<T, F>>
3383        where
3384            F: tonic::service::Interceptor,
3385            T::ResponseBody: Default,
3386            T: tonic::codegen::Service<
3387                http::Request<tonic::body::Body>,
3388                Response = http::Response<
3389                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3390                >,
3391            >,
3392            <T as tonic::codegen::Service<
3393                http::Request<tonic::body::Body>,
3394            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3395        {
3396            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3397        }
3398        /// Compress requests with the given encoding.
3399        ///
3400        /// This requires the server to support it otherwise it might respond with an
3401        /// error.
3402        #[must_use]
3403        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3404            self.inner = self.inner.send_compressed(encoding);
3405            self
3406        }
3407        /// Enable decompressing responses.
3408        #[must_use]
3409        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3410            self.inner = self.inner.accept_compressed(encoding);
3411            self
3412        }
3413        /// Limits the maximum size of a decoded message.
3414        ///
3415        /// Default: `4MB`
3416        #[must_use]
3417        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3418            self.inner = self.inner.max_decoding_message_size(limit);
3419            self
3420        }
3421        /// Limits the maximum size of an encoded message.
3422        ///
3423        /// Default: `usize::MAX`
3424        #[must_use]
3425        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3426            self.inner = self.inner.max_encoding_message_size(limit);
3427            self
3428        }
3429        /** Create a new campaign with a template, audience, and workflow.
3430 Authorization: Requires MANAGER+ role.
3431*/
3432        pub async fn create_campaign(
3433            &mut self,
3434            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3435        ) -> std::result::Result<
3436            tonic::Response<super::CreateCampaignResponse>,
3437            tonic::Status,
3438        > {
3439            self.inner
3440                .ready()
3441                .await
3442                .map_err(|e| {
3443                    tonic::Status::unknown(
3444                        format!("Service was not ready: {}", e.into()),
3445                    )
3446                })?;
3447            let codec = tonic_prost::ProstCodec::default();
3448            let path = http::uri::PathAndQuery::from_static(
3449                "/pidgr.v1.CampaignService/CreateCampaign",
3450            );
3451            let mut req = request.into_request();
3452            req.extensions_mut()
3453                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3454            self.inner.unary(req, path, codec).await
3455        }
3456        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3457 Authorization: Requires MANAGER+ role.
3458*/
3459        pub async fn start_campaign(
3460            &mut self,
3461            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3462        ) -> std::result::Result<
3463            tonic::Response<super::StartCampaignResponse>,
3464            tonic::Status,
3465        > {
3466            self.inner
3467                .ready()
3468                .await
3469                .map_err(|e| {
3470                    tonic::Status::unknown(
3471                        format!("Service was not ready: {}", e.into()),
3472                    )
3473                })?;
3474            let codec = tonic_prost::ProstCodec::default();
3475            let path = http::uri::PathAndQuery::from_static(
3476                "/pidgr.v1.CampaignService/StartCampaign",
3477            );
3478            let mut req = request.into_request();
3479            req.extensions_mut()
3480                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3481            self.inner.unary(req, path, codec).await
3482        }
3483        /** Retrieve a single campaign by ID.
3484 Authorization: Authenticated user within the organization.
3485*/
3486        pub async fn get_campaign(
3487            &mut self,
3488            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3489        ) -> std::result::Result<
3490            tonic::Response<super::GetCampaignResponse>,
3491            tonic::Status,
3492        > {
3493            self.inner
3494                .ready()
3495                .await
3496                .map_err(|e| {
3497                    tonic::Status::unknown(
3498                        format!("Service was not ready: {}", e.into()),
3499                    )
3500                })?;
3501            let codec = tonic_prost::ProstCodec::default();
3502            let path = http::uri::PathAndQuery::from_static(
3503                "/pidgr.v1.CampaignService/GetCampaign",
3504            );
3505            let mut req = request.into_request();
3506            req.extensions_mut()
3507                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3508            self.inner.unary(req, path, codec).await
3509        }
3510        /** List campaigns for the organization with pagination.
3511 Authorization: Authenticated user within the organization.
3512*/
3513        pub async fn list_campaigns(
3514            &mut self,
3515            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3516        ) -> std::result::Result<
3517            tonic::Response<super::ListCampaignsResponse>,
3518            tonic::Status,
3519        > {
3520            self.inner
3521                .ready()
3522                .await
3523                .map_err(|e| {
3524                    tonic::Status::unknown(
3525                        format!("Service was not ready: {}", e.into()),
3526                    )
3527                })?;
3528            let codec = tonic_prost::ProstCodec::default();
3529            let path = http::uri::PathAndQuery::from_static(
3530                "/pidgr.v1.CampaignService/ListCampaigns",
3531            );
3532            let mut req = request.into_request();
3533            req.extensions_mut()
3534                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3535            self.inner.unary(req, path, codec).await
3536        }
3537        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3538 Authorization: Requires MANAGER+ role.
3539*/
3540        pub async fn update_campaign(
3541            &mut self,
3542            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3543        ) -> std::result::Result<
3544            tonic::Response<super::UpdateCampaignResponse>,
3545            tonic::Status,
3546        > {
3547            self.inner
3548                .ready()
3549                .await
3550                .map_err(|e| {
3551                    tonic::Status::unknown(
3552                        format!("Service was not ready: {}", e.into()),
3553                    )
3554                })?;
3555            let codec = tonic_prost::ProstCodec::default();
3556            let path = http::uri::PathAndQuery::from_static(
3557                "/pidgr.v1.CampaignService/UpdateCampaign",
3558            );
3559            let mut req = request.into_request();
3560            req.extensions_mut()
3561                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3562            self.inner.unary(req, path, codec).await
3563        }
3564        /** Cancel a running campaign, stopping further deliveries and reminders.
3565 Authorization: Requires MANAGER+ role.
3566*/
3567        pub async fn cancel_campaign(
3568            &mut self,
3569            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3570        ) -> std::result::Result<
3571            tonic::Response<super::CancelCampaignResponse>,
3572            tonic::Status,
3573        > {
3574            self.inner
3575                .ready()
3576                .await
3577                .map_err(|e| {
3578                    tonic::Status::unknown(
3579                        format!("Service was not ready: {}", e.into()),
3580                    )
3581                })?;
3582            let codec = tonic_prost::ProstCodec::default();
3583            let path = http::uri::PathAndQuery::from_static(
3584                "/pidgr.v1.CampaignService/CancelCampaign",
3585            );
3586            let mut req = request.into_request();
3587            req.extensions_mut()
3588                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3589            self.inner.unary(req, path, codec).await
3590        }
3591        /** List delivery records for a campaign, optionally filtered by status.
3592 Authorization: Authenticated user within the organization.
3593*/
3594        pub async fn list_deliveries(
3595            &mut self,
3596            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3597        ) -> std::result::Result<
3598            tonic::Response<super::ListDeliveriesResponse>,
3599            tonic::Status,
3600        > {
3601            self.inner
3602                .ready()
3603                .await
3604                .map_err(|e| {
3605                    tonic::Status::unknown(
3606                        format!("Service was not ready: {}", e.into()),
3607                    )
3608                })?;
3609            let codec = tonic_prost::ProstCodec::default();
3610            let path = http::uri::PathAndQuery::from_static(
3611                "/pidgr.v1.CampaignService/ListDeliveries",
3612            );
3613            let mut req = request.into_request();
3614            req.extensions_mut()
3615                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3616            self.inner.unary(req, path, codec).await
3617        }
3618        /** Break down a campaign's recipients by current archetype membership
3619 and return ack-rate per bucket, with k-anonymity gate applied.
3620 Only valid for campaigns whose originating_archetype is set.
3621 Authorization: Authenticated user within the organization.
3622*/
3623        pub async fn get_campaign_archetype_breakdown(
3624            &mut self,
3625            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3626        ) -> std::result::Result<
3627            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3628            tonic::Status,
3629        > {
3630            self.inner
3631                .ready()
3632                .await
3633                .map_err(|e| {
3634                    tonic::Status::unknown(
3635                        format!("Service was not ready: {}", e.into()),
3636                    )
3637                })?;
3638            let codec = tonic_prost::ProstCodec::default();
3639            let path = http::uri::PathAndQuery::from_static(
3640                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3641            );
3642            let mut req = request.into_request();
3643            req.extensions_mut()
3644                .insert(
3645                    GrpcMethod::new(
3646                        "pidgr.v1.CampaignService",
3647                        "GetCampaignArchetypeBreakdown",
3648                    ),
3649                );
3650            self.inner.unary(req, path, codec).await
3651        }
3652        /** Resolve a campaign's 8-character base62 short-code, lazily
3653 generating one on the first call. Stable for the campaign's
3654 lifetime; the same campaign always returns the same code.
3655 Authorization: Internal-service callers only (mTLS-gated). The
3656 dispatch layer calls this when assembling a third-party-channel
3657 deeplink.
3658*/
3659        pub async fn resolve_or_create_short_code(
3660            &mut self,
3661            request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3662        ) -> std::result::Result<
3663            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3664            tonic::Status,
3665        > {
3666            self.inner
3667                .ready()
3668                .await
3669                .map_err(|e| {
3670                    tonic::Status::unknown(
3671                        format!("Service was not ready: {}", e.into()),
3672                    )
3673                })?;
3674            let codec = tonic_prost::ProstCodec::default();
3675            let path = http::uri::PathAndQuery::from_static(
3676                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3677            );
3678            let mut req = request.into_request();
3679            req.extensions_mut()
3680                .insert(
3681                    GrpcMethod::new(
3682                        "pidgr.v1.CampaignService",
3683                        "ResolveOrCreateShortCode",
3684                    ),
3685                );
3686            self.inner.unary(req, path, codec).await
3687        }
3688        /** Look up a campaign by its short-code. Returns minimal, non-PII
3689 metadata sufficient for the native app to route a tapped
3690 third-party-channel deeplink to the correct campaign card and
3691 show org branding before the auth gate.
3692 Authorization: Unauthenticated. The short-code IS the lookup key;
3693 returned fields are already visible to the recipient via their
3694 inbox or the org's public profile.
3695*/
3696        pub async fn get_campaign_by_short_code(
3697            &mut self,
3698            request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3699        ) -> std::result::Result<
3700            tonic::Response<super::GetCampaignByShortCodeResponse>,
3701            tonic::Status,
3702        > {
3703            self.inner
3704                .ready()
3705                .await
3706                .map_err(|e| {
3707                    tonic::Status::unknown(
3708                        format!("Service was not ready: {}", e.into()),
3709                    )
3710                })?;
3711            let codec = tonic_prost::ProstCodec::default();
3712            let path = http::uri::PathAndQuery::from_static(
3713                "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3714            );
3715            let mut req = request.into_request();
3716            req.extensions_mut()
3717                .insert(
3718                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3719                );
3720            self.inner.unary(req, path, codec).await
3721        }
3722    }
3723}
3724/// Generated server implementations.
3725pub mod campaign_service_server {
3726    #![allow(
3727        unused_variables,
3728        dead_code,
3729        missing_docs,
3730        clippy::wildcard_imports,
3731        clippy::let_unit_value,
3732    )]
3733    use tonic::codegen::*;
3734    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3735    #[async_trait]
3736    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3737        /** Create a new campaign with a template, audience, and workflow.
3738 Authorization: Requires MANAGER+ role.
3739*/
3740        async fn create_campaign(
3741            &self,
3742            request: tonic::Request<super::CreateCampaignRequest>,
3743        ) -> std::result::Result<
3744            tonic::Response<super::CreateCampaignResponse>,
3745            tonic::Status,
3746        >;
3747        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3748 Authorization: Requires MANAGER+ role.
3749*/
3750        async fn start_campaign(
3751            &self,
3752            request: tonic::Request<super::StartCampaignRequest>,
3753        ) -> std::result::Result<
3754            tonic::Response<super::StartCampaignResponse>,
3755            tonic::Status,
3756        >;
3757        /** Retrieve a single campaign by ID.
3758 Authorization: Authenticated user within the organization.
3759*/
3760        async fn get_campaign(
3761            &self,
3762            request: tonic::Request<super::GetCampaignRequest>,
3763        ) -> std::result::Result<
3764            tonic::Response<super::GetCampaignResponse>,
3765            tonic::Status,
3766        >;
3767        /** List campaigns for the organization with pagination.
3768 Authorization: Authenticated user within the organization.
3769*/
3770        async fn list_campaigns(
3771            &self,
3772            request: tonic::Request<super::ListCampaignsRequest>,
3773        ) -> std::result::Result<
3774            tonic::Response<super::ListCampaignsResponse>,
3775            tonic::Status,
3776        >;
3777        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3778 Authorization: Requires MANAGER+ role.
3779*/
3780        async fn update_campaign(
3781            &self,
3782            request: tonic::Request<super::UpdateCampaignRequest>,
3783        ) -> std::result::Result<
3784            tonic::Response<super::UpdateCampaignResponse>,
3785            tonic::Status,
3786        >;
3787        /** Cancel a running campaign, stopping further deliveries and reminders.
3788 Authorization: Requires MANAGER+ role.
3789*/
3790        async fn cancel_campaign(
3791            &self,
3792            request: tonic::Request<super::CancelCampaignRequest>,
3793        ) -> std::result::Result<
3794            tonic::Response<super::CancelCampaignResponse>,
3795            tonic::Status,
3796        >;
3797        /** List delivery records for a campaign, optionally filtered by status.
3798 Authorization: Authenticated user within the organization.
3799*/
3800        async fn list_deliveries(
3801            &self,
3802            request: tonic::Request<super::ListDeliveriesRequest>,
3803        ) -> std::result::Result<
3804            tonic::Response<super::ListDeliveriesResponse>,
3805            tonic::Status,
3806        >;
3807        /** Break down a campaign's recipients by current archetype membership
3808 and return ack-rate per bucket, with k-anonymity gate applied.
3809 Only valid for campaigns whose originating_archetype is set.
3810 Authorization: Authenticated user within the organization.
3811*/
3812        async fn get_campaign_archetype_breakdown(
3813            &self,
3814            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3815        ) -> std::result::Result<
3816            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3817            tonic::Status,
3818        >;
3819        /** Resolve a campaign's 8-character base62 short-code, lazily
3820 generating one on the first call. Stable for the campaign's
3821 lifetime; the same campaign always returns the same code.
3822 Authorization: Internal-service callers only (mTLS-gated). The
3823 dispatch layer calls this when assembling a third-party-channel
3824 deeplink.
3825*/
3826        async fn resolve_or_create_short_code(
3827            &self,
3828            request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3829        ) -> std::result::Result<
3830            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3831            tonic::Status,
3832        >;
3833        /** Look up a campaign by its short-code. Returns minimal, non-PII
3834 metadata sufficient for the native app to route a tapped
3835 third-party-channel deeplink to the correct campaign card and
3836 show org branding before the auth gate.
3837 Authorization: Unauthenticated. The short-code IS the lookup key;
3838 returned fields are already visible to the recipient via their
3839 inbox or the org's public profile.
3840*/
3841        async fn get_campaign_by_short_code(
3842            &self,
3843            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3844        ) -> std::result::Result<
3845            tonic::Response<super::GetCampaignByShortCodeResponse>,
3846            tonic::Status,
3847        >;
3848    }
3849    /** Manages the full lifecycle of communication campaigns — creation,
3850 execution, monitoring, and cancellation.
3851*/
3852    #[derive(Debug)]
3853    pub struct CampaignServiceServer<T> {
3854        inner: Arc<T>,
3855        accept_compression_encodings: EnabledCompressionEncodings,
3856        send_compression_encodings: EnabledCompressionEncodings,
3857        max_decoding_message_size: Option<usize>,
3858        max_encoding_message_size: Option<usize>,
3859    }
3860    impl<T> CampaignServiceServer<T> {
3861        pub fn new(inner: T) -> Self {
3862            Self::from_arc(Arc::new(inner))
3863        }
3864        pub fn from_arc(inner: Arc<T>) -> Self {
3865            Self {
3866                inner,
3867                accept_compression_encodings: Default::default(),
3868                send_compression_encodings: Default::default(),
3869                max_decoding_message_size: None,
3870                max_encoding_message_size: None,
3871            }
3872        }
3873        pub fn with_interceptor<F>(
3874            inner: T,
3875            interceptor: F,
3876        ) -> InterceptedService<Self, F>
3877        where
3878            F: tonic::service::Interceptor,
3879        {
3880            InterceptedService::new(Self::new(inner), interceptor)
3881        }
3882        /// Enable decompressing requests with the given encoding.
3883        #[must_use]
3884        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3885            self.accept_compression_encodings.enable(encoding);
3886            self
3887        }
3888        /// Compress responses with the given encoding, if the client supports it.
3889        #[must_use]
3890        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3891            self.send_compression_encodings.enable(encoding);
3892            self
3893        }
3894        /// Limits the maximum size of a decoded message.
3895        ///
3896        /// Default: `4MB`
3897        #[must_use]
3898        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3899            self.max_decoding_message_size = Some(limit);
3900            self
3901        }
3902        /// Limits the maximum size of an encoded message.
3903        ///
3904        /// Default: `usize::MAX`
3905        #[must_use]
3906        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3907            self.max_encoding_message_size = Some(limit);
3908            self
3909        }
3910    }
3911    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3912    where
3913        T: CampaignService,
3914        B: Body + std::marker::Send + 'static,
3915        B::Error: Into<StdError> + std::marker::Send + 'static,
3916    {
3917        type Response = http::Response<tonic::body::Body>;
3918        type Error = std::convert::Infallible;
3919        type Future = BoxFuture<Self::Response, Self::Error>;
3920        fn poll_ready(
3921            &mut self,
3922            _cx: &mut Context<'_>,
3923        ) -> Poll<std::result::Result<(), Self::Error>> {
3924            Poll::Ready(Ok(()))
3925        }
3926        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3927            match req.uri().path() {
3928                "/pidgr.v1.CampaignService/CreateCampaign" => {
3929                    #[allow(non_camel_case_types)]
3930                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3931                    impl<
3932                        T: CampaignService,
3933                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3934                    for CreateCampaignSvc<T> {
3935                        type Response = super::CreateCampaignResponse;
3936                        type Future = BoxFuture<
3937                            tonic::Response<Self::Response>,
3938                            tonic::Status,
3939                        >;
3940                        fn call(
3941                            &mut self,
3942                            request: tonic::Request<super::CreateCampaignRequest>,
3943                        ) -> Self::Future {
3944                            let inner = Arc::clone(&self.0);
3945                            let fut = async move {
3946                                <T as CampaignService>::create_campaign(&inner, request)
3947                                    .await
3948                            };
3949                            Box::pin(fut)
3950                        }
3951                    }
3952                    let accept_compression_encodings = self.accept_compression_encodings;
3953                    let send_compression_encodings = self.send_compression_encodings;
3954                    let max_decoding_message_size = self.max_decoding_message_size;
3955                    let max_encoding_message_size = self.max_encoding_message_size;
3956                    let inner = self.inner.clone();
3957                    let fut = async move {
3958                        let method = CreateCampaignSvc(inner);
3959                        let codec = tonic_prost::ProstCodec::default();
3960                        let mut grpc = tonic::server::Grpc::new(codec)
3961                            .apply_compression_config(
3962                                accept_compression_encodings,
3963                                send_compression_encodings,
3964                            )
3965                            .apply_max_message_size_config(
3966                                max_decoding_message_size,
3967                                max_encoding_message_size,
3968                            );
3969                        let res = grpc.unary(method, req).await;
3970                        Ok(res)
3971                    };
3972                    Box::pin(fut)
3973                }
3974                "/pidgr.v1.CampaignService/StartCampaign" => {
3975                    #[allow(non_camel_case_types)]
3976                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3977                    impl<
3978                        T: CampaignService,
3979                    > tonic::server::UnaryService<super::StartCampaignRequest>
3980                    for StartCampaignSvc<T> {
3981                        type Response = super::StartCampaignResponse;
3982                        type Future = BoxFuture<
3983                            tonic::Response<Self::Response>,
3984                            tonic::Status,
3985                        >;
3986                        fn call(
3987                            &mut self,
3988                            request: tonic::Request<super::StartCampaignRequest>,
3989                        ) -> Self::Future {
3990                            let inner = Arc::clone(&self.0);
3991                            let fut = async move {
3992                                <T as CampaignService>::start_campaign(&inner, request)
3993                                    .await
3994                            };
3995                            Box::pin(fut)
3996                        }
3997                    }
3998                    let accept_compression_encodings = self.accept_compression_encodings;
3999                    let send_compression_encodings = self.send_compression_encodings;
4000                    let max_decoding_message_size = self.max_decoding_message_size;
4001                    let max_encoding_message_size = self.max_encoding_message_size;
4002                    let inner = self.inner.clone();
4003                    let fut = async move {
4004                        let method = StartCampaignSvc(inner);
4005                        let codec = tonic_prost::ProstCodec::default();
4006                        let mut grpc = tonic::server::Grpc::new(codec)
4007                            .apply_compression_config(
4008                                accept_compression_encodings,
4009                                send_compression_encodings,
4010                            )
4011                            .apply_max_message_size_config(
4012                                max_decoding_message_size,
4013                                max_encoding_message_size,
4014                            );
4015                        let res = grpc.unary(method, req).await;
4016                        Ok(res)
4017                    };
4018                    Box::pin(fut)
4019                }
4020                "/pidgr.v1.CampaignService/GetCampaign" => {
4021                    #[allow(non_camel_case_types)]
4022                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
4023                    impl<
4024                        T: CampaignService,
4025                    > tonic::server::UnaryService<super::GetCampaignRequest>
4026                    for GetCampaignSvc<T> {
4027                        type Response = super::GetCampaignResponse;
4028                        type Future = BoxFuture<
4029                            tonic::Response<Self::Response>,
4030                            tonic::Status,
4031                        >;
4032                        fn call(
4033                            &mut self,
4034                            request: tonic::Request<super::GetCampaignRequest>,
4035                        ) -> Self::Future {
4036                            let inner = Arc::clone(&self.0);
4037                            let fut = async move {
4038                                <T as CampaignService>::get_campaign(&inner, request).await
4039                            };
4040                            Box::pin(fut)
4041                        }
4042                    }
4043                    let accept_compression_encodings = self.accept_compression_encodings;
4044                    let send_compression_encodings = self.send_compression_encodings;
4045                    let max_decoding_message_size = self.max_decoding_message_size;
4046                    let max_encoding_message_size = self.max_encoding_message_size;
4047                    let inner = self.inner.clone();
4048                    let fut = async move {
4049                        let method = GetCampaignSvc(inner);
4050                        let codec = tonic_prost::ProstCodec::default();
4051                        let mut grpc = tonic::server::Grpc::new(codec)
4052                            .apply_compression_config(
4053                                accept_compression_encodings,
4054                                send_compression_encodings,
4055                            )
4056                            .apply_max_message_size_config(
4057                                max_decoding_message_size,
4058                                max_encoding_message_size,
4059                            );
4060                        let res = grpc.unary(method, req).await;
4061                        Ok(res)
4062                    };
4063                    Box::pin(fut)
4064                }
4065                "/pidgr.v1.CampaignService/ListCampaigns" => {
4066                    #[allow(non_camel_case_types)]
4067                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
4068                    impl<
4069                        T: CampaignService,
4070                    > tonic::server::UnaryService<super::ListCampaignsRequest>
4071                    for ListCampaignsSvc<T> {
4072                        type Response = super::ListCampaignsResponse;
4073                        type Future = BoxFuture<
4074                            tonic::Response<Self::Response>,
4075                            tonic::Status,
4076                        >;
4077                        fn call(
4078                            &mut self,
4079                            request: tonic::Request<super::ListCampaignsRequest>,
4080                        ) -> Self::Future {
4081                            let inner = Arc::clone(&self.0);
4082                            let fut = async move {
4083                                <T as CampaignService>::list_campaigns(&inner, request)
4084                                    .await
4085                            };
4086                            Box::pin(fut)
4087                        }
4088                    }
4089                    let accept_compression_encodings = self.accept_compression_encodings;
4090                    let send_compression_encodings = self.send_compression_encodings;
4091                    let max_decoding_message_size = self.max_decoding_message_size;
4092                    let max_encoding_message_size = self.max_encoding_message_size;
4093                    let inner = self.inner.clone();
4094                    let fut = async move {
4095                        let method = ListCampaignsSvc(inner);
4096                        let codec = tonic_prost::ProstCodec::default();
4097                        let mut grpc = tonic::server::Grpc::new(codec)
4098                            .apply_compression_config(
4099                                accept_compression_encodings,
4100                                send_compression_encodings,
4101                            )
4102                            .apply_max_message_size_config(
4103                                max_decoding_message_size,
4104                                max_encoding_message_size,
4105                            );
4106                        let res = grpc.unary(method, req).await;
4107                        Ok(res)
4108                    };
4109                    Box::pin(fut)
4110                }
4111                "/pidgr.v1.CampaignService/UpdateCampaign" => {
4112                    #[allow(non_camel_case_types)]
4113                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
4114                    impl<
4115                        T: CampaignService,
4116                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
4117                    for UpdateCampaignSvc<T> {
4118                        type Response = super::UpdateCampaignResponse;
4119                        type Future = BoxFuture<
4120                            tonic::Response<Self::Response>,
4121                            tonic::Status,
4122                        >;
4123                        fn call(
4124                            &mut self,
4125                            request: tonic::Request<super::UpdateCampaignRequest>,
4126                        ) -> Self::Future {
4127                            let inner = Arc::clone(&self.0);
4128                            let fut = async move {
4129                                <T as CampaignService>::update_campaign(&inner, request)
4130                                    .await
4131                            };
4132                            Box::pin(fut)
4133                        }
4134                    }
4135                    let accept_compression_encodings = self.accept_compression_encodings;
4136                    let send_compression_encodings = self.send_compression_encodings;
4137                    let max_decoding_message_size = self.max_decoding_message_size;
4138                    let max_encoding_message_size = self.max_encoding_message_size;
4139                    let inner = self.inner.clone();
4140                    let fut = async move {
4141                        let method = UpdateCampaignSvc(inner);
4142                        let codec = tonic_prost::ProstCodec::default();
4143                        let mut grpc = tonic::server::Grpc::new(codec)
4144                            .apply_compression_config(
4145                                accept_compression_encodings,
4146                                send_compression_encodings,
4147                            )
4148                            .apply_max_message_size_config(
4149                                max_decoding_message_size,
4150                                max_encoding_message_size,
4151                            );
4152                        let res = grpc.unary(method, req).await;
4153                        Ok(res)
4154                    };
4155                    Box::pin(fut)
4156                }
4157                "/pidgr.v1.CampaignService/CancelCampaign" => {
4158                    #[allow(non_camel_case_types)]
4159                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
4160                    impl<
4161                        T: CampaignService,
4162                    > tonic::server::UnaryService<super::CancelCampaignRequest>
4163                    for CancelCampaignSvc<T> {
4164                        type Response = super::CancelCampaignResponse;
4165                        type Future = BoxFuture<
4166                            tonic::Response<Self::Response>,
4167                            tonic::Status,
4168                        >;
4169                        fn call(
4170                            &mut self,
4171                            request: tonic::Request<super::CancelCampaignRequest>,
4172                        ) -> Self::Future {
4173                            let inner = Arc::clone(&self.0);
4174                            let fut = async move {
4175                                <T as CampaignService>::cancel_campaign(&inner, request)
4176                                    .await
4177                            };
4178                            Box::pin(fut)
4179                        }
4180                    }
4181                    let accept_compression_encodings = self.accept_compression_encodings;
4182                    let send_compression_encodings = self.send_compression_encodings;
4183                    let max_decoding_message_size = self.max_decoding_message_size;
4184                    let max_encoding_message_size = self.max_encoding_message_size;
4185                    let inner = self.inner.clone();
4186                    let fut = async move {
4187                        let method = CancelCampaignSvc(inner);
4188                        let codec = tonic_prost::ProstCodec::default();
4189                        let mut grpc = tonic::server::Grpc::new(codec)
4190                            .apply_compression_config(
4191                                accept_compression_encodings,
4192                                send_compression_encodings,
4193                            )
4194                            .apply_max_message_size_config(
4195                                max_decoding_message_size,
4196                                max_encoding_message_size,
4197                            );
4198                        let res = grpc.unary(method, req).await;
4199                        Ok(res)
4200                    };
4201                    Box::pin(fut)
4202                }
4203                "/pidgr.v1.CampaignService/ListDeliveries" => {
4204                    #[allow(non_camel_case_types)]
4205                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
4206                    impl<
4207                        T: CampaignService,
4208                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
4209                    for ListDeliveriesSvc<T> {
4210                        type Response = super::ListDeliveriesResponse;
4211                        type Future = BoxFuture<
4212                            tonic::Response<Self::Response>,
4213                            tonic::Status,
4214                        >;
4215                        fn call(
4216                            &mut self,
4217                            request: tonic::Request<super::ListDeliveriesRequest>,
4218                        ) -> Self::Future {
4219                            let inner = Arc::clone(&self.0);
4220                            let fut = async move {
4221                                <T as CampaignService>::list_deliveries(&inner, request)
4222                                    .await
4223                            };
4224                            Box::pin(fut)
4225                        }
4226                    }
4227                    let accept_compression_encodings = self.accept_compression_encodings;
4228                    let send_compression_encodings = self.send_compression_encodings;
4229                    let max_decoding_message_size = self.max_decoding_message_size;
4230                    let max_encoding_message_size = self.max_encoding_message_size;
4231                    let inner = self.inner.clone();
4232                    let fut = async move {
4233                        let method = ListDeliveriesSvc(inner);
4234                        let codec = tonic_prost::ProstCodec::default();
4235                        let mut grpc = tonic::server::Grpc::new(codec)
4236                            .apply_compression_config(
4237                                accept_compression_encodings,
4238                                send_compression_encodings,
4239                            )
4240                            .apply_max_message_size_config(
4241                                max_decoding_message_size,
4242                                max_encoding_message_size,
4243                            );
4244                        let res = grpc.unary(method, req).await;
4245                        Ok(res)
4246                    };
4247                    Box::pin(fut)
4248                }
4249                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
4250                    #[allow(non_camel_case_types)]
4251                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
4252                        pub Arc<T>,
4253                    );
4254                    impl<
4255                        T: CampaignService,
4256                    > tonic::server::UnaryService<
4257                        super::GetCampaignArchetypeBreakdownRequest,
4258                    > for GetCampaignArchetypeBreakdownSvc<T> {
4259                        type Response = super::GetCampaignArchetypeBreakdownResponse;
4260                        type Future = BoxFuture<
4261                            tonic::Response<Self::Response>,
4262                            tonic::Status,
4263                        >;
4264                        fn call(
4265                            &mut self,
4266                            request: tonic::Request<
4267                                super::GetCampaignArchetypeBreakdownRequest,
4268                            >,
4269                        ) -> Self::Future {
4270                            let inner = Arc::clone(&self.0);
4271                            let fut = async move {
4272                                <T as CampaignService>::get_campaign_archetype_breakdown(
4273                                        &inner,
4274                                        request,
4275                                    )
4276                                    .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 = GetCampaignArchetypeBreakdownSvc(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.CampaignService/ResolveOrCreateShortCode" => {
4304                    #[allow(non_camel_case_types)]
4305                    struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
4306                    impl<
4307                        T: CampaignService,
4308                    > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
4309                    for ResolveOrCreateShortCodeSvc<T> {
4310                        type Response = super::ResolveOrCreateShortCodeResponse;
4311                        type Future = BoxFuture<
4312                            tonic::Response<Self::Response>,
4313                            tonic::Status,
4314                        >;
4315                        fn call(
4316                            &mut self,
4317                            request: tonic::Request<
4318                                super::ResolveOrCreateShortCodeRequest,
4319                            >,
4320                        ) -> Self::Future {
4321                            let inner = Arc::clone(&self.0);
4322                            let fut = async move {
4323                                <T as CampaignService>::resolve_or_create_short_code(
4324                                        &inner,
4325                                        request,
4326                                    )
4327                                    .await
4328                            };
4329                            Box::pin(fut)
4330                        }
4331                    }
4332                    let accept_compression_encodings = self.accept_compression_encodings;
4333                    let send_compression_encodings = self.send_compression_encodings;
4334                    let max_decoding_message_size = self.max_decoding_message_size;
4335                    let max_encoding_message_size = self.max_encoding_message_size;
4336                    let inner = self.inner.clone();
4337                    let fut = async move {
4338                        let method = ResolveOrCreateShortCodeSvc(inner);
4339                        let codec = tonic_prost::ProstCodec::default();
4340                        let mut grpc = tonic::server::Grpc::new(codec)
4341                            .apply_compression_config(
4342                                accept_compression_encodings,
4343                                send_compression_encodings,
4344                            )
4345                            .apply_max_message_size_config(
4346                                max_decoding_message_size,
4347                                max_encoding_message_size,
4348                            );
4349                        let res = grpc.unary(method, req).await;
4350                        Ok(res)
4351                    };
4352                    Box::pin(fut)
4353                }
4354                "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
4355                    #[allow(non_camel_case_types)]
4356                    struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4357                    impl<
4358                        T: CampaignService,
4359                    > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4360                    for GetCampaignByShortCodeSvc<T> {
4361                        type Response = super::GetCampaignByShortCodeResponse;
4362                        type Future = BoxFuture<
4363                            tonic::Response<Self::Response>,
4364                            tonic::Status,
4365                        >;
4366                        fn call(
4367                            &mut self,
4368                            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4369                        ) -> Self::Future {
4370                            let inner = Arc::clone(&self.0);
4371                            let fut = async move {
4372                                <T as CampaignService>::get_campaign_by_short_code(
4373                                        &inner,
4374                                        request,
4375                                    )
4376                                    .await
4377                            };
4378                            Box::pin(fut)
4379                        }
4380                    }
4381                    let accept_compression_encodings = self.accept_compression_encodings;
4382                    let send_compression_encodings = self.send_compression_encodings;
4383                    let max_decoding_message_size = self.max_decoding_message_size;
4384                    let max_encoding_message_size = self.max_encoding_message_size;
4385                    let inner = self.inner.clone();
4386                    let fut = async move {
4387                        let method = GetCampaignByShortCodeSvc(inner);
4388                        let codec = tonic_prost::ProstCodec::default();
4389                        let mut grpc = tonic::server::Grpc::new(codec)
4390                            .apply_compression_config(
4391                                accept_compression_encodings,
4392                                send_compression_encodings,
4393                            )
4394                            .apply_max_message_size_config(
4395                                max_decoding_message_size,
4396                                max_encoding_message_size,
4397                            );
4398                        let res = grpc.unary(method, req).await;
4399                        Ok(res)
4400                    };
4401                    Box::pin(fut)
4402                }
4403                _ => {
4404                    Box::pin(async move {
4405                        let mut response = http::Response::new(
4406                            tonic::body::Body::default(),
4407                        );
4408                        let headers = response.headers_mut();
4409                        headers
4410                            .insert(
4411                                tonic::Status::GRPC_STATUS,
4412                                (tonic::Code::Unimplemented as i32).into(),
4413                            );
4414                        headers
4415                            .insert(
4416                                http::header::CONTENT_TYPE,
4417                                tonic::metadata::GRPC_CONTENT_TYPE,
4418                            );
4419                        Ok(response)
4420                    })
4421                }
4422            }
4423        }
4424    }
4425    impl<T> Clone for CampaignServiceServer<T> {
4426        fn clone(&self) -> Self {
4427            let inner = self.inner.clone();
4428            Self {
4429                inner,
4430                accept_compression_encodings: self.accept_compression_encodings,
4431                send_compression_encodings: self.send_compression_encodings,
4432                max_decoding_message_size: self.max_decoding_message_size,
4433                max_encoding_message_size: self.max_encoding_message_size,
4434            }
4435        }
4436    }
4437    /// Generated gRPC service name
4438    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4439    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4440        const NAME: &'static str = SERVICE_NAME;
4441    }
4442}
4443/// Generated client implementations.
4444pub mod device_service_client {
4445    #![allow(
4446        unused_variables,
4447        dead_code,
4448        missing_docs,
4449        clippy::wildcard_imports,
4450        clippy::let_unit_value,
4451    )]
4452    use tonic::codegen::*;
4453    use tonic::codegen::http::Uri;
4454    /** Manages push notification device registration.
4455 Used by the mobile app to register push tokens and manage device lifecycle.
4456*/
4457    #[derive(Debug, Clone)]
4458    pub struct DeviceServiceClient<T> {
4459        inner: tonic::client::Grpc<T>,
4460    }
4461    impl DeviceServiceClient<tonic::transport::Channel> {
4462        /// Attempt to create a new client by connecting to a given endpoint.
4463        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4464        where
4465            D: TryInto<tonic::transport::Endpoint>,
4466            D::Error: Into<StdError>,
4467        {
4468            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4469            Ok(Self::new(conn))
4470        }
4471    }
4472    impl<T> DeviceServiceClient<T>
4473    where
4474        T: tonic::client::GrpcService<tonic::body::Body>,
4475        T::Error: Into<StdError>,
4476        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4477        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4478    {
4479        pub fn new(inner: T) -> Self {
4480            let inner = tonic::client::Grpc::new(inner);
4481            Self { inner }
4482        }
4483        pub fn with_origin(inner: T, origin: Uri) -> Self {
4484            let inner = tonic::client::Grpc::with_origin(inner, origin);
4485            Self { inner }
4486        }
4487        pub fn with_interceptor<F>(
4488            inner: T,
4489            interceptor: F,
4490        ) -> DeviceServiceClient<InterceptedService<T, F>>
4491        where
4492            F: tonic::service::Interceptor,
4493            T::ResponseBody: Default,
4494            T: tonic::codegen::Service<
4495                http::Request<tonic::body::Body>,
4496                Response = http::Response<
4497                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4498                >,
4499            >,
4500            <T as tonic::codegen::Service<
4501                http::Request<tonic::body::Body>,
4502            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4503        {
4504            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4505        }
4506        /// Compress requests with the given encoding.
4507        ///
4508        /// This requires the server to support it otherwise it might respond with an
4509        /// error.
4510        #[must_use]
4511        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4512            self.inner = self.inner.send_compressed(encoding);
4513            self
4514        }
4515        /// Enable decompressing responses.
4516        #[must_use]
4517        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4518            self.inner = self.inner.accept_compressed(encoding);
4519            self
4520        }
4521        /// Limits the maximum size of a decoded message.
4522        ///
4523        /// Default: `4MB`
4524        #[must_use]
4525        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4526            self.inner = self.inner.max_decoding_message_size(limit);
4527            self
4528        }
4529        /// Limits the maximum size of an encoded message.
4530        ///
4531        /// Default: `usize::MAX`
4532        #[must_use]
4533        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4534            self.inner = self.inner.max_encoding_message_size(limit);
4535            self
4536        }
4537        /** Register a device with its push token for receiving notifications.
4538 Authorization: Authenticated user (own devices only).
4539*/
4540        pub async fn register(
4541            &mut self,
4542            request: impl tonic::IntoRequest<super::RegisterRequest>,
4543        ) -> std::result::Result<
4544            tonic::Response<super::RegisterResponse>,
4545            tonic::Status,
4546        > {
4547            self.inner
4548                .ready()
4549                .await
4550                .map_err(|e| {
4551                    tonic::Status::unknown(
4552                        format!("Service was not ready: {}", e.into()),
4553                    )
4554                })?;
4555            let codec = tonic_prost::ProstCodec::default();
4556            let path = http::uri::PathAndQuery::from_static(
4557                "/pidgr.v1.DeviceService/Register",
4558            );
4559            let mut req = request.into_request();
4560            req.extensions_mut()
4561                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4562            self.inner.unary(req, path, codec).await
4563        }
4564        /** Deactivate a device, preventing further push notifications.
4565 Authorization: Authenticated user (own devices only).
4566*/
4567        pub async fn deactivate(
4568            &mut self,
4569            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4570        ) -> std::result::Result<
4571            tonic::Response<super::DeactivateResponse>,
4572            tonic::Status,
4573        > {
4574            self.inner
4575                .ready()
4576                .await
4577                .map_err(|e| {
4578                    tonic::Status::unknown(
4579                        format!("Service was not ready: {}", e.into()),
4580                    )
4581                })?;
4582            let codec = tonic_prost::ProstCodec::default();
4583            let path = http::uri::PathAndQuery::from_static(
4584                "/pidgr.v1.DeviceService/Deactivate",
4585            );
4586            let mut req = request.into_request();
4587            req.extensions_mut()
4588                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4589            self.inner.unary(req, path, codec).await
4590        }
4591        /** List all devices registered to the authenticated user.
4592 Authorization: Authenticated user (own devices only).
4593*/
4594        pub async fn list_devices(
4595            &mut self,
4596            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4597        ) -> std::result::Result<
4598            tonic::Response<super::ListDevicesResponse>,
4599            tonic::Status,
4600        > {
4601            self.inner
4602                .ready()
4603                .await
4604                .map_err(|e| {
4605                    tonic::Status::unknown(
4606                        format!("Service was not ready: {}", e.into()),
4607                    )
4608                })?;
4609            let codec = tonic_prost::ProstCodec::default();
4610            let path = http::uri::PathAndQuery::from_static(
4611                "/pidgr.v1.DeviceService/ListDevices",
4612            );
4613            let mut req = request.into_request();
4614            req.extensions_mut()
4615                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4616            self.inner.unary(req, path, codec).await
4617        }
4618        /** List all devices for a specific organization member.
4619 Authorization: Requires MEMBERS_READ permission.
4620*/
4621        pub async fn list_member_devices(
4622            &mut self,
4623            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4624        ) -> std::result::Result<
4625            tonic::Response<super::ListMemberDevicesResponse>,
4626            tonic::Status,
4627        > {
4628            self.inner
4629                .ready()
4630                .await
4631                .map_err(|e| {
4632                    tonic::Status::unknown(
4633                        format!("Service was not ready: {}", e.into()),
4634                    )
4635                })?;
4636            let codec = tonic_prost::ProstCodec::default();
4637            let path = http::uri::PathAndQuery::from_static(
4638                "/pidgr.v1.DeviceService/ListMemberDevices",
4639            );
4640            let mut req = request.into_request();
4641            req.extensions_mut()
4642                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4643            self.inner.unary(req, path, codec).await
4644        }
4645    }
4646}
4647/// Generated server implementations.
4648pub mod device_service_server {
4649    #![allow(
4650        unused_variables,
4651        dead_code,
4652        missing_docs,
4653        clippy::wildcard_imports,
4654        clippy::let_unit_value,
4655    )]
4656    use tonic::codegen::*;
4657    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4658    #[async_trait]
4659    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4660        /** Register a device with its push token for receiving notifications.
4661 Authorization: Authenticated user (own devices only).
4662*/
4663        async fn register(
4664            &self,
4665            request: tonic::Request<super::RegisterRequest>,
4666        ) -> std::result::Result<
4667            tonic::Response<super::RegisterResponse>,
4668            tonic::Status,
4669        >;
4670        /** Deactivate a device, preventing further push notifications.
4671 Authorization: Authenticated user (own devices only).
4672*/
4673        async fn deactivate(
4674            &self,
4675            request: tonic::Request<super::DeactivateRequest>,
4676        ) -> std::result::Result<
4677            tonic::Response<super::DeactivateResponse>,
4678            tonic::Status,
4679        >;
4680        /** List all devices registered to the authenticated user.
4681 Authorization: Authenticated user (own devices only).
4682*/
4683        async fn list_devices(
4684            &self,
4685            request: tonic::Request<super::ListDevicesRequest>,
4686        ) -> std::result::Result<
4687            tonic::Response<super::ListDevicesResponse>,
4688            tonic::Status,
4689        >;
4690        /** List all devices for a specific organization member.
4691 Authorization: Requires MEMBERS_READ permission.
4692*/
4693        async fn list_member_devices(
4694            &self,
4695            request: tonic::Request<super::ListMemberDevicesRequest>,
4696        ) -> std::result::Result<
4697            tonic::Response<super::ListMemberDevicesResponse>,
4698            tonic::Status,
4699        >;
4700    }
4701    /** Manages push notification device registration.
4702 Used by the mobile app to register push tokens and manage device lifecycle.
4703*/
4704    #[derive(Debug)]
4705    pub struct DeviceServiceServer<T> {
4706        inner: Arc<T>,
4707        accept_compression_encodings: EnabledCompressionEncodings,
4708        send_compression_encodings: EnabledCompressionEncodings,
4709        max_decoding_message_size: Option<usize>,
4710        max_encoding_message_size: Option<usize>,
4711    }
4712    impl<T> DeviceServiceServer<T> {
4713        pub fn new(inner: T) -> Self {
4714            Self::from_arc(Arc::new(inner))
4715        }
4716        pub fn from_arc(inner: Arc<T>) -> Self {
4717            Self {
4718                inner,
4719                accept_compression_encodings: Default::default(),
4720                send_compression_encodings: Default::default(),
4721                max_decoding_message_size: None,
4722                max_encoding_message_size: None,
4723            }
4724        }
4725        pub fn with_interceptor<F>(
4726            inner: T,
4727            interceptor: F,
4728        ) -> InterceptedService<Self, F>
4729        where
4730            F: tonic::service::Interceptor,
4731        {
4732            InterceptedService::new(Self::new(inner), interceptor)
4733        }
4734        /// Enable decompressing requests with the given encoding.
4735        #[must_use]
4736        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4737            self.accept_compression_encodings.enable(encoding);
4738            self
4739        }
4740        /// Compress responses with the given encoding, if the client supports it.
4741        #[must_use]
4742        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4743            self.send_compression_encodings.enable(encoding);
4744            self
4745        }
4746        /// Limits the maximum size of a decoded message.
4747        ///
4748        /// Default: `4MB`
4749        #[must_use]
4750        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4751            self.max_decoding_message_size = Some(limit);
4752            self
4753        }
4754        /// Limits the maximum size of an encoded message.
4755        ///
4756        /// Default: `usize::MAX`
4757        #[must_use]
4758        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4759            self.max_encoding_message_size = Some(limit);
4760            self
4761        }
4762    }
4763    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4764    where
4765        T: DeviceService,
4766        B: Body + std::marker::Send + 'static,
4767        B::Error: Into<StdError> + std::marker::Send + 'static,
4768    {
4769        type Response = http::Response<tonic::body::Body>;
4770        type Error = std::convert::Infallible;
4771        type Future = BoxFuture<Self::Response, Self::Error>;
4772        fn poll_ready(
4773            &mut self,
4774            _cx: &mut Context<'_>,
4775        ) -> Poll<std::result::Result<(), Self::Error>> {
4776            Poll::Ready(Ok(()))
4777        }
4778        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4779            match req.uri().path() {
4780                "/pidgr.v1.DeviceService/Register" => {
4781                    #[allow(non_camel_case_types)]
4782                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4783                    impl<
4784                        T: DeviceService,
4785                    > tonic::server::UnaryService<super::RegisterRequest>
4786                    for RegisterSvc<T> {
4787                        type Response = super::RegisterResponse;
4788                        type Future = BoxFuture<
4789                            tonic::Response<Self::Response>,
4790                            tonic::Status,
4791                        >;
4792                        fn call(
4793                            &mut self,
4794                            request: tonic::Request<super::RegisterRequest>,
4795                        ) -> Self::Future {
4796                            let inner = Arc::clone(&self.0);
4797                            let fut = async move {
4798                                <T as DeviceService>::register(&inner, request).await
4799                            };
4800                            Box::pin(fut)
4801                        }
4802                    }
4803                    let accept_compression_encodings = self.accept_compression_encodings;
4804                    let send_compression_encodings = self.send_compression_encodings;
4805                    let max_decoding_message_size = self.max_decoding_message_size;
4806                    let max_encoding_message_size = self.max_encoding_message_size;
4807                    let inner = self.inner.clone();
4808                    let fut = async move {
4809                        let method = RegisterSvc(inner);
4810                        let codec = tonic_prost::ProstCodec::default();
4811                        let mut grpc = tonic::server::Grpc::new(codec)
4812                            .apply_compression_config(
4813                                accept_compression_encodings,
4814                                send_compression_encodings,
4815                            )
4816                            .apply_max_message_size_config(
4817                                max_decoding_message_size,
4818                                max_encoding_message_size,
4819                            );
4820                        let res = grpc.unary(method, req).await;
4821                        Ok(res)
4822                    };
4823                    Box::pin(fut)
4824                }
4825                "/pidgr.v1.DeviceService/Deactivate" => {
4826                    #[allow(non_camel_case_types)]
4827                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4828                    impl<
4829                        T: DeviceService,
4830                    > tonic::server::UnaryService<super::DeactivateRequest>
4831                    for DeactivateSvc<T> {
4832                        type Response = super::DeactivateResponse;
4833                        type Future = BoxFuture<
4834                            tonic::Response<Self::Response>,
4835                            tonic::Status,
4836                        >;
4837                        fn call(
4838                            &mut self,
4839                            request: tonic::Request<super::DeactivateRequest>,
4840                        ) -> Self::Future {
4841                            let inner = Arc::clone(&self.0);
4842                            let fut = async move {
4843                                <T as DeviceService>::deactivate(&inner, request).await
4844                            };
4845                            Box::pin(fut)
4846                        }
4847                    }
4848                    let accept_compression_encodings = self.accept_compression_encodings;
4849                    let send_compression_encodings = self.send_compression_encodings;
4850                    let max_decoding_message_size = self.max_decoding_message_size;
4851                    let max_encoding_message_size = self.max_encoding_message_size;
4852                    let inner = self.inner.clone();
4853                    let fut = async move {
4854                        let method = DeactivateSvc(inner);
4855                        let codec = tonic_prost::ProstCodec::default();
4856                        let mut grpc = tonic::server::Grpc::new(codec)
4857                            .apply_compression_config(
4858                                accept_compression_encodings,
4859                                send_compression_encodings,
4860                            )
4861                            .apply_max_message_size_config(
4862                                max_decoding_message_size,
4863                                max_encoding_message_size,
4864                            );
4865                        let res = grpc.unary(method, req).await;
4866                        Ok(res)
4867                    };
4868                    Box::pin(fut)
4869                }
4870                "/pidgr.v1.DeviceService/ListDevices" => {
4871                    #[allow(non_camel_case_types)]
4872                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4873                    impl<
4874                        T: DeviceService,
4875                    > tonic::server::UnaryService<super::ListDevicesRequest>
4876                    for ListDevicesSvc<T> {
4877                        type Response = super::ListDevicesResponse;
4878                        type Future = BoxFuture<
4879                            tonic::Response<Self::Response>,
4880                            tonic::Status,
4881                        >;
4882                        fn call(
4883                            &mut self,
4884                            request: tonic::Request<super::ListDevicesRequest>,
4885                        ) -> Self::Future {
4886                            let inner = Arc::clone(&self.0);
4887                            let fut = async move {
4888                                <T as DeviceService>::list_devices(&inner, request).await
4889                            };
4890                            Box::pin(fut)
4891                        }
4892                    }
4893                    let accept_compression_encodings = self.accept_compression_encodings;
4894                    let send_compression_encodings = self.send_compression_encodings;
4895                    let max_decoding_message_size = self.max_decoding_message_size;
4896                    let max_encoding_message_size = self.max_encoding_message_size;
4897                    let inner = self.inner.clone();
4898                    let fut = async move {
4899                        let method = ListDevicesSvc(inner);
4900                        let codec = tonic_prost::ProstCodec::default();
4901                        let mut grpc = tonic::server::Grpc::new(codec)
4902                            .apply_compression_config(
4903                                accept_compression_encodings,
4904                                send_compression_encodings,
4905                            )
4906                            .apply_max_message_size_config(
4907                                max_decoding_message_size,
4908                                max_encoding_message_size,
4909                            );
4910                        let res = grpc.unary(method, req).await;
4911                        Ok(res)
4912                    };
4913                    Box::pin(fut)
4914                }
4915                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4916                    #[allow(non_camel_case_types)]
4917                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4918                    impl<
4919                        T: DeviceService,
4920                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4921                    for ListMemberDevicesSvc<T> {
4922                        type Response = super::ListMemberDevicesResponse;
4923                        type Future = BoxFuture<
4924                            tonic::Response<Self::Response>,
4925                            tonic::Status,
4926                        >;
4927                        fn call(
4928                            &mut self,
4929                            request: tonic::Request<super::ListMemberDevicesRequest>,
4930                        ) -> Self::Future {
4931                            let inner = Arc::clone(&self.0);
4932                            let fut = async move {
4933                                <T as DeviceService>::list_member_devices(&inner, request)
4934                                    .await
4935                            };
4936                            Box::pin(fut)
4937                        }
4938                    }
4939                    let accept_compression_encodings = self.accept_compression_encodings;
4940                    let send_compression_encodings = self.send_compression_encodings;
4941                    let max_decoding_message_size = self.max_decoding_message_size;
4942                    let max_encoding_message_size = self.max_encoding_message_size;
4943                    let inner = self.inner.clone();
4944                    let fut = async move {
4945                        let method = ListMemberDevicesSvc(inner);
4946                        let codec = tonic_prost::ProstCodec::default();
4947                        let mut grpc = tonic::server::Grpc::new(codec)
4948                            .apply_compression_config(
4949                                accept_compression_encodings,
4950                                send_compression_encodings,
4951                            )
4952                            .apply_max_message_size_config(
4953                                max_decoding_message_size,
4954                                max_encoding_message_size,
4955                            );
4956                        let res = grpc.unary(method, req).await;
4957                        Ok(res)
4958                    };
4959                    Box::pin(fut)
4960                }
4961                _ => {
4962                    Box::pin(async move {
4963                        let mut response = http::Response::new(
4964                            tonic::body::Body::default(),
4965                        );
4966                        let headers = response.headers_mut();
4967                        headers
4968                            .insert(
4969                                tonic::Status::GRPC_STATUS,
4970                                (tonic::Code::Unimplemented as i32).into(),
4971                            );
4972                        headers
4973                            .insert(
4974                                http::header::CONTENT_TYPE,
4975                                tonic::metadata::GRPC_CONTENT_TYPE,
4976                            );
4977                        Ok(response)
4978                    })
4979                }
4980            }
4981        }
4982    }
4983    impl<T> Clone for DeviceServiceServer<T> {
4984        fn clone(&self) -> Self {
4985            let inner = self.inner.clone();
4986            Self {
4987                inner,
4988                accept_compression_encodings: self.accept_compression_encodings,
4989                send_compression_encodings: self.send_compression_encodings,
4990                max_decoding_message_size: self.max_decoding_message_size,
4991                max_encoding_message_size: self.max_encoding_message_size,
4992            }
4993        }
4994    }
4995    /// Generated gRPC service name
4996    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4997    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4998        const NAME: &'static str = SERVICE_NAME;
4999    }
5000}
5001/// Generated client implementations.
5002pub mod group_service_client {
5003    #![allow(
5004        unused_variables,
5005        dead_code,
5006        missing_docs,
5007        clippy::wildcard_imports,
5008        clippy::let_unit_value,
5009    )]
5010    use tonic::codegen::*;
5011    use tonic::codegen::http::Uri;
5012    /** Manages groups and group membership within an organization.
5013 Groups are recipient collections used for campaign audience targeting.
5014 All RPCs operate within the caller's org (extracted from JWT).
5015*/
5016    #[derive(Debug, Clone)]
5017    pub struct GroupServiceClient<T> {
5018        inner: tonic::client::Grpc<T>,
5019    }
5020    impl GroupServiceClient<tonic::transport::Channel> {
5021        /// Attempt to create a new client by connecting to a given endpoint.
5022        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5023        where
5024            D: TryInto<tonic::transport::Endpoint>,
5025            D::Error: Into<StdError>,
5026        {
5027            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5028            Ok(Self::new(conn))
5029        }
5030    }
5031    impl<T> GroupServiceClient<T>
5032    where
5033        T: tonic::client::GrpcService<tonic::body::Body>,
5034        T::Error: Into<StdError>,
5035        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5036        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5037    {
5038        pub fn new(inner: T) -> Self {
5039            let inner = tonic::client::Grpc::new(inner);
5040            Self { inner }
5041        }
5042        pub fn with_origin(inner: T, origin: Uri) -> Self {
5043            let inner = tonic::client::Grpc::with_origin(inner, origin);
5044            Self { inner }
5045        }
5046        pub fn with_interceptor<F>(
5047            inner: T,
5048            interceptor: F,
5049        ) -> GroupServiceClient<InterceptedService<T, F>>
5050        where
5051            F: tonic::service::Interceptor,
5052            T::ResponseBody: Default,
5053            T: tonic::codegen::Service<
5054                http::Request<tonic::body::Body>,
5055                Response = http::Response<
5056                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5057                >,
5058            >,
5059            <T as tonic::codegen::Service<
5060                http::Request<tonic::body::Body>,
5061            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5062        {
5063            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
5064        }
5065        /// Compress requests with the given encoding.
5066        ///
5067        /// This requires the server to support it otherwise it might respond with an
5068        /// error.
5069        #[must_use]
5070        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5071            self.inner = self.inner.send_compressed(encoding);
5072            self
5073        }
5074        /// Enable decompressing responses.
5075        #[must_use]
5076        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5077            self.inner = self.inner.accept_compressed(encoding);
5078            self
5079        }
5080        /// Limits the maximum size of a decoded message.
5081        ///
5082        /// Default: `4MB`
5083        #[must_use]
5084        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5085            self.inner = self.inner.max_decoding_message_size(limit);
5086            self
5087        }
5088        /// Limits the maximum size of an encoded message.
5089        ///
5090        /// Default: `usize::MAX`
5091        #[must_use]
5092        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5093            self.inner = self.inner.max_encoding_message_size(limit);
5094            self
5095        }
5096        /** Create a new group in the organization.
5097 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5098*/
5099        pub async fn create_group(
5100            &mut self,
5101            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
5102        ) -> std::result::Result<
5103            tonic::Response<super::CreateGroupResponse>,
5104            tonic::Status,
5105        > {
5106            self.inner
5107                .ready()
5108                .await
5109                .map_err(|e| {
5110                    tonic::Status::unknown(
5111                        format!("Service was not ready: {}", e.into()),
5112                    )
5113                })?;
5114            let codec = tonic_prost::ProstCodec::default();
5115            let path = http::uri::PathAndQuery::from_static(
5116                "/pidgr.v1.GroupService/CreateGroup",
5117            );
5118            let mut req = request.into_request();
5119            req.extensions_mut()
5120                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
5121            self.inner.unary(req, path, codec).await
5122        }
5123        /** Retrieve a group by ID.
5124 Authorization: Caller must be a member of the group, or have
5125 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5126*/
5127        pub async fn get_group(
5128            &mut self,
5129            request: impl tonic::IntoRequest<super::GetGroupRequest>,
5130        ) -> std::result::Result<
5131            tonic::Response<super::GetGroupResponse>,
5132            tonic::Status,
5133        > {
5134            self.inner
5135                .ready()
5136                .await
5137                .map_err(|e| {
5138                    tonic::Status::unknown(
5139                        format!("Service was not ready: {}", e.into()),
5140                    )
5141                })?;
5142            let codec = tonic_prost::ProstCodec::default();
5143            let path = http::uri::PathAndQuery::from_static(
5144                "/pidgr.v1.GroupService/GetGroup",
5145            );
5146            let mut req = request.into_request();
5147            req.extensions_mut()
5148                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
5149            self.inner.unary(req, path, codec).await
5150        }
5151        /** List groups in the organization with pagination.
5152 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5153*/
5154        pub async fn list_groups(
5155            &mut self,
5156            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
5157        ) -> std::result::Result<
5158            tonic::Response<super::ListGroupsResponse>,
5159            tonic::Status,
5160        > {
5161            self.inner
5162                .ready()
5163                .await
5164                .map_err(|e| {
5165                    tonic::Status::unknown(
5166                        format!("Service was not ready: {}", e.into()),
5167                    )
5168                })?;
5169            let codec = tonic_prost::ProstCodec::default();
5170            let path = http::uri::PathAndQuery::from_static(
5171                "/pidgr.v1.GroupService/ListGroups",
5172            );
5173            let mut req = request.into_request();
5174            req.extensions_mut()
5175                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
5176            self.inner.unary(req, path, codec).await
5177        }
5178        /** Update a group's name and/or description.
5179 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5180*/
5181        pub async fn update_group(
5182            &mut self,
5183            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
5184        ) -> std::result::Result<
5185            tonic::Response<super::UpdateGroupResponse>,
5186            tonic::Status,
5187        > {
5188            self.inner
5189                .ready()
5190                .await
5191                .map_err(|e| {
5192                    tonic::Status::unknown(
5193                        format!("Service was not ready: {}", e.into()),
5194                    )
5195                })?;
5196            let codec = tonic_prost::ProstCodec::default();
5197            let path = http::uri::PathAndQuery::from_static(
5198                "/pidgr.v1.GroupService/UpdateGroup",
5199            );
5200            let mut req = request.into_request();
5201            req.extensions_mut()
5202                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
5203            self.inner.unary(req, path, codec).await
5204        }
5205        /** Delete a group and all its membership records. Default groups cannot be deleted.
5206 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5207*/
5208        pub async fn delete_group(
5209            &mut self,
5210            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
5211        ) -> std::result::Result<
5212            tonic::Response<super::DeleteGroupResponse>,
5213            tonic::Status,
5214        > {
5215            self.inner
5216                .ready()
5217                .await
5218                .map_err(|e| {
5219                    tonic::Status::unknown(
5220                        format!("Service was not ready: {}", e.into()),
5221                    )
5222                })?;
5223            let codec = tonic_prost::ProstCodec::default();
5224            let path = http::uri::PathAndQuery::from_static(
5225                "/pidgr.v1.GroupService/DeleteGroup",
5226            );
5227            let mut req = request.into_request();
5228            req.extensions_mut()
5229                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
5230            self.inner.unary(req, path, codec).await
5231        }
5232        /** Add one or more users to a group (idempotent).
5233 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5234*/
5235        pub async fn add_group_members(
5236            &mut self,
5237            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
5238        ) -> std::result::Result<
5239            tonic::Response<super::AddGroupMembersResponse>,
5240            tonic::Status,
5241        > {
5242            self.inner
5243                .ready()
5244                .await
5245                .map_err(|e| {
5246                    tonic::Status::unknown(
5247                        format!("Service was not ready: {}", e.into()),
5248                    )
5249                })?;
5250            let codec = tonic_prost::ProstCodec::default();
5251            let path = http::uri::PathAndQuery::from_static(
5252                "/pidgr.v1.GroupService/AddGroupMembers",
5253            );
5254            let mut req = request.into_request();
5255            req.extensions_mut()
5256                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
5257            self.inner.unary(req, path, codec).await
5258        }
5259        /** Remove one or more users from a group (idempotent).
5260 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5261*/
5262        pub async fn remove_group_members(
5263            &mut self,
5264            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
5265        ) -> std::result::Result<
5266            tonic::Response<super::RemoveGroupMembersResponse>,
5267            tonic::Status,
5268        > {
5269            self.inner
5270                .ready()
5271                .await
5272                .map_err(|e| {
5273                    tonic::Status::unknown(
5274                        format!("Service was not ready: {}", e.into()),
5275                    )
5276                })?;
5277            let codec = tonic_prost::ProstCodec::default();
5278            let path = http::uri::PathAndQuery::from_static(
5279                "/pidgr.v1.GroupService/RemoveGroupMembers",
5280            );
5281            let mut req = request.into_request();
5282            req.extensions_mut()
5283                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
5284            self.inner.unary(req, path, codec).await
5285        }
5286        /** List members of a group with pagination.
5287 Authorization: Caller must be a member of the group, or have
5288 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5289*/
5290        pub async fn list_group_members(
5291            &mut self,
5292            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
5293        ) -> std::result::Result<
5294            tonic::Response<super::ListGroupMembersResponse>,
5295            tonic::Status,
5296        > {
5297            self.inner
5298                .ready()
5299                .await
5300                .map_err(|e| {
5301                    tonic::Status::unknown(
5302                        format!("Service was not ready: {}", e.into()),
5303                    )
5304                })?;
5305            let codec = tonic_prost::ProstCodec::default();
5306            let path = http::uri::PathAndQuery::from_static(
5307                "/pidgr.v1.GroupService/ListGroupMembers",
5308            );
5309            let mut req = request.into_request();
5310            req.extensions_mut()
5311                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
5312            self.inner.unary(req, path, codec).await
5313        }
5314        /** Get group memberships for a batch of users.
5315 Used by campaign audience to show group badges.
5316 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5317*/
5318        pub async fn get_user_group_memberships(
5319            &mut self,
5320            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
5321        ) -> std::result::Result<
5322            tonic::Response<super::GetUserGroupMembershipsResponse>,
5323            tonic::Status,
5324        > {
5325            self.inner
5326                .ready()
5327                .await
5328                .map_err(|e| {
5329                    tonic::Status::unknown(
5330                        format!("Service was not ready: {}", e.into()),
5331                    )
5332                })?;
5333            let codec = tonic_prost::ProstCodec::default();
5334            let path = http::uri::PathAndQuery::from_static(
5335                "/pidgr.v1.GroupService/GetUserGroupMemberships",
5336            );
5337            let mut req = request.into_request();
5338            req.extensions_mut()
5339                .insert(
5340                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5341                );
5342            self.inner.unary(req, path, codec).await
5343        }
5344    }
5345}
5346/// Generated server implementations.
5347pub mod group_service_server {
5348    #![allow(
5349        unused_variables,
5350        dead_code,
5351        missing_docs,
5352        clippy::wildcard_imports,
5353        clippy::let_unit_value,
5354    )]
5355    use tonic::codegen::*;
5356    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
5357    #[async_trait]
5358    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5359        /** Create a new group in the organization.
5360 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5361*/
5362        async fn create_group(
5363            &self,
5364            request: tonic::Request<super::CreateGroupRequest>,
5365        ) -> std::result::Result<
5366            tonic::Response<super::CreateGroupResponse>,
5367            tonic::Status,
5368        >;
5369        /** Retrieve a group by ID.
5370 Authorization: Caller must be a member of the group, or have
5371 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5372*/
5373        async fn get_group(
5374            &self,
5375            request: tonic::Request<super::GetGroupRequest>,
5376        ) -> std::result::Result<
5377            tonic::Response<super::GetGroupResponse>,
5378            tonic::Status,
5379        >;
5380        /** List groups in the organization with pagination.
5381 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5382*/
5383        async fn list_groups(
5384            &self,
5385            request: tonic::Request<super::ListGroupsRequest>,
5386        ) -> std::result::Result<
5387            tonic::Response<super::ListGroupsResponse>,
5388            tonic::Status,
5389        >;
5390        /** Update a group's name and/or description.
5391 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5392*/
5393        async fn update_group(
5394            &self,
5395            request: tonic::Request<super::UpdateGroupRequest>,
5396        ) -> std::result::Result<
5397            tonic::Response<super::UpdateGroupResponse>,
5398            tonic::Status,
5399        >;
5400        /** Delete a group and all its membership records. Default groups cannot be deleted.
5401 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5402*/
5403        async fn delete_group(
5404            &self,
5405            request: tonic::Request<super::DeleteGroupRequest>,
5406        ) -> std::result::Result<
5407            tonic::Response<super::DeleteGroupResponse>,
5408            tonic::Status,
5409        >;
5410        /** Add one or more users to a group (idempotent).
5411 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5412*/
5413        async fn add_group_members(
5414            &self,
5415            request: tonic::Request<super::AddGroupMembersRequest>,
5416        ) -> std::result::Result<
5417            tonic::Response<super::AddGroupMembersResponse>,
5418            tonic::Status,
5419        >;
5420        /** Remove one or more users from a group (idempotent).
5421 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5422*/
5423        async fn remove_group_members(
5424            &self,
5425            request: tonic::Request<super::RemoveGroupMembersRequest>,
5426        ) -> std::result::Result<
5427            tonic::Response<super::RemoveGroupMembersResponse>,
5428            tonic::Status,
5429        >;
5430        /** List members of a group with pagination.
5431 Authorization: Caller must be a member of the group, or have
5432 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5433*/
5434        async fn list_group_members(
5435            &self,
5436            request: tonic::Request<super::ListGroupMembersRequest>,
5437        ) -> std::result::Result<
5438            tonic::Response<super::ListGroupMembersResponse>,
5439            tonic::Status,
5440        >;
5441        /** Get group memberships for a batch of users.
5442 Used by campaign audience to show group badges.
5443 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5444*/
5445        async fn get_user_group_memberships(
5446            &self,
5447            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5448        ) -> std::result::Result<
5449            tonic::Response<super::GetUserGroupMembershipsResponse>,
5450            tonic::Status,
5451        >;
5452    }
5453    /** Manages groups and group membership within an organization.
5454 Groups are recipient collections used for campaign audience targeting.
5455 All RPCs operate within the caller's org (extracted from JWT).
5456*/
5457    #[derive(Debug)]
5458    pub struct GroupServiceServer<T> {
5459        inner: Arc<T>,
5460        accept_compression_encodings: EnabledCompressionEncodings,
5461        send_compression_encodings: EnabledCompressionEncodings,
5462        max_decoding_message_size: Option<usize>,
5463        max_encoding_message_size: Option<usize>,
5464    }
5465    impl<T> GroupServiceServer<T> {
5466        pub fn new(inner: T) -> Self {
5467            Self::from_arc(Arc::new(inner))
5468        }
5469        pub fn from_arc(inner: Arc<T>) -> Self {
5470            Self {
5471                inner,
5472                accept_compression_encodings: Default::default(),
5473                send_compression_encodings: Default::default(),
5474                max_decoding_message_size: None,
5475                max_encoding_message_size: None,
5476            }
5477        }
5478        pub fn with_interceptor<F>(
5479            inner: T,
5480            interceptor: F,
5481        ) -> InterceptedService<Self, F>
5482        where
5483            F: tonic::service::Interceptor,
5484        {
5485            InterceptedService::new(Self::new(inner), interceptor)
5486        }
5487        /// Enable decompressing requests with the given encoding.
5488        #[must_use]
5489        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5490            self.accept_compression_encodings.enable(encoding);
5491            self
5492        }
5493        /// Compress responses with the given encoding, if the client supports it.
5494        #[must_use]
5495        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5496            self.send_compression_encodings.enable(encoding);
5497            self
5498        }
5499        /// Limits the maximum size of a decoded message.
5500        ///
5501        /// Default: `4MB`
5502        #[must_use]
5503        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5504            self.max_decoding_message_size = Some(limit);
5505            self
5506        }
5507        /// Limits the maximum size of an encoded message.
5508        ///
5509        /// Default: `usize::MAX`
5510        #[must_use]
5511        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5512            self.max_encoding_message_size = Some(limit);
5513            self
5514        }
5515    }
5516    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5517    where
5518        T: GroupService,
5519        B: Body + std::marker::Send + 'static,
5520        B::Error: Into<StdError> + std::marker::Send + 'static,
5521    {
5522        type Response = http::Response<tonic::body::Body>;
5523        type Error = std::convert::Infallible;
5524        type Future = BoxFuture<Self::Response, Self::Error>;
5525        fn poll_ready(
5526            &mut self,
5527            _cx: &mut Context<'_>,
5528        ) -> Poll<std::result::Result<(), Self::Error>> {
5529            Poll::Ready(Ok(()))
5530        }
5531        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5532            match req.uri().path() {
5533                "/pidgr.v1.GroupService/CreateGroup" => {
5534                    #[allow(non_camel_case_types)]
5535                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5536                    impl<
5537                        T: GroupService,
5538                    > tonic::server::UnaryService<super::CreateGroupRequest>
5539                    for CreateGroupSvc<T> {
5540                        type Response = super::CreateGroupResponse;
5541                        type Future = BoxFuture<
5542                            tonic::Response<Self::Response>,
5543                            tonic::Status,
5544                        >;
5545                        fn call(
5546                            &mut self,
5547                            request: tonic::Request<super::CreateGroupRequest>,
5548                        ) -> Self::Future {
5549                            let inner = Arc::clone(&self.0);
5550                            let fut = async move {
5551                                <T as GroupService>::create_group(&inner, request).await
5552                            };
5553                            Box::pin(fut)
5554                        }
5555                    }
5556                    let accept_compression_encodings = self.accept_compression_encodings;
5557                    let send_compression_encodings = self.send_compression_encodings;
5558                    let max_decoding_message_size = self.max_decoding_message_size;
5559                    let max_encoding_message_size = self.max_encoding_message_size;
5560                    let inner = self.inner.clone();
5561                    let fut = async move {
5562                        let method = CreateGroupSvc(inner);
5563                        let codec = tonic_prost::ProstCodec::default();
5564                        let mut grpc = tonic::server::Grpc::new(codec)
5565                            .apply_compression_config(
5566                                accept_compression_encodings,
5567                                send_compression_encodings,
5568                            )
5569                            .apply_max_message_size_config(
5570                                max_decoding_message_size,
5571                                max_encoding_message_size,
5572                            );
5573                        let res = grpc.unary(method, req).await;
5574                        Ok(res)
5575                    };
5576                    Box::pin(fut)
5577                }
5578                "/pidgr.v1.GroupService/GetGroup" => {
5579                    #[allow(non_camel_case_types)]
5580                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5581                    impl<
5582                        T: GroupService,
5583                    > tonic::server::UnaryService<super::GetGroupRequest>
5584                    for GetGroupSvc<T> {
5585                        type Response = super::GetGroupResponse;
5586                        type Future = BoxFuture<
5587                            tonic::Response<Self::Response>,
5588                            tonic::Status,
5589                        >;
5590                        fn call(
5591                            &mut self,
5592                            request: tonic::Request<super::GetGroupRequest>,
5593                        ) -> Self::Future {
5594                            let inner = Arc::clone(&self.0);
5595                            let fut = async move {
5596                                <T as GroupService>::get_group(&inner, request).await
5597                            };
5598                            Box::pin(fut)
5599                        }
5600                    }
5601                    let accept_compression_encodings = self.accept_compression_encodings;
5602                    let send_compression_encodings = self.send_compression_encodings;
5603                    let max_decoding_message_size = self.max_decoding_message_size;
5604                    let max_encoding_message_size = self.max_encoding_message_size;
5605                    let inner = self.inner.clone();
5606                    let fut = async move {
5607                        let method = GetGroupSvc(inner);
5608                        let codec = tonic_prost::ProstCodec::default();
5609                        let mut grpc = tonic::server::Grpc::new(codec)
5610                            .apply_compression_config(
5611                                accept_compression_encodings,
5612                                send_compression_encodings,
5613                            )
5614                            .apply_max_message_size_config(
5615                                max_decoding_message_size,
5616                                max_encoding_message_size,
5617                            );
5618                        let res = grpc.unary(method, req).await;
5619                        Ok(res)
5620                    };
5621                    Box::pin(fut)
5622                }
5623                "/pidgr.v1.GroupService/ListGroups" => {
5624                    #[allow(non_camel_case_types)]
5625                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5626                    impl<
5627                        T: GroupService,
5628                    > tonic::server::UnaryService<super::ListGroupsRequest>
5629                    for ListGroupsSvc<T> {
5630                        type Response = super::ListGroupsResponse;
5631                        type Future = BoxFuture<
5632                            tonic::Response<Self::Response>,
5633                            tonic::Status,
5634                        >;
5635                        fn call(
5636                            &mut self,
5637                            request: tonic::Request<super::ListGroupsRequest>,
5638                        ) -> Self::Future {
5639                            let inner = Arc::clone(&self.0);
5640                            let fut = async move {
5641                                <T as GroupService>::list_groups(&inner, request).await
5642                            };
5643                            Box::pin(fut)
5644                        }
5645                    }
5646                    let accept_compression_encodings = self.accept_compression_encodings;
5647                    let send_compression_encodings = self.send_compression_encodings;
5648                    let max_decoding_message_size = self.max_decoding_message_size;
5649                    let max_encoding_message_size = self.max_encoding_message_size;
5650                    let inner = self.inner.clone();
5651                    let fut = async move {
5652                        let method = ListGroupsSvc(inner);
5653                        let codec = tonic_prost::ProstCodec::default();
5654                        let mut grpc = tonic::server::Grpc::new(codec)
5655                            .apply_compression_config(
5656                                accept_compression_encodings,
5657                                send_compression_encodings,
5658                            )
5659                            .apply_max_message_size_config(
5660                                max_decoding_message_size,
5661                                max_encoding_message_size,
5662                            );
5663                        let res = grpc.unary(method, req).await;
5664                        Ok(res)
5665                    };
5666                    Box::pin(fut)
5667                }
5668                "/pidgr.v1.GroupService/UpdateGroup" => {
5669                    #[allow(non_camel_case_types)]
5670                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5671                    impl<
5672                        T: GroupService,
5673                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5674                    for UpdateGroupSvc<T> {
5675                        type Response = super::UpdateGroupResponse;
5676                        type Future = BoxFuture<
5677                            tonic::Response<Self::Response>,
5678                            tonic::Status,
5679                        >;
5680                        fn call(
5681                            &mut self,
5682                            request: tonic::Request<super::UpdateGroupRequest>,
5683                        ) -> Self::Future {
5684                            let inner = Arc::clone(&self.0);
5685                            let fut = async move {
5686                                <T as GroupService>::update_group(&inner, request).await
5687                            };
5688                            Box::pin(fut)
5689                        }
5690                    }
5691                    let accept_compression_encodings = self.accept_compression_encodings;
5692                    let send_compression_encodings = self.send_compression_encodings;
5693                    let max_decoding_message_size = self.max_decoding_message_size;
5694                    let max_encoding_message_size = self.max_encoding_message_size;
5695                    let inner = self.inner.clone();
5696                    let fut = async move {
5697                        let method = UpdateGroupSvc(inner);
5698                        let codec = tonic_prost::ProstCodec::default();
5699                        let mut grpc = tonic::server::Grpc::new(codec)
5700                            .apply_compression_config(
5701                                accept_compression_encodings,
5702                                send_compression_encodings,
5703                            )
5704                            .apply_max_message_size_config(
5705                                max_decoding_message_size,
5706                                max_encoding_message_size,
5707                            );
5708                        let res = grpc.unary(method, req).await;
5709                        Ok(res)
5710                    };
5711                    Box::pin(fut)
5712                }
5713                "/pidgr.v1.GroupService/DeleteGroup" => {
5714                    #[allow(non_camel_case_types)]
5715                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5716                    impl<
5717                        T: GroupService,
5718                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5719                    for DeleteGroupSvc<T> {
5720                        type Response = super::DeleteGroupResponse;
5721                        type Future = BoxFuture<
5722                            tonic::Response<Self::Response>,
5723                            tonic::Status,
5724                        >;
5725                        fn call(
5726                            &mut self,
5727                            request: tonic::Request<super::DeleteGroupRequest>,
5728                        ) -> Self::Future {
5729                            let inner = Arc::clone(&self.0);
5730                            let fut = async move {
5731                                <T as GroupService>::delete_group(&inner, request).await
5732                            };
5733                            Box::pin(fut)
5734                        }
5735                    }
5736                    let accept_compression_encodings = self.accept_compression_encodings;
5737                    let send_compression_encodings = self.send_compression_encodings;
5738                    let max_decoding_message_size = self.max_decoding_message_size;
5739                    let max_encoding_message_size = self.max_encoding_message_size;
5740                    let inner = self.inner.clone();
5741                    let fut = async move {
5742                        let method = DeleteGroupSvc(inner);
5743                        let codec = tonic_prost::ProstCodec::default();
5744                        let mut grpc = tonic::server::Grpc::new(codec)
5745                            .apply_compression_config(
5746                                accept_compression_encodings,
5747                                send_compression_encodings,
5748                            )
5749                            .apply_max_message_size_config(
5750                                max_decoding_message_size,
5751                                max_encoding_message_size,
5752                            );
5753                        let res = grpc.unary(method, req).await;
5754                        Ok(res)
5755                    };
5756                    Box::pin(fut)
5757                }
5758                "/pidgr.v1.GroupService/AddGroupMembers" => {
5759                    #[allow(non_camel_case_types)]
5760                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5761                    impl<
5762                        T: GroupService,
5763                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5764                    for AddGroupMembersSvc<T> {
5765                        type Response = super::AddGroupMembersResponse;
5766                        type Future = BoxFuture<
5767                            tonic::Response<Self::Response>,
5768                            tonic::Status,
5769                        >;
5770                        fn call(
5771                            &mut self,
5772                            request: tonic::Request<super::AddGroupMembersRequest>,
5773                        ) -> Self::Future {
5774                            let inner = Arc::clone(&self.0);
5775                            let fut = async move {
5776                                <T as GroupService>::add_group_members(&inner, request)
5777                                    .await
5778                            };
5779                            Box::pin(fut)
5780                        }
5781                    }
5782                    let accept_compression_encodings = self.accept_compression_encodings;
5783                    let send_compression_encodings = self.send_compression_encodings;
5784                    let max_decoding_message_size = self.max_decoding_message_size;
5785                    let max_encoding_message_size = self.max_encoding_message_size;
5786                    let inner = self.inner.clone();
5787                    let fut = async move {
5788                        let method = AddGroupMembersSvc(inner);
5789                        let codec = tonic_prost::ProstCodec::default();
5790                        let mut grpc = tonic::server::Grpc::new(codec)
5791                            .apply_compression_config(
5792                                accept_compression_encodings,
5793                                send_compression_encodings,
5794                            )
5795                            .apply_max_message_size_config(
5796                                max_decoding_message_size,
5797                                max_encoding_message_size,
5798                            );
5799                        let res = grpc.unary(method, req).await;
5800                        Ok(res)
5801                    };
5802                    Box::pin(fut)
5803                }
5804                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5805                    #[allow(non_camel_case_types)]
5806                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5807                    impl<
5808                        T: GroupService,
5809                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5810                    for RemoveGroupMembersSvc<T> {
5811                        type Response = super::RemoveGroupMembersResponse;
5812                        type Future = BoxFuture<
5813                            tonic::Response<Self::Response>,
5814                            tonic::Status,
5815                        >;
5816                        fn call(
5817                            &mut self,
5818                            request: tonic::Request<super::RemoveGroupMembersRequest>,
5819                        ) -> Self::Future {
5820                            let inner = Arc::clone(&self.0);
5821                            let fut = async move {
5822                                <T as GroupService>::remove_group_members(&inner, request)
5823                                    .await
5824                            };
5825                            Box::pin(fut)
5826                        }
5827                    }
5828                    let accept_compression_encodings = self.accept_compression_encodings;
5829                    let send_compression_encodings = self.send_compression_encodings;
5830                    let max_decoding_message_size = self.max_decoding_message_size;
5831                    let max_encoding_message_size = self.max_encoding_message_size;
5832                    let inner = self.inner.clone();
5833                    let fut = async move {
5834                        let method = RemoveGroupMembersSvc(inner);
5835                        let codec = tonic_prost::ProstCodec::default();
5836                        let mut grpc = tonic::server::Grpc::new(codec)
5837                            .apply_compression_config(
5838                                accept_compression_encodings,
5839                                send_compression_encodings,
5840                            )
5841                            .apply_max_message_size_config(
5842                                max_decoding_message_size,
5843                                max_encoding_message_size,
5844                            );
5845                        let res = grpc.unary(method, req).await;
5846                        Ok(res)
5847                    };
5848                    Box::pin(fut)
5849                }
5850                "/pidgr.v1.GroupService/ListGroupMembers" => {
5851                    #[allow(non_camel_case_types)]
5852                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5853                    impl<
5854                        T: GroupService,
5855                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5856                    for ListGroupMembersSvc<T> {
5857                        type Response = super::ListGroupMembersResponse;
5858                        type Future = BoxFuture<
5859                            tonic::Response<Self::Response>,
5860                            tonic::Status,
5861                        >;
5862                        fn call(
5863                            &mut self,
5864                            request: tonic::Request<super::ListGroupMembersRequest>,
5865                        ) -> Self::Future {
5866                            let inner = Arc::clone(&self.0);
5867                            let fut = async move {
5868                                <T as GroupService>::list_group_members(&inner, request)
5869                                    .await
5870                            };
5871                            Box::pin(fut)
5872                        }
5873                    }
5874                    let accept_compression_encodings = self.accept_compression_encodings;
5875                    let send_compression_encodings = self.send_compression_encodings;
5876                    let max_decoding_message_size = self.max_decoding_message_size;
5877                    let max_encoding_message_size = self.max_encoding_message_size;
5878                    let inner = self.inner.clone();
5879                    let fut = async move {
5880                        let method = ListGroupMembersSvc(inner);
5881                        let codec = tonic_prost::ProstCodec::default();
5882                        let mut grpc = tonic::server::Grpc::new(codec)
5883                            .apply_compression_config(
5884                                accept_compression_encodings,
5885                                send_compression_encodings,
5886                            )
5887                            .apply_max_message_size_config(
5888                                max_decoding_message_size,
5889                                max_encoding_message_size,
5890                            );
5891                        let res = grpc.unary(method, req).await;
5892                        Ok(res)
5893                    };
5894                    Box::pin(fut)
5895                }
5896                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5897                    #[allow(non_camel_case_types)]
5898                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5899                    impl<
5900                        T: GroupService,
5901                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5902                    for GetUserGroupMembershipsSvc<T> {
5903                        type Response = super::GetUserGroupMembershipsResponse;
5904                        type Future = BoxFuture<
5905                            tonic::Response<Self::Response>,
5906                            tonic::Status,
5907                        >;
5908                        fn call(
5909                            &mut self,
5910                            request: tonic::Request<
5911                                super::GetUserGroupMembershipsRequest,
5912                            >,
5913                        ) -> Self::Future {
5914                            let inner = Arc::clone(&self.0);
5915                            let fut = async move {
5916                                <T as GroupService>::get_user_group_memberships(
5917                                        &inner,
5918                                        request,
5919                                    )
5920                                    .await
5921                            };
5922                            Box::pin(fut)
5923                        }
5924                    }
5925                    let accept_compression_encodings = self.accept_compression_encodings;
5926                    let send_compression_encodings = self.send_compression_encodings;
5927                    let max_decoding_message_size = self.max_decoding_message_size;
5928                    let max_encoding_message_size = self.max_encoding_message_size;
5929                    let inner = self.inner.clone();
5930                    let fut = async move {
5931                        let method = GetUserGroupMembershipsSvc(inner);
5932                        let codec = tonic_prost::ProstCodec::default();
5933                        let mut grpc = tonic::server::Grpc::new(codec)
5934                            .apply_compression_config(
5935                                accept_compression_encodings,
5936                                send_compression_encodings,
5937                            )
5938                            .apply_max_message_size_config(
5939                                max_decoding_message_size,
5940                                max_encoding_message_size,
5941                            );
5942                        let res = grpc.unary(method, req).await;
5943                        Ok(res)
5944                    };
5945                    Box::pin(fut)
5946                }
5947                _ => {
5948                    Box::pin(async move {
5949                        let mut response = http::Response::new(
5950                            tonic::body::Body::default(),
5951                        );
5952                        let headers = response.headers_mut();
5953                        headers
5954                            .insert(
5955                                tonic::Status::GRPC_STATUS,
5956                                (tonic::Code::Unimplemented as i32).into(),
5957                            );
5958                        headers
5959                            .insert(
5960                                http::header::CONTENT_TYPE,
5961                                tonic::metadata::GRPC_CONTENT_TYPE,
5962                            );
5963                        Ok(response)
5964                    })
5965                }
5966            }
5967        }
5968    }
5969    impl<T> Clone for GroupServiceServer<T> {
5970        fn clone(&self) -> Self {
5971            let inner = self.inner.clone();
5972            Self {
5973                inner,
5974                accept_compression_encodings: self.accept_compression_encodings,
5975                send_compression_encodings: self.send_compression_encodings,
5976                max_decoding_message_size: self.max_decoding_message_size,
5977                max_encoding_message_size: self.max_encoding_message_size,
5978            }
5979        }
5980    }
5981    /// Generated gRPC service name
5982    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5983    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5984        const NAME: &'static str = SERVICE_NAME;
5985    }
5986}
5987/// Generated client implementations.
5988pub mod heatmap_service_client {
5989    #![allow(
5990        unused_variables,
5991        dead_code,
5992        missing_docs,
5993        clippy::wildcard_imports,
5994        clippy::let_unit_value,
5995    )]
5996    use tonic::codegen::*;
5997    use tonic::codegen::http::Uri;
5998    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5999 for mobile app interaction analytics.
6000*/
6001    #[derive(Debug, Clone)]
6002    pub struct HeatmapServiceClient<T> {
6003        inner: tonic::client::Grpc<T>,
6004    }
6005    impl HeatmapServiceClient<tonic::transport::Channel> {
6006        /// Attempt to create a new client by connecting to a given endpoint.
6007        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6008        where
6009            D: TryInto<tonic::transport::Endpoint>,
6010            D::Error: Into<StdError>,
6011        {
6012            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6013            Ok(Self::new(conn))
6014        }
6015    }
6016    impl<T> HeatmapServiceClient<T>
6017    where
6018        T: tonic::client::GrpcService<tonic::body::Body>,
6019        T::Error: Into<StdError>,
6020        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6021        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6022    {
6023        pub fn new(inner: T) -> Self {
6024            let inner = tonic::client::Grpc::new(inner);
6025            Self { inner }
6026        }
6027        pub fn with_origin(inner: T, origin: Uri) -> Self {
6028            let inner = tonic::client::Grpc::with_origin(inner, origin);
6029            Self { inner }
6030        }
6031        pub fn with_interceptor<F>(
6032            inner: T,
6033            interceptor: F,
6034        ) -> HeatmapServiceClient<InterceptedService<T, F>>
6035        where
6036            F: tonic::service::Interceptor,
6037            T::ResponseBody: Default,
6038            T: tonic::codegen::Service<
6039                http::Request<tonic::body::Body>,
6040                Response = http::Response<
6041                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6042                >,
6043            >,
6044            <T as tonic::codegen::Service<
6045                http::Request<tonic::body::Body>,
6046            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6047        {
6048            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
6049        }
6050        /// Compress requests with the given encoding.
6051        ///
6052        /// This requires the server to support it otherwise it might respond with an
6053        /// error.
6054        #[must_use]
6055        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6056            self.inner = self.inner.send_compressed(encoding);
6057            self
6058        }
6059        /// Enable decompressing responses.
6060        #[must_use]
6061        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6062            self.inner = self.inner.accept_compressed(encoding);
6063            self
6064        }
6065        /// Limits the maximum size of a decoded message.
6066        ///
6067        /// Default: `4MB`
6068        #[must_use]
6069        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6070            self.inner = self.inner.max_decoding_message_size(limit);
6071            self
6072        }
6073        /// Limits the maximum size of an encoded message.
6074        ///
6075        /// Default: `usize::MAX`
6076        #[must_use]
6077        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6078            self.inner = self.inner.max_encoding_message_size(limit);
6079            self
6080        }
6081        /** Ingest a batch of touch events from the mobile app.
6082 Authorization: Authenticated mobile user.
6083*/
6084        pub async fn ingest_touch_events(
6085            &mut self,
6086            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
6087        ) -> std::result::Result<
6088            tonic::Response<super::IngestTouchEventsResponse>,
6089            tonic::Status,
6090        > {
6091            self.inner
6092                .ready()
6093                .await
6094                .map_err(|e| {
6095                    tonic::Status::unknown(
6096                        format!("Service was not ready: {}", e.into()),
6097                    )
6098                })?;
6099            let codec = tonic_prost::ProstCodec::default();
6100            let path = http::uri::PathAndQuery::from_static(
6101                "/pidgr.v1.HeatmapService/IngestTouchEvents",
6102            );
6103            let mut req = request.into_request();
6104            req.extensions_mut()
6105                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
6106            self.inner.unary(req, path, codec).await
6107        }
6108        /** Query aggregated touch data for heatmap rendering.
6109 Authorization: Requires CAMPAIGNS_READ permission.
6110*/
6111        pub async fn query_heatmap_data(
6112            &mut self,
6113            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
6114        ) -> std::result::Result<
6115            tonic::Response<super::QueryHeatmapDataResponse>,
6116            tonic::Status,
6117        > {
6118            self.inner
6119                .ready()
6120                .await
6121                .map_err(|e| {
6122                    tonic::Status::unknown(
6123                        format!("Service was not ready: {}", e.into()),
6124                    )
6125                })?;
6126            let codec = tonic_prost::ProstCodec::default();
6127            let path = http::uri::PathAndQuery::from_static(
6128                "/pidgr.v1.HeatmapService/QueryHeatmapData",
6129            );
6130            let mut req = request.into_request();
6131            req.extensions_mut()
6132                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
6133            self.inner.unary(req, path, codec).await
6134        }
6135        /** List available screen screenshots for heatmap backgrounds.
6136 Authorization: Requires CAMPAIGNS_READ permission.
6137*/
6138        pub async fn list_screenshots(
6139            &mut self,
6140            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
6141        ) -> std::result::Result<
6142            tonic::Response<super::ListScreenshotsResponse>,
6143            tonic::Status,
6144        > {
6145            self.inner
6146                .ready()
6147                .await
6148                .map_err(|e| {
6149                    tonic::Status::unknown(
6150                        format!("Service was not ready: {}", e.into()),
6151                    )
6152                })?;
6153            let codec = tonic_prost::ProstCodec::default();
6154            let path = http::uri::PathAndQuery::from_static(
6155                "/pidgr.v1.HeatmapService/ListScreenshots",
6156            );
6157            let mut req = request.into_request();
6158            req.extensions_mut()
6159                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
6160            self.inner.unary(req, path, codec).await
6161        }
6162        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6163 Authorization: Authenticated mobile user.
6164*/
6165        pub async fn upload_screenshot(
6166            &mut self,
6167            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
6168        ) -> std::result::Result<
6169            tonic::Response<super::UploadScreenshotResponse>,
6170            tonic::Status,
6171        > {
6172            self.inner
6173                .ready()
6174                .await
6175                .map_err(|e| {
6176                    tonic::Status::unknown(
6177                        format!("Service was not ready: {}", e.into()),
6178                    )
6179                })?;
6180            let codec = tonic_prost::ProstCodec::default();
6181            let path = http::uri::PathAndQuery::from_static(
6182                "/pidgr.v1.HeatmapService/UploadScreenshot",
6183            );
6184            let mut req = request.into_request();
6185            req.extensions_mut()
6186                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
6187            self.inner.unary(req, path, codec).await
6188        }
6189    }
6190}
6191/// Generated server implementations.
6192pub mod heatmap_service_server {
6193    #![allow(
6194        unused_variables,
6195        dead_code,
6196        missing_docs,
6197        clippy::wildcard_imports,
6198        clippy::let_unit_value,
6199    )]
6200    use tonic::codegen::*;
6201    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
6202    #[async_trait]
6203    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
6204        /** Ingest a batch of touch events from the mobile app.
6205 Authorization: Authenticated mobile user.
6206*/
6207        async fn ingest_touch_events(
6208            &self,
6209            request: tonic::Request<super::IngestTouchEventsRequest>,
6210        ) -> std::result::Result<
6211            tonic::Response<super::IngestTouchEventsResponse>,
6212            tonic::Status,
6213        >;
6214        /** Query aggregated touch data for heatmap rendering.
6215 Authorization: Requires CAMPAIGNS_READ permission.
6216*/
6217        async fn query_heatmap_data(
6218            &self,
6219            request: tonic::Request<super::QueryHeatmapDataRequest>,
6220        ) -> std::result::Result<
6221            tonic::Response<super::QueryHeatmapDataResponse>,
6222            tonic::Status,
6223        >;
6224        /** List available screen screenshots for heatmap backgrounds.
6225 Authorization: Requires CAMPAIGNS_READ permission.
6226*/
6227        async fn list_screenshots(
6228            &self,
6229            request: tonic::Request<super::ListScreenshotsRequest>,
6230        ) -> std::result::Result<
6231            tonic::Response<super::ListScreenshotsResponse>,
6232            tonic::Status,
6233        >;
6234        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6235 Authorization: Authenticated mobile user.
6236*/
6237        async fn upload_screenshot(
6238            &self,
6239            request: tonic::Request<super::UploadScreenshotRequest>,
6240        ) -> std::result::Result<
6241            tonic::Response<super::UploadScreenshotResponse>,
6242            tonic::Status,
6243        >;
6244    }
6245    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6246 for mobile app interaction analytics.
6247*/
6248    #[derive(Debug)]
6249    pub struct HeatmapServiceServer<T> {
6250        inner: Arc<T>,
6251        accept_compression_encodings: EnabledCompressionEncodings,
6252        send_compression_encodings: EnabledCompressionEncodings,
6253        max_decoding_message_size: Option<usize>,
6254        max_encoding_message_size: Option<usize>,
6255    }
6256    impl<T> HeatmapServiceServer<T> {
6257        pub fn new(inner: T) -> Self {
6258            Self::from_arc(Arc::new(inner))
6259        }
6260        pub fn from_arc(inner: Arc<T>) -> Self {
6261            Self {
6262                inner,
6263                accept_compression_encodings: Default::default(),
6264                send_compression_encodings: Default::default(),
6265                max_decoding_message_size: None,
6266                max_encoding_message_size: None,
6267            }
6268        }
6269        pub fn with_interceptor<F>(
6270            inner: T,
6271            interceptor: F,
6272        ) -> InterceptedService<Self, F>
6273        where
6274            F: tonic::service::Interceptor,
6275        {
6276            InterceptedService::new(Self::new(inner), interceptor)
6277        }
6278        /// Enable decompressing requests with the given encoding.
6279        #[must_use]
6280        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6281            self.accept_compression_encodings.enable(encoding);
6282            self
6283        }
6284        /// Compress responses with the given encoding, if the client supports it.
6285        #[must_use]
6286        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6287            self.send_compression_encodings.enable(encoding);
6288            self
6289        }
6290        /// Limits the maximum size of a decoded message.
6291        ///
6292        /// Default: `4MB`
6293        #[must_use]
6294        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6295            self.max_decoding_message_size = Some(limit);
6296            self
6297        }
6298        /// Limits the maximum size of an encoded message.
6299        ///
6300        /// Default: `usize::MAX`
6301        #[must_use]
6302        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6303            self.max_encoding_message_size = Some(limit);
6304            self
6305        }
6306    }
6307    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
6308    where
6309        T: HeatmapService,
6310        B: Body + std::marker::Send + 'static,
6311        B::Error: Into<StdError> + std::marker::Send + 'static,
6312    {
6313        type Response = http::Response<tonic::body::Body>;
6314        type Error = std::convert::Infallible;
6315        type Future = BoxFuture<Self::Response, Self::Error>;
6316        fn poll_ready(
6317            &mut self,
6318            _cx: &mut Context<'_>,
6319        ) -> Poll<std::result::Result<(), Self::Error>> {
6320            Poll::Ready(Ok(()))
6321        }
6322        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6323            match req.uri().path() {
6324                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
6325                    #[allow(non_camel_case_types)]
6326                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6327                    impl<
6328                        T: HeatmapService,
6329                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6330                    for IngestTouchEventsSvc<T> {
6331                        type Response = super::IngestTouchEventsResponse;
6332                        type Future = BoxFuture<
6333                            tonic::Response<Self::Response>,
6334                            tonic::Status,
6335                        >;
6336                        fn call(
6337                            &mut self,
6338                            request: tonic::Request<super::IngestTouchEventsRequest>,
6339                        ) -> Self::Future {
6340                            let inner = Arc::clone(&self.0);
6341                            let fut = async move {
6342                                <T as HeatmapService>::ingest_touch_events(&inner, request)
6343                                    .await
6344                            };
6345                            Box::pin(fut)
6346                        }
6347                    }
6348                    let accept_compression_encodings = self.accept_compression_encodings;
6349                    let send_compression_encodings = self.send_compression_encodings;
6350                    let max_decoding_message_size = self.max_decoding_message_size;
6351                    let max_encoding_message_size = self.max_encoding_message_size;
6352                    let inner = self.inner.clone();
6353                    let fut = async move {
6354                        let method = IngestTouchEventsSvc(inner);
6355                        let codec = tonic_prost::ProstCodec::default();
6356                        let mut grpc = tonic::server::Grpc::new(codec)
6357                            .apply_compression_config(
6358                                accept_compression_encodings,
6359                                send_compression_encodings,
6360                            )
6361                            .apply_max_message_size_config(
6362                                max_decoding_message_size,
6363                                max_encoding_message_size,
6364                            );
6365                        let res = grpc.unary(method, req).await;
6366                        Ok(res)
6367                    };
6368                    Box::pin(fut)
6369                }
6370                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6371                    #[allow(non_camel_case_types)]
6372                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6373                    impl<
6374                        T: HeatmapService,
6375                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6376                    for QueryHeatmapDataSvc<T> {
6377                        type Response = super::QueryHeatmapDataResponse;
6378                        type Future = BoxFuture<
6379                            tonic::Response<Self::Response>,
6380                            tonic::Status,
6381                        >;
6382                        fn call(
6383                            &mut self,
6384                            request: tonic::Request<super::QueryHeatmapDataRequest>,
6385                        ) -> Self::Future {
6386                            let inner = Arc::clone(&self.0);
6387                            let fut = async move {
6388                                <T as HeatmapService>::query_heatmap_data(&inner, request)
6389                                    .await
6390                            };
6391                            Box::pin(fut)
6392                        }
6393                    }
6394                    let accept_compression_encodings = self.accept_compression_encodings;
6395                    let send_compression_encodings = self.send_compression_encodings;
6396                    let max_decoding_message_size = self.max_decoding_message_size;
6397                    let max_encoding_message_size = self.max_encoding_message_size;
6398                    let inner = self.inner.clone();
6399                    let fut = async move {
6400                        let method = QueryHeatmapDataSvc(inner);
6401                        let codec = tonic_prost::ProstCodec::default();
6402                        let mut grpc = tonic::server::Grpc::new(codec)
6403                            .apply_compression_config(
6404                                accept_compression_encodings,
6405                                send_compression_encodings,
6406                            )
6407                            .apply_max_message_size_config(
6408                                max_decoding_message_size,
6409                                max_encoding_message_size,
6410                            );
6411                        let res = grpc.unary(method, req).await;
6412                        Ok(res)
6413                    };
6414                    Box::pin(fut)
6415                }
6416                "/pidgr.v1.HeatmapService/ListScreenshots" => {
6417                    #[allow(non_camel_case_types)]
6418                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6419                    impl<
6420                        T: HeatmapService,
6421                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
6422                    for ListScreenshotsSvc<T> {
6423                        type Response = super::ListScreenshotsResponse;
6424                        type Future = BoxFuture<
6425                            tonic::Response<Self::Response>,
6426                            tonic::Status,
6427                        >;
6428                        fn call(
6429                            &mut self,
6430                            request: tonic::Request<super::ListScreenshotsRequest>,
6431                        ) -> Self::Future {
6432                            let inner = Arc::clone(&self.0);
6433                            let fut = async move {
6434                                <T as HeatmapService>::list_screenshots(&inner, request)
6435                                    .await
6436                            };
6437                            Box::pin(fut)
6438                        }
6439                    }
6440                    let accept_compression_encodings = self.accept_compression_encodings;
6441                    let send_compression_encodings = self.send_compression_encodings;
6442                    let max_decoding_message_size = self.max_decoding_message_size;
6443                    let max_encoding_message_size = self.max_encoding_message_size;
6444                    let inner = self.inner.clone();
6445                    let fut = async move {
6446                        let method = ListScreenshotsSvc(inner);
6447                        let codec = tonic_prost::ProstCodec::default();
6448                        let mut grpc = tonic::server::Grpc::new(codec)
6449                            .apply_compression_config(
6450                                accept_compression_encodings,
6451                                send_compression_encodings,
6452                            )
6453                            .apply_max_message_size_config(
6454                                max_decoding_message_size,
6455                                max_encoding_message_size,
6456                            );
6457                        let res = grpc.unary(method, req).await;
6458                        Ok(res)
6459                    };
6460                    Box::pin(fut)
6461                }
6462                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6463                    #[allow(non_camel_case_types)]
6464                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6465                    impl<
6466                        T: HeatmapService,
6467                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
6468                    for UploadScreenshotSvc<T> {
6469                        type Response = super::UploadScreenshotResponse;
6470                        type Future = BoxFuture<
6471                            tonic::Response<Self::Response>,
6472                            tonic::Status,
6473                        >;
6474                        fn call(
6475                            &mut self,
6476                            request: tonic::Request<super::UploadScreenshotRequest>,
6477                        ) -> Self::Future {
6478                            let inner = Arc::clone(&self.0);
6479                            let fut = async move {
6480                                <T as HeatmapService>::upload_screenshot(&inner, request)
6481                                    .await
6482                            };
6483                            Box::pin(fut)
6484                        }
6485                    }
6486                    let accept_compression_encodings = self.accept_compression_encodings;
6487                    let send_compression_encodings = self.send_compression_encodings;
6488                    let max_decoding_message_size = self.max_decoding_message_size;
6489                    let max_encoding_message_size = self.max_encoding_message_size;
6490                    let inner = self.inner.clone();
6491                    let fut = async move {
6492                        let method = UploadScreenshotSvc(inner);
6493                        let codec = tonic_prost::ProstCodec::default();
6494                        let mut grpc = tonic::server::Grpc::new(codec)
6495                            .apply_compression_config(
6496                                accept_compression_encodings,
6497                                send_compression_encodings,
6498                            )
6499                            .apply_max_message_size_config(
6500                                max_decoding_message_size,
6501                                max_encoding_message_size,
6502                            );
6503                        let res = grpc.unary(method, req).await;
6504                        Ok(res)
6505                    };
6506                    Box::pin(fut)
6507                }
6508                _ => {
6509                    Box::pin(async move {
6510                        let mut response = http::Response::new(
6511                            tonic::body::Body::default(),
6512                        );
6513                        let headers = response.headers_mut();
6514                        headers
6515                            .insert(
6516                                tonic::Status::GRPC_STATUS,
6517                                (tonic::Code::Unimplemented as i32).into(),
6518                            );
6519                        headers
6520                            .insert(
6521                                http::header::CONTENT_TYPE,
6522                                tonic::metadata::GRPC_CONTENT_TYPE,
6523                            );
6524                        Ok(response)
6525                    })
6526                }
6527            }
6528        }
6529    }
6530    impl<T> Clone for HeatmapServiceServer<T> {
6531        fn clone(&self) -> Self {
6532            let inner = self.inner.clone();
6533            Self {
6534                inner,
6535                accept_compression_encodings: self.accept_compression_encodings,
6536                send_compression_encodings: self.send_compression_encodings,
6537                max_decoding_message_size: self.max_decoding_message_size,
6538                max_encoding_message_size: self.max_encoding_message_size,
6539            }
6540        }
6541    }
6542    /// Generated gRPC service name
6543    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6544    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6545        const NAME: &'static str = SERVICE_NAME;
6546    }
6547}
6548/// Generated client implementations.
6549pub mod inbox_service_client {
6550    #![allow(
6551        unused_variables,
6552        dead_code,
6553        missing_docs,
6554        clippy::wildcard_imports,
6555        clippy::let_unit_value,
6556    )]
6557    use tonic::codegen::*;
6558    use tonic::codegen::http::Uri;
6559    /** Provides the mobile app's inbox experience — syncing messages,
6560 tracking read status, and retrieving individual entries.
6561*/
6562    #[derive(Debug, Clone)]
6563    pub struct InboxServiceClient<T> {
6564        inner: tonic::client::Grpc<T>,
6565    }
6566    impl InboxServiceClient<tonic::transport::Channel> {
6567        /// Attempt to create a new client by connecting to a given endpoint.
6568        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6569        where
6570            D: TryInto<tonic::transport::Endpoint>,
6571            D::Error: Into<StdError>,
6572        {
6573            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6574            Ok(Self::new(conn))
6575        }
6576    }
6577    impl<T> InboxServiceClient<T>
6578    where
6579        T: tonic::client::GrpcService<tonic::body::Body>,
6580        T::Error: Into<StdError>,
6581        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6582        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6583    {
6584        pub fn new(inner: T) -> Self {
6585            let inner = tonic::client::Grpc::new(inner);
6586            Self { inner }
6587        }
6588        pub fn with_origin(inner: T, origin: Uri) -> Self {
6589            let inner = tonic::client::Grpc::with_origin(inner, origin);
6590            Self { inner }
6591        }
6592        pub fn with_interceptor<F>(
6593            inner: T,
6594            interceptor: F,
6595        ) -> InboxServiceClient<InterceptedService<T, F>>
6596        where
6597            F: tonic::service::Interceptor,
6598            T::ResponseBody: Default,
6599            T: tonic::codegen::Service<
6600                http::Request<tonic::body::Body>,
6601                Response = http::Response<
6602                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6603                >,
6604            >,
6605            <T as tonic::codegen::Service<
6606                http::Request<tonic::body::Body>,
6607            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6608        {
6609            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6610        }
6611        /// Compress requests with the given encoding.
6612        ///
6613        /// This requires the server to support it otherwise it might respond with an
6614        /// error.
6615        #[must_use]
6616        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6617            self.inner = self.inner.send_compressed(encoding);
6618            self
6619        }
6620        /// Enable decompressing responses.
6621        #[must_use]
6622        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6623            self.inner = self.inner.accept_compressed(encoding);
6624            self
6625        }
6626        /// Limits the maximum size of a decoded message.
6627        ///
6628        /// Default: `4MB`
6629        #[must_use]
6630        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6631            self.inner = self.inner.max_decoding_message_size(limit);
6632            self
6633        }
6634        /// Limits the maximum size of an encoded message.
6635        ///
6636        /// Default: `usize::MAX`
6637        #[must_use]
6638        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6639            self.inner = self.inner.max_encoding_message_size(limit);
6640            self
6641        }
6642        /** Sync inbox entries since a given timestamp for incremental updates.
6643 Authorization: Authenticated user (own inbox only).
6644*/
6645        pub async fn sync(
6646            &mut self,
6647            request: impl tonic::IntoRequest<super::SyncRequest>,
6648        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6649            self.inner
6650                .ready()
6651                .await
6652                .map_err(|e| {
6653                    tonic::Status::unknown(
6654                        format!("Service was not ready: {}", e.into()),
6655                    )
6656                })?;
6657            let codec = tonic_prost::ProstCodec::default();
6658            let path = http::uri::PathAndQuery::from_static(
6659                "/pidgr.v1.InboxService/Sync",
6660            );
6661            let mut req = request.into_request();
6662            req.extensions_mut()
6663                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6664            self.inner.unary(req, path, codec).await
6665        }
6666        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6667 Authorization: Authenticated user (own inbox only).
6668*/
6669        pub async fn mark_read(
6670            &mut self,
6671            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6672        ) -> std::result::Result<
6673            tonic::Response<super::MarkReadResponse>,
6674            tonic::Status,
6675        > {
6676            self.inner
6677                .ready()
6678                .await
6679                .map_err(|e| {
6680                    tonic::Status::unknown(
6681                        format!("Service was not ready: {}", e.into()),
6682                    )
6683                })?;
6684            let codec = tonic_prost::ProstCodec::default();
6685            let path = http::uri::PathAndQuery::from_static(
6686                "/pidgr.v1.InboxService/MarkRead",
6687            );
6688            let mut req = request.into_request();
6689            req.extensions_mut()
6690                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6691            self.inner.unary(req, path, codec).await
6692        }
6693        /** Retrieve a single inbox entry by delivery ID.
6694 Authorization: Authenticated user (own inbox only).
6695*/
6696        pub async fn get_message(
6697            &mut self,
6698            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6699        ) -> std::result::Result<
6700            tonic::Response<super::GetMessageResponse>,
6701            tonic::Status,
6702        > {
6703            self.inner
6704                .ready()
6705                .await
6706                .map_err(|e| {
6707                    tonic::Status::unknown(
6708                        format!("Service was not ready: {}", e.into()),
6709                    )
6710                })?;
6711            let codec = tonic_prost::ProstCodec::default();
6712            let path = http::uri::PathAndQuery::from_static(
6713                "/pidgr.v1.InboxService/GetMessage",
6714            );
6715            let mut req = request.into_request();
6716            req.extensions_mut()
6717                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6718            self.inner.unary(req, path, codec).await
6719        }
6720    }
6721}
6722/// Generated server implementations.
6723pub mod inbox_service_server {
6724    #![allow(
6725        unused_variables,
6726        dead_code,
6727        missing_docs,
6728        clippy::wildcard_imports,
6729        clippy::let_unit_value,
6730    )]
6731    use tonic::codegen::*;
6732    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6733    #[async_trait]
6734    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6735        /** Sync inbox entries since a given timestamp for incremental updates.
6736 Authorization: Authenticated user (own inbox only).
6737*/
6738        async fn sync(
6739            &self,
6740            request: tonic::Request<super::SyncRequest>,
6741        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6742        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6743 Authorization: Authenticated user (own inbox only).
6744*/
6745        async fn mark_read(
6746            &self,
6747            request: tonic::Request<super::MarkReadRequest>,
6748        ) -> std::result::Result<
6749            tonic::Response<super::MarkReadResponse>,
6750            tonic::Status,
6751        >;
6752        /** Retrieve a single inbox entry by delivery ID.
6753 Authorization: Authenticated user (own inbox only).
6754*/
6755        async fn get_message(
6756            &self,
6757            request: tonic::Request<super::GetMessageRequest>,
6758        ) -> std::result::Result<
6759            tonic::Response<super::GetMessageResponse>,
6760            tonic::Status,
6761        >;
6762    }
6763    /** Provides the mobile app's inbox experience — syncing messages,
6764 tracking read status, and retrieving individual entries.
6765*/
6766    #[derive(Debug)]
6767    pub struct InboxServiceServer<T> {
6768        inner: Arc<T>,
6769        accept_compression_encodings: EnabledCompressionEncodings,
6770        send_compression_encodings: EnabledCompressionEncodings,
6771        max_decoding_message_size: Option<usize>,
6772        max_encoding_message_size: Option<usize>,
6773    }
6774    impl<T> InboxServiceServer<T> {
6775        pub fn new(inner: T) -> Self {
6776            Self::from_arc(Arc::new(inner))
6777        }
6778        pub fn from_arc(inner: Arc<T>) -> Self {
6779            Self {
6780                inner,
6781                accept_compression_encodings: Default::default(),
6782                send_compression_encodings: Default::default(),
6783                max_decoding_message_size: None,
6784                max_encoding_message_size: None,
6785            }
6786        }
6787        pub fn with_interceptor<F>(
6788            inner: T,
6789            interceptor: F,
6790        ) -> InterceptedService<Self, F>
6791        where
6792            F: tonic::service::Interceptor,
6793        {
6794            InterceptedService::new(Self::new(inner), interceptor)
6795        }
6796        /// Enable decompressing requests with the given encoding.
6797        #[must_use]
6798        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6799            self.accept_compression_encodings.enable(encoding);
6800            self
6801        }
6802        /// Compress responses with the given encoding, if the client supports it.
6803        #[must_use]
6804        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6805            self.send_compression_encodings.enable(encoding);
6806            self
6807        }
6808        /// Limits the maximum size of a decoded message.
6809        ///
6810        /// Default: `4MB`
6811        #[must_use]
6812        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6813            self.max_decoding_message_size = Some(limit);
6814            self
6815        }
6816        /// Limits the maximum size of an encoded message.
6817        ///
6818        /// Default: `usize::MAX`
6819        #[must_use]
6820        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6821            self.max_encoding_message_size = Some(limit);
6822            self
6823        }
6824    }
6825    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6826    where
6827        T: InboxService,
6828        B: Body + std::marker::Send + 'static,
6829        B::Error: Into<StdError> + std::marker::Send + 'static,
6830    {
6831        type Response = http::Response<tonic::body::Body>;
6832        type Error = std::convert::Infallible;
6833        type Future = BoxFuture<Self::Response, Self::Error>;
6834        fn poll_ready(
6835            &mut self,
6836            _cx: &mut Context<'_>,
6837        ) -> Poll<std::result::Result<(), Self::Error>> {
6838            Poll::Ready(Ok(()))
6839        }
6840        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6841            match req.uri().path() {
6842                "/pidgr.v1.InboxService/Sync" => {
6843                    #[allow(non_camel_case_types)]
6844                    struct SyncSvc<T: InboxService>(pub Arc<T>);
6845                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6846                    for SyncSvc<T> {
6847                        type Response = super::SyncResponse;
6848                        type Future = BoxFuture<
6849                            tonic::Response<Self::Response>,
6850                            tonic::Status,
6851                        >;
6852                        fn call(
6853                            &mut self,
6854                            request: tonic::Request<super::SyncRequest>,
6855                        ) -> Self::Future {
6856                            let inner = Arc::clone(&self.0);
6857                            let fut = async move {
6858                                <T as InboxService>::sync(&inner, request).await
6859                            };
6860                            Box::pin(fut)
6861                        }
6862                    }
6863                    let accept_compression_encodings = self.accept_compression_encodings;
6864                    let send_compression_encodings = self.send_compression_encodings;
6865                    let max_decoding_message_size = self.max_decoding_message_size;
6866                    let max_encoding_message_size = self.max_encoding_message_size;
6867                    let inner = self.inner.clone();
6868                    let fut = async move {
6869                        let method = SyncSvc(inner);
6870                        let codec = tonic_prost::ProstCodec::default();
6871                        let mut grpc = tonic::server::Grpc::new(codec)
6872                            .apply_compression_config(
6873                                accept_compression_encodings,
6874                                send_compression_encodings,
6875                            )
6876                            .apply_max_message_size_config(
6877                                max_decoding_message_size,
6878                                max_encoding_message_size,
6879                            );
6880                        let res = grpc.unary(method, req).await;
6881                        Ok(res)
6882                    };
6883                    Box::pin(fut)
6884                }
6885                "/pidgr.v1.InboxService/MarkRead" => {
6886                    #[allow(non_camel_case_types)]
6887                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6888                    impl<
6889                        T: InboxService,
6890                    > tonic::server::UnaryService<super::MarkReadRequest>
6891                    for MarkReadSvc<T> {
6892                        type Response = super::MarkReadResponse;
6893                        type Future = BoxFuture<
6894                            tonic::Response<Self::Response>,
6895                            tonic::Status,
6896                        >;
6897                        fn call(
6898                            &mut self,
6899                            request: tonic::Request<super::MarkReadRequest>,
6900                        ) -> Self::Future {
6901                            let inner = Arc::clone(&self.0);
6902                            let fut = async move {
6903                                <T as InboxService>::mark_read(&inner, request).await
6904                            };
6905                            Box::pin(fut)
6906                        }
6907                    }
6908                    let accept_compression_encodings = self.accept_compression_encodings;
6909                    let send_compression_encodings = self.send_compression_encodings;
6910                    let max_decoding_message_size = self.max_decoding_message_size;
6911                    let max_encoding_message_size = self.max_encoding_message_size;
6912                    let inner = self.inner.clone();
6913                    let fut = async move {
6914                        let method = MarkReadSvc(inner);
6915                        let codec = tonic_prost::ProstCodec::default();
6916                        let mut grpc = tonic::server::Grpc::new(codec)
6917                            .apply_compression_config(
6918                                accept_compression_encodings,
6919                                send_compression_encodings,
6920                            )
6921                            .apply_max_message_size_config(
6922                                max_decoding_message_size,
6923                                max_encoding_message_size,
6924                            );
6925                        let res = grpc.unary(method, req).await;
6926                        Ok(res)
6927                    };
6928                    Box::pin(fut)
6929                }
6930                "/pidgr.v1.InboxService/GetMessage" => {
6931                    #[allow(non_camel_case_types)]
6932                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6933                    impl<
6934                        T: InboxService,
6935                    > tonic::server::UnaryService<super::GetMessageRequest>
6936                    for GetMessageSvc<T> {
6937                        type Response = super::GetMessageResponse;
6938                        type Future = BoxFuture<
6939                            tonic::Response<Self::Response>,
6940                            tonic::Status,
6941                        >;
6942                        fn call(
6943                            &mut self,
6944                            request: tonic::Request<super::GetMessageRequest>,
6945                        ) -> Self::Future {
6946                            let inner = Arc::clone(&self.0);
6947                            let fut = async move {
6948                                <T as InboxService>::get_message(&inner, request).await
6949                            };
6950                            Box::pin(fut)
6951                        }
6952                    }
6953                    let accept_compression_encodings = self.accept_compression_encodings;
6954                    let send_compression_encodings = self.send_compression_encodings;
6955                    let max_decoding_message_size = self.max_decoding_message_size;
6956                    let max_encoding_message_size = self.max_encoding_message_size;
6957                    let inner = self.inner.clone();
6958                    let fut = async move {
6959                        let method = GetMessageSvc(inner);
6960                        let codec = tonic_prost::ProstCodec::default();
6961                        let mut grpc = tonic::server::Grpc::new(codec)
6962                            .apply_compression_config(
6963                                accept_compression_encodings,
6964                                send_compression_encodings,
6965                            )
6966                            .apply_max_message_size_config(
6967                                max_decoding_message_size,
6968                                max_encoding_message_size,
6969                            );
6970                        let res = grpc.unary(method, req).await;
6971                        Ok(res)
6972                    };
6973                    Box::pin(fut)
6974                }
6975                _ => {
6976                    Box::pin(async move {
6977                        let mut response = http::Response::new(
6978                            tonic::body::Body::default(),
6979                        );
6980                        let headers = response.headers_mut();
6981                        headers
6982                            .insert(
6983                                tonic::Status::GRPC_STATUS,
6984                                (tonic::Code::Unimplemented as i32).into(),
6985                            );
6986                        headers
6987                            .insert(
6988                                http::header::CONTENT_TYPE,
6989                                tonic::metadata::GRPC_CONTENT_TYPE,
6990                            );
6991                        Ok(response)
6992                    })
6993                }
6994            }
6995        }
6996    }
6997    impl<T> Clone for InboxServiceServer<T> {
6998        fn clone(&self) -> Self {
6999            let inner = self.inner.clone();
7000            Self {
7001                inner,
7002                accept_compression_encodings: self.accept_compression_encodings,
7003                send_compression_encodings: self.send_compression_encodings,
7004                max_decoding_message_size: self.max_decoding_message_size,
7005                max_encoding_message_size: self.max_encoding_message_size,
7006            }
7007        }
7008    }
7009    /// Generated gRPC service name
7010    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
7011    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
7012        const NAME: &'static str = SERVICE_NAME;
7013    }
7014}
7015/// Generated client implementations.
7016pub mod insights_service_client {
7017    #![allow(
7018        unused_variables,
7019        dead_code,
7020        missing_docs,
7021        clippy::wildcard_imports,
7022        clippy::let_unit_value,
7023    )]
7024    use tonic::codegen::*;
7025    use tonic::codegen::http::Uri;
7026    /** Provides cohort-level AI insights for campaign planning and optimization.
7027 All predictions are aggregate — no individual-level profiling.
7028 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7029 All RPCs operate within the caller's org (extracted from JWT).
7030*/
7031    #[derive(Debug, Clone)]
7032    pub struct InsightsServiceClient<T> {
7033        inner: tonic::client::Grpc<T>,
7034    }
7035    impl InsightsServiceClient<tonic::transport::Channel> {
7036        /// Attempt to create a new client by connecting to a given endpoint.
7037        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7038        where
7039            D: TryInto<tonic::transport::Endpoint>,
7040            D::Error: Into<StdError>,
7041        {
7042            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7043            Ok(Self::new(conn))
7044        }
7045    }
7046    impl<T> InsightsServiceClient<T>
7047    where
7048        T: tonic::client::GrpcService<tonic::body::Body>,
7049        T::Error: Into<StdError>,
7050        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7051        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7052    {
7053        pub fn new(inner: T) -> Self {
7054            let inner = tonic::client::Grpc::new(inner);
7055            Self { inner }
7056        }
7057        pub fn with_origin(inner: T, origin: Uri) -> Self {
7058            let inner = tonic::client::Grpc::with_origin(inner, origin);
7059            Self { inner }
7060        }
7061        pub fn with_interceptor<F>(
7062            inner: T,
7063            interceptor: F,
7064        ) -> InsightsServiceClient<InterceptedService<T, F>>
7065        where
7066            F: tonic::service::Interceptor,
7067            T::ResponseBody: Default,
7068            T: tonic::codegen::Service<
7069                http::Request<tonic::body::Body>,
7070                Response = http::Response<
7071                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7072                >,
7073            >,
7074            <T as tonic::codegen::Service<
7075                http::Request<tonic::body::Body>,
7076            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7077        {
7078            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
7079        }
7080        /// Compress requests with the given encoding.
7081        ///
7082        /// This requires the server to support it otherwise it might respond with an
7083        /// error.
7084        #[must_use]
7085        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7086            self.inner = self.inner.send_compressed(encoding);
7087            self
7088        }
7089        /// Enable decompressing responses.
7090        #[must_use]
7091        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7092            self.inner = self.inner.accept_compressed(encoding);
7093            self
7094        }
7095        /// Limits the maximum size of a decoded message.
7096        ///
7097        /// Default: `4MB`
7098        #[must_use]
7099        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7100            self.inner = self.inner.max_decoding_message_size(limit);
7101            self
7102        }
7103        /// Limits the maximum size of an encoded message.
7104        ///
7105        /// Default: `usize::MAX`
7106        #[must_use]
7107        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7108            self.inner = self.inner.max_encoding_message_size(limit);
7109            self
7110        }
7111        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7112 Returns empty archetypes if insufficient data (cold start).
7113 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7114*/
7115        pub async fn get_group_archetypes(
7116            &mut self,
7117            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
7118        ) -> std::result::Result<
7119            tonic::Response<super::GetGroupArchetypesResponse>,
7120            tonic::Status,
7121        > {
7122            self.inner
7123                .ready()
7124                .await
7125                .map_err(|e| {
7126                    tonic::Status::unknown(
7127                        format!("Service was not ready: {}", e.into()),
7128                    )
7129                })?;
7130            let codec = tonic_prost::ProstCodec::default();
7131            let path = http::uri::PathAndQuery::from_static(
7132                "/pidgr.v1.InsightsService/GetGroupArchetypes",
7133            );
7134            let mut req = request.into_request();
7135            req.extensions_mut()
7136                .insert(
7137                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
7138                );
7139            self.inner.unary(req, path, codec).await
7140        }
7141        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7142 Returns a confidence interval that narrows as more campaign data accumulates.
7143 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7144*/
7145        pub async fn predict_campaign_ack(
7146            &mut self,
7147            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
7148        ) -> std::result::Result<
7149            tonic::Response<super::PredictCampaignAckResponse>,
7150            tonic::Status,
7151        > {
7152            self.inner
7153                .ready()
7154                .await
7155                .map_err(|e| {
7156                    tonic::Status::unknown(
7157                        format!("Service was not ready: {}", e.into()),
7158                    )
7159                })?;
7160            let codec = tonic_prost::ProstCodec::default();
7161            let path = http::uri::PathAndQuery::from_static(
7162                "/pidgr.v1.InsightsService/PredictCampaignACK",
7163            );
7164            let mut req = request.into_request();
7165            req.extensions_mut()
7166                .insert(
7167                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
7168                );
7169            self.inner.unary(req, path, codec).await
7170        }
7171        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7172 Advisory is informational only — never drives automated decisions.
7173 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7174*/
7175        pub async fn get_campaign_advisory(
7176            &mut self,
7177            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
7178        ) -> std::result::Result<
7179            tonic::Response<super::GetCampaignAdvisoryResponse>,
7180            tonic::Status,
7181        > {
7182            self.inner
7183                .ready()
7184                .await
7185                .map_err(|e| {
7186                    tonic::Status::unknown(
7187                        format!("Service was not ready: {}", e.into()),
7188                    )
7189                })?;
7190            let codec = tonic_prost::ProstCodec::default();
7191            let path = http::uri::PathAndQuery::from_static(
7192                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
7193            );
7194            let mut req = request.into_request();
7195            req.extensions_mut()
7196                .insert(
7197                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
7198                );
7199            self.inner.unary(req, path, codec).await
7200        }
7201        /** Generate an AI-powered narrative summary of a group's insights.
7202 Combines archetype, prediction, and campaign data into human-readable analysis.
7203 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7204*/
7205        pub async fn get_insight_narrative(
7206            &mut self,
7207            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
7208        ) -> std::result::Result<
7209            tonic::Response<super::GetInsightNarrativeResponse>,
7210            tonic::Status,
7211        > {
7212            self.inner
7213                .ready()
7214                .await
7215                .map_err(|e| {
7216                    tonic::Status::unknown(
7217                        format!("Service was not ready: {}", e.into()),
7218                    )
7219                })?;
7220            let codec = tonic_prost::ProstCodec::default();
7221            let path = http::uri::PathAndQuery::from_static(
7222                "/pidgr.v1.InsightsService/GetInsightNarrative",
7223            );
7224            let mut req = request.into_request();
7225            req.extensions_mut()
7226                .insert(
7227                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
7228                );
7229            self.inner.unary(req, path, codec).await
7230        }
7231        /** Manually trigger the ML training pipeline for the caller's organization.
7232 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7233 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7234*/
7235        pub async fn trigger_ml_pipeline(
7236            &mut self,
7237            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
7238        ) -> std::result::Result<
7239            tonic::Response<super::TriggerMlPipelineResponse>,
7240            tonic::Status,
7241        > {
7242            self.inner
7243                .ready()
7244                .await
7245                .map_err(|e| {
7246                    tonic::Status::unknown(
7247                        format!("Service was not ready: {}", e.into()),
7248                    )
7249                })?;
7250            let codec = tonic_prost::ProstCodec::default();
7251            let path = http::uri::PathAndQuery::from_static(
7252                "/pidgr.v1.InsightsService/TriggerMLPipeline",
7253            );
7254            let mut req = request.into_request();
7255            req.extensions_mut()
7256                .insert(
7257                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
7258                );
7259            self.inner.unary(req, path, codec).await
7260        }
7261        /** Manually retrigger archetype clustering for a single group, reusing
7262 the already-deployed SageMaker clustering model. Cheaper than a
7263 full TriggerMLPipeline run because no training happens. Shares the
7264 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7265 get N manual retrains per month across both RPCs.
7266 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7267*/
7268        pub async fn trigger_archetype_clustering(
7269            &mut self,
7270            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7271        ) -> std::result::Result<
7272            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7273            tonic::Status,
7274        > {
7275            self.inner
7276                .ready()
7277                .await
7278                .map_err(|e| {
7279                    tonic::Status::unknown(
7280                        format!("Service was not ready: {}", e.into()),
7281                    )
7282                })?;
7283            let codec = tonic_prost::ProstCodec::default();
7284            let path = http::uri::PathAndQuery::from_static(
7285                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7286            );
7287            let mut req = request.into_request();
7288            req.extensions_mut()
7289                .insert(
7290                    GrpcMethod::new(
7291                        "pidgr.v1.InsightsService",
7292                        "TriggerArchetypeClustering",
7293                    ),
7294                );
7295            self.inner.unary(req, path, codec).await
7296        }
7297        /** Draft a campaign body for the given archetype using Bedrock with the
7298 campaign-for-archetype prompt template. Used by the Compass
7299 "Target this archetype" CTA to pre-fill the wizard's body field.
7300 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7301 returns NOT_FOUND.
7302 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7303*/
7304        pub async fn generate_campaign_body_draft(
7305            &mut self,
7306            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7307        ) -> std::result::Result<
7308            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7309            tonic::Status,
7310        > {
7311            self.inner
7312                .ready()
7313                .await
7314                .map_err(|e| {
7315                    tonic::Status::unknown(
7316                        format!("Service was not ready: {}", e.into()),
7317                    )
7318                })?;
7319            let codec = tonic_prost::ProstCodec::default();
7320            let path = http::uri::PathAndQuery::from_static(
7321                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7322            );
7323            let mut req = request.into_request();
7324            req.extensions_mut()
7325                .insert(
7326                    GrpcMethod::new(
7327                        "pidgr.v1.InsightsService",
7328                        "GenerateCampaignBodyDraft",
7329                    ),
7330                );
7331            self.inner.unary(req, path, codec).await
7332        }
7333    }
7334}
7335/// Generated server implementations.
7336pub mod insights_service_server {
7337    #![allow(
7338        unused_variables,
7339        dead_code,
7340        missing_docs,
7341        clippy::wildcard_imports,
7342        clippy::let_unit_value,
7343    )]
7344    use tonic::codegen::*;
7345    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7346    #[async_trait]
7347    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7348        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7349 Returns empty archetypes if insufficient data (cold start).
7350 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7351*/
7352        async fn get_group_archetypes(
7353            &self,
7354            request: tonic::Request<super::GetGroupArchetypesRequest>,
7355        ) -> std::result::Result<
7356            tonic::Response<super::GetGroupArchetypesResponse>,
7357            tonic::Status,
7358        >;
7359        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7360 Returns a confidence interval that narrows as more campaign data accumulates.
7361 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7362*/
7363        async fn predict_campaign_ack(
7364            &self,
7365            request: tonic::Request<super::PredictCampaignAckRequest>,
7366        ) -> std::result::Result<
7367            tonic::Response<super::PredictCampaignAckResponse>,
7368            tonic::Status,
7369        >;
7370        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7371 Advisory is informational only — never drives automated decisions.
7372 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7373*/
7374        async fn get_campaign_advisory(
7375            &self,
7376            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7377        ) -> std::result::Result<
7378            tonic::Response<super::GetCampaignAdvisoryResponse>,
7379            tonic::Status,
7380        >;
7381        /** Generate an AI-powered narrative summary of a group's insights.
7382 Combines archetype, prediction, and campaign data into human-readable analysis.
7383 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7384*/
7385        async fn get_insight_narrative(
7386            &self,
7387            request: tonic::Request<super::GetInsightNarrativeRequest>,
7388        ) -> std::result::Result<
7389            tonic::Response<super::GetInsightNarrativeResponse>,
7390            tonic::Status,
7391        >;
7392        /** Manually trigger the ML training pipeline for the caller's organization.
7393 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7394 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7395*/
7396        async fn trigger_ml_pipeline(
7397            &self,
7398            request: tonic::Request<super::TriggerMlPipelineRequest>,
7399        ) -> std::result::Result<
7400            tonic::Response<super::TriggerMlPipelineResponse>,
7401            tonic::Status,
7402        >;
7403        /** Manually retrigger archetype clustering for a single group, reusing
7404 the already-deployed SageMaker clustering model. Cheaper than a
7405 full TriggerMLPipeline run because no training happens. Shares the
7406 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7407 get N manual retrains per month across both RPCs.
7408 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7409*/
7410        async fn trigger_archetype_clustering(
7411            &self,
7412            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7413        ) -> std::result::Result<
7414            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7415            tonic::Status,
7416        >;
7417        /** Draft a campaign body for the given archetype using Bedrock with the
7418 campaign-for-archetype prompt template. Used by the Compass
7419 "Target this archetype" CTA to pre-fill the wizard's body field.
7420 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7421 returns NOT_FOUND.
7422 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7423*/
7424        async fn generate_campaign_body_draft(
7425            &self,
7426            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7427        ) -> std::result::Result<
7428            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7429            tonic::Status,
7430        >;
7431    }
7432    /** Provides cohort-level AI insights for campaign planning and optimization.
7433 All predictions are aggregate — no individual-level profiling.
7434 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7435 All RPCs operate within the caller's org (extracted from JWT).
7436*/
7437    #[derive(Debug)]
7438    pub struct InsightsServiceServer<T> {
7439        inner: Arc<T>,
7440        accept_compression_encodings: EnabledCompressionEncodings,
7441        send_compression_encodings: EnabledCompressionEncodings,
7442        max_decoding_message_size: Option<usize>,
7443        max_encoding_message_size: Option<usize>,
7444    }
7445    impl<T> InsightsServiceServer<T> {
7446        pub fn new(inner: T) -> Self {
7447            Self::from_arc(Arc::new(inner))
7448        }
7449        pub fn from_arc(inner: Arc<T>) -> Self {
7450            Self {
7451                inner,
7452                accept_compression_encodings: Default::default(),
7453                send_compression_encodings: Default::default(),
7454                max_decoding_message_size: None,
7455                max_encoding_message_size: None,
7456            }
7457        }
7458        pub fn with_interceptor<F>(
7459            inner: T,
7460            interceptor: F,
7461        ) -> InterceptedService<Self, F>
7462        where
7463            F: tonic::service::Interceptor,
7464        {
7465            InterceptedService::new(Self::new(inner), interceptor)
7466        }
7467        /// Enable decompressing requests with the given encoding.
7468        #[must_use]
7469        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7470            self.accept_compression_encodings.enable(encoding);
7471            self
7472        }
7473        /// Compress responses with the given encoding, if the client supports it.
7474        #[must_use]
7475        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7476            self.send_compression_encodings.enable(encoding);
7477            self
7478        }
7479        /// Limits the maximum size of a decoded message.
7480        ///
7481        /// Default: `4MB`
7482        #[must_use]
7483        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7484            self.max_decoding_message_size = Some(limit);
7485            self
7486        }
7487        /// Limits the maximum size of an encoded message.
7488        ///
7489        /// Default: `usize::MAX`
7490        #[must_use]
7491        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7492            self.max_encoding_message_size = Some(limit);
7493            self
7494        }
7495    }
7496    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7497    where
7498        T: InsightsService,
7499        B: Body + std::marker::Send + 'static,
7500        B::Error: Into<StdError> + std::marker::Send + 'static,
7501    {
7502        type Response = http::Response<tonic::body::Body>;
7503        type Error = std::convert::Infallible;
7504        type Future = BoxFuture<Self::Response, Self::Error>;
7505        fn poll_ready(
7506            &mut self,
7507            _cx: &mut Context<'_>,
7508        ) -> Poll<std::result::Result<(), Self::Error>> {
7509            Poll::Ready(Ok(()))
7510        }
7511        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7512            match req.uri().path() {
7513                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7514                    #[allow(non_camel_case_types)]
7515                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7516                    impl<
7517                        T: InsightsService,
7518                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7519                    for GetGroupArchetypesSvc<T> {
7520                        type Response = super::GetGroupArchetypesResponse;
7521                        type Future = BoxFuture<
7522                            tonic::Response<Self::Response>,
7523                            tonic::Status,
7524                        >;
7525                        fn call(
7526                            &mut self,
7527                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7528                        ) -> Self::Future {
7529                            let inner = Arc::clone(&self.0);
7530                            let fut = async move {
7531                                <T as InsightsService>::get_group_archetypes(
7532                                        &inner,
7533                                        request,
7534                                    )
7535                                    .await
7536                            };
7537                            Box::pin(fut)
7538                        }
7539                    }
7540                    let accept_compression_encodings = self.accept_compression_encodings;
7541                    let send_compression_encodings = self.send_compression_encodings;
7542                    let max_decoding_message_size = self.max_decoding_message_size;
7543                    let max_encoding_message_size = self.max_encoding_message_size;
7544                    let inner = self.inner.clone();
7545                    let fut = async move {
7546                        let method = GetGroupArchetypesSvc(inner);
7547                        let codec = tonic_prost::ProstCodec::default();
7548                        let mut grpc = tonic::server::Grpc::new(codec)
7549                            .apply_compression_config(
7550                                accept_compression_encodings,
7551                                send_compression_encodings,
7552                            )
7553                            .apply_max_message_size_config(
7554                                max_decoding_message_size,
7555                                max_encoding_message_size,
7556                            );
7557                        let res = grpc.unary(method, req).await;
7558                        Ok(res)
7559                    };
7560                    Box::pin(fut)
7561                }
7562                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7563                    #[allow(non_camel_case_types)]
7564                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7565                    impl<
7566                        T: InsightsService,
7567                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7568                    for PredictCampaignACKSvc<T> {
7569                        type Response = super::PredictCampaignAckResponse;
7570                        type Future = BoxFuture<
7571                            tonic::Response<Self::Response>,
7572                            tonic::Status,
7573                        >;
7574                        fn call(
7575                            &mut self,
7576                            request: tonic::Request<super::PredictCampaignAckRequest>,
7577                        ) -> Self::Future {
7578                            let inner = Arc::clone(&self.0);
7579                            let fut = async move {
7580                                <T as InsightsService>::predict_campaign_ack(
7581                                        &inner,
7582                                        request,
7583                                    )
7584                                    .await
7585                            };
7586                            Box::pin(fut)
7587                        }
7588                    }
7589                    let accept_compression_encodings = self.accept_compression_encodings;
7590                    let send_compression_encodings = self.send_compression_encodings;
7591                    let max_decoding_message_size = self.max_decoding_message_size;
7592                    let max_encoding_message_size = self.max_encoding_message_size;
7593                    let inner = self.inner.clone();
7594                    let fut = async move {
7595                        let method = PredictCampaignACKSvc(inner);
7596                        let codec = tonic_prost::ProstCodec::default();
7597                        let mut grpc = tonic::server::Grpc::new(codec)
7598                            .apply_compression_config(
7599                                accept_compression_encodings,
7600                                send_compression_encodings,
7601                            )
7602                            .apply_max_message_size_config(
7603                                max_decoding_message_size,
7604                                max_encoding_message_size,
7605                            );
7606                        let res = grpc.unary(method, req).await;
7607                        Ok(res)
7608                    };
7609                    Box::pin(fut)
7610                }
7611                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7612                    #[allow(non_camel_case_types)]
7613                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7614                    impl<
7615                        T: InsightsService,
7616                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7617                    for GetCampaignAdvisorySvc<T> {
7618                        type Response = super::GetCampaignAdvisoryResponse;
7619                        type Future = BoxFuture<
7620                            tonic::Response<Self::Response>,
7621                            tonic::Status,
7622                        >;
7623                        fn call(
7624                            &mut self,
7625                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7626                        ) -> Self::Future {
7627                            let inner = Arc::clone(&self.0);
7628                            let fut = async move {
7629                                <T as InsightsService>::get_campaign_advisory(
7630                                        &inner,
7631                                        request,
7632                                    )
7633                                    .await
7634                            };
7635                            Box::pin(fut)
7636                        }
7637                    }
7638                    let accept_compression_encodings = self.accept_compression_encodings;
7639                    let send_compression_encodings = self.send_compression_encodings;
7640                    let max_decoding_message_size = self.max_decoding_message_size;
7641                    let max_encoding_message_size = self.max_encoding_message_size;
7642                    let inner = self.inner.clone();
7643                    let fut = async move {
7644                        let method = GetCampaignAdvisorySvc(inner);
7645                        let codec = tonic_prost::ProstCodec::default();
7646                        let mut grpc = tonic::server::Grpc::new(codec)
7647                            .apply_compression_config(
7648                                accept_compression_encodings,
7649                                send_compression_encodings,
7650                            )
7651                            .apply_max_message_size_config(
7652                                max_decoding_message_size,
7653                                max_encoding_message_size,
7654                            );
7655                        let res = grpc.unary(method, req).await;
7656                        Ok(res)
7657                    };
7658                    Box::pin(fut)
7659                }
7660                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7661                    #[allow(non_camel_case_types)]
7662                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7663                    impl<
7664                        T: InsightsService,
7665                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7666                    for GetInsightNarrativeSvc<T> {
7667                        type Response = super::GetInsightNarrativeResponse;
7668                        type Future = BoxFuture<
7669                            tonic::Response<Self::Response>,
7670                            tonic::Status,
7671                        >;
7672                        fn call(
7673                            &mut self,
7674                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7675                        ) -> Self::Future {
7676                            let inner = Arc::clone(&self.0);
7677                            let fut = async move {
7678                                <T as InsightsService>::get_insight_narrative(
7679                                        &inner,
7680                                        request,
7681                                    )
7682                                    .await
7683                            };
7684                            Box::pin(fut)
7685                        }
7686                    }
7687                    let accept_compression_encodings = self.accept_compression_encodings;
7688                    let send_compression_encodings = self.send_compression_encodings;
7689                    let max_decoding_message_size = self.max_decoding_message_size;
7690                    let max_encoding_message_size = self.max_encoding_message_size;
7691                    let inner = self.inner.clone();
7692                    let fut = async move {
7693                        let method = GetInsightNarrativeSvc(inner);
7694                        let codec = tonic_prost::ProstCodec::default();
7695                        let mut grpc = tonic::server::Grpc::new(codec)
7696                            .apply_compression_config(
7697                                accept_compression_encodings,
7698                                send_compression_encodings,
7699                            )
7700                            .apply_max_message_size_config(
7701                                max_decoding_message_size,
7702                                max_encoding_message_size,
7703                            );
7704                        let res = grpc.unary(method, req).await;
7705                        Ok(res)
7706                    };
7707                    Box::pin(fut)
7708                }
7709                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7710                    #[allow(non_camel_case_types)]
7711                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7712                    impl<
7713                        T: InsightsService,
7714                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7715                    for TriggerMLPipelineSvc<T> {
7716                        type Response = super::TriggerMlPipelineResponse;
7717                        type Future = BoxFuture<
7718                            tonic::Response<Self::Response>,
7719                            tonic::Status,
7720                        >;
7721                        fn call(
7722                            &mut self,
7723                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7724                        ) -> Self::Future {
7725                            let inner = Arc::clone(&self.0);
7726                            let fut = async move {
7727                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7728                                    .await
7729                            };
7730                            Box::pin(fut)
7731                        }
7732                    }
7733                    let accept_compression_encodings = self.accept_compression_encodings;
7734                    let send_compression_encodings = self.send_compression_encodings;
7735                    let max_decoding_message_size = self.max_decoding_message_size;
7736                    let max_encoding_message_size = self.max_encoding_message_size;
7737                    let inner = self.inner.clone();
7738                    let fut = async move {
7739                        let method = TriggerMLPipelineSvc(inner);
7740                        let codec = tonic_prost::ProstCodec::default();
7741                        let mut grpc = tonic::server::Grpc::new(codec)
7742                            .apply_compression_config(
7743                                accept_compression_encodings,
7744                                send_compression_encodings,
7745                            )
7746                            .apply_max_message_size_config(
7747                                max_decoding_message_size,
7748                                max_encoding_message_size,
7749                            );
7750                        let res = grpc.unary(method, req).await;
7751                        Ok(res)
7752                    };
7753                    Box::pin(fut)
7754                }
7755                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7756                    #[allow(non_camel_case_types)]
7757                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7758                    impl<
7759                        T: InsightsService,
7760                    > tonic::server::UnaryService<
7761                        super::TriggerArchetypeClusteringRequest,
7762                    > for TriggerArchetypeClusteringSvc<T> {
7763                        type Response = super::TriggerArchetypeClusteringResponse;
7764                        type Future = BoxFuture<
7765                            tonic::Response<Self::Response>,
7766                            tonic::Status,
7767                        >;
7768                        fn call(
7769                            &mut self,
7770                            request: tonic::Request<
7771                                super::TriggerArchetypeClusteringRequest,
7772                            >,
7773                        ) -> Self::Future {
7774                            let inner = Arc::clone(&self.0);
7775                            let fut = async move {
7776                                <T as InsightsService>::trigger_archetype_clustering(
7777                                        &inner,
7778                                        request,
7779                                    )
7780                                    .await
7781                            };
7782                            Box::pin(fut)
7783                        }
7784                    }
7785                    let accept_compression_encodings = self.accept_compression_encodings;
7786                    let send_compression_encodings = self.send_compression_encodings;
7787                    let max_decoding_message_size = self.max_decoding_message_size;
7788                    let max_encoding_message_size = self.max_encoding_message_size;
7789                    let inner = self.inner.clone();
7790                    let fut = async move {
7791                        let method = TriggerArchetypeClusteringSvc(inner);
7792                        let codec = tonic_prost::ProstCodec::default();
7793                        let mut grpc = tonic::server::Grpc::new(codec)
7794                            .apply_compression_config(
7795                                accept_compression_encodings,
7796                                send_compression_encodings,
7797                            )
7798                            .apply_max_message_size_config(
7799                                max_decoding_message_size,
7800                                max_encoding_message_size,
7801                            );
7802                        let res = grpc.unary(method, req).await;
7803                        Ok(res)
7804                    };
7805                    Box::pin(fut)
7806                }
7807                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7808                    #[allow(non_camel_case_types)]
7809                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7810                    impl<
7811                        T: InsightsService,
7812                    > tonic::server::UnaryService<
7813                        super::GenerateCampaignBodyDraftRequest,
7814                    > for GenerateCampaignBodyDraftSvc<T> {
7815                        type Response = super::GenerateCampaignBodyDraftResponse;
7816                        type Future = BoxFuture<
7817                            tonic::Response<Self::Response>,
7818                            tonic::Status,
7819                        >;
7820                        fn call(
7821                            &mut self,
7822                            request: tonic::Request<
7823                                super::GenerateCampaignBodyDraftRequest,
7824                            >,
7825                        ) -> Self::Future {
7826                            let inner = Arc::clone(&self.0);
7827                            let fut = async move {
7828                                <T as InsightsService>::generate_campaign_body_draft(
7829                                        &inner,
7830                                        request,
7831                                    )
7832                                    .await
7833                            };
7834                            Box::pin(fut)
7835                        }
7836                    }
7837                    let accept_compression_encodings = self.accept_compression_encodings;
7838                    let send_compression_encodings = self.send_compression_encodings;
7839                    let max_decoding_message_size = self.max_decoding_message_size;
7840                    let max_encoding_message_size = self.max_encoding_message_size;
7841                    let inner = self.inner.clone();
7842                    let fut = async move {
7843                        let method = GenerateCampaignBodyDraftSvc(inner);
7844                        let codec = tonic_prost::ProstCodec::default();
7845                        let mut grpc = tonic::server::Grpc::new(codec)
7846                            .apply_compression_config(
7847                                accept_compression_encodings,
7848                                send_compression_encodings,
7849                            )
7850                            .apply_max_message_size_config(
7851                                max_decoding_message_size,
7852                                max_encoding_message_size,
7853                            );
7854                        let res = grpc.unary(method, req).await;
7855                        Ok(res)
7856                    };
7857                    Box::pin(fut)
7858                }
7859                _ => {
7860                    Box::pin(async move {
7861                        let mut response = http::Response::new(
7862                            tonic::body::Body::default(),
7863                        );
7864                        let headers = response.headers_mut();
7865                        headers
7866                            .insert(
7867                                tonic::Status::GRPC_STATUS,
7868                                (tonic::Code::Unimplemented as i32).into(),
7869                            );
7870                        headers
7871                            .insert(
7872                                http::header::CONTENT_TYPE,
7873                                tonic::metadata::GRPC_CONTENT_TYPE,
7874                            );
7875                        Ok(response)
7876                    })
7877                }
7878            }
7879        }
7880    }
7881    impl<T> Clone for InsightsServiceServer<T> {
7882        fn clone(&self) -> Self {
7883            let inner = self.inner.clone();
7884            Self {
7885                inner,
7886                accept_compression_encodings: self.accept_compression_encodings,
7887                send_compression_encodings: self.send_compression_encodings,
7888                max_decoding_message_size: self.max_decoding_message_size,
7889                max_encoding_message_size: self.max_encoding_message_size,
7890            }
7891        }
7892    }
7893    /// Generated gRPC service name
7894    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7895    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7896        const NAME: &'static str = SERVICE_NAME;
7897    }
7898}
7899/// Generated client implementations.
7900pub mod integrations_service_client {
7901    #![allow(
7902        unused_variables,
7903        dead_code,
7904        missing_docs,
7905        clippy::wildcard_imports,
7906        clippy::let_unit_value,
7907    )]
7908    use tonic::codegen::*;
7909    use tonic::codegen::http::Uri;
7910    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
7911
7912 Auth model:
7913   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
7914     on behalf of pidgr-api dispatch activities. Never exposed publicly.
7915   - UpsertReachability / RemoveReachability / GetReachability /
7916     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
7917     caller's `custom:org_id` claim).
7918   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
7919     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
7920     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
7921
7922 Cross-org access is denied with `permission_denied`.
7923*/
7924    #[derive(Debug, Clone)]
7925    pub struct IntegrationsServiceClient<T> {
7926        inner: tonic::client::Grpc<T>,
7927    }
7928    impl IntegrationsServiceClient<tonic::transport::Channel> {
7929        /// Attempt to create a new client by connecting to a given endpoint.
7930        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7931        where
7932            D: TryInto<tonic::transport::Endpoint>,
7933            D::Error: Into<StdError>,
7934        {
7935            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7936            Ok(Self::new(conn))
7937        }
7938    }
7939    impl<T> IntegrationsServiceClient<T>
7940    where
7941        T: tonic::client::GrpcService<tonic::body::Body>,
7942        T::Error: Into<StdError>,
7943        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7944        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7945    {
7946        pub fn new(inner: T) -> Self {
7947            let inner = tonic::client::Grpc::new(inner);
7948            Self { inner }
7949        }
7950        pub fn with_origin(inner: T, origin: Uri) -> Self {
7951            let inner = tonic::client::Grpc::with_origin(inner, origin);
7952            Self { inner }
7953        }
7954        pub fn with_interceptor<F>(
7955            inner: T,
7956            interceptor: F,
7957        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
7958        where
7959            F: tonic::service::Interceptor,
7960            T::ResponseBody: Default,
7961            T: tonic::codegen::Service<
7962                http::Request<tonic::body::Body>,
7963                Response = http::Response<
7964                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7965                >,
7966            >,
7967            <T as tonic::codegen::Service<
7968                http::Request<tonic::body::Body>,
7969            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7970        {
7971            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
7972        }
7973        /// Compress requests with the given encoding.
7974        ///
7975        /// This requires the server to support it otherwise it might respond with an
7976        /// error.
7977        #[must_use]
7978        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7979            self.inner = self.inner.send_compressed(encoding);
7980            self
7981        }
7982        /// Enable decompressing responses.
7983        #[must_use]
7984        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7985            self.inner = self.inner.accept_compressed(encoding);
7986            self
7987        }
7988        /// Limits the maximum size of a decoded message.
7989        ///
7990        /// Default: `4MB`
7991        #[must_use]
7992        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7993            self.inner = self.inner.max_decoding_message_size(limit);
7994            self
7995        }
7996        /// Limits the maximum size of an encoded message.
7997        ///
7998        /// Default: `usize::MAX`
7999        #[must_use]
8000        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8001            self.inner = self.inner.max_encoding_message_size(limit);
8002            self
8003        }
8004        /** Dispatch a single rendered message to one channel. Idempotent on
8005 `dispatch_id`. Internal-mTLS only.
8006*/
8007        pub async fn dispatch_to_channel(
8008            &mut self,
8009            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8010        ) -> std::result::Result<
8011            tonic::Response<super::DispatchToChannelResponse>,
8012            tonic::Status,
8013        > {
8014            self.inner
8015                .ready()
8016                .await
8017                .map_err(|e| {
8018                    tonic::Status::unknown(
8019                        format!("Service was not ready: {}", e.into()),
8020                    )
8021                })?;
8022            let codec = tonic_prost::ProstCodec::default();
8023            let path = http::uri::PathAndQuery::from_static(
8024                "/pidgr.v1.IntegrationsService/DispatchToChannel",
8025            );
8026            let mut req = request.into_request();
8027            req.extensions_mut()
8028                .insert(
8029                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8030                );
8031            self.inner.unary(req, path, codec).await
8032        }
8033        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8034 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8035 audit row BEFORE the registry commit.
8036*/
8037        pub async fn upsert_reachability(
8038            &mut self,
8039            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8040        ) -> std::result::Result<
8041            tonic::Response<super::UpsertReachabilityResponse>,
8042            tonic::Status,
8043        > {
8044            self.inner
8045                .ready()
8046                .await
8047                .map_err(|e| {
8048                    tonic::Status::unknown(
8049                        format!("Service was not ready: {}", e.into()),
8050                    )
8051                })?;
8052            let codec = tonic_prost::ProstCodec::default();
8053            let path = http::uri::PathAndQuery::from_static(
8054                "/pidgr.v1.IntegrationsService/UpsertReachability",
8055            );
8056            let mut req = request.into_request();
8057            req.extensions_mut()
8058                .insert(
8059                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8060                );
8061            self.inner.unary(req, path, codec).await
8062        }
8063        /** Remove a reachability identifier. Idempotent. Emits a
8064 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8065*/
8066        pub async fn remove_reachability(
8067            &mut self,
8068            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8069        ) -> std::result::Result<
8070            tonic::Response<super::RemoveReachabilityResponse>,
8071            tonic::Status,
8072        > {
8073            self.inner
8074                .ready()
8075                .await
8076                .map_err(|e| {
8077                    tonic::Status::unknown(
8078                        format!("Service was not ready: {}", e.into()),
8079                    )
8080                })?;
8081            let codec = tonic_prost::ProstCodec::default();
8082            let path = http::uri::PathAndQuery::from_static(
8083                "/pidgr.v1.IntegrationsService/RemoveReachability",
8084            );
8085            let mut req = request.into_request();
8086            req.extensions_mut()
8087                .insert(
8088                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8089                );
8090            self.inner.unary(req, path, codec).await
8091        }
8092        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8093 Does not return plaintext or envelope ciphertext.
8094*/
8095        pub async fn get_reachability(
8096            &mut self,
8097            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8098        ) -> std::result::Result<
8099            tonic::Response<super::GetReachabilityResponse>,
8100            tonic::Status,
8101        > {
8102            self.inner
8103                .ready()
8104                .await
8105                .map_err(|e| {
8106                    tonic::Status::unknown(
8107                        format!("Service was not ready: {}", e.into()),
8108                    )
8109                })?;
8110            let codec = tonic_prost::ProstCodec::default();
8111            let path = http::uri::PathAndQuery::from_static(
8112                "/pidgr.v1.IntegrationsService/GetReachability",
8113            );
8114            let mut req = request.into_request();
8115            req.extensions_mut()
8116                .insert(
8117                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8118                );
8119            self.inner.unary(req, path, codec).await
8120        }
8121        /** List per-channel reachability metadata for a single user. Used by the
8122 admin per-user matrix view. Does not return plaintext or ciphertext.
8123*/
8124        pub async fn list_reachability_for_user(
8125            &mut self,
8126            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8127        ) -> std::result::Result<
8128            tonic::Response<super::ListReachabilityForUserResponse>,
8129            tonic::Status,
8130        > {
8131            self.inner
8132                .ready()
8133                .await
8134                .map_err(|e| {
8135                    tonic::Status::unknown(
8136                        format!("Service was not ready: {}", e.into()),
8137                    )
8138                })?;
8139            let codec = tonic_prost::ProstCodec::default();
8140            let path = http::uri::PathAndQuery::from_static(
8141                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8142            );
8143            let mut req = request.into_request();
8144            req.extensions_mut()
8145                .insert(
8146                    GrpcMethod::new(
8147                        "pidgr.v1.IntegrationsService",
8148                        "ListReachabilityForUser",
8149                    ),
8150                );
8151            self.inner.unary(req, path, codec).await
8152        }
8153        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8154 no policy is configured — NOT a NOT_FOUND.
8155*/
8156        pub async fn get_region_policy(
8157            &mut self,
8158            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8159        ) -> std::result::Result<
8160            tonic::Response<super::GetRegionPolicyResponse>,
8161            tonic::Status,
8162        > {
8163            self.inner
8164                .ready()
8165                .await
8166                .map_err(|e| {
8167                    tonic::Status::unknown(
8168                        format!("Service was not ready: {}", e.into()),
8169                    )
8170                })?;
8171            let codec = tonic_prost::ProstCodec::default();
8172            let path = http::uri::PathAndQuery::from_static(
8173                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8174            );
8175            let mut req = request.into_request();
8176            req.extensions_mut()
8177                .insert(
8178                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8179                );
8180            self.inner.unary(req, path, codec).await
8181        }
8182        /** Admin-only upsert of the per-(org, channel) region allowlist.
8183*/
8184        pub async fn set_region_policy(
8185            &mut self,
8186            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8187        ) -> std::result::Result<
8188            tonic::Response<super::SetRegionPolicyResponse>,
8189            tonic::Status,
8190        > {
8191            self.inner
8192                .ready()
8193                .await
8194                .map_err(|e| {
8195                    tonic::Status::unknown(
8196                        format!("Service was not ready: {}", e.into()),
8197                    )
8198                })?;
8199            let codec = tonic_prost::ProstCodec::default();
8200            let path = http::uri::PathAndQuery::from_static(
8201                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8202            );
8203            let mut req = request.into_request();
8204            req.extensions_mut()
8205                .insert(
8206                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8207                );
8208            self.inner.unary(req, path, codec).await
8209        }
8210        /** Read the current calendar-month cost-cap state. Returns the channel
8211 default cap when no row exists; never NOT_FOUND.
8212*/
8213        pub async fn get_cost_cap_policy(
8214            &mut self,
8215            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8216        ) -> std::result::Result<
8217            tonic::Response<super::GetCostCapPolicyResponse>,
8218            tonic::Status,
8219        > {
8220            self.inner
8221                .ready()
8222                .await
8223                .map_err(|e| {
8224                    tonic::Status::unknown(
8225                        format!("Service was not ready: {}", e.into()),
8226                    )
8227                })?;
8228            let codec = tonic_prost::ProstCodec::default();
8229            let path = http::uri::PathAndQuery::from_static(
8230                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8231            );
8232            let mut req = request.into_request();
8233            req.extensions_mut()
8234                .insert(
8235                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8236                );
8237            self.inner.unary(req, path, codec).await
8238        }
8239        /** Admin-only upsert of the current calendar-month cost cap.
8240*/
8241        pub async fn set_cost_cap_policy(
8242            &mut self,
8243            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8244        ) -> std::result::Result<
8245            tonic::Response<super::SetCostCapPolicyResponse>,
8246            tonic::Status,
8247        > {
8248            self.inner
8249                .ready()
8250                .await
8251                .map_err(|e| {
8252                    tonic::Status::unknown(
8253                        format!("Service was not ready: {}", e.into()),
8254                    )
8255                })?;
8256            let codec = tonic_prost::ProstCodec::default();
8257            let path = http::uri::PathAndQuery::from_static(
8258                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8259            );
8260            let mut req = request.into_request();
8261            req.extensions_mut()
8262                .insert(
8263                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8264                );
8265            self.inner.unary(req, path, codec).await
8266        }
8267        /** Read the org's generic-webhook channel configuration. The signing secret
8268 is never returned. Returns an empty-url config when none exists — NOT a
8269 NOT_FOUND.
8270*/
8271        pub async fn get_org_webhook_config(
8272            &mut self,
8273            request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8274        ) -> std::result::Result<
8275            tonic::Response<super::GetOrgWebhookConfigResponse>,
8276            tonic::Status,
8277        > {
8278            self.inner
8279                .ready()
8280                .await
8281                .map_err(|e| {
8282                    tonic::Status::unknown(
8283                        format!("Service was not ready: {}", e.into()),
8284                    )
8285                })?;
8286            let codec = tonic_prost::ProstCodec::default();
8287            let path = http::uri::PathAndQuery::from_static(
8288                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8289            );
8290            let mut req = request.into_request();
8291            req.extensions_mut()
8292                .insert(
8293                    GrpcMethod::new(
8294                        "pidgr.v1.IntegrationsService",
8295                        "GetOrgWebhookConfig",
8296                    ),
8297                );
8298            self.inner.unary(req, path, codec).await
8299        }
8300        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8301 the destination URL (https-only, public hosts) and envelope-encrypts the
8302 secret at rest.
8303*/
8304        pub async fn set_org_webhook_config(
8305            &mut self,
8306            request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8307        ) -> std::result::Result<
8308            tonic::Response<super::SetOrgWebhookConfigResponse>,
8309            tonic::Status,
8310        > {
8311            self.inner
8312                .ready()
8313                .await
8314                .map_err(|e| {
8315                    tonic::Status::unknown(
8316                        format!("Service was not ready: {}", e.into()),
8317                    )
8318                })?;
8319            let codec = tonic_prost::ProstCodec::default();
8320            let path = http::uri::PathAndQuery::from_static(
8321                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8322            );
8323            let mut req = request.into_request();
8324            req.extensions_mut()
8325                .insert(
8326                    GrpcMethod::new(
8327                        "pidgr.v1.IntegrationsService",
8328                        "SetOrgWebhookConfig",
8329                    ),
8330                );
8331            self.inner.unary(req, path, codec).await
8332        }
8333        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8334 user follows to bind a third-party channel (Telegram bot-follow, Slack
8335 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8336 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8337 are rejected with `invalid_argument`.
8338*/
8339        pub async fn create_channel_connect_link(
8340            &mut self,
8341            request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8342        ) -> std::result::Result<
8343            tonic::Response<super::CreateChannelConnectLinkResponse>,
8344            tonic::Status,
8345        > {
8346            self.inner
8347                .ready()
8348                .await
8349                .map_err(|e| {
8350                    tonic::Status::unknown(
8351                        format!("Service was not ready: {}", e.into()),
8352                    )
8353                })?;
8354            let codec = tonic_prost::ProstCodec::default();
8355            let path = http::uri::PathAndQuery::from_static(
8356                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8357            );
8358            let mut req = request.into_request();
8359            req.extensions_mut()
8360                .insert(
8361                    GrpcMethod::new(
8362                        "pidgr.v1.IntegrationsService",
8363                        "CreateChannelConnectLink",
8364                    ),
8365                );
8366            self.inner.unary(req, path, codec).await
8367        }
8368    }
8369}
8370/// Generated server implementations.
8371pub mod integrations_service_server {
8372    #![allow(
8373        unused_variables,
8374        dead_code,
8375        missing_docs,
8376        clippy::wildcard_imports,
8377        clippy::let_unit_value,
8378    )]
8379    use tonic::codegen::*;
8380    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8381    #[async_trait]
8382    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8383        /** Dispatch a single rendered message to one channel. Idempotent on
8384 `dispatch_id`. Internal-mTLS only.
8385*/
8386        async fn dispatch_to_channel(
8387            &self,
8388            request: tonic::Request<super::DispatchToChannelRequest>,
8389        ) -> std::result::Result<
8390            tonic::Response<super::DispatchToChannelResponse>,
8391            tonic::Status,
8392        >;
8393        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8394 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8395 audit row BEFORE the registry commit.
8396*/
8397        async fn upsert_reachability(
8398            &self,
8399            request: tonic::Request<super::UpsertReachabilityRequest>,
8400        ) -> std::result::Result<
8401            tonic::Response<super::UpsertReachabilityResponse>,
8402            tonic::Status,
8403        >;
8404        /** Remove a reachability identifier. Idempotent. Emits a
8405 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8406*/
8407        async fn remove_reachability(
8408            &self,
8409            request: tonic::Request<super::RemoveReachabilityRequest>,
8410        ) -> std::result::Result<
8411            tonic::Response<super::RemoveReachabilityResponse>,
8412            tonic::Status,
8413        >;
8414        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8415 Does not return plaintext or envelope ciphertext.
8416*/
8417        async fn get_reachability(
8418            &self,
8419            request: tonic::Request<super::GetReachabilityRequest>,
8420        ) -> std::result::Result<
8421            tonic::Response<super::GetReachabilityResponse>,
8422            tonic::Status,
8423        >;
8424        /** List per-channel reachability metadata for a single user. Used by the
8425 admin per-user matrix view. Does not return plaintext or ciphertext.
8426*/
8427        async fn list_reachability_for_user(
8428            &self,
8429            request: tonic::Request<super::ListReachabilityForUserRequest>,
8430        ) -> std::result::Result<
8431            tonic::Response<super::ListReachabilityForUserResponse>,
8432            tonic::Status,
8433        >;
8434        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8435 no policy is configured — NOT a NOT_FOUND.
8436*/
8437        async fn get_region_policy(
8438            &self,
8439            request: tonic::Request<super::GetRegionPolicyRequest>,
8440        ) -> std::result::Result<
8441            tonic::Response<super::GetRegionPolicyResponse>,
8442            tonic::Status,
8443        >;
8444        /** Admin-only upsert of the per-(org, channel) region allowlist.
8445*/
8446        async fn set_region_policy(
8447            &self,
8448            request: tonic::Request<super::SetRegionPolicyRequest>,
8449        ) -> std::result::Result<
8450            tonic::Response<super::SetRegionPolicyResponse>,
8451            tonic::Status,
8452        >;
8453        /** Read the current calendar-month cost-cap state. Returns the channel
8454 default cap when no row exists; never NOT_FOUND.
8455*/
8456        async fn get_cost_cap_policy(
8457            &self,
8458            request: tonic::Request<super::GetCostCapPolicyRequest>,
8459        ) -> std::result::Result<
8460            tonic::Response<super::GetCostCapPolicyResponse>,
8461            tonic::Status,
8462        >;
8463        /** Admin-only upsert of the current calendar-month cost cap.
8464*/
8465        async fn set_cost_cap_policy(
8466            &self,
8467            request: tonic::Request<super::SetCostCapPolicyRequest>,
8468        ) -> std::result::Result<
8469            tonic::Response<super::SetCostCapPolicyResponse>,
8470            tonic::Status,
8471        >;
8472        /** Read the org's generic-webhook channel configuration. The signing secret
8473 is never returned. Returns an empty-url config when none exists — NOT a
8474 NOT_FOUND.
8475*/
8476        async fn get_org_webhook_config(
8477            &self,
8478            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8479        ) -> std::result::Result<
8480            tonic::Response<super::GetOrgWebhookConfigResponse>,
8481            tonic::Status,
8482        >;
8483        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8484 the destination URL (https-only, public hosts) and envelope-encrypts the
8485 secret at rest.
8486*/
8487        async fn set_org_webhook_config(
8488            &self,
8489            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8490        ) -> std::result::Result<
8491            tonic::Response<super::SetOrgWebhookConfigResponse>,
8492            tonic::Status,
8493        >;
8494        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8495 user follows to bind a third-party channel (Telegram bot-follow, Slack
8496 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8497 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8498 are rejected with `invalid_argument`.
8499*/
8500        async fn create_channel_connect_link(
8501            &self,
8502            request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8503        ) -> std::result::Result<
8504            tonic::Response<super::CreateChannelConnectLinkResponse>,
8505            tonic::Status,
8506        >;
8507    }
8508    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8509
8510 Auth model:
8511   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8512     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8513   - UpsertReachability / RemoveReachability / GetReachability /
8514     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8515     caller's `custom:org_id` claim).
8516   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8517     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8518     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8519
8520 Cross-org access is denied with `permission_denied`.
8521*/
8522    #[derive(Debug)]
8523    pub struct IntegrationsServiceServer<T> {
8524        inner: Arc<T>,
8525        accept_compression_encodings: EnabledCompressionEncodings,
8526        send_compression_encodings: EnabledCompressionEncodings,
8527        max_decoding_message_size: Option<usize>,
8528        max_encoding_message_size: Option<usize>,
8529    }
8530    impl<T> IntegrationsServiceServer<T> {
8531        pub fn new(inner: T) -> Self {
8532            Self::from_arc(Arc::new(inner))
8533        }
8534        pub fn from_arc(inner: Arc<T>) -> Self {
8535            Self {
8536                inner,
8537                accept_compression_encodings: Default::default(),
8538                send_compression_encodings: Default::default(),
8539                max_decoding_message_size: None,
8540                max_encoding_message_size: None,
8541            }
8542        }
8543        pub fn with_interceptor<F>(
8544            inner: T,
8545            interceptor: F,
8546        ) -> InterceptedService<Self, F>
8547        where
8548            F: tonic::service::Interceptor,
8549        {
8550            InterceptedService::new(Self::new(inner), interceptor)
8551        }
8552        /// Enable decompressing requests with the given encoding.
8553        #[must_use]
8554        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8555            self.accept_compression_encodings.enable(encoding);
8556            self
8557        }
8558        /// Compress responses with the given encoding, if the client supports it.
8559        #[must_use]
8560        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8561            self.send_compression_encodings.enable(encoding);
8562            self
8563        }
8564        /// Limits the maximum size of a decoded message.
8565        ///
8566        /// Default: `4MB`
8567        #[must_use]
8568        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8569            self.max_decoding_message_size = Some(limit);
8570            self
8571        }
8572        /// Limits the maximum size of an encoded message.
8573        ///
8574        /// Default: `usize::MAX`
8575        #[must_use]
8576        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8577            self.max_encoding_message_size = Some(limit);
8578            self
8579        }
8580    }
8581    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8582    where
8583        T: IntegrationsService,
8584        B: Body + std::marker::Send + 'static,
8585        B::Error: Into<StdError> + std::marker::Send + 'static,
8586    {
8587        type Response = http::Response<tonic::body::Body>;
8588        type Error = std::convert::Infallible;
8589        type Future = BoxFuture<Self::Response, Self::Error>;
8590        fn poll_ready(
8591            &mut self,
8592            _cx: &mut Context<'_>,
8593        ) -> Poll<std::result::Result<(), Self::Error>> {
8594            Poll::Ready(Ok(()))
8595        }
8596        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8597            match req.uri().path() {
8598                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8599                    #[allow(non_camel_case_types)]
8600                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8601                    impl<
8602                        T: IntegrationsService,
8603                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
8604                    for DispatchToChannelSvc<T> {
8605                        type Response = super::DispatchToChannelResponse;
8606                        type Future = BoxFuture<
8607                            tonic::Response<Self::Response>,
8608                            tonic::Status,
8609                        >;
8610                        fn call(
8611                            &mut self,
8612                            request: tonic::Request<super::DispatchToChannelRequest>,
8613                        ) -> Self::Future {
8614                            let inner = Arc::clone(&self.0);
8615                            let fut = async move {
8616                                <T as IntegrationsService>::dispatch_to_channel(
8617                                        &inner,
8618                                        request,
8619                                    )
8620                                    .await
8621                            };
8622                            Box::pin(fut)
8623                        }
8624                    }
8625                    let accept_compression_encodings = self.accept_compression_encodings;
8626                    let send_compression_encodings = self.send_compression_encodings;
8627                    let max_decoding_message_size = self.max_decoding_message_size;
8628                    let max_encoding_message_size = self.max_encoding_message_size;
8629                    let inner = self.inner.clone();
8630                    let fut = async move {
8631                        let method = DispatchToChannelSvc(inner);
8632                        let codec = tonic_prost::ProstCodec::default();
8633                        let mut grpc = tonic::server::Grpc::new(codec)
8634                            .apply_compression_config(
8635                                accept_compression_encodings,
8636                                send_compression_encodings,
8637                            )
8638                            .apply_max_message_size_config(
8639                                max_decoding_message_size,
8640                                max_encoding_message_size,
8641                            );
8642                        let res = grpc.unary(method, req).await;
8643                        Ok(res)
8644                    };
8645                    Box::pin(fut)
8646                }
8647                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8648                    #[allow(non_camel_case_types)]
8649                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8650                    impl<
8651                        T: IntegrationsService,
8652                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8653                    for UpsertReachabilitySvc<T> {
8654                        type Response = super::UpsertReachabilityResponse;
8655                        type Future = BoxFuture<
8656                            tonic::Response<Self::Response>,
8657                            tonic::Status,
8658                        >;
8659                        fn call(
8660                            &mut self,
8661                            request: tonic::Request<super::UpsertReachabilityRequest>,
8662                        ) -> Self::Future {
8663                            let inner = Arc::clone(&self.0);
8664                            let fut = async move {
8665                                <T as IntegrationsService>::upsert_reachability(
8666                                        &inner,
8667                                        request,
8668                                    )
8669                                    .await
8670                            };
8671                            Box::pin(fut)
8672                        }
8673                    }
8674                    let accept_compression_encodings = self.accept_compression_encodings;
8675                    let send_compression_encodings = self.send_compression_encodings;
8676                    let max_decoding_message_size = self.max_decoding_message_size;
8677                    let max_encoding_message_size = self.max_encoding_message_size;
8678                    let inner = self.inner.clone();
8679                    let fut = async move {
8680                        let method = UpsertReachabilitySvc(inner);
8681                        let codec = tonic_prost::ProstCodec::default();
8682                        let mut grpc = tonic::server::Grpc::new(codec)
8683                            .apply_compression_config(
8684                                accept_compression_encodings,
8685                                send_compression_encodings,
8686                            )
8687                            .apply_max_message_size_config(
8688                                max_decoding_message_size,
8689                                max_encoding_message_size,
8690                            );
8691                        let res = grpc.unary(method, req).await;
8692                        Ok(res)
8693                    };
8694                    Box::pin(fut)
8695                }
8696                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8697                    #[allow(non_camel_case_types)]
8698                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8699                    impl<
8700                        T: IntegrationsService,
8701                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8702                    for RemoveReachabilitySvc<T> {
8703                        type Response = super::RemoveReachabilityResponse;
8704                        type Future = BoxFuture<
8705                            tonic::Response<Self::Response>,
8706                            tonic::Status,
8707                        >;
8708                        fn call(
8709                            &mut self,
8710                            request: tonic::Request<super::RemoveReachabilityRequest>,
8711                        ) -> Self::Future {
8712                            let inner = Arc::clone(&self.0);
8713                            let fut = async move {
8714                                <T as IntegrationsService>::remove_reachability(
8715                                        &inner,
8716                                        request,
8717                                    )
8718                                    .await
8719                            };
8720                            Box::pin(fut)
8721                        }
8722                    }
8723                    let accept_compression_encodings = self.accept_compression_encodings;
8724                    let send_compression_encodings = self.send_compression_encodings;
8725                    let max_decoding_message_size = self.max_decoding_message_size;
8726                    let max_encoding_message_size = self.max_encoding_message_size;
8727                    let inner = self.inner.clone();
8728                    let fut = async move {
8729                        let method = RemoveReachabilitySvc(inner);
8730                        let codec = tonic_prost::ProstCodec::default();
8731                        let mut grpc = tonic::server::Grpc::new(codec)
8732                            .apply_compression_config(
8733                                accept_compression_encodings,
8734                                send_compression_encodings,
8735                            )
8736                            .apply_max_message_size_config(
8737                                max_decoding_message_size,
8738                                max_encoding_message_size,
8739                            );
8740                        let res = grpc.unary(method, req).await;
8741                        Ok(res)
8742                    };
8743                    Box::pin(fut)
8744                }
8745                "/pidgr.v1.IntegrationsService/GetReachability" => {
8746                    #[allow(non_camel_case_types)]
8747                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8748                    impl<
8749                        T: IntegrationsService,
8750                    > tonic::server::UnaryService<super::GetReachabilityRequest>
8751                    for GetReachabilitySvc<T> {
8752                        type Response = super::GetReachabilityResponse;
8753                        type Future = BoxFuture<
8754                            tonic::Response<Self::Response>,
8755                            tonic::Status,
8756                        >;
8757                        fn call(
8758                            &mut self,
8759                            request: tonic::Request<super::GetReachabilityRequest>,
8760                        ) -> Self::Future {
8761                            let inner = Arc::clone(&self.0);
8762                            let fut = async move {
8763                                <T as IntegrationsService>::get_reachability(
8764                                        &inner,
8765                                        request,
8766                                    )
8767                                    .await
8768                            };
8769                            Box::pin(fut)
8770                        }
8771                    }
8772                    let accept_compression_encodings = self.accept_compression_encodings;
8773                    let send_compression_encodings = self.send_compression_encodings;
8774                    let max_decoding_message_size = self.max_decoding_message_size;
8775                    let max_encoding_message_size = self.max_encoding_message_size;
8776                    let inner = self.inner.clone();
8777                    let fut = async move {
8778                        let method = GetReachabilitySvc(inner);
8779                        let codec = tonic_prost::ProstCodec::default();
8780                        let mut grpc = tonic::server::Grpc::new(codec)
8781                            .apply_compression_config(
8782                                accept_compression_encodings,
8783                                send_compression_encodings,
8784                            )
8785                            .apply_max_message_size_config(
8786                                max_decoding_message_size,
8787                                max_encoding_message_size,
8788                            );
8789                        let res = grpc.unary(method, req).await;
8790                        Ok(res)
8791                    };
8792                    Box::pin(fut)
8793                }
8794                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8795                    #[allow(non_camel_case_types)]
8796                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
8797                        pub Arc<T>,
8798                    );
8799                    impl<
8800                        T: IntegrationsService,
8801                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8802                    for ListReachabilityForUserSvc<T> {
8803                        type Response = super::ListReachabilityForUserResponse;
8804                        type Future = BoxFuture<
8805                            tonic::Response<Self::Response>,
8806                            tonic::Status,
8807                        >;
8808                        fn call(
8809                            &mut self,
8810                            request: tonic::Request<
8811                                super::ListReachabilityForUserRequest,
8812                            >,
8813                        ) -> Self::Future {
8814                            let inner = Arc::clone(&self.0);
8815                            let fut = async move {
8816                                <T as IntegrationsService>::list_reachability_for_user(
8817                                        &inner,
8818                                        request,
8819                                    )
8820                                    .await
8821                            };
8822                            Box::pin(fut)
8823                        }
8824                    }
8825                    let accept_compression_encodings = self.accept_compression_encodings;
8826                    let send_compression_encodings = self.send_compression_encodings;
8827                    let max_decoding_message_size = self.max_decoding_message_size;
8828                    let max_encoding_message_size = self.max_encoding_message_size;
8829                    let inner = self.inner.clone();
8830                    let fut = async move {
8831                        let method = ListReachabilityForUserSvc(inner);
8832                        let codec = tonic_prost::ProstCodec::default();
8833                        let mut grpc = tonic::server::Grpc::new(codec)
8834                            .apply_compression_config(
8835                                accept_compression_encodings,
8836                                send_compression_encodings,
8837                            )
8838                            .apply_max_message_size_config(
8839                                max_decoding_message_size,
8840                                max_encoding_message_size,
8841                            );
8842                        let res = grpc.unary(method, req).await;
8843                        Ok(res)
8844                    };
8845                    Box::pin(fut)
8846                }
8847                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
8848                    #[allow(non_camel_case_types)]
8849                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8850                    impl<
8851                        T: IntegrationsService,
8852                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
8853                    for GetRegionPolicySvc<T> {
8854                        type Response = super::GetRegionPolicyResponse;
8855                        type Future = BoxFuture<
8856                            tonic::Response<Self::Response>,
8857                            tonic::Status,
8858                        >;
8859                        fn call(
8860                            &mut self,
8861                            request: tonic::Request<super::GetRegionPolicyRequest>,
8862                        ) -> Self::Future {
8863                            let inner = Arc::clone(&self.0);
8864                            let fut = async move {
8865                                <T as IntegrationsService>::get_region_policy(
8866                                        &inner,
8867                                        request,
8868                                    )
8869                                    .await
8870                            };
8871                            Box::pin(fut)
8872                        }
8873                    }
8874                    let accept_compression_encodings = self.accept_compression_encodings;
8875                    let send_compression_encodings = self.send_compression_encodings;
8876                    let max_decoding_message_size = self.max_decoding_message_size;
8877                    let max_encoding_message_size = self.max_encoding_message_size;
8878                    let inner = self.inner.clone();
8879                    let fut = async move {
8880                        let method = GetRegionPolicySvc(inner);
8881                        let codec = tonic_prost::ProstCodec::default();
8882                        let mut grpc = tonic::server::Grpc::new(codec)
8883                            .apply_compression_config(
8884                                accept_compression_encodings,
8885                                send_compression_encodings,
8886                            )
8887                            .apply_max_message_size_config(
8888                                max_decoding_message_size,
8889                                max_encoding_message_size,
8890                            );
8891                        let res = grpc.unary(method, req).await;
8892                        Ok(res)
8893                    };
8894                    Box::pin(fut)
8895                }
8896                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
8897                    #[allow(non_camel_case_types)]
8898                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8899                    impl<
8900                        T: IntegrationsService,
8901                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
8902                    for SetRegionPolicySvc<T> {
8903                        type Response = super::SetRegionPolicyResponse;
8904                        type Future = BoxFuture<
8905                            tonic::Response<Self::Response>,
8906                            tonic::Status,
8907                        >;
8908                        fn call(
8909                            &mut self,
8910                            request: tonic::Request<super::SetRegionPolicyRequest>,
8911                        ) -> Self::Future {
8912                            let inner = Arc::clone(&self.0);
8913                            let fut = async move {
8914                                <T as IntegrationsService>::set_region_policy(
8915                                        &inner,
8916                                        request,
8917                                    )
8918                                    .await
8919                            };
8920                            Box::pin(fut)
8921                        }
8922                    }
8923                    let accept_compression_encodings = self.accept_compression_encodings;
8924                    let send_compression_encodings = self.send_compression_encodings;
8925                    let max_decoding_message_size = self.max_decoding_message_size;
8926                    let max_encoding_message_size = self.max_encoding_message_size;
8927                    let inner = self.inner.clone();
8928                    let fut = async move {
8929                        let method = SetRegionPolicySvc(inner);
8930                        let codec = tonic_prost::ProstCodec::default();
8931                        let mut grpc = tonic::server::Grpc::new(codec)
8932                            .apply_compression_config(
8933                                accept_compression_encodings,
8934                                send_compression_encodings,
8935                            )
8936                            .apply_max_message_size_config(
8937                                max_decoding_message_size,
8938                                max_encoding_message_size,
8939                            );
8940                        let res = grpc.unary(method, req).await;
8941                        Ok(res)
8942                    };
8943                    Box::pin(fut)
8944                }
8945                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
8946                    #[allow(non_camel_case_types)]
8947                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8948                    impl<
8949                        T: IntegrationsService,
8950                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
8951                    for GetCostCapPolicySvc<T> {
8952                        type Response = super::GetCostCapPolicyResponse;
8953                        type Future = BoxFuture<
8954                            tonic::Response<Self::Response>,
8955                            tonic::Status,
8956                        >;
8957                        fn call(
8958                            &mut self,
8959                            request: tonic::Request<super::GetCostCapPolicyRequest>,
8960                        ) -> Self::Future {
8961                            let inner = Arc::clone(&self.0);
8962                            let fut = async move {
8963                                <T as IntegrationsService>::get_cost_cap_policy(
8964                                        &inner,
8965                                        request,
8966                                    )
8967                                    .await
8968                            };
8969                            Box::pin(fut)
8970                        }
8971                    }
8972                    let accept_compression_encodings = self.accept_compression_encodings;
8973                    let send_compression_encodings = self.send_compression_encodings;
8974                    let max_decoding_message_size = self.max_decoding_message_size;
8975                    let max_encoding_message_size = self.max_encoding_message_size;
8976                    let inner = self.inner.clone();
8977                    let fut = async move {
8978                        let method = GetCostCapPolicySvc(inner);
8979                        let codec = tonic_prost::ProstCodec::default();
8980                        let mut grpc = tonic::server::Grpc::new(codec)
8981                            .apply_compression_config(
8982                                accept_compression_encodings,
8983                                send_compression_encodings,
8984                            )
8985                            .apply_max_message_size_config(
8986                                max_decoding_message_size,
8987                                max_encoding_message_size,
8988                            );
8989                        let res = grpc.unary(method, req).await;
8990                        Ok(res)
8991                    };
8992                    Box::pin(fut)
8993                }
8994                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
8995                    #[allow(non_camel_case_types)]
8996                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8997                    impl<
8998                        T: IntegrationsService,
8999                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9000                    for SetCostCapPolicySvc<T> {
9001                        type Response = super::SetCostCapPolicyResponse;
9002                        type Future = BoxFuture<
9003                            tonic::Response<Self::Response>,
9004                            tonic::Status,
9005                        >;
9006                        fn call(
9007                            &mut self,
9008                            request: tonic::Request<super::SetCostCapPolicyRequest>,
9009                        ) -> Self::Future {
9010                            let inner = Arc::clone(&self.0);
9011                            let fut = async move {
9012                                <T as IntegrationsService>::set_cost_cap_policy(
9013                                        &inner,
9014                                        request,
9015                                    )
9016                                    .await
9017                            };
9018                            Box::pin(fut)
9019                        }
9020                    }
9021                    let accept_compression_encodings = self.accept_compression_encodings;
9022                    let send_compression_encodings = self.send_compression_encodings;
9023                    let max_decoding_message_size = self.max_decoding_message_size;
9024                    let max_encoding_message_size = self.max_encoding_message_size;
9025                    let inner = self.inner.clone();
9026                    let fut = async move {
9027                        let method = SetCostCapPolicySvc(inner);
9028                        let codec = tonic_prost::ProstCodec::default();
9029                        let mut grpc = tonic::server::Grpc::new(codec)
9030                            .apply_compression_config(
9031                                accept_compression_encodings,
9032                                send_compression_encodings,
9033                            )
9034                            .apply_max_message_size_config(
9035                                max_decoding_message_size,
9036                                max_encoding_message_size,
9037                            );
9038                        let res = grpc.unary(method, req).await;
9039                        Ok(res)
9040                    };
9041                    Box::pin(fut)
9042                }
9043                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9044                    #[allow(non_camel_case_types)]
9045                    struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9046                    impl<
9047                        T: IntegrationsService,
9048                    > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9049                    for GetOrgWebhookConfigSvc<T> {
9050                        type Response = super::GetOrgWebhookConfigResponse;
9051                        type Future = BoxFuture<
9052                            tonic::Response<Self::Response>,
9053                            tonic::Status,
9054                        >;
9055                        fn call(
9056                            &mut self,
9057                            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9058                        ) -> Self::Future {
9059                            let inner = Arc::clone(&self.0);
9060                            let fut = async move {
9061                                <T as IntegrationsService>::get_org_webhook_config(
9062                                        &inner,
9063                                        request,
9064                                    )
9065                                    .await
9066                            };
9067                            Box::pin(fut)
9068                        }
9069                    }
9070                    let accept_compression_encodings = self.accept_compression_encodings;
9071                    let send_compression_encodings = self.send_compression_encodings;
9072                    let max_decoding_message_size = self.max_decoding_message_size;
9073                    let max_encoding_message_size = self.max_encoding_message_size;
9074                    let inner = self.inner.clone();
9075                    let fut = async move {
9076                        let method = GetOrgWebhookConfigSvc(inner);
9077                        let codec = tonic_prost::ProstCodec::default();
9078                        let mut grpc = tonic::server::Grpc::new(codec)
9079                            .apply_compression_config(
9080                                accept_compression_encodings,
9081                                send_compression_encodings,
9082                            )
9083                            .apply_max_message_size_config(
9084                                max_decoding_message_size,
9085                                max_encoding_message_size,
9086                            );
9087                        let res = grpc.unary(method, req).await;
9088                        Ok(res)
9089                    };
9090                    Box::pin(fut)
9091                }
9092                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9093                    #[allow(non_camel_case_types)]
9094                    struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9095                    impl<
9096                        T: IntegrationsService,
9097                    > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9098                    for SetOrgWebhookConfigSvc<T> {
9099                        type Response = super::SetOrgWebhookConfigResponse;
9100                        type Future = BoxFuture<
9101                            tonic::Response<Self::Response>,
9102                            tonic::Status,
9103                        >;
9104                        fn call(
9105                            &mut self,
9106                            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9107                        ) -> Self::Future {
9108                            let inner = Arc::clone(&self.0);
9109                            let fut = async move {
9110                                <T as IntegrationsService>::set_org_webhook_config(
9111                                        &inner,
9112                                        request,
9113                                    )
9114                                    .await
9115                            };
9116                            Box::pin(fut)
9117                        }
9118                    }
9119                    let accept_compression_encodings = self.accept_compression_encodings;
9120                    let send_compression_encodings = self.send_compression_encodings;
9121                    let max_decoding_message_size = self.max_decoding_message_size;
9122                    let max_encoding_message_size = self.max_encoding_message_size;
9123                    let inner = self.inner.clone();
9124                    let fut = async move {
9125                        let method = SetOrgWebhookConfigSvc(inner);
9126                        let codec = tonic_prost::ProstCodec::default();
9127                        let mut grpc = tonic::server::Grpc::new(codec)
9128                            .apply_compression_config(
9129                                accept_compression_encodings,
9130                                send_compression_encodings,
9131                            )
9132                            .apply_max_message_size_config(
9133                                max_decoding_message_size,
9134                                max_encoding_message_size,
9135                            );
9136                        let res = grpc.unary(method, req).await;
9137                        Ok(res)
9138                    };
9139                    Box::pin(fut)
9140                }
9141                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9142                    #[allow(non_camel_case_types)]
9143                    struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9144                        pub Arc<T>,
9145                    );
9146                    impl<
9147                        T: IntegrationsService,
9148                    > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9149                    for CreateChannelConnectLinkSvc<T> {
9150                        type Response = super::CreateChannelConnectLinkResponse;
9151                        type Future = BoxFuture<
9152                            tonic::Response<Self::Response>,
9153                            tonic::Status,
9154                        >;
9155                        fn call(
9156                            &mut self,
9157                            request: tonic::Request<
9158                                super::CreateChannelConnectLinkRequest,
9159                            >,
9160                        ) -> Self::Future {
9161                            let inner = Arc::clone(&self.0);
9162                            let fut = async move {
9163                                <T as IntegrationsService>::create_channel_connect_link(
9164                                        &inner,
9165                                        request,
9166                                    )
9167                                    .await
9168                            };
9169                            Box::pin(fut)
9170                        }
9171                    }
9172                    let accept_compression_encodings = self.accept_compression_encodings;
9173                    let send_compression_encodings = self.send_compression_encodings;
9174                    let max_decoding_message_size = self.max_decoding_message_size;
9175                    let max_encoding_message_size = self.max_encoding_message_size;
9176                    let inner = self.inner.clone();
9177                    let fut = async move {
9178                        let method = CreateChannelConnectLinkSvc(inner);
9179                        let codec = tonic_prost::ProstCodec::default();
9180                        let mut grpc = tonic::server::Grpc::new(codec)
9181                            .apply_compression_config(
9182                                accept_compression_encodings,
9183                                send_compression_encodings,
9184                            )
9185                            .apply_max_message_size_config(
9186                                max_decoding_message_size,
9187                                max_encoding_message_size,
9188                            );
9189                        let res = grpc.unary(method, req).await;
9190                        Ok(res)
9191                    };
9192                    Box::pin(fut)
9193                }
9194                _ => {
9195                    Box::pin(async move {
9196                        let mut response = http::Response::new(
9197                            tonic::body::Body::default(),
9198                        );
9199                        let headers = response.headers_mut();
9200                        headers
9201                            .insert(
9202                                tonic::Status::GRPC_STATUS,
9203                                (tonic::Code::Unimplemented as i32).into(),
9204                            );
9205                        headers
9206                            .insert(
9207                                http::header::CONTENT_TYPE,
9208                                tonic::metadata::GRPC_CONTENT_TYPE,
9209                            );
9210                        Ok(response)
9211                    })
9212                }
9213            }
9214        }
9215    }
9216    impl<T> Clone for IntegrationsServiceServer<T> {
9217        fn clone(&self) -> Self {
9218            let inner = self.inner.clone();
9219            Self {
9220                inner,
9221                accept_compression_encodings: self.accept_compression_encodings,
9222                send_compression_encodings: self.send_compression_encodings,
9223                max_decoding_message_size: self.max_decoding_message_size,
9224                max_encoding_message_size: self.max_encoding_message_size,
9225            }
9226        }
9227    }
9228    /// Generated gRPC service name
9229    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9230    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9231        const NAME: &'static str = SERVICE_NAME;
9232    }
9233}
9234/// Generated client implementations.
9235pub mod invite_link_service_client {
9236    #![allow(
9237        unused_variables,
9238        dead_code,
9239        missing_docs,
9240        clippy::wildcard_imports,
9241        clippy::let_unit_value,
9242    )]
9243    use tonic::codegen::*;
9244    use tonic::codegen::http::Uri;
9245    /** Manages shareable invite links for organization self-join.
9246 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9247 ValidateInviteLink is unauthenticated — the token IS the authorization.
9248 RedeemInviteLink requires a valid JWT.
9249*/
9250    #[derive(Debug, Clone)]
9251    pub struct InviteLinkServiceClient<T> {
9252        inner: tonic::client::Grpc<T>,
9253    }
9254    impl InviteLinkServiceClient<tonic::transport::Channel> {
9255        /// Attempt to create a new client by connecting to a given endpoint.
9256        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9257        where
9258            D: TryInto<tonic::transport::Endpoint>,
9259            D::Error: Into<StdError>,
9260        {
9261            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9262            Ok(Self::new(conn))
9263        }
9264    }
9265    impl<T> InviteLinkServiceClient<T>
9266    where
9267        T: tonic::client::GrpcService<tonic::body::Body>,
9268        T::Error: Into<StdError>,
9269        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9270        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9271    {
9272        pub fn new(inner: T) -> Self {
9273            let inner = tonic::client::Grpc::new(inner);
9274            Self { inner }
9275        }
9276        pub fn with_origin(inner: T, origin: Uri) -> Self {
9277            let inner = tonic::client::Grpc::with_origin(inner, origin);
9278            Self { inner }
9279        }
9280        pub fn with_interceptor<F>(
9281            inner: T,
9282            interceptor: F,
9283        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9284        where
9285            F: tonic::service::Interceptor,
9286            T::ResponseBody: Default,
9287            T: tonic::codegen::Service<
9288                http::Request<tonic::body::Body>,
9289                Response = http::Response<
9290                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9291                >,
9292            >,
9293            <T as tonic::codegen::Service<
9294                http::Request<tonic::body::Body>,
9295            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9296        {
9297            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9298        }
9299        /// Compress requests with the given encoding.
9300        ///
9301        /// This requires the server to support it otherwise it might respond with an
9302        /// error.
9303        #[must_use]
9304        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9305            self.inner = self.inner.send_compressed(encoding);
9306            self
9307        }
9308        /// Enable decompressing responses.
9309        #[must_use]
9310        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9311            self.inner = self.inner.accept_compressed(encoding);
9312            self
9313        }
9314        /// Limits the maximum size of a decoded message.
9315        ///
9316        /// Default: `4MB`
9317        #[must_use]
9318        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9319            self.inner = self.inner.max_decoding_message_size(limit);
9320            self
9321        }
9322        /// Limits the maximum size of an encoded message.
9323        ///
9324        /// Default: `usize::MAX`
9325        #[must_use]
9326        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9327            self.inner = self.inner.max_encoding_message_size(limit);
9328            self
9329        }
9330        /** Create a new shareable invite link for the organization.
9331 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9332*/
9333        pub async fn create_invite_link(
9334            &mut self,
9335            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9336        ) -> std::result::Result<
9337            tonic::Response<super::CreateInviteLinkResponse>,
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.InviteLinkService/CreateInviteLink",
9351            );
9352            let mut req = request.into_request();
9353            req.extensions_mut()
9354                .insert(
9355                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9356                );
9357            self.inner.unary(req, path, codec).await
9358        }
9359        /** List all invite links for the organization.
9360 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9361*/
9362        pub async fn list_invite_links(
9363            &mut self,
9364            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9365        ) -> std::result::Result<
9366            tonic::Response<super::ListInviteLinksResponse>,
9367            tonic::Status,
9368        > {
9369            self.inner
9370                .ready()
9371                .await
9372                .map_err(|e| {
9373                    tonic::Status::unknown(
9374                        format!("Service was not ready: {}", e.into()),
9375                    )
9376                })?;
9377            let codec = tonic_prost::ProstCodec::default();
9378            let path = http::uri::PathAndQuery::from_static(
9379                "/pidgr.v1.InviteLinkService/ListInviteLinks",
9380            );
9381            let mut req = request.into_request();
9382            req.extensions_mut()
9383                .insert(
9384                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9385                );
9386            self.inner.unary(req, path, codec).await
9387        }
9388        /** Revoke an invite link, making it immediately unusable. Idempotent.
9389 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9390*/
9391        pub async fn revoke_invite_link(
9392            &mut self,
9393            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9394        ) -> std::result::Result<
9395            tonic::Response<super::RevokeInviteLinkResponse>,
9396            tonic::Status,
9397        > {
9398            self.inner
9399                .ready()
9400                .await
9401                .map_err(|e| {
9402                    tonic::Status::unknown(
9403                        format!("Service was not ready: {}", e.into()),
9404                    )
9405                })?;
9406            let codec = tonic_prost::ProstCodec::default();
9407            let path = http::uri::PathAndQuery::from_static(
9408                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9409            );
9410            let mut req = request.into_request();
9411            req.extensions_mut()
9412                .insert(
9413                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9414                );
9415            self.inner.unary(req, path, codec).await
9416        }
9417        /** Validate an invite link and provision a user account if needed.
9418 This is a pre-authentication endpoint — no JWT required.
9419 Rate limited to 10 requests per minute per IP.
9420 Authorization: None (token-based).
9421*/
9422        pub async fn validate_invite_link(
9423            &mut self,
9424            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9425        ) -> std::result::Result<
9426            tonic::Response<super::ValidateInviteLinkResponse>,
9427            tonic::Status,
9428        > {
9429            self.inner
9430                .ready()
9431                .await
9432                .map_err(|e| {
9433                    tonic::Status::unknown(
9434                        format!("Service was not ready: {}", e.into()),
9435                    )
9436                })?;
9437            let codec = tonic_prost::ProstCodec::default();
9438            let path = http::uri::PathAndQuery::from_static(
9439                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9440            );
9441            let mut req = request.into_request();
9442            req.extensions_mut()
9443                .insert(
9444                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9445                );
9446            self.inner.unary(req, path, codec).await
9447        }
9448        /** Redeem an invite link to join an organization.
9449 Requires a valid JWT — the email is extracted from the token.
9450 Authorization: JWT required.
9451*/
9452        pub async fn redeem_invite_link(
9453            &mut self,
9454            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9455        ) -> std::result::Result<
9456            tonic::Response<super::RedeemInviteLinkResponse>,
9457            tonic::Status,
9458        > {
9459            self.inner
9460                .ready()
9461                .await
9462                .map_err(|e| {
9463                    tonic::Status::unknown(
9464                        format!("Service was not ready: {}", e.into()),
9465                    )
9466                })?;
9467            let codec = tonic_prost::ProstCodec::default();
9468            let path = http::uri::PathAndQuery::from_static(
9469                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9470            );
9471            let mut req = request.into_request();
9472            req.extensions_mut()
9473                .insert(
9474                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9475                );
9476            self.inner.unary(req, path, codec).await
9477        }
9478    }
9479}
9480/// Generated server implementations.
9481pub mod invite_link_service_server {
9482    #![allow(
9483        unused_variables,
9484        dead_code,
9485        missing_docs,
9486        clippy::wildcard_imports,
9487        clippy::let_unit_value,
9488    )]
9489    use tonic::codegen::*;
9490    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
9491    #[async_trait]
9492    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9493        /** Create a new shareable invite link for the organization.
9494 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9495*/
9496        async fn create_invite_link(
9497            &self,
9498            request: tonic::Request<super::CreateInviteLinkRequest>,
9499        ) -> std::result::Result<
9500            tonic::Response<super::CreateInviteLinkResponse>,
9501            tonic::Status,
9502        >;
9503        /** List all invite links for the organization.
9504 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9505*/
9506        async fn list_invite_links(
9507            &self,
9508            request: tonic::Request<super::ListInviteLinksRequest>,
9509        ) -> std::result::Result<
9510            tonic::Response<super::ListInviteLinksResponse>,
9511            tonic::Status,
9512        >;
9513        /** Revoke an invite link, making it immediately unusable. Idempotent.
9514 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9515*/
9516        async fn revoke_invite_link(
9517            &self,
9518            request: tonic::Request<super::RevokeInviteLinkRequest>,
9519        ) -> std::result::Result<
9520            tonic::Response<super::RevokeInviteLinkResponse>,
9521            tonic::Status,
9522        >;
9523        /** Validate an invite link and provision a user account if needed.
9524 This is a pre-authentication endpoint — no JWT required.
9525 Rate limited to 10 requests per minute per IP.
9526 Authorization: None (token-based).
9527*/
9528        async fn validate_invite_link(
9529            &self,
9530            request: tonic::Request<super::ValidateInviteLinkRequest>,
9531        ) -> std::result::Result<
9532            tonic::Response<super::ValidateInviteLinkResponse>,
9533            tonic::Status,
9534        >;
9535        /** Redeem an invite link to join an organization.
9536 Requires a valid JWT — the email is extracted from the token.
9537 Authorization: JWT required.
9538*/
9539        async fn redeem_invite_link(
9540            &self,
9541            request: tonic::Request<super::RedeemInviteLinkRequest>,
9542        ) -> std::result::Result<
9543            tonic::Response<super::RedeemInviteLinkResponse>,
9544            tonic::Status,
9545        >;
9546    }
9547    /** Manages shareable invite links for organization self-join.
9548 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9549 ValidateInviteLink is unauthenticated — the token IS the authorization.
9550 RedeemInviteLink requires a valid JWT.
9551*/
9552    #[derive(Debug)]
9553    pub struct InviteLinkServiceServer<T> {
9554        inner: Arc<T>,
9555        accept_compression_encodings: EnabledCompressionEncodings,
9556        send_compression_encodings: EnabledCompressionEncodings,
9557        max_decoding_message_size: Option<usize>,
9558        max_encoding_message_size: Option<usize>,
9559    }
9560    impl<T> InviteLinkServiceServer<T> {
9561        pub fn new(inner: T) -> Self {
9562            Self::from_arc(Arc::new(inner))
9563        }
9564        pub fn from_arc(inner: Arc<T>) -> Self {
9565            Self {
9566                inner,
9567                accept_compression_encodings: Default::default(),
9568                send_compression_encodings: Default::default(),
9569                max_decoding_message_size: None,
9570                max_encoding_message_size: None,
9571            }
9572        }
9573        pub fn with_interceptor<F>(
9574            inner: T,
9575            interceptor: F,
9576        ) -> InterceptedService<Self, F>
9577        where
9578            F: tonic::service::Interceptor,
9579        {
9580            InterceptedService::new(Self::new(inner), interceptor)
9581        }
9582        /// Enable decompressing requests with the given encoding.
9583        #[must_use]
9584        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9585            self.accept_compression_encodings.enable(encoding);
9586            self
9587        }
9588        /// Compress responses with the given encoding, if the client supports it.
9589        #[must_use]
9590        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9591            self.send_compression_encodings.enable(encoding);
9592            self
9593        }
9594        /// Limits the maximum size of a decoded message.
9595        ///
9596        /// Default: `4MB`
9597        #[must_use]
9598        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9599            self.max_decoding_message_size = Some(limit);
9600            self
9601        }
9602        /// Limits the maximum size of an encoded message.
9603        ///
9604        /// Default: `usize::MAX`
9605        #[must_use]
9606        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9607            self.max_encoding_message_size = Some(limit);
9608            self
9609        }
9610    }
9611    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9612    where
9613        T: InviteLinkService,
9614        B: Body + std::marker::Send + 'static,
9615        B::Error: Into<StdError> + std::marker::Send + 'static,
9616    {
9617        type Response = http::Response<tonic::body::Body>;
9618        type Error = std::convert::Infallible;
9619        type Future = BoxFuture<Self::Response, Self::Error>;
9620        fn poll_ready(
9621            &mut self,
9622            _cx: &mut Context<'_>,
9623        ) -> Poll<std::result::Result<(), Self::Error>> {
9624            Poll::Ready(Ok(()))
9625        }
9626        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9627            match req.uri().path() {
9628                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9629                    #[allow(non_camel_case_types)]
9630                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9631                    impl<
9632                        T: InviteLinkService,
9633                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9634                    for CreateInviteLinkSvc<T> {
9635                        type Response = super::CreateInviteLinkResponse;
9636                        type Future = BoxFuture<
9637                            tonic::Response<Self::Response>,
9638                            tonic::Status,
9639                        >;
9640                        fn call(
9641                            &mut self,
9642                            request: tonic::Request<super::CreateInviteLinkRequest>,
9643                        ) -> Self::Future {
9644                            let inner = Arc::clone(&self.0);
9645                            let fut = async move {
9646                                <T as InviteLinkService>::create_invite_link(
9647                                        &inner,
9648                                        request,
9649                                    )
9650                                    .await
9651                            };
9652                            Box::pin(fut)
9653                        }
9654                    }
9655                    let accept_compression_encodings = self.accept_compression_encodings;
9656                    let send_compression_encodings = self.send_compression_encodings;
9657                    let max_decoding_message_size = self.max_decoding_message_size;
9658                    let max_encoding_message_size = self.max_encoding_message_size;
9659                    let inner = self.inner.clone();
9660                    let fut = async move {
9661                        let method = CreateInviteLinkSvc(inner);
9662                        let codec = tonic_prost::ProstCodec::default();
9663                        let mut grpc = tonic::server::Grpc::new(codec)
9664                            .apply_compression_config(
9665                                accept_compression_encodings,
9666                                send_compression_encodings,
9667                            )
9668                            .apply_max_message_size_config(
9669                                max_decoding_message_size,
9670                                max_encoding_message_size,
9671                            );
9672                        let res = grpc.unary(method, req).await;
9673                        Ok(res)
9674                    };
9675                    Box::pin(fut)
9676                }
9677                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9678                    #[allow(non_camel_case_types)]
9679                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9680                    impl<
9681                        T: InviteLinkService,
9682                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
9683                    for ListInviteLinksSvc<T> {
9684                        type Response = super::ListInviteLinksResponse;
9685                        type Future = BoxFuture<
9686                            tonic::Response<Self::Response>,
9687                            tonic::Status,
9688                        >;
9689                        fn call(
9690                            &mut self,
9691                            request: tonic::Request<super::ListInviteLinksRequest>,
9692                        ) -> Self::Future {
9693                            let inner = Arc::clone(&self.0);
9694                            let fut = async move {
9695                                <T as InviteLinkService>::list_invite_links(&inner, request)
9696                                    .await
9697                            };
9698                            Box::pin(fut)
9699                        }
9700                    }
9701                    let accept_compression_encodings = self.accept_compression_encodings;
9702                    let send_compression_encodings = self.send_compression_encodings;
9703                    let max_decoding_message_size = self.max_decoding_message_size;
9704                    let max_encoding_message_size = self.max_encoding_message_size;
9705                    let inner = self.inner.clone();
9706                    let fut = async move {
9707                        let method = ListInviteLinksSvc(inner);
9708                        let codec = tonic_prost::ProstCodec::default();
9709                        let mut grpc = tonic::server::Grpc::new(codec)
9710                            .apply_compression_config(
9711                                accept_compression_encodings,
9712                                send_compression_encodings,
9713                            )
9714                            .apply_max_message_size_config(
9715                                max_decoding_message_size,
9716                                max_encoding_message_size,
9717                            );
9718                        let res = grpc.unary(method, req).await;
9719                        Ok(res)
9720                    };
9721                    Box::pin(fut)
9722                }
9723                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
9724                    #[allow(non_camel_case_types)]
9725                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9726                    impl<
9727                        T: InviteLinkService,
9728                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
9729                    for RevokeInviteLinkSvc<T> {
9730                        type Response = super::RevokeInviteLinkResponse;
9731                        type Future = BoxFuture<
9732                            tonic::Response<Self::Response>,
9733                            tonic::Status,
9734                        >;
9735                        fn call(
9736                            &mut self,
9737                            request: tonic::Request<super::RevokeInviteLinkRequest>,
9738                        ) -> Self::Future {
9739                            let inner = Arc::clone(&self.0);
9740                            let fut = async move {
9741                                <T as InviteLinkService>::revoke_invite_link(
9742                                        &inner,
9743                                        request,
9744                                    )
9745                                    .await
9746                            };
9747                            Box::pin(fut)
9748                        }
9749                    }
9750                    let accept_compression_encodings = self.accept_compression_encodings;
9751                    let send_compression_encodings = self.send_compression_encodings;
9752                    let max_decoding_message_size = self.max_decoding_message_size;
9753                    let max_encoding_message_size = self.max_encoding_message_size;
9754                    let inner = self.inner.clone();
9755                    let fut = async move {
9756                        let method = RevokeInviteLinkSvc(inner);
9757                        let codec = tonic_prost::ProstCodec::default();
9758                        let mut grpc = tonic::server::Grpc::new(codec)
9759                            .apply_compression_config(
9760                                accept_compression_encodings,
9761                                send_compression_encodings,
9762                            )
9763                            .apply_max_message_size_config(
9764                                max_decoding_message_size,
9765                                max_encoding_message_size,
9766                            );
9767                        let res = grpc.unary(method, req).await;
9768                        Ok(res)
9769                    };
9770                    Box::pin(fut)
9771                }
9772                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
9773                    #[allow(non_camel_case_types)]
9774                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9775                    impl<
9776                        T: InviteLinkService,
9777                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
9778                    for ValidateInviteLinkSvc<T> {
9779                        type Response = super::ValidateInviteLinkResponse;
9780                        type Future = BoxFuture<
9781                            tonic::Response<Self::Response>,
9782                            tonic::Status,
9783                        >;
9784                        fn call(
9785                            &mut self,
9786                            request: tonic::Request<super::ValidateInviteLinkRequest>,
9787                        ) -> Self::Future {
9788                            let inner = Arc::clone(&self.0);
9789                            let fut = async move {
9790                                <T as InviteLinkService>::validate_invite_link(
9791                                        &inner,
9792                                        request,
9793                                    )
9794                                    .await
9795                            };
9796                            Box::pin(fut)
9797                        }
9798                    }
9799                    let accept_compression_encodings = self.accept_compression_encodings;
9800                    let send_compression_encodings = self.send_compression_encodings;
9801                    let max_decoding_message_size = self.max_decoding_message_size;
9802                    let max_encoding_message_size = self.max_encoding_message_size;
9803                    let inner = self.inner.clone();
9804                    let fut = async move {
9805                        let method = ValidateInviteLinkSvc(inner);
9806                        let codec = tonic_prost::ProstCodec::default();
9807                        let mut grpc = tonic::server::Grpc::new(codec)
9808                            .apply_compression_config(
9809                                accept_compression_encodings,
9810                                send_compression_encodings,
9811                            )
9812                            .apply_max_message_size_config(
9813                                max_decoding_message_size,
9814                                max_encoding_message_size,
9815                            );
9816                        let res = grpc.unary(method, req).await;
9817                        Ok(res)
9818                    };
9819                    Box::pin(fut)
9820                }
9821                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
9822                    #[allow(non_camel_case_types)]
9823                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9824                    impl<
9825                        T: InviteLinkService,
9826                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
9827                    for RedeemInviteLinkSvc<T> {
9828                        type Response = super::RedeemInviteLinkResponse;
9829                        type Future = BoxFuture<
9830                            tonic::Response<Self::Response>,
9831                            tonic::Status,
9832                        >;
9833                        fn call(
9834                            &mut self,
9835                            request: tonic::Request<super::RedeemInviteLinkRequest>,
9836                        ) -> Self::Future {
9837                            let inner = Arc::clone(&self.0);
9838                            let fut = async move {
9839                                <T as InviteLinkService>::redeem_invite_link(
9840                                        &inner,
9841                                        request,
9842                                    )
9843                                    .await
9844                            };
9845                            Box::pin(fut)
9846                        }
9847                    }
9848                    let accept_compression_encodings = self.accept_compression_encodings;
9849                    let send_compression_encodings = self.send_compression_encodings;
9850                    let max_decoding_message_size = self.max_decoding_message_size;
9851                    let max_encoding_message_size = self.max_encoding_message_size;
9852                    let inner = self.inner.clone();
9853                    let fut = async move {
9854                        let method = RedeemInviteLinkSvc(inner);
9855                        let codec = tonic_prost::ProstCodec::default();
9856                        let mut grpc = tonic::server::Grpc::new(codec)
9857                            .apply_compression_config(
9858                                accept_compression_encodings,
9859                                send_compression_encodings,
9860                            )
9861                            .apply_max_message_size_config(
9862                                max_decoding_message_size,
9863                                max_encoding_message_size,
9864                            );
9865                        let res = grpc.unary(method, req).await;
9866                        Ok(res)
9867                    };
9868                    Box::pin(fut)
9869                }
9870                _ => {
9871                    Box::pin(async move {
9872                        let mut response = http::Response::new(
9873                            tonic::body::Body::default(),
9874                        );
9875                        let headers = response.headers_mut();
9876                        headers
9877                            .insert(
9878                                tonic::Status::GRPC_STATUS,
9879                                (tonic::Code::Unimplemented as i32).into(),
9880                            );
9881                        headers
9882                            .insert(
9883                                http::header::CONTENT_TYPE,
9884                                tonic::metadata::GRPC_CONTENT_TYPE,
9885                            );
9886                        Ok(response)
9887                    })
9888                }
9889            }
9890        }
9891    }
9892    impl<T> Clone for InviteLinkServiceServer<T> {
9893        fn clone(&self) -> Self {
9894            let inner = self.inner.clone();
9895            Self {
9896                inner,
9897                accept_compression_encodings: self.accept_compression_encodings,
9898                send_compression_encodings: self.send_compression_encodings,
9899                max_decoding_message_size: self.max_decoding_message_size,
9900                max_encoding_message_size: self.max_encoding_message_size,
9901            }
9902        }
9903    }
9904    /// Generated gRPC service name
9905    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
9906    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
9907        const NAME: &'static str = SERVICE_NAME;
9908    }
9909}
9910/// Generated client implementations.
9911pub mod member_service_client {
9912    #![allow(
9913        unused_variables,
9914        dead_code,
9915        missing_docs,
9916        clippy::wildcard_imports,
9917        clippy::let_unit_value,
9918    )]
9919    use tonic::codegen::*;
9920    use tonic::codegen::http::Uri;
9921    /** Manages members (users) within an organization.
9922 All RPCs operate within the caller's org (extracted from JWT).
9923*/
9924    #[derive(Debug, Clone)]
9925    pub struct MemberServiceClient<T> {
9926        inner: tonic::client::Grpc<T>,
9927    }
9928    impl MemberServiceClient<tonic::transport::Channel> {
9929        /// Attempt to create a new client by connecting to a given endpoint.
9930        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9931        where
9932            D: TryInto<tonic::transport::Endpoint>,
9933            D::Error: Into<StdError>,
9934        {
9935            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9936            Ok(Self::new(conn))
9937        }
9938    }
9939    impl<T> MemberServiceClient<T>
9940    where
9941        T: tonic::client::GrpcService<tonic::body::Body>,
9942        T::Error: Into<StdError>,
9943        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9944        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9945    {
9946        pub fn new(inner: T) -> Self {
9947            let inner = tonic::client::Grpc::new(inner);
9948            Self { inner }
9949        }
9950        pub fn with_origin(inner: T, origin: Uri) -> Self {
9951            let inner = tonic::client::Grpc::with_origin(inner, origin);
9952            Self { inner }
9953        }
9954        pub fn with_interceptor<F>(
9955            inner: T,
9956            interceptor: F,
9957        ) -> MemberServiceClient<InterceptedService<T, F>>
9958        where
9959            F: tonic::service::Interceptor,
9960            T::ResponseBody: Default,
9961            T: tonic::codegen::Service<
9962                http::Request<tonic::body::Body>,
9963                Response = http::Response<
9964                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9965                >,
9966            >,
9967            <T as tonic::codegen::Service<
9968                http::Request<tonic::body::Body>,
9969            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9970        {
9971            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
9972        }
9973        /// Compress requests with the given encoding.
9974        ///
9975        /// This requires the server to support it otherwise it might respond with an
9976        /// error.
9977        #[must_use]
9978        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9979            self.inner = self.inner.send_compressed(encoding);
9980            self
9981        }
9982        /// Enable decompressing responses.
9983        #[must_use]
9984        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9985            self.inner = self.inner.accept_compressed(encoding);
9986            self
9987        }
9988        /// Limits the maximum size of a decoded message.
9989        ///
9990        /// Default: `4MB`
9991        #[must_use]
9992        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9993            self.inner = self.inner.max_decoding_message_size(limit);
9994            self
9995        }
9996        /// Limits the maximum size of an encoded message.
9997        ///
9998        /// Default: `usize::MAX`
9999        #[must_use]
10000        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10001            self.inner = self.inner.max_encoding_message_size(limit);
10002            self
10003        }
10004        /** Invite a new user to the organization via email.
10005 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10006*/
10007        pub async fn invite_user(
10008            &mut self,
10009            request: impl tonic::IntoRequest<super::InviteUserRequest>,
10010        ) -> std::result::Result<
10011            tonic::Response<super::InviteUserResponse>,
10012            tonic::Status,
10013        > {
10014            self.inner
10015                .ready()
10016                .await
10017                .map_err(|e| {
10018                    tonic::Status::unknown(
10019                        format!("Service was not ready: {}", e.into()),
10020                    )
10021                })?;
10022            let codec = tonic_prost::ProstCodec::default();
10023            let path = http::uri::PathAndQuery::from_static(
10024                "/pidgr.v1.MemberService/InviteUser",
10025            );
10026            let mut req = request.into_request();
10027            req.extensions_mut()
10028                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10029            self.inner.unary(req, path, codec).await
10030        }
10031        /** Retrieve a user by ID within the organization.
10032 Self-lookup (empty user_id) is allowed for any authenticated user.
10033 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10034*/
10035        pub async fn get_user(
10036            &mut self,
10037            request: impl tonic::IntoRequest<super::GetUserRequest>,
10038        ) -> std::result::Result<
10039            tonic::Response<super::GetUserResponse>,
10040            tonic::Status,
10041        > {
10042            self.inner
10043                .ready()
10044                .await
10045                .map_err(|e| {
10046                    tonic::Status::unknown(
10047                        format!("Service was not ready: {}", e.into()),
10048                    )
10049                })?;
10050            let codec = tonic_prost::ProstCodec::default();
10051            let path = http::uri::PathAndQuery::from_static(
10052                "/pidgr.v1.MemberService/GetUser",
10053            );
10054            let mut req = request.into_request();
10055            req.extensions_mut()
10056                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10057            self.inner.unary(req, path, codec).await
10058        }
10059        /** List all users in the organization with pagination.
10060 Authorization: Requires PERMISSION_MEMBERS_READ.
10061*/
10062        pub async fn list_users(
10063            &mut self,
10064            request: impl tonic::IntoRequest<super::ListUsersRequest>,
10065        ) -> std::result::Result<
10066            tonic::Response<super::ListUsersResponse>,
10067            tonic::Status,
10068        > {
10069            self.inner
10070                .ready()
10071                .await
10072                .map_err(|e| {
10073                    tonic::Status::unknown(
10074                        format!("Service was not ready: {}", e.into()),
10075                    )
10076                })?;
10077            let codec = tonic_prost::ProstCodec::default();
10078            let path = http::uri::PathAndQuery::from_static(
10079                "/pidgr.v1.MemberService/ListUsers",
10080            );
10081            let mut req = request.into_request();
10082            req.extensions_mut()
10083                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10084            self.inner.unary(req, path, codec).await
10085        }
10086        /** Change a user's role within the organization.
10087 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10088*/
10089        pub async fn update_user_role(
10090            &mut self,
10091            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10092        ) -> std::result::Result<
10093            tonic::Response<super::UpdateUserRoleResponse>,
10094            tonic::Status,
10095        > {
10096            self.inner
10097                .ready()
10098                .await
10099                .map_err(|e| {
10100                    tonic::Status::unknown(
10101                        format!("Service was not ready: {}", e.into()),
10102                    )
10103                })?;
10104            let codec = tonic_prost::ProstCodec::default();
10105            let path = http::uri::PathAndQuery::from_static(
10106                "/pidgr.v1.MemberService/UpdateUserRole",
10107            );
10108            let mut req = request.into_request();
10109            req.extensions_mut()
10110                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10111            self.inner.unary(req, path, codec).await
10112        }
10113        /** Deactivate a user within the organization.
10114 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10115*/
10116        pub async fn deactivate_user(
10117            &mut self,
10118            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10119        ) -> std::result::Result<
10120            tonic::Response<super::DeactivateUserResponse>,
10121            tonic::Status,
10122        > {
10123            self.inner
10124                .ready()
10125                .await
10126                .map_err(|e| {
10127                    tonic::Status::unknown(
10128                        format!("Service was not ready: {}", e.into()),
10129                    )
10130                })?;
10131            let codec = tonic_prost::ProstCodec::default();
10132            let path = http::uri::PathAndQuery::from_static(
10133                "/pidgr.v1.MemberService/DeactivateUser",
10134            );
10135            let mut req = request.into_request();
10136            req.extensions_mut()
10137                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10138            self.inner.unary(req, path, codec).await
10139        }
10140        /** Reactivate a deactivated user, restoring their status to INVITED.
10141 The user must complete the invite link flow again to become ACTIVE.
10142 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10143*/
10144        pub async fn reactivate_user(
10145            &mut self,
10146            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10147        ) -> std::result::Result<
10148            tonic::Response<super::ReactivateUserResponse>,
10149            tonic::Status,
10150        > {
10151            self.inner
10152                .ready()
10153                .await
10154                .map_err(|e| {
10155                    tonic::Status::unknown(
10156                        format!("Service was not ready: {}", e.into()),
10157                    )
10158                })?;
10159            let codec = tonic_prost::ProstCodec::default();
10160            let path = http::uri::PathAndQuery::from_static(
10161                "/pidgr.v1.MemberService/ReactivateUser",
10162            );
10163            let mut req = request.into_request();
10164            req.extensions_mut()
10165                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10166            self.inner.unary(req, path, codec).await
10167        }
10168        /** Revoke an invitation for a user who has not yet completed registration.
10169 Hard-deletes the user record (INVITED users have no data to preserve).
10170 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10171*/
10172        pub async fn revoke_invite(
10173            &mut self,
10174            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10175        ) -> std::result::Result<
10176            tonic::Response<super::RevokeInviteResponse>,
10177            tonic::Status,
10178        > {
10179            self.inner
10180                .ready()
10181                .await
10182                .map_err(|e| {
10183                    tonic::Status::unknown(
10184                        format!("Service was not ready: {}", e.into()),
10185                    )
10186                })?;
10187            let codec = tonic_prost::ProstCodec::default();
10188            let path = http::uri::PathAndQuery::from_static(
10189                "/pidgr.v1.MemberService/RevokeInvite",
10190            );
10191            let mut req = request.into_request();
10192            req.extensions_mut()
10193                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10194            self.inner.unary(req, path, codec).await
10195        }
10196        /** Update a user's profile attributes (department, title, etc.).
10197 Self-update (empty user_id or matching JWT sub) requires no special permission.
10198 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10199*/
10200        pub async fn update_user_profile(
10201            &mut self,
10202            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10203        ) -> std::result::Result<
10204            tonic::Response<super::UpdateUserProfileResponse>,
10205            tonic::Status,
10206        > {
10207            self.inner
10208                .ready()
10209                .await
10210                .map_err(|e| {
10211                    tonic::Status::unknown(
10212                        format!("Service was not ready: {}", e.into()),
10213                    )
10214                })?;
10215            let codec = tonic_prost::ProstCodec::default();
10216            let path = http::uri::PathAndQuery::from_static(
10217                "/pidgr.v1.MemberService/UpdateUserProfile",
10218            );
10219            let mut req = request.into_request();
10220            req.extensions_mut()
10221                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10222            self.inner.unary(req, path, codec).await
10223        }
10224        /** Retrieve the caller's platform settings (theme, etc.).
10225 Authorization: Any authenticated user (self-only).
10226*/
10227        pub async fn get_user_settings(
10228            &mut self,
10229            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10230        ) -> std::result::Result<
10231            tonic::Response<super::GetUserSettingsResponse>,
10232            tonic::Status,
10233        > {
10234            self.inner
10235                .ready()
10236                .await
10237                .map_err(|e| {
10238                    tonic::Status::unknown(
10239                        format!("Service was not ready: {}", e.into()),
10240                    )
10241                })?;
10242            let codec = tonic_prost::ProstCodec::default();
10243            let path = http::uri::PathAndQuery::from_static(
10244                "/pidgr.v1.MemberService/GetUserSettings",
10245            );
10246            let mut req = request.into_request();
10247            req.extensions_mut()
10248                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10249            self.inner.unary(req, path, codec).await
10250        }
10251        /** Update the caller's platform settings.
10252 Only fields with non-default values are applied; others are left unchanged.
10253 Authorization: Any authenticated user (self-only).
10254*/
10255        pub async fn update_user_settings(
10256            &mut self,
10257            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10258        ) -> std::result::Result<
10259            tonic::Response<super::UpdateUserSettingsResponse>,
10260            tonic::Status,
10261        > {
10262            self.inner
10263                .ready()
10264                .await
10265                .map_err(|e| {
10266                    tonic::Status::unknown(
10267                        format!("Service was not ready: {}", e.into()),
10268                    )
10269                })?;
10270            let codec = tonic_prost::ProstCodec::default();
10271            let path = http::uri::PathAndQuery::from_static(
10272                "/pidgr.v1.MemberService/UpdateUserSettings",
10273            );
10274            let mut req = request.into_request();
10275            req.extensions_mut()
10276                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10277            self.inner.unary(req, path, codec).await
10278        }
10279        /** Invite multiple users to the organization in a single call.
10280 Emails are deduplicated. Each email is processed independently — individual
10281 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10282 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10283*/
10284        pub async fn bulk_invite_users(
10285            &mut self,
10286            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10287        ) -> std::result::Result<
10288            tonic::Response<super::BulkInviteUsersResponse>,
10289            tonic::Status,
10290        > {
10291            self.inner
10292                .ready()
10293                .await
10294                .map_err(|e| {
10295                    tonic::Status::unknown(
10296                        format!("Service was not ready: {}", e.into()),
10297                    )
10298                })?;
10299            let codec = tonic_prost::ProstCodec::default();
10300            let path = http::uri::PathAndQuery::from_static(
10301                "/pidgr.v1.MemberService/BulkInviteUsers",
10302            );
10303            let mut req = request.into_request();
10304            req.extensions_mut()
10305                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10306            self.inner.unary(req, path, codec).await
10307        }
10308        /** Confirm passkey enrollment after client-side WebAuthn registration.
10309 Verifies the caller has at least one registered credential server-side,
10310 then marks the user as passkey-enrolled in the identity provider.
10311 Authorization: Any authenticated user (self-only, no permission required).
10312*/
10313        pub async fn confirm_passkey_enrollment(
10314            &mut self,
10315            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10316        ) -> std::result::Result<
10317            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10318            tonic::Status,
10319        > {
10320            self.inner
10321                .ready()
10322                .await
10323                .map_err(|e| {
10324                    tonic::Status::unknown(
10325                        format!("Service was not ready: {}", e.into()),
10326                    )
10327                })?;
10328            let codec = tonic_prost::ProstCodec::default();
10329            let path = http::uri::PathAndQuery::from_static(
10330                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10331            );
10332            let mut req = request.into_request();
10333            req.extensions_mut()
10334                .insert(
10335                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10336                );
10337            self.inner.unary(req, path, codec).await
10338        }
10339        /** Update the data governance region for a user. Triggers a data migration
10340 workflow if the region changed. Admin-only operation.
10341 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10342*/
10343        pub async fn update_user_region(
10344            &mut self,
10345            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10346        ) -> std::result::Result<
10347            tonic::Response<super::UpdateUserRegionResponse>,
10348            tonic::Status,
10349        > {
10350            self.inner
10351                .ready()
10352                .await
10353                .map_err(|e| {
10354                    tonic::Status::unknown(
10355                        format!("Service was not ready: {}", e.into()),
10356                    )
10357                })?;
10358            let codec = tonic_prost::ProstCodec::default();
10359            let path = http::uri::PathAndQuery::from_static(
10360                "/pidgr.v1.MemberService/UpdateUserRegion",
10361            );
10362            let mut req = request.into_request();
10363            req.extensions_mut()
10364                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10365            self.inner.unary(req, path, codec).await
10366        }
10367    }
10368}
10369/// Generated server implementations.
10370pub mod member_service_server {
10371    #![allow(
10372        unused_variables,
10373        dead_code,
10374        missing_docs,
10375        clippy::wildcard_imports,
10376        clippy::let_unit_value,
10377    )]
10378    use tonic::codegen::*;
10379    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
10380    #[async_trait]
10381    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10382        /** Invite a new user to the organization via email.
10383 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10384*/
10385        async fn invite_user(
10386            &self,
10387            request: tonic::Request<super::InviteUserRequest>,
10388        ) -> std::result::Result<
10389            tonic::Response<super::InviteUserResponse>,
10390            tonic::Status,
10391        >;
10392        /** Retrieve a user by ID within the organization.
10393 Self-lookup (empty user_id) is allowed for any authenticated user.
10394 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10395*/
10396        async fn get_user(
10397            &self,
10398            request: tonic::Request<super::GetUserRequest>,
10399        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10400        /** List all users in the organization with pagination.
10401 Authorization: Requires PERMISSION_MEMBERS_READ.
10402*/
10403        async fn list_users(
10404            &self,
10405            request: tonic::Request<super::ListUsersRequest>,
10406        ) -> std::result::Result<
10407            tonic::Response<super::ListUsersResponse>,
10408            tonic::Status,
10409        >;
10410        /** Change a user's role within the organization.
10411 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10412*/
10413        async fn update_user_role(
10414            &self,
10415            request: tonic::Request<super::UpdateUserRoleRequest>,
10416        ) -> std::result::Result<
10417            tonic::Response<super::UpdateUserRoleResponse>,
10418            tonic::Status,
10419        >;
10420        /** Deactivate a user within the organization.
10421 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10422*/
10423        async fn deactivate_user(
10424            &self,
10425            request: tonic::Request<super::DeactivateUserRequest>,
10426        ) -> std::result::Result<
10427            tonic::Response<super::DeactivateUserResponse>,
10428            tonic::Status,
10429        >;
10430        /** Reactivate a deactivated user, restoring their status to INVITED.
10431 The user must complete the invite link flow again to become ACTIVE.
10432 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10433*/
10434        async fn reactivate_user(
10435            &self,
10436            request: tonic::Request<super::ReactivateUserRequest>,
10437        ) -> std::result::Result<
10438            tonic::Response<super::ReactivateUserResponse>,
10439            tonic::Status,
10440        >;
10441        /** Revoke an invitation for a user who has not yet completed registration.
10442 Hard-deletes the user record (INVITED users have no data to preserve).
10443 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10444*/
10445        async fn revoke_invite(
10446            &self,
10447            request: tonic::Request<super::RevokeInviteRequest>,
10448        ) -> std::result::Result<
10449            tonic::Response<super::RevokeInviteResponse>,
10450            tonic::Status,
10451        >;
10452        /** Update a user's profile attributes (department, title, etc.).
10453 Self-update (empty user_id or matching JWT sub) requires no special permission.
10454 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10455*/
10456        async fn update_user_profile(
10457            &self,
10458            request: tonic::Request<super::UpdateUserProfileRequest>,
10459        ) -> std::result::Result<
10460            tonic::Response<super::UpdateUserProfileResponse>,
10461            tonic::Status,
10462        >;
10463        /** Retrieve the caller's platform settings (theme, etc.).
10464 Authorization: Any authenticated user (self-only).
10465*/
10466        async fn get_user_settings(
10467            &self,
10468            request: tonic::Request<super::GetUserSettingsRequest>,
10469        ) -> std::result::Result<
10470            tonic::Response<super::GetUserSettingsResponse>,
10471            tonic::Status,
10472        >;
10473        /** Update the caller's platform settings.
10474 Only fields with non-default values are applied; others are left unchanged.
10475 Authorization: Any authenticated user (self-only).
10476*/
10477        async fn update_user_settings(
10478            &self,
10479            request: tonic::Request<super::UpdateUserSettingsRequest>,
10480        ) -> std::result::Result<
10481            tonic::Response<super::UpdateUserSettingsResponse>,
10482            tonic::Status,
10483        >;
10484        /** Invite multiple users to the organization in a single call.
10485 Emails are deduplicated. Each email is processed independently — individual
10486 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10487 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10488*/
10489        async fn bulk_invite_users(
10490            &self,
10491            request: tonic::Request<super::BulkInviteUsersRequest>,
10492        ) -> std::result::Result<
10493            tonic::Response<super::BulkInviteUsersResponse>,
10494            tonic::Status,
10495        >;
10496        /** Confirm passkey enrollment after client-side WebAuthn registration.
10497 Verifies the caller has at least one registered credential server-side,
10498 then marks the user as passkey-enrolled in the identity provider.
10499 Authorization: Any authenticated user (self-only, no permission required).
10500*/
10501        async fn confirm_passkey_enrollment(
10502            &self,
10503            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10504        ) -> std::result::Result<
10505            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10506            tonic::Status,
10507        >;
10508        /** Update the data governance region for a user. Triggers a data migration
10509 workflow if the region changed. Admin-only operation.
10510 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10511*/
10512        async fn update_user_region(
10513            &self,
10514            request: tonic::Request<super::UpdateUserRegionRequest>,
10515        ) -> std::result::Result<
10516            tonic::Response<super::UpdateUserRegionResponse>,
10517            tonic::Status,
10518        >;
10519    }
10520    /** Manages members (users) within an organization.
10521 All RPCs operate within the caller's org (extracted from JWT).
10522*/
10523    #[derive(Debug)]
10524    pub struct MemberServiceServer<T> {
10525        inner: Arc<T>,
10526        accept_compression_encodings: EnabledCompressionEncodings,
10527        send_compression_encodings: EnabledCompressionEncodings,
10528        max_decoding_message_size: Option<usize>,
10529        max_encoding_message_size: Option<usize>,
10530    }
10531    impl<T> MemberServiceServer<T> {
10532        pub fn new(inner: T) -> Self {
10533            Self::from_arc(Arc::new(inner))
10534        }
10535        pub fn from_arc(inner: Arc<T>) -> Self {
10536            Self {
10537                inner,
10538                accept_compression_encodings: Default::default(),
10539                send_compression_encodings: Default::default(),
10540                max_decoding_message_size: None,
10541                max_encoding_message_size: None,
10542            }
10543        }
10544        pub fn with_interceptor<F>(
10545            inner: T,
10546            interceptor: F,
10547        ) -> InterceptedService<Self, F>
10548        where
10549            F: tonic::service::Interceptor,
10550        {
10551            InterceptedService::new(Self::new(inner), interceptor)
10552        }
10553        /// Enable decompressing requests with the given encoding.
10554        #[must_use]
10555        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10556            self.accept_compression_encodings.enable(encoding);
10557            self
10558        }
10559        /// Compress responses with the given encoding, if the client supports it.
10560        #[must_use]
10561        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10562            self.send_compression_encodings.enable(encoding);
10563            self
10564        }
10565        /// Limits the maximum size of a decoded message.
10566        ///
10567        /// Default: `4MB`
10568        #[must_use]
10569        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10570            self.max_decoding_message_size = Some(limit);
10571            self
10572        }
10573        /// Limits the maximum size of an encoded message.
10574        ///
10575        /// Default: `usize::MAX`
10576        #[must_use]
10577        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10578            self.max_encoding_message_size = Some(limit);
10579            self
10580        }
10581    }
10582    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10583    where
10584        T: MemberService,
10585        B: Body + std::marker::Send + 'static,
10586        B::Error: Into<StdError> + std::marker::Send + 'static,
10587    {
10588        type Response = http::Response<tonic::body::Body>;
10589        type Error = std::convert::Infallible;
10590        type Future = BoxFuture<Self::Response, Self::Error>;
10591        fn poll_ready(
10592            &mut self,
10593            _cx: &mut Context<'_>,
10594        ) -> Poll<std::result::Result<(), Self::Error>> {
10595            Poll::Ready(Ok(()))
10596        }
10597        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10598            match req.uri().path() {
10599                "/pidgr.v1.MemberService/InviteUser" => {
10600                    #[allow(non_camel_case_types)]
10601                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10602                    impl<
10603                        T: MemberService,
10604                    > tonic::server::UnaryService<super::InviteUserRequest>
10605                    for InviteUserSvc<T> {
10606                        type Response = super::InviteUserResponse;
10607                        type Future = BoxFuture<
10608                            tonic::Response<Self::Response>,
10609                            tonic::Status,
10610                        >;
10611                        fn call(
10612                            &mut self,
10613                            request: tonic::Request<super::InviteUserRequest>,
10614                        ) -> Self::Future {
10615                            let inner = Arc::clone(&self.0);
10616                            let fut = async move {
10617                                <T as MemberService>::invite_user(&inner, request).await
10618                            };
10619                            Box::pin(fut)
10620                        }
10621                    }
10622                    let accept_compression_encodings = self.accept_compression_encodings;
10623                    let send_compression_encodings = self.send_compression_encodings;
10624                    let max_decoding_message_size = self.max_decoding_message_size;
10625                    let max_encoding_message_size = self.max_encoding_message_size;
10626                    let inner = self.inner.clone();
10627                    let fut = async move {
10628                        let method = InviteUserSvc(inner);
10629                        let codec = tonic_prost::ProstCodec::default();
10630                        let mut grpc = tonic::server::Grpc::new(codec)
10631                            .apply_compression_config(
10632                                accept_compression_encodings,
10633                                send_compression_encodings,
10634                            )
10635                            .apply_max_message_size_config(
10636                                max_decoding_message_size,
10637                                max_encoding_message_size,
10638                            );
10639                        let res = grpc.unary(method, req).await;
10640                        Ok(res)
10641                    };
10642                    Box::pin(fut)
10643                }
10644                "/pidgr.v1.MemberService/GetUser" => {
10645                    #[allow(non_camel_case_types)]
10646                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
10647                    impl<
10648                        T: MemberService,
10649                    > tonic::server::UnaryService<super::GetUserRequest>
10650                    for GetUserSvc<T> {
10651                        type Response = super::GetUserResponse;
10652                        type Future = BoxFuture<
10653                            tonic::Response<Self::Response>,
10654                            tonic::Status,
10655                        >;
10656                        fn call(
10657                            &mut self,
10658                            request: tonic::Request<super::GetUserRequest>,
10659                        ) -> Self::Future {
10660                            let inner = Arc::clone(&self.0);
10661                            let fut = async move {
10662                                <T as MemberService>::get_user(&inner, request).await
10663                            };
10664                            Box::pin(fut)
10665                        }
10666                    }
10667                    let accept_compression_encodings = self.accept_compression_encodings;
10668                    let send_compression_encodings = self.send_compression_encodings;
10669                    let max_decoding_message_size = self.max_decoding_message_size;
10670                    let max_encoding_message_size = self.max_encoding_message_size;
10671                    let inner = self.inner.clone();
10672                    let fut = async move {
10673                        let method = GetUserSvc(inner);
10674                        let codec = tonic_prost::ProstCodec::default();
10675                        let mut grpc = tonic::server::Grpc::new(codec)
10676                            .apply_compression_config(
10677                                accept_compression_encodings,
10678                                send_compression_encodings,
10679                            )
10680                            .apply_max_message_size_config(
10681                                max_decoding_message_size,
10682                                max_encoding_message_size,
10683                            );
10684                        let res = grpc.unary(method, req).await;
10685                        Ok(res)
10686                    };
10687                    Box::pin(fut)
10688                }
10689                "/pidgr.v1.MemberService/ListUsers" => {
10690                    #[allow(non_camel_case_types)]
10691                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10692                    impl<
10693                        T: MemberService,
10694                    > tonic::server::UnaryService<super::ListUsersRequest>
10695                    for ListUsersSvc<T> {
10696                        type Response = super::ListUsersResponse;
10697                        type Future = BoxFuture<
10698                            tonic::Response<Self::Response>,
10699                            tonic::Status,
10700                        >;
10701                        fn call(
10702                            &mut self,
10703                            request: tonic::Request<super::ListUsersRequest>,
10704                        ) -> Self::Future {
10705                            let inner = Arc::clone(&self.0);
10706                            let fut = async move {
10707                                <T as MemberService>::list_users(&inner, request).await
10708                            };
10709                            Box::pin(fut)
10710                        }
10711                    }
10712                    let accept_compression_encodings = self.accept_compression_encodings;
10713                    let send_compression_encodings = self.send_compression_encodings;
10714                    let max_decoding_message_size = self.max_decoding_message_size;
10715                    let max_encoding_message_size = self.max_encoding_message_size;
10716                    let inner = self.inner.clone();
10717                    let fut = async move {
10718                        let method = ListUsersSvc(inner);
10719                        let codec = tonic_prost::ProstCodec::default();
10720                        let mut grpc = tonic::server::Grpc::new(codec)
10721                            .apply_compression_config(
10722                                accept_compression_encodings,
10723                                send_compression_encodings,
10724                            )
10725                            .apply_max_message_size_config(
10726                                max_decoding_message_size,
10727                                max_encoding_message_size,
10728                            );
10729                        let res = grpc.unary(method, req).await;
10730                        Ok(res)
10731                    };
10732                    Box::pin(fut)
10733                }
10734                "/pidgr.v1.MemberService/UpdateUserRole" => {
10735                    #[allow(non_camel_case_types)]
10736                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
10737                    impl<
10738                        T: MemberService,
10739                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
10740                    for UpdateUserRoleSvc<T> {
10741                        type Response = super::UpdateUserRoleResponse;
10742                        type Future = BoxFuture<
10743                            tonic::Response<Self::Response>,
10744                            tonic::Status,
10745                        >;
10746                        fn call(
10747                            &mut self,
10748                            request: tonic::Request<super::UpdateUserRoleRequest>,
10749                        ) -> Self::Future {
10750                            let inner = Arc::clone(&self.0);
10751                            let fut = async move {
10752                                <T as MemberService>::update_user_role(&inner, request)
10753                                    .await
10754                            };
10755                            Box::pin(fut)
10756                        }
10757                    }
10758                    let accept_compression_encodings = self.accept_compression_encodings;
10759                    let send_compression_encodings = self.send_compression_encodings;
10760                    let max_decoding_message_size = self.max_decoding_message_size;
10761                    let max_encoding_message_size = self.max_encoding_message_size;
10762                    let inner = self.inner.clone();
10763                    let fut = async move {
10764                        let method = UpdateUserRoleSvc(inner);
10765                        let codec = tonic_prost::ProstCodec::default();
10766                        let mut grpc = tonic::server::Grpc::new(codec)
10767                            .apply_compression_config(
10768                                accept_compression_encodings,
10769                                send_compression_encodings,
10770                            )
10771                            .apply_max_message_size_config(
10772                                max_decoding_message_size,
10773                                max_encoding_message_size,
10774                            );
10775                        let res = grpc.unary(method, req).await;
10776                        Ok(res)
10777                    };
10778                    Box::pin(fut)
10779                }
10780                "/pidgr.v1.MemberService/DeactivateUser" => {
10781                    #[allow(non_camel_case_types)]
10782                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
10783                    impl<
10784                        T: MemberService,
10785                    > tonic::server::UnaryService<super::DeactivateUserRequest>
10786                    for DeactivateUserSvc<T> {
10787                        type Response = super::DeactivateUserResponse;
10788                        type Future = BoxFuture<
10789                            tonic::Response<Self::Response>,
10790                            tonic::Status,
10791                        >;
10792                        fn call(
10793                            &mut self,
10794                            request: tonic::Request<super::DeactivateUserRequest>,
10795                        ) -> Self::Future {
10796                            let inner = Arc::clone(&self.0);
10797                            let fut = async move {
10798                                <T as MemberService>::deactivate_user(&inner, request).await
10799                            };
10800                            Box::pin(fut)
10801                        }
10802                    }
10803                    let accept_compression_encodings = self.accept_compression_encodings;
10804                    let send_compression_encodings = self.send_compression_encodings;
10805                    let max_decoding_message_size = self.max_decoding_message_size;
10806                    let max_encoding_message_size = self.max_encoding_message_size;
10807                    let inner = self.inner.clone();
10808                    let fut = async move {
10809                        let method = DeactivateUserSvc(inner);
10810                        let codec = tonic_prost::ProstCodec::default();
10811                        let mut grpc = tonic::server::Grpc::new(codec)
10812                            .apply_compression_config(
10813                                accept_compression_encodings,
10814                                send_compression_encodings,
10815                            )
10816                            .apply_max_message_size_config(
10817                                max_decoding_message_size,
10818                                max_encoding_message_size,
10819                            );
10820                        let res = grpc.unary(method, req).await;
10821                        Ok(res)
10822                    };
10823                    Box::pin(fut)
10824                }
10825                "/pidgr.v1.MemberService/ReactivateUser" => {
10826                    #[allow(non_camel_case_types)]
10827                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
10828                    impl<
10829                        T: MemberService,
10830                    > tonic::server::UnaryService<super::ReactivateUserRequest>
10831                    for ReactivateUserSvc<T> {
10832                        type Response = super::ReactivateUserResponse;
10833                        type Future = BoxFuture<
10834                            tonic::Response<Self::Response>,
10835                            tonic::Status,
10836                        >;
10837                        fn call(
10838                            &mut self,
10839                            request: tonic::Request<super::ReactivateUserRequest>,
10840                        ) -> Self::Future {
10841                            let inner = Arc::clone(&self.0);
10842                            let fut = async move {
10843                                <T as MemberService>::reactivate_user(&inner, request).await
10844                            };
10845                            Box::pin(fut)
10846                        }
10847                    }
10848                    let accept_compression_encodings = self.accept_compression_encodings;
10849                    let send_compression_encodings = self.send_compression_encodings;
10850                    let max_decoding_message_size = self.max_decoding_message_size;
10851                    let max_encoding_message_size = self.max_encoding_message_size;
10852                    let inner = self.inner.clone();
10853                    let fut = async move {
10854                        let method = ReactivateUserSvc(inner);
10855                        let codec = tonic_prost::ProstCodec::default();
10856                        let mut grpc = tonic::server::Grpc::new(codec)
10857                            .apply_compression_config(
10858                                accept_compression_encodings,
10859                                send_compression_encodings,
10860                            )
10861                            .apply_max_message_size_config(
10862                                max_decoding_message_size,
10863                                max_encoding_message_size,
10864                            );
10865                        let res = grpc.unary(method, req).await;
10866                        Ok(res)
10867                    };
10868                    Box::pin(fut)
10869                }
10870                "/pidgr.v1.MemberService/RevokeInvite" => {
10871                    #[allow(non_camel_case_types)]
10872                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
10873                    impl<
10874                        T: MemberService,
10875                    > tonic::server::UnaryService<super::RevokeInviteRequest>
10876                    for RevokeInviteSvc<T> {
10877                        type Response = super::RevokeInviteResponse;
10878                        type Future = BoxFuture<
10879                            tonic::Response<Self::Response>,
10880                            tonic::Status,
10881                        >;
10882                        fn call(
10883                            &mut self,
10884                            request: tonic::Request<super::RevokeInviteRequest>,
10885                        ) -> Self::Future {
10886                            let inner = Arc::clone(&self.0);
10887                            let fut = async move {
10888                                <T as MemberService>::revoke_invite(&inner, request).await
10889                            };
10890                            Box::pin(fut)
10891                        }
10892                    }
10893                    let accept_compression_encodings = self.accept_compression_encodings;
10894                    let send_compression_encodings = self.send_compression_encodings;
10895                    let max_decoding_message_size = self.max_decoding_message_size;
10896                    let max_encoding_message_size = self.max_encoding_message_size;
10897                    let inner = self.inner.clone();
10898                    let fut = async move {
10899                        let method = RevokeInviteSvc(inner);
10900                        let codec = tonic_prost::ProstCodec::default();
10901                        let mut grpc = tonic::server::Grpc::new(codec)
10902                            .apply_compression_config(
10903                                accept_compression_encodings,
10904                                send_compression_encodings,
10905                            )
10906                            .apply_max_message_size_config(
10907                                max_decoding_message_size,
10908                                max_encoding_message_size,
10909                            );
10910                        let res = grpc.unary(method, req).await;
10911                        Ok(res)
10912                    };
10913                    Box::pin(fut)
10914                }
10915                "/pidgr.v1.MemberService/UpdateUserProfile" => {
10916                    #[allow(non_camel_case_types)]
10917                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
10918                    impl<
10919                        T: MemberService,
10920                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
10921                    for UpdateUserProfileSvc<T> {
10922                        type Response = super::UpdateUserProfileResponse;
10923                        type Future = BoxFuture<
10924                            tonic::Response<Self::Response>,
10925                            tonic::Status,
10926                        >;
10927                        fn call(
10928                            &mut self,
10929                            request: tonic::Request<super::UpdateUserProfileRequest>,
10930                        ) -> Self::Future {
10931                            let inner = Arc::clone(&self.0);
10932                            let fut = async move {
10933                                <T as MemberService>::update_user_profile(&inner, request)
10934                                    .await
10935                            };
10936                            Box::pin(fut)
10937                        }
10938                    }
10939                    let accept_compression_encodings = self.accept_compression_encodings;
10940                    let send_compression_encodings = self.send_compression_encodings;
10941                    let max_decoding_message_size = self.max_decoding_message_size;
10942                    let max_encoding_message_size = self.max_encoding_message_size;
10943                    let inner = self.inner.clone();
10944                    let fut = async move {
10945                        let method = UpdateUserProfileSvc(inner);
10946                        let codec = tonic_prost::ProstCodec::default();
10947                        let mut grpc = tonic::server::Grpc::new(codec)
10948                            .apply_compression_config(
10949                                accept_compression_encodings,
10950                                send_compression_encodings,
10951                            )
10952                            .apply_max_message_size_config(
10953                                max_decoding_message_size,
10954                                max_encoding_message_size,
10955                            );
10956                        let res = grpc.unary(method, req).await;
10957                        Ok(res)
10958                    };
10959                    Box::pin(fut)
10960                }
10961                "/pidgr.v1.MemberService/GetUserSettings" => {
10962                    #[allow(non_camel_case_types)]
10963                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
10964                    impl<
10965                        T: MemberService,
10966                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
10967                    for GetUserSettingsSvc<T> {
10968                        type Response = super::GetUserSettingsResponse;
10969                        type Future = BoxFuture<
10970                            tonic::Response<Self::Response>,
10971                            tonic::Status,
10972                        >;
10973                        fn call(
10974                            &mut self,
10975                            request: tonic::Request<super::GetUserSettingsRequest>,
10976                        ) -> Self::Future {
10977                            let inner = Arc::clone(&self.0);
10978                            let fut = async move {
10979                                <T as MemberService>::get_user_settings(&inner, request)
10980                                    .await
10981                            };
10982                            Box::pin(fut)
10983                        }
10984                    }
10985                    let accept_compression_encodings = self.accept_compression_encodings;
10986                    let send_compression_encodings = self.send_compression_encodings;
10987                    let max_decoding_message_size = self.max_decoding_message_size;
10988                    let max_encoding_message_size = self.max_encoding_message_size;
10989                    let inner = self.inner.clone();
10990                    let fut = async move {
10991                        let method = GetUserSettingsSvc(inner);
10992                        let codec = tonic_prost::ProstCodec::default();
10993                        let mut grpc = tonic::server::Grpc::new(codec)
10994                            .apply_compression_config(
10995                                accept_compression_encodings,
10996                                send_compression_encodings,
10997                            )
10998                            .apply_max_message_size_config(
10999                                max_decoding_message_size,
11000                                max_encoding_message_size,
11001                            );
11002                        let res = grpc.unary(method, req).await;
11003                        Ok(res)
11004                    };
11005                    Box::pin(fut)
11006                }
11007                "/pidgr.v1.MemberService/UpdateUserSettings" => {
11008                    #[allow(non_camel_case_types)]
11009                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11010                    impl<
11011                        T: MemberService,
11012                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11013                    for UpdateUserSettingsSvc<T> {
11014                        type Response = super::UpdateUserSettingsResponse;
11015                        type Future = BoxFuture<
11016                            tonic::Response<Self::Response>,
11017                            tonic::Status,
11018                        >;
11019                        fn call(
11020                            &mut self,
11021                            request: tonic::Request<super::UpdateUserSettingsRequest>,
11022                        ) -> Self::Future {
11023                            let inner = Arc::clone(&self.0);
11024                            let fut = async move {
11025                                <T as MemberService>::update_user_settings(&inner, request)
11026                                    .await
11027                            };
11028                            Box::pin(fut)
11029                        }
11030                    }
11031                    let accept_compression_encodings = self.accept_compression_encodings;
11032                    let send_compression_encodings = self.send_compression_encodings;
11033                    let max_decoding_message_size = self.max_decoding_message_size;
11034                    let max_encoding_message_size = self.max_encoding_message_size;
11035                    let inner = self.inner.clone();
11036                    let fut = async move {
11037                        let method = UpdateUserSettingsSvc(inner);
11038                        let codec = tonic_prost::ProstCodec::default();
11039                        let mut grpc = tonic::server::Grpc::new(codec)
11040                            .apply_compression_config(
11041                                accept_compression_encodings,
11042                                send_compression_encodings,
11043                            )
11044                            .apply_max_message_size_config(
11045                                max_decoding_message_size,
11046                                max_encoding_message_size,
11047                            );
11048                        let res = grpc.unary(method, req).await;
11049                        Ok(res)
11050                    };
11051                    Box::pin(fut)
11052                }
11053                "/pidgr.v1.MemberService/BulkInviteUsers" => {
11054                    #[allow(non_camel_case_types)]
11055                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11056                    impl<
11057                        T: MemberService,
11058                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11059                    for BulkInviteUsersSvc<T> {
11060                        type Response = super::BulkInviteUsersResponse;
11061                        type Future = BoxFuture<
11062                            tonic::Response<Self::Response>,
11063                            tonic::Status,
11064                        >;
11065                        fn call(
11066                            &mut self,
11067                            request: tonic::Request<super::BulkInviteUsersRequest>,
11068                        ) -> Self::Future {
11069                            let inner = Arc::clone(&self.0);
11070                            let fut = async move {
11071                                <T as MemberService>::bulk_invite_users(&inner, request)
11072                                    .await
11073                            };
11074                            Box::pin(fut)
11075                        }
11076                    }
11077                    let accept_compression_encodings = self.accept_compression_encodings;
11078                    let send_compression_encodings = self.send_compression_encodings;
11079                    let max_decoding_message_size = self.max_decoding_message_size;
11080                    let max_encoding_message_size = self.max_encoding_message_size;
11081                    let inner = self.inner.clone();
11082                    let fut = async move {
11083                        let method = BulkInviteUsersSvc(inner);
11084                        let codec = tonic_prost::ProstCodec::default();
11085                        let mut grpc = tonic::server::Grpc::new(codec)
11086                            .apply_compression_config(
11087                                accept_compression_encodings,
11088                                send_compression_encodings,
11089                            )
11090                            .apply_max_message_size_config(
11091                                max_decoding_message_size,
11092                                max_encoding_message_size,
11093                            );
11094                        let res = grpc.unary(method, req).await;
11095                        Ok(res)
11096                    };
11097                    Box::pin(fut)
11098                }
11099                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11100                    #[allow(non_camel_case_types)]
11101                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11102                    impl<
11103                        T: MemberService,
11104                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11105                    for ConfirmPasskeyEnrollmentSvc<T> {
11106                        type Response = super::ConfirmPasskeyEnrollmentResponse;
11107                        type Future = BoxFuture<
11108                            tonic::Response<Self::Response>,
11109                            tonic::Status,
11110                        >;
11111                        fn call(
11112                            &mut self,
11113                            request: tonic::Request<
11114                                super::ConfirmPasskeyEnrollmentRequest,
11115                            >,
11116                        ) -> Self::Future {
11117                            let inner = Arc::clone(&self.0);
11118                            let fut = async move {
11119                                <T as MemberService>::confirm_passkey_enrollment(
11120                                        &inner,
11121                                        request,
11122                                    )
11123                                    .await
11124                            };
11125                            Box::pin(fut)
11126                        }
11127                    }
11128                    let accept_compression_encodings = self.accept_compression_encodings;
11129                    let send_compression_encodings = self.send_compression_encodings;
11130                    let max_decoding_message_size = self.max_decoding_message_size;
11131                    let max_encoding_message_size = self.max_encoding_message_size;
11132                    let inner = self.inner.clone();
11133                    let fut = async move {
11134                        let method = ConfirmPasskeyEnrollmentSvc(inner);
11135                        let codec = tonic_prost::ProstCodec::default();
11136                        let mut grpc = tonic::server::Grpc::new(codec)
11137                            .apply_compression_config(
11138                                accept_compression_encodings,
11139                                send_compression_encodings,
11140                            )
11141                            .apply_max_message_size_config(
11142                                max_decoding_message_size,
11143                                max_encoding_message_size,
11144                            );
11145                        let res = grpc.unary(method, req).await;
11146                        Ok(res)
11147                    };
11148                    Box::pin(fut)
11149                }
11150                "/pidgr.v1.MemberService/UpdateUserRegion" => {
11151                    #[allow(non_camel_case_types)]
11152                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11153                    impl<
11154                        T: MemberService,
11155                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11156                    for UpdateUserRegionSvc<T> {
11157                        type Response = super::UpdateUserRegionResponse;
11158                        type Future = BoxFuture<
11159                            tonic::Response<Self::Response>,
11160                            tonic::Status,
11161                        >;
11162                        fn call(
11163                            &mut self,
11164                            request: tonic::Request<super::UpdateUserRegionRequest>,
11165                        ) -> Self::Future {
11166                            let inner = Arc::clone(&self.0);
11167                            let fut = async move {
11168                                <T as MemberService>::update_user_region(&inner, request)
11169                                    .await
11170                            };
11171                            Box::pin(fut)
11172                        }
11173                    }
11174                    let accept_compression_encodings = self.accept_compression_encodings;
11175                    let send_compression_encodings = self.send_compression_encodings;
11176                    let max_decoding_message_size = self.max_decoding_message_size;
11177                    let max_encoding_message_size = self.max_encoding_message_size;
11178                    let inner = self.inner.clone();
11179                    let fut = async move {
11180                        let method = UpdateUserRegionSvc(inner);
11181                        let codec = tonic_prost::ProstCodec::default();
11182                        let mut grpc = tonic::server::Grpc::new(codec)
11183                            .apply_compression_config(
11184                                accept_compression_encodings,
11185                                send_compression_encodings,
11186                            )
11187                            .apply_max_message_size_config(
11188                                max_decoding_message_size,
11189                                max_encoding_message_size,
11190                            );
11191                        let res = grpc.unary(method, req).await;
11192                        Ok(res)
11193                    };
11194                    Box::pin(fut)
11195                }
11196                _ => {
11197                    Box::pin(async move {
11198                        let mut response = http::Response::new(
11199                            tonic::body::Body::default(),
11200                        );
11201                        let headers = response.headers_mut();
11202                        headers
11203                            .insert(
11204                                tonic::Status::GRPC_STATUS,
11205                                (tonic::Code::Unimplemented as i32).into(),
11206                            );
11207                        headers
11208                            .insert(
11209                                http::header::CONTENT_TYPE,
11210                                tonic::metadata::GRPC_CONTENT_TYPE,
11211                            );
11212                        Ok(response)
11213                    })
11214                }
11215            }
11216        }
11217    }
11218    impl<T> Clone for MemberServiceServer<T> {
11219        fn clone(&self) -> Self {
11220            let inner = self.inner.clone();
11221            Self {
11222                inner,
11223                accept_compression_encodings: self.accept_compression_encodings,
11224                send_compression_encodings: self.send_compression_encodings,
11225                max_decoding_message_size: self.max_decoding_message_size,
11226                max_encoding_message_size: self.max_encoding_message_size,
11227            }
11228        }
11229    }
11230    /// Generated gRPC service name
11231    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11232    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11233        const NAME: &'static str = SERVICE_NAME;
11234    }
11235}
11236/// Generated client implementations.
11237pub mod org_security_keys_service_client {
11238    #![allow(
11239        unused_variables,
11240        dead_code,
11241        missing_docs,
11242        clippy::wildcard_imports,
11243        clippy::let_unit_value,
11244    )]
11245    use tonic::codegen::*;
11246    use tonic::codegen::http::Uri;
11247    /** OrgSecurityKeysService exposes per-org secret key material to internal
11248 services that need it for HMAC computation, signature verification, or
11249 envelope-key derivation.
11250
11251 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11252 material. The server MUST require a client certificate from a known
11253 internal service (allowlisted by subject DN) and MUST reject any request
11254 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11255
11256 Callers (today: pidgr-integrations) cache returned peppers in-process
11257 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11258 keep dispatch hot-path latency bounded.
11259*/
11260    #[derive(Debug, Clone)]
11261    pub struct OrgSecurityKeysServiceClient<T> {
11262        inner: tonic::client::Grpc<T>,
11263    }
11264    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
11265        /// Attempt to create a new client by connecting to a given endpoint.
11266        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11267        where
11268            D: TryInto<tonic::transport::Endpoint>,
11269            D::Error: Into<StdError>,
11270        {
11271            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11272            Ok(Self::new(conn))
11273        }
11274    }
11275    impl<T> OrgSecurityKeysServiceClient<T>
11276    where
11277        T: tonic::client::GrpcService<tonic::body::Body>,
11278        T::Error: Into<StdError>,
11279        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11280        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11281    {
11282        pub fn new(inner: T) -> Self {
11283            let inner = tonic::client::Grpc::new(inner);
11284            Self { inner }
11285        }
11286        pub fn with_origin(inner: T, origin: Uri) -> Self {
11287            let inner = tonic::client::Grpc::with_origin(inner, origin);
11288            Self { inner }
11289        }
11290        pub fn with_interceptor<F>(
11291            inner: T,
11292            interceptor: F,
11293        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
11294        where
11295            F: tonic::service::Interceptor,
11296            T::ResponseBody: Default,
11297            T: tonic::codegen::Service<
11298                http::Request<tonic::body::Body>,
11299                Response = http::Response<
11300                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11301                >,
11302            >,
11303            <T as tonic::codegen::Service<
11304                http::Request<tonic::body::Body>,
11305            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11306        {
11307            OrgSecurityKeysServiceClient::new(
11308                InterceptedService::new(inner, interceptor),
11309            )
11310        }
11311        /// Compress requests with the given encoding.
11312        ///
11313        /// This requires the server to support it otherwise it might respond with an
11314        /// error.
11315        #[must_use]
11316        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11317            self.inner = self.inner.send_compressed(encoding);
11318            self
11319        }
11320        /// Enable decompressing responses.
11321        #[must_use]
11322        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11323            self.inner = self.inner.accept_compressed(encoding);
11324            self
11325        }
11326        /// Limits the maximum size of a decoded message.
11327        ///
11328        /// Default: `4MB`
11329        #[must_use]
11330        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11331            self.inner = self.inner.max_decoding_message_size(limit);
11332            self
11333        }
11334        /// Limits the maximum size of an encoded message.
11335        ///
11336        /// Default: `usize::MAX`
11337        #[must_use]
11338        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11339            self.inner = self.inner.max_encoding_message_size(limit);
11340            self
11341        }
11342        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11343 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11344 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11345*/
11346        pub async fn get_peppers(
11347            &mut self,
11348            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11349        ) -> std::result::Result<
11350            tonic::Response<super::GetPeppersResponse>,
11351            tonic::Status,
11352        > {
11353            self.inner
11354                .ready()
11355                .await
11356                .map_err(|e| {
11357                    tonic::Status::unknown(
11358                        format!("Service was not ready: {}", e.into()),
11359                    )
11360                })?;
11361            let codec = tonic_prost::ProstCodec::default();
11362            let path = http::uri::PathAndQuery::from_static(
11363                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11364            );
11365            let mut req = request.into_request();
11366            req.extensions_mut()
11367                .insert(
11368                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11369                );
11370            self.inner.unary(req, path, codec).await
11371        }
11372    }
11373}
11374/// Generated server implementations.
11375pub mod org_security_keys_service_server {
11376    #![allow(
11377        unused_variables,
11378        dead_code,
11379        missing_docs,
11380        clippy::wildcard_imports,
11381        clippy::let_unit_value,
11382    )]
11383    use tonic::codegen::*;
11384    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
11385    #[async_trait]
11386    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11387        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11388 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11389 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11390*/
11391        async fn get_peppers(
11392            &self,
11393            request: tonic::Request<super::GetPeppersRequest>,
11394        ) -> std::result::Result<
11395            tonic::Response<super::GetPeppersResponse>,
11396            tonic::Status,
11397        >;
11398    }
11399    /** OrgSecurityKeysService exposes per-org secret key material to internal
11400 services that need it for HMAC computation, signature verification, or
11401 envelope-key derivation.
11402
11403 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11404 material. The server MUST require a client certificate from a known
11405 internal service (allowlisted by subject DN) and MUST reject any request
11406 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11407
11408 Callers (today: pidgr-integrations) cache returned peppers in-process
11409 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11410 keep dispatch hot-path latency bounded.
11411*/
11412    #[derive(Debug)]
11413    pub struct OrgSecurityKeysServiceServer<T> {
11414        inner: Arc<T>,
11415        accept_compression_encodings: EnabledCompressionEncodings,
11416        send_compression_encodings: EnabledCompressionEncodings,
11417        max_decoding_message_size: Option<usize>,
11418        max_encoding_message_size: Option<usize>,
11419    }
11420    impl<T> OrgSecurityKeysServiceServer<T> {
11421        pub fn new(inner: T) -> Self {
11422            Self::from_arc(Arc::new(inner))
11423        }
11424        pub fn from_arc(inner: Arc<T>) -> Self {
11425            Self {
11426                inner,
11427                accept_compression_encodings: Default::default(),
11428                send_compression_encodings: Default::default(),
11429                max_decoding_message_size: None,
11430                max_encoding_message_size: None,
11431            }
11432        }
11433        pub fn with_interceptor<F>(
11434            inner: T,
11435            interceptor: F,
11436        ) -> InterceptedService<Self, F>
11437        where
11438            F: tonic::service::Interceptor,
11439        {
11440            InterceptedService::new(Self::new(inner), interceptor)
11441        }
11442        /// Enable decompressing requests with the given encoding.
11443        #[must_use]
11444        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11445            self.accept_compression_encodings.enable(encoding);
11446            self
11447        }
11448        /// Compress responses with the given encoding, if the client supports it.
11449        #[must_use]
11450        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11451            self.send_compression_encodings.enable(encoding);
11452            self
11453        }
11454        /// Limits the maximum size of a decoded message.
11455        ///
11456        /// Default: `4MB`
11457        #[must_use]
11458        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11459            self.max_decoding_message_size = Some(limit);
11460            self
11461        }
11462        /// Limits the maximum size of an encoded message.
11463        ///
11464        /// Default: `usize::MAX`
11465        #[must_use]
11466        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11467            self.max_encoding_message_size = Some(limit);
11468            self
11469        }
11470    }
11471    impl<T, B> tonic::codegen::Service<http::Request<B>>
11472    for OrgSecurityKeysServiceServer<T>
11473    where
11474        T: OrgSecurityKeysService,
11475        B: Body + std::marker::Send + 'static,
11476        B::Error: Into<StdError> + std::marker::Send + 'static,
11477    {
11478        type Response = http::Response<tonic::body::Body>;
11479        type Error = std::convert::Infallible;
11480        type Future = BoxFuture<Self::Response, Self::Error>;
11481        fn poll_ready(
11482            &mut self,
11483            _cx: &mut Context<'_>,
11484        ) -> Poll<std::result::Result<(), Self::Error>> {
11485            Poll::Ready(Ok(()))
11486        }
11487        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11488            match req.uri().path() {
11489                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11490                    #[allow(non_camel_case_types)]
11491                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11492                    impl<
11493                        T: OrgSecurityKeysService,
11494                    > tonic::server::UnaryService<super::GetPeppersRequest>
11495                    for GetPeppersSvc<T> {
11496                        type Response = super::GetPeppersResponse;
11497                        type Future = BoxFuture<
11498                            tonic::Response<Self::Response>,
11499                            tonic::Status,
11500                        >;
11501                        fn call(
11502                            &mut self,
11503                            request: tonic::Request<super::GetPeppersRequest>,
11504                        ) -> Self::Future {
11505                            let inner = Arc::clone(&self.0);
11506                            let fut = async move {
11507                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11508                                    .await
11509                            };
11510                            Box::pin(fut)
11511                        }
11512                    }
11513                    let accept_compression_encodings = self.accept_compression_encodings;
11514                    let send_compression_encodings = self.send_compression_encodings;
11515                    let max_decoding_message_size = self.max_decoding_message_size;
11516                    let max_encoding_message_size = self.max_encoding_message_size;
11517                    let inner = self.inner.clone();
11518                    let fut = async move {
11519                        let method = GetPeppersSvc(inner);
11520                        let codec = tonic_prost::ProstCodec::default();
11521                        let mut grpc = tonic::server::Grpc::new(codec)
11522                            .apply_compression_config(
11523                                accept_compression_encodings,
11524                                send_compression_encodings,
11525                            )
11526                            .apply_max_message_size_config(
11527                                max_decoding_message_size,
11528                                max_encoding_message_size,
11529                            );
11530                        let res = grpc.unary(method, req).await;
11531                        Ok(res)
11532                    };
11533                    Box::pin(fut)
11534                }
11535                _ => {
11536                    Box::pin(async move {
11537                        let mut response = http::Response::new(
11538                            tonic::body::Body::default(),
11539                        );
11540                        let headers = response.headers_mut();
11541                        headers
11542                            .insert(
11543                                tonic::Status::GRPC_STATUS,
11544                                (tonic::Code::Unimplemented as i32).into(),
11545                            );
11546                        headers
11547                            .insert(
11548                                http::header::CONTENT_TYPE,
11549                                tonic::metadata::GRPC_CONTENT_TYPE,
11550                            );
11551                        Ok(response)
11552                    })
11553                }
11554            }
11555        }
11556    }
11557    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11558        fn clone(&self) -> Self {
11559            let inner = self.inner.clone();
11560            Self {
11561                inner,
11562                accept_compression_encodings: self.accept_compression_encodings,
11563                send_compression_encodings: self.send_compression_encodings,
11564                max_decoding_message_size: self.max_decoding_message_size,
11565                max_encoding_message_size: self.max_encoding_message_size,
11566            }
11567        }
11568    }
11569    /// Generated gRPC service name
11570    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11571    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11572        const NAME: &'static str = SERVICE_NAME;
11573    }
11574}
11575/// Generated client implementations.
11576pub mod organization_service_client {
11577    #![allow(
11578        unused_variables,
11579        dead_code,
11580        missing_docs,
11581        clippy::wildcard_imports,
11582        clippy::let_unit_value,
11583    )]
11584    use tonic::codegen::*;
11585    use tonic::codegen::http::Uri;
11586    /** Manages organizations (tenants) in the Pidgr platform.
11587 Most RPCs operate within the caller's org (extracted from JWT).
11588 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11589*/
11590    #[derive(Debug, Clone)]
11591    pub struct OrganizationServiceClient<T> {
11592        inner: tonic::client::Grpc<T>,
11593    }
11594    impl OrganizationServiceClient<tonic::transport::Channel> {
11595        /// Attempt to create a new client by connecting to a given endpoint.
11596        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11597        where
11598            D: TryInto<tonic::transport::Endpoint>,
11599            D::Error: Into<StdError>,
11600        {
11601            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11602            Ok(Self::new(conn))
11603        }
11604    }
11605    impl<T> OrganizationServiceClient<T>
11606    where
11607        T: tonic::client::GrpcService<tonic::body::Body>,
11608        T::Error: Into<StdError>,
11609        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11610        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11611    {
11612        pub fn new(inner: T) -> Self {
11613            let inner = tonic::client::Grpc::new(inner);
11614            Self { inner }
11615        }
11616        pub fn with_origin(inner: T, origin: Uri) -> Self {
11617            let inner = tonic::client::Grpc::with_origin(inner, origin);
11618            Self { inner }
11619        }
11620        pub fn with_interceptor<F>(
11621            inner: T,
11622            interceptor: F,
11623        ) -> OrganizationServiceClient<InterceptedService<T, F>>
11624        where
11625            F: tonic::service::Interceptor,
11626            T::ResponseBody: Default,
11627            T: tonic::codegen::Service<
11628                http::Request<tonic::body::Body>,
11629                Response = http::Response<
11630                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11631                >,
11632            >,
11633            <T as tonic::codegen::Service<
11634                http::Request<tonic::body::Body>,
11635            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11636        {
11637            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11638        }
11639        /// Compress requests with the given encoding.
11640        ///
11641        /// This requires the server to support it otherwise it might respond with an
11642        /// error.
11643        #[must_use]
11644        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11645            self.inner = self.inner.send_compressed(encoding);
11646            self
11647        }
11648        /// Enable decompressing responses.
11649        #[must_use]
11650        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11651            self.inner = self.inner.accept_compressed(encoding);
11652            self
11653        }
11654        /// Limits the maximum size of a decoded message.
11655        ///
11656        /// Default: `4MB`
11657        #[must_use]
11658        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11659            self.inner = self.inner.max_decoding_message_size(limit);
11660            self
11661        }
11662        /// Limits the maximum size of an encoded message.
11663        ///
11664        /// Default: `usize::MAX`
11665        #[must_use]
11666        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11667            self.inner = self.inner.max_encoding_message_size(limit);
11668            self
11669        }
11670        /** Create a new organization. JWT auth only — the caller becomes the initial
11671 admin. Add further admins via CreateInviteLink.
11672 Authorization: Authenticated user (no specific permission required).
11673*/
11674        pub async fn create_organization(
11675            &mut self,
11676            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11677        ) -> std::result::Result<
11678            tonic::Response<super::CreateOrganizationResponse>,
11679            tonic::Status,
11680        > {
11681            self.inner
11682                .ready()
11683                .await
11684                .map_err(|e| {
11685                    tonic::Status::unknown(
11686                        format!("Service was not ready: {}", e.into()),
11687                    )
11688                })?;
11689            let codec = tonic_prost::ProstCodec::default();
11690            let path = http::uri::PathAndQuery::from_static(
11691                "/pidgr.v1.OrganizationService/CreateOrganization",
11692            );
11693            let mut req = request.into_request();
11694            req.extensions_mut()
11695                .insert(
11696                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11697                );
11698            self.inner.unary(req, path, codec).await
11699        }
11700        /** Retrieve the organization for the authenticated user.
11701 Authorization: Requires PERMISSION_ORG_READ.
11702*/
11703        pub async fn get_organization(
11704            &mut self,
11705            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11706        ) -> std::result::Result<
11707            tonic::Response<super::GetOrganizationResponse>,
11708            tonic::Status,
11709        > {
11710            self.inner
11711                .ready()
11712                .await
11713                .map_err(|e| {
11714                    tonic::Status::unknown(
11715                        format!("Service was not ready: {}", e.into()),
11716                    )
11717                })?;
11718            let codec = tonic_prost::ProstCodec::default();
11719            let path = http::uri::PathAndQuery::from_static(
11720                "/pidgr.v1.OrganizationService/GetOrganization",
11721            );
11722            let mut req = request.into_request();
11723            req.extensions_mut()
11724                .insert(
11725                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
11726                );
11727            self.inner.unary(req, path, codec).await
11728        }
11729        /** Update organization settings (name, default workflow, industry, company size).
11730 Authorization: Requires PERMISSION_ORG_WRITE.
11731*/
11732        pub async fn update_organization(
11733            &mut self,
11734            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
11735        ) -> std::result::Result<
11736            tonic::Response<super::UpdateOrganizationResponse>,
11737            tonic::Status,
11738        > {
11739            self.inner
11740                .ready()
11741                .await
11742                .map_err(|e| {
11743                    tonic::Status::unknown(
11744                        format!("Service was not ready: {}", e.into()),
11745                    )
11746                })?;
11747            let codec = tonic_prost::ProstCodec::default();
11748            let path = http::uri::PathAndQuery::from_static(
11749                "/pidgr.v1.OrganizationService/UpdateOrganization",
11750            );
11751            let mut req = request.into_request();
11752            req.extensions_mut()
11753                .insert(
11754                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
11755                );
11756            self.inner.unary(req, path, codec).await
11757        }
11758        /** Replace all SSO attribute mappings for the organization.
11759 Authorization: Requires PERMISSION_ORG_WRITE.
11760*/
11761        pub async fn update_sso_attribute_mappings(
11762            &mut self,
11763            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
11764        ) -> std::result::Result<
11765            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11766            tonic::Status,
11767        > {
11768            self.inner
11769                .ready()
11770                .await
11771                .map_err(|e| {
11772                    tonic::Status::unknown(
11773                        format!("Service was not ready: {}", e.into()),
11774                    )
11775                })?;
11776            let codec = tonic_prost::ProstCodec::default();
11777            let path = http::uri::PathAndQuery::from_static(
11778                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
11779            );
11780            let mut req = request.into_request();
11781            req.extensions_mut()
11782                .insert(
11783                    GrpcMethod::new(
11784                        "pidgr.v1.OrganizationService",
11785                        "UpdateSsoAttributeMappings",
11786                    ),
11787                );
11788            self.inner.unary(req, path, codec).await
11789        }
11790        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11791 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11792*/
11793        pub async fn rotate_analytics_salt(
11794            &mut self,
11795            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
11796        ) -> std::result::Result<
11797            tonic::Response<super::RotateAnalyticsSaltResponse>,
11798            tonic::Status,
11799        > {
11800            self.inner
11801                .ready()
11802                .await
11803                .map_err(|e| {
11804                    tonic::Status::unknown(
11805                        format!("Service was not ready: {}", e.into()),
11806                    )
11807                })?;
11808            let codec = tonic_prost::ProstCodec::default();
11809            let path = http::uri::PathAndQuery::from_static(
11810                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11811            );
11812            let mut req = request.into_request();
11813            req.extensions_mut()
11814                .insert(
11815                    GrpcMethod::new(
11816                        "pidgr.v1.OrganizationService",
11817                        "RotateAnalyticsSalt",
11818                    ),
11819                );
11820            self.inner.unary(req, path, codec).await
11821        }
11822        /** Update the differential privacy epsilon parameter.
11823 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11824*/
11825        pub async fn update_analytics_epsilon(
11826            &mut self,
11827            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
11828        ) -> std::result::Result<
11829            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11830            tonic::Status,
11831        > {
11832            self.inner
11833                .ready()
11834                .await
11835                .map_err(|e| {
11836                    tonic::Status::unknown(
11837                        format!("Service was not ready: {}", e.into()),
11838                    )
11839                })?;
11840            let codec = tonic_prost::ProstCodec::default();
11841            let path = http::uri::PathAndQuery::from_static(
11842                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
11843            );
11844            let mut req = request.into_request();
11845            req.extensions_mut()
11846                .insert(
11847                    GrpcMethod::new(
11848                        "pidgr.v1.OrganizationService",
11849                        "UpdateAnalyticsEpsilon",
11850                    ),
11851                );
11852            self.inner.unary(req, path, codec).await
11853        }
11854        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
11855 analytics, third-party channels) with last-changed-by/at metadata for
11856 the consent-trace UI.
11857 Authorization: Requires PERMISSION_PRIVACY_READ.
11858*/
11859        pub async fn get_org_privacy_settings(
11860            &mut self,
11861            request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
11862        ) -> std::result::Result<
11863            tonic::Response<super::GetOrgPrivacySettingsResponse>,
11864            tonic::Status,
11865        > {
11866            self.inner
11867                .ready()
11868                .await
11869                .map_err(|e| {
11870                    tonic::Status::unknown(
11871                        format!("Service was not ready: {}", e.into()),
11872                    )
11873                })?;
11874            let codec = tonic_prost::ProstCodec::default();
11875            let path = http::uri::PathAndQuery::from_static(
11876                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
11877            );
11878            let mut req = request.into_request();
11879            req.extensions_mut()
11880                .insert(
11881                    GrpcMethod::new(
11882                        "pidgr.v1.OrganizationService",
11883                        "GetOrgPrivacySettings",
11884                    ),
11885                );
11886            self.inner.unary(req, path, codec).await
11887        }
11888        /** Update org-level data-processing toggles. Only provided fields change;
11889 each change is recorded with the acting admin and timestamp.
11890 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11891*/
11892        pub async fn update_org_privacy_settings(
11893            &mut self,
11894            request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
11895        ) -> std::result::Result<
11896            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
11897            tonic::Status,
11898        > {
11899            self.inner
11900                .ready()
11901                .await
11902                .map_err(|e| {
11903                    tonic::Status::unknown(
11904                        format!("Service was not ready: {}", e.into()),
11905                    )
11906                })?;
11907            let codec = tonic_prost::ProstCodec::default();
11908            let path = http::uri::PathAndQuery::from_static(
11909                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
11910            );
11911            let mut req = request.into_request();
11912            req.extensions_mut()
11913                .insert(
11914                    GrpcMethod::new(
11915                        "pidgr.v1.OrganizationService",
11916                        "UpdateOrgPrivacySettings",
11917                    ),
11918                );
11919            self.inner.unary(req, path, codec).await
11920        }
11921        /** Create a sandbox organization for testing configurations.
11922 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
11923 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
11924 per user to prevent abuse.
11925*/
11926        pub async fn create_sandbox_organization(
11927            &mut self,
11928            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
11929        ) -> std::result::Result<
11930            tonic::Response<super::CreateSandboxOrganizationResponse>,
11931            tonic::Status,
11932        > {
11933            self.inner
11934                .ready()
11935                .await
11936                .map_err(|e| {
11937                    tonic::Status::unknown(
11938                        format!("Service was not ready: {}", e.into()),
11939                    )
11940                })?;
11941            let codec = tonic_prost::ProstCodec::default();
11942            let path = http::uri::PathAndQuery::from_static(
11943                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
11944            );
11945            let mut req = request.into_request();
11946            req.extensions_mut()
11947                .insert(
11948                    GrpcMethod::new(
11949                        "pidgr.v1.OrganizationService",
11950                        "CreateSandboxOrganization",
11951                    ),
11952                );
11953            self.inner.unary(req, path, codec).await
11954        }
11955        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
11956 which handles cleanup across DB, Cognito, S3, Temporal, and regional
11957 content stores.
11958 Authorization: Super admin of the target sandbox OR its creator.
11959*/
11960        pub async fn delete_sandbox_organization(
11961            &mut self,
11962            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
11963        ) -> std::result::Result<
11964            tonic::Response<super::DeleteSandboxOrganizationResponse>,
11965            tonic::Status,
11966        > {
11967            self.inner
11968                .ready()
11969                .await
11970                .map_err(|e| {
11971                    tonic::Status::unknown(
11972                        format!("Service was not ready: {}", e.into()),
11973                    )
11974                })?;
11975            let codec = tonic_prost::ProstCodec::default();
11976            let path = http::uri::PathAndQuery::from_static(
11977                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
11978            );
11979            let mut req = request.into_request();
11980            req.extensions_mut()
11981                .insert(
11982                    GrpcMethod::new(
11983                        "pidgr.v1.OrganizationService",
11984                        "DeleteSandboxOrganization",
11985                    ),
11986                );
11987            self.inner.unary(req, path, codec).await
11988        }
11989        /** List bootstrap fixtures available for seeding new organizations. The
11990 catalog is backend-owned; admin UI populates the "seed initial data"
11991 control or dropdown from this response.
11992 Authorization: Any authenticated user.
11993*/
11994        pub async fn list_sandbox_fixtures(
11995            &mut self,
11996            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
11997        ) -> std::result::Result<
11998            tonic::Response<super::ListSandboxFixturesResponse>,
11999            tonic::Status,
12000        > {
12001            self.inner
12002                .ready()
12003                .await
12004                .map_err(|e| {
12005                    tonic::Status::unknown(
12006                        format!("Service was not ready: {}", e.into()),
12007                    )
12008                })?;
12009            let codec = tonic_prost::ProstCodec::default();
12010            let path = http::uri::PathAndQuery::from_static(
12011                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
12012            );
12013            let mut req = request.into_request();
12014            req.extensions_mut()
12015                .insert(
12016                    GrpcMethod::new(
12017                        "pidgr.v1.OrganizationService",
12018                        "ListSandboxFixtures",
12019                    ),
12020                );
12021            self.inner.unary(req, path, codec).await
12022        }
12023        /** List all organizations the authenticated user belongs to.
12024 Org-exempt: callable without org context (only requires valid JWT).
12025 Used by the admin org switcher to discover available orgs.
12026 Excludes expired sandbox organizations.
12027 Authorization: Authenticated user (no specific permission required).
12028*/
12029        pub async fn list_user_organizations(
12030            &mut self,
12031            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
12032        ) -> std::result::Result<
12033            tonic::Response<super::ListUserOrganizationsResponse>,
12034            tonic::Status,
12035        > {
12036            self.inner
12037                .ready()
12038                .await
12039                .map_err(|e| {
12040                    tonic::Status::unknown(
12041                        format!("Service was not ready: {}", e.into()),
12042                    )
12043                })?;
12044            let codec = tonic_prost::ProstCodec::default();
12045            let path = http::uri::PathAndQuery::from_static(
12046                "/pidgr.v1.OrganizationService/ListUserOrganizations",
12047            );
12048            let mut req = request.into_request();
12049            req.extensions_mut()
12050                .insert(
12051                    GrpcMethod::new(
12052                        "pidgr.v1.OrganizationService",
12053                        "ListUserOrganizations",
12054                    ),
12055                );
12056            self.inner.unary(req, path, codec).await
12057        }
12058        /** List only the sandbox organizations the authenticated user belongs to.
12059 Org-exempt: callable without org context. The admin UI's /sandboxes
12060 management page is the primary consumer — it's a user-level surface
12061 rather than org-scoped, so this RPC is user-scoped too.
12062 Excludes already-expired sandboxes (pending cleanup).
12063 Authorization: Authenticated user (no specific permission required).
12064*/
12065        pub async fn list_user_sandboxes(
12066            &mut self,
12067            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
12068        ) -> std::result::Result<
12069            tonic::Response<super::ListUserSandboxesResponse>,
12070            tonic::Status,
12071        > {
12072            self.inner
12073                .ready()
12074                .await
12075                .map_err(|e| {
12076                    tonic::Status::unknown(
12077                        format!("Service was not ready: {}", e.into()),
12078                    )
12079                })?;
12080            let codec = tonic_prost::ProstCodec::default();
12081            let path = http::uri::PathAndQuery::from_static(
12082                "/pidgr.v1.OrganizationService/ListUserSandboxes",
12083            );
12084            let mut req = request.into_request();
12085            req.extensions_mut()
12086                .insert(
12087                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
12088                );
12089            self.inner.unary(req, path, codec).await
12090        }
12091    }
12092}
12093/// Generated server implementations.
12094pub mod organization_service_server {
12095    #![allow(
12096        unused_variables,
12097        dead_code,
12098        missing_docs,
12099        clippy::wildcard_imports,
12100        clippy::let_unit_value,
12101    )]
12102    use tonic::codegen::*;
12103    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
12104    #[async_trait]
12105    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
12106        /** Create a new organization. JWT auth only — the caller becomes the initial
12107 admin. Add further admins via CreateInviteLink.
12108 Authorization: Authenticated user (no specific permission required).
12109*/
12110        async fn create_organization(
12111            &self,
12112            request: tonic::Request<super::CreateOrganizationRequest>,
12113        ) -> std::result::Result<
12114            tonic::Response<super::CreateOrganizationResponse>,
12115            tonic::Status,
12116        >;
12117        /** Retrieve the organization for the authenticated user.
12118 Authorization: Requires PERMISSION_ORG_READ.
12119*/
12120        async fn get_organization(
12121            &self,
12122            request: tonic::Request<super::GetOrganizationRequest>,
12123        ) -> std::result::Result<
12124            tonic::Response<super::GetOrganizationResponse>,
12125            tonic::Status,
12126        >;
12127        /** Update organization settings (name, default workflow, industry, company size).
12128 Authorization: Requires PERMISSION_ORG_WRITE.
12129*/
12130        async fn update_organization(
12131            &self,
12132            request: tonic::Request<super::UpdateOrganizationRequest>,
12133        ) -> std::result::Result<
12134            tonic::Response<super::UpdateOrganizationResponse>,
12135            tonic::Status,
12136        >;
12137        /** Replace all SSO attribute mappings for the organization.
12138 Authorization: Requires PERMISSION_ORG_WRITE.
12139*/
12140        async fn update_sso_attribute_mappings(
12141            &self,
12142            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
12143        ) -> std::result::Result<
12144            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12145            tonic::Status,
12146        >;
12147        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
12148 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12149*/
12150        async fn rotate_analytics_salt(
12151            &self,
12152            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12153        ) -> std::result::Result<
12154            tonic::Response<super::RotateAnalyticsSaltResponse>,
12155            tonic::Status,
12156        >;
12157        /** Update the differential privacy epsilon parameter.
12158 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12159*/
12160        async fn update_analytics_epsilon(
12161            &self,
12162            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12163        ) -> std::result::Result<
12164            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12165            tonic::Status,
12166        >;
12167        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12168 analytics, third-party channels) with last-changed-by/at metadata for
12169 the consent-trace UI.
12170 Authorization: Requires PERMISSION_PRIVACY_READ.
12171*/
12172        async fn get_org_privacy_settings(
12173            &self,
12174            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12175        ) -> std::result::Result<
12176            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12177            tonic::Status,
12178        >;
12179        /** Update org-level data-processing toggles. Only provided fields change;
12180 each change is recorded with the acting admin and timestamp.
12181 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12182*/
12183        async fn update_org_privacy_settings(
12184            &self,
12185            request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
12186        ) -> std::result::Result<
12187            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12188            tonic::Status,
12189        >;
12190        /** Create a sandbox organization for testing configurations.
12191 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12192 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12193 per user to prevent abuse.
12194*/
12195        async fn create_sandbox_organization(
12196            &self,
12197            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
12198        ) -> std::result::Result<
12199            tonic::Response<super::CreateSandboxOrganizationResponse>,
12200            tonic::Status,
12201        >;
12202        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12203 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12204 content stores.
12205 Authorization: Super admin of the target sandbox OR its creator.
12206*/
12207        async fn delete_sandbox_organization(
12208            &self,
12209            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
12210        ) -> std::result::Result<
12211            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12212            tonic::Status,
12213        >;
12214        /** List bootstrap fixtures available for seeding new organizations. The
12215 catalog is backend-owned; admin UI populates the "seed initial data"
12216 control or dropdown from this response.
12217 Authorization: Any authenticated user.
12218*/
12219        async fn list_sandbox_fixtures(
12220            &self,
12221            request: tonic::Request<super::ListSandboxFixturesRequest>,
12222        ) -> std::result::Result<
12223            tonic::Response<super::ListSandboxFixturesResponse>,
12224            tonic::Status,
12225        >;
12226        /** List all organizations the authenticated user belongs to.
12227 Org-exempt: callable without org context (only requires valid JWT).
12228 Used by the admin org switcher to discover available orgs.
12229 Excludes expired sandbox organizations.
12230 Authorization: Authenticated user (no specific permission required).
12231*/
12232        async fn list_user_organizations(
12233            &self,
12234            request: tonic::Request<super::ListUserOrganizationsRequest>,
12235        ) -> std::result::Result<
12236            tonic::Response<super::ListUserOrganizationsResponse>,
12237            tonic::Status,
12238        >;
12239        /** List only the sandbox organizations the authenticated user belongs to.
12240 Org-exempt: callable without org context. The admin UI's /sandboxes
12241 management page is the primary consumer — it's a user-level surface
12242 rather than org-scoped, so this RPC is user-scoped too.
12243 Excludes already-expired sandboxes (pending cleanup).
12244 Authorization: Authenticated user (no specific permission required).
12245*/
12246        async fn list_user_sandboxes(
12247            &self,
12248            request: tonic::Request<super::ListUserSandboxesRequest>,
12249        ) -> std::result::Result<
12250            tonic::Response<super::ListUserSandboxesResponse>,
12251            tonic::Status,
12252        >;
12253    }
12254    /** Manages organizations (tenants) in the Pidgr platform.
12255 Most RPCs operate within the caller's org (extracted from JWT).
12256 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
12257*/
12258    #[derive(Debug)]
12259    pub struct OrganizationServiceServer<T> {
12260        inner: Arc<T>,
12261        accept_compression_encodings: EnabledCompressionEncodings,
12262        send_compression_encodings: EnabledCompressionEncodings,
12263        max_decoding_message_size: Option<usize>,
12264        max_encoding_message_size: Option<usize>,
12265    }
12266    impl<T> OrganizationServiceServer<T> {
12267        pub fn new(inner: T) -> Self {
12268            Self::from_arc(Arc::new(inner))
12269        }
12270        pub fn from_arc(inner: Arc<T>) -> Self {
12271            Self {
12272                inner,
12273                accept_compression_encodings: Default::default(),
12274                send_compression_encodings: Default::default(),
12275                max_decoding_message_size: None,
12276                max_encoding_message_size: None,
12277            }
12278        }
12279        pub fn with_interceptor<F>(
12280            inner: T,
12281            interceptor: F,
12282        ) -> InterceptedService<Self, F>
12283        where
12284            F: tonic::service::Interceptor,
12285        {
12286            InterceptedService::new(Self::new(inner), interceptor)
12287        }
12288        /// Enable decompressing requests with the given encoding.
12289        #[must_use]
12290        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12291            self.accept_compression_encodings.enable(encoding);
12292            self
12293        }
12294        /// Compress responses with the given encoding, if the client supports it.
12295        #[must_use]
12296        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12297            self.send_compression_encodings.enable(encoding);
12298            self
12299        }
12300        /// Limits the maximum size of a decoded message.
12301        ///
12302        /// Default: `4MB`
12303        #[must_use]
12304        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12305            self.max_decoding_message_size = Some(limit);
12306            self
12307        }
12308        /// Limits the maximum size of an encoded message.
12309        ///
12310        /// Default: `usize::MAX`
12311        #[must_use]
12312        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12313            self.max_encoding_message_size = Some(limit);
12314            self
12315        }
12316    }
12317    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
12318    where
12319        T: OrganizationService,
12320        B: Body + std::marker::Send + 'static,
12321        B::Error: Into<StdError> + std::marker::Send + 'static,
12322    {
12323        type Response = http::Response<tonic::body::Body>;
12324        type Error = std::convert::Infallible;
12325        type Future = BoxFuture<Self::Response, Self::Error>;
12326        fn poll_ready(
12327            &mut self,
12328            _cx: &mut Context<'_>,
12329        ) -> Poll<std::result::Result<(), Self::Error>> {
12330            Poll::Ready(Ok(()))
12331        }
12332        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12333            match req.uri().path() {
12334                "/pidgr.v1.OrganizationService/CreateOrganization" => {
12335                    #[allow(non_camel_case_types)]
12336                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12337                    impl<
12338                        T: OrganizationService,
12339                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
12340                    for CreateOrganizationSvc<T> {
12341                        type Response = super::CreateOrganizationResponse;
12342                        type Future = BoxFuture<
12343                            tonic::Response<Self::Response>,
12344                            tonic::Status,
12345                        >;
12346                        fn call(
12347                            &mut self,
12348                            request: tonic::Request<super::CreateOrganizationRequest>,
12349                        ) -> Self::Future {
12350                            let inner = Arc::clone(&self.0);
12351                            let fut = async move {
12352                                <T as OrganizationService>::create_organization(
12353                                        &inner,
12354                                        request,
12355                                    )
12356                                    .await
12357                            };
12358                            Box::pin(fut)
12359                        }
12360                    }
12361                    let accept_compression_encodings = self.accept_compression_encodings;
12362                    let send_compression_encodings = self.send_compression_encodings;
12363                    let max_decoding_message_size = self.max_decoding_message_size;
12364                    let max_encoding_message_size = self.max_encoding_message_size;
12365                    let inner = self.inner.clone();
12366                    let fut = async move {
12367                        let method = CreateOrganizationSvc(inner);
12368                        let codec = tonic_prost::ProstCodec::default();
12369                        let mut grpc = tonic::server::Grpc::new(codec)
12370                            .apply_compression_config(
12371                                accept_compression_encodings,
12372                                send_compression_encodings,
12373                            )
12374                            .apply_max_message_size_config(
12375                                max_decoding_message_size,
12376                                max_encoding_message_size,
12377                            );
12378                        let res = grpc.unary(method, req).await;
12379                        Ok(res)
12380                    };
12381                    Box::pin(fut)
12382                }
12383                "/pidgr.v1.OrganizationService/GetOrganization" => {
12384                    #[allow(non_camel_case_types)]
12385                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12386                    impl<
12387                        T: OrganizationService,
12388                    > tonic::server::UnaryService<super::GetOrganizationRequest>
12389                    for GetOrganizationSvc<T> {
12390                        type Response = super::GetOrganizationResponse;
12391                        type Future = BoxFuture<
12392                            tonic::Response<Self::Response>,
12393                            tonic::Status,
12394                        >;
12395                        fn call(
12396                            &mut self,
12397                            request: tonic::Request<super::GetOrganizationRequest>,
12398                        ) -> Self::Future {
12399                            let inner = Arc::clone(&self.0);
12400                            let fut = async move {
12401                                <T as OrganizationService>::get_organization(
12402                                        &inner,
12403                                        request,
12404                                    )
12405                                    .await
12406                            };
12407                            Box::pin(fut)
12408                        }
12409                    }
12410                    let accept_compression_encodings = self.accept_compression_encodings;
12411                    let send_compression_encodings = self.send_compression_encodings;
12412                    let max_decoding_message_size = self.max_decoding_message_size;
12413                    let max_encoding_message_size = self.max_encoding_message_size;
12414                    let inner = self.inner.clone();
12415                    let fut = async move {
12416                        let method = GetOrganizationSvc(inner);
12417                        let codec = tonic_prost::ProstCodec::default();
12418                        let mut grpc = tonic::server::Grpc::new(codec)
12419                            .apply_compression_config(
12420                                accept_compression_encodings,
12421                                send_compression_encodings,
12422                            )
12423                            .apply_max_message_size_config(
12424                                max_decoding_message_size,
12425                                max_encoding_message_size,
12426                            );
12427                        let res = grpc.unary(method, req).await;
12428                        Ok(res)
12429                    };
12430                    Box::pin(fut)
12431                }
12432                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12433                    #[allow(non_camel_case_types)]
12434                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12435                    impl<
12436                        T: OrganizationService,
12437                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12438                    for UpdateOrganizationSvc<T> {
12439                        type Response = super::UpdateOrganizationResponse;
12440                        type Future = BoxFuture<
12441                            tonic::Response<Self::Response>,
12442                            tonic::Status,
12443                        >;
12444                        fn call(
12445                            &mut self,
12446                            request: tonic::Request<super::UpdateOrganizationRequest>,
12447                        ) -> Self::Future {
12448                            let inner = Arc::clone(&self.0);
12449                            let fut = async move {
12450                                <T as OrganizationService>::update_organization(
12451                                        &inner,
12452                                        request,
12453                                    )
12454                                    .await
12455                            };
12456                            Box::pin(fut)
12457                        }
12458                    }
12459                    let accept_compression_encodings = self.accept_compression_encodings;
12460                    let send_compression_encodings = self.send_compression_encodings;
12461                    let max_decoding_message_size = self.max_decoding_message_size;
12462                    let max_encoding_message_size = self.max_encoding_message_size;
12463                    let inner = self.inner.clone();
12464                    let fut = async move {
12465                        let method = UpdateOrganizationSvc(inner);
12466                        let codec = tonic_prost::ProstCodec::default();
12467                        let mut grpc = tonic::server::Grpc::new(codec)
12468                            .apply_compression_config(
12469                                accept_compression_encodings,
12470                                send_compression_encodings,
12471                            )
12472                            .apply_max_message_size_config(
12473                                max_decoding_message_size,
12474                                max_encoding_message_size,
12475                            );
12476                        let res = grpc.unary(method, req).await;
12477                        Ok(res)
12478                    };
12479                    Box::pin(fut)
12480                }
12481                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12482                    #[allow(non_camel_case_types)]
12483                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12484                        pub Arc<T>,
12485                    );
12486                    impl<
12487                        T: OrganizationService,
12488                    > tonic::server::UnaryService<
12489                        super::UpdateSsoAttributeMappingsRequest,
12490                    > for UpdateSsoAttributeMappingsSvc<T> {
12491                        type Response = super::UpdateSsoAttributeMappingsResponse;
12492                        type Future = BoxFuture<
12493                            tonic::Response<Self::Response>,
12494                            tonic::Status,
12495                        >;
12496                        fn call(
12497                            &mut self,
12498                            request: tonic::Request<
12499                                super::UpdateSsoAttributeMappingsRequest,
12500                            >,
12501                        ) -> Self::Future {
12502                            let inner = Arc::clone(&self.0);
12503                            let fut = async move {
12504                                <T as OrganizationService>::update_sso_attribute_mappings(
12505                                        &inner,
12506                                        request,
12507                                    )
12508                                    .await
12509                            };
12510                            Box::pin(fut)
12511                        }
12512                    }
12513                    let accept_compression_encodings = self.accept_compression_encodings;
12514                    let send_compression_encodings = self.send_compression_encodings;
12515                    let max_decoding_message_size = self.max_decoding_message_size;
12516                    let max_encoding_message_size = self.max_encoding_message_size;
12517                    let inner = self.inner.clone();
12518                    let fut = async move {
12519                        let method = UpdateSsoAttributeMappingsSvc(inner);
12520                        let codec = tonic_prost::ProstCodec::default();
12521                        let mut grpc = tonic::server::Grpc::new(codec)
12522                            .apply_compression_config(
12523                                accept_compression_encodings,
12524                                send_compression_encodings,
12525                            )
12526                            .apply_max_message_size_config(
12527                                max_decoding_message_size,
12528                                max_encoding_message_size,
12529                            );
12530                        let res = grpc.unary(method, req).await;
12531                        Ok(res)
12532                    };
12533                    Box::pin(fut)
12534                }
12535                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12536                    #[allow(non_camel_case_types)]
12537                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12538                    impl<
12539                        T: OrganizationService,
12540                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12541                    for RotateAnalyticsSaltSvc<T> {
12542                        type Response = super::RotateAnalyticsSaltResponse;
12543                        type Future = BoxFuture<
12544                            tonic::Response<Self::Response>,
12545                            tonic::Status,
12546                        >;
12547                        fn call(
12548                            &mut self,
12549                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12550                        ) -> Self::Future {
12551                            let inner = Arc::clone(&self.0);
12552                            let fut = async move {
12553                                <T as OrganizationService>::rotate_analytics_salt(
12554                                        &inner,
12555                                        request,
12556                                    )
12557                                    .await
12558                            };
12559                            Box::pin(fut)
12560                        }
12561                    }
12562                    let accept_compression_encodings = self.accept_compression_encodings;
12563                    let send_compression_encodings = self.send_compression_encodings;
12564                    let max_decoding_message_size = self.max_decoding_message_size;
12565                    let max_encoding_message_size = self.max_encoding_message_size;
12566                    let inner = self.inner.clone();
12567                    let fut = async move {
12568                        let method = RotateAnalyticsSaltSvc(inner);
12569                        let codec = tonic_prost::ProstCodec::default();
12570                        let mut grpc = tonic::server::Grpc::new(codec)
12571                            .apply_compression_config(
12572                                accept_compression_encodings,
12573                                send_compression_encodings,
12574                            )
12575                            .apply_max_message_size_config(
12576                                max_decoding_message_size,
12577                                max_encoding_message_size,
12578                            );
12579                        let res = grpc.unary(method, req).await;
12580                        Ok(res)
12581                    };
12582                    Box::pin(fut)
12583                }
12584                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12585                    #[allow(non_camel_case_types)]
12586                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12587                    impl<
12588                        T: OrganizationService,
12589                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12590                    for UpdateAnalyticsEpsilonSvc<T> {
12591                        type Response = super::UpdateAnalyticsEpsilonResponse;
12592                        type Future = BoxFuture<
12593                            tonic::Response<Self::Response>,
12594                            tonic::Status,
12595                        >;
12596                        fn call(
12597                            &mut self,
12598                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12599                        ) -> Self::Future {
12600                            let inner = Arc::clone(&self.0);
12601                            let fut = async move {
12602                                <T as OrganizationService>::update_analytics_epsilon(
12603                                        &inner,
12604                                        request,
12605                                    )
12606                                    .await
12607                            };
12608                            Box::pin(fut)
12609                        }
12610                    }
12611                    let accept_compression_encodings = self.accept_compression_encodings;
12612                    let send_compression_encodings = self.send_compression_encodings;
12613                    let max_decoding_message_size = self.max_decoding_message_size;
12614                    let max_encoding_message_size = self.max_encoding_message_size;
12615                    let inner = self.inner.clone();
12616                    let fut = async move {
12617                        let method = UpdateAnalyticsEpsilonSvc(inner);
12618                        let codec = tonic_prost::ProstCodec::default();
12619                        let mut grpc = tonic::server::Grpc::new(codec)
12620                            .apply_compression_config(
12621                                accept_compression_encodings,
12622                                send_compression_encodings,
12623                            )
12624                            .apply_max_message_size_config(
12625                                max_decoding_message_size,
12626                                max_encoding_message_size,
12627                            );
12628                        let res = grpc.unary(method, req).await;
12629                        Ok(res)
12630                    };
12631                    Box::pin(fut)
12632                }
12633                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
12634                    #[allow(non_camel_case_types)]
12635                    struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
12636                    impl<
12637                        T: OrganizationService,
12638                    > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
12639                    for GetOrgPrivacySettingsSvc<T> {
12640                        type Response = super::GetOrgPrivacySettingsResponse;
12641                        type Future = BoxFuture<
12642                            tonic::Response<Self::Response>,
12643                            tonic::Status,
12644                        >;
12645                        fn call(
12646                            &mut self,
12647                            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12648                        ) -> Self::Future {
12649                            let inner = Arc::clone(&self.0);
12650                            let fut = async move {
12651                                <T as OrganizationService>::get_org_privacy_settings(
12652                                        &inner,
12653                                        request,
12654                                    )
12655                                    .await
12656                            };
12657                            Box::pin(fut)
12658                        }
12659                    }
12660                    let accept_compression_encodings = self.accept_compression_encodings;
12661                    let send_compression_encodings = self.send_compression_encodings;
12662                    let max_decoding_message_size = self.max_decoding_message_size;
12663                    let max_encoding_message_size = self.max_encoding_message_size;
12664                    let inner = self.inner.clone();
12665                    let fut = async move {
12666                        let method = GetOrgPrivacySettingsSvc(inner);
12667                        let codec = tonic_prost::ProstCodec::default();
12668                        let mut grpc = tonic::server::Grpc::new(codec)
12669                            .apply_compression_config(
12670                                accept_compression_encodings,
12671                                send_compression_encodings,
12672                            )
12673                            .apply_max_message_size_config(
12674                                max_decoding_message_size,
12675                                max_encoding_message_size,
12676                            );
12677                        let res = grpc.unary(method, req).await;
12678                        Ok(res)
12679                    };
12680                    Box::pin(fut)
12681                }
12682                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
12683                    #[allow(non_camel_case_types)]
12684                    struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
12685                        pub Arc<T>,
12686                    );
12687                    impl<
12688                        T: OrganizationService,
12689                    > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
12690                    for UpdateOrgPrivacySettingsSvc<T> {
12691                        type Response = super::UpdateOrgPrivacySettingsResponse;
12692                        type Future = BoxFuture<
12693                            tonic::Response<Self::Response>,
12694                            tonic::Status,
12695                        >;
12696                        fn call(
12697                            &mut self,
12698                            request: tonic::Request<
12699                                super::UpdateOrgPrivacySettingsRequest,
12700                            >,
12701                        ) -> Self::Future {
12702                            let inner = Arc::clone(&self.0);
12703                            let fut = async move {
12704                                <T as OrganizationService>::update_org_privacy_settings(
12705                                        &inner,
12706                                        request,
12707                                    )
12708                                    .await
12709                            };
12710                            Box::pin(fut)
12711                        }
12712                    }
12713                    let accept_compression_encodings = self.accept_compression_encodings;
12714                    let send_compression_encodings = self.send_compression_encodings;
12715                    let max_decoding_message_size = self.max_decoding_message_size;
12716                    let max_encoding_message_size = self.max_encoding_message_size;
12717                    let inner = self.inner.clone();
12718                    let fut = async move {
12719                        let method = UpdateOrgPrivacySettingsSvc(inner);
12720                        let codec = tonic_prost::ProstCodec::default();
12721                        let mut grpc = tonic::server::Grpc::new(codec)
12722                            .apply_compression_config(
12723                                accept_compression_encodings,
12724                                send_compression_encodings,
12725                            )
12726                            .apply_max_message_size_config(
12727                                max_decoding_message_size,
12728                                max_encoding_message_size,
12729                            );
12730                        let res = grpc.unary(method, req).await;
12731                        Ok(res)
12732                    };
12733                    Box::pin(fut)
12734                }
12735                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
12736                    #[allow(non_camel_case_types)]
12737                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
12738                        pub Arc<T>,
12739                    );
12740                    impl<
12741                        T: OrganizationService,
12742                    > tonic::server::UnaryService<
12743                        super::CreateSandboxOrganizationRequest,
12744                    > for CreateSandboxOrganizationSvc<T> {
12745                        type Response = super::CreateSandboxOrganizationResponse;
12746                        type Future = BoxFuture<
12747                            tonic::Response<Self::Response>,
12748                            tonic::Status,
12749                        >;
12750                        fn call(
12751                            &mut self,
12752                            request: tonic::Request<
12753                                super::CreateSandboxOrganizationRequest,
12754                            >,
12755                        ) -> Self::Future {
12756                            let inner = Arc::clone(&self.0);
12757                            let fut = async move {
12758                                <T as OrganizationService>::create_sandbox_organization(
12759                                        &inner,
12760                                        request,
12761                                    )
12762                                    .await
12763                            };
12764                            Box::pin(fut)
12765                        }
12766                    }
12767                    let accept_compression_encodings = self.accept_compression_encodings;
12768                    let send_compression_encodings = self.send_compression_encodings;
12769                    let max_decoding_message_size = self.max_decoding_message_size;
12770                    let max_encoding_message_size = self.max_encoding_message_size;
12771                    let inner = self.inner.clone();
12772                    let fut = async move {
12773                        let method = CreateSandboxOrganizationSvc(inner);
12774                        let codec = tonic_prost::ProstCodec::default();
12775                        let mut grpc = tonic::server::Grpc::new(codec)
12776                            .apply_compression_config(
12777                                accept_compression_encodings,
12778                                send_compression_encodings,
12779                            )
12780                            .apply_max_message_size_config(
12781                                max_decoding_message_size,
12782                                max_encoding_message_size,
12783                            );
12784                        let res = grpc.unary(method, req).await;
12785                        Ok(res)
12786                    };
12787                    Box::pin(fut)
12788                }
12789                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
12790                    #[allow(non_camel_case_types)]
12791                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
12792                        pub Arc<T>,
12793                    );
12794                    impl<
12795                        T: OrganizationService,
12796                    > tonic::server::UnaryService<
12797                        super::DeleteSandboxOrganizationRequest,
12798                    > for DeleteSandboxOrganizationSvc<T> {
12799                        type Response = super::DeleteSandboxOrganizationResponse;
12800                        type Future = BoxFuture<
12801                            tonic::Response<Self::Response>,
12802                            tonic::Status,
12803                        >;
12804                        fn call(
12805                            &mut self,
12806                            request: tonic::Request<
12807                                super::DeleteSandboxOrganizationRequest,
12808                            >,
12809                        ) -> Self::Future {
12810                            let inner = Arc::clone(&self.0);
12811                            let fut = async move {
12812                                <T as OrganizationService>::delete_sandbox_organization(
12813                                        &inner,
12814                                        request,
12815                                    )
12816                                    .await
12817                            };
12818                            Box::pin(fut)
12819                        }
12820                    }
12821                    let accept_compression_encodings = self.accept_compression_encodings;
12822                    let send_compression_encodings = self.send_compression_encodings;
12823                    let max_decoding_message_size = self.max_decoding_message_size;
12824                    let max_encoding_message_size = self.max_encoding_message_size;
12825                    let inner = self.inner.clone();
12826                    let fut = async move {
12827                        let method = DeleteSandboxOrganizationSvc(inner);
12828                        let codec = tonic_prost::ProstCodec::default();
12829                        let mut grpc = tonic::server::Grpc::new(codec)
12830                            .apply_compression_config(
12831                                accept_compression_encodings,
12832                                send_compression_encodings,
12833                            )
12834                            .apply_max_message_size_config(
12835                                max_decoding_message_size,
12836                                max_encoding_message_size,
12837                            );
12838                        let res = grpc.unary(method, req).await;
12839                        Ok(res)
12840                    };
12841                    Box::pin(fut)
12842                }
12843                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
12844                    #[allow(non_camel_case_types)]
12845                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
12846                    impl<
12847                        T: OrganizationService,
12848                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
12849                    for ListSandboxFixturesSvc<T> {
12850                        type Response = super::ListSandboxFixturesResponse;
12851                        type Future = BoxFuture<
12852                            tonic::Response<Self::Response>,
12853                            tonic::Status,
12854                        >;
12855                        fn call(
12856                            &mut self,
12857                            request: tonic::Request<super::ListSandboxFixturesRequest>,
12858                        ) -> Self::Future {
12859                            let inner = Arc::clone(&self.0);
12860                            let fut = async move {
12861                                <T as OrganizationService>::list_sandbox_fixtures(
12862                                        &inner,
12863                                        request,
12864                                    )
12865                                    .await
12866                            };
12867                            Box::pin(fut)
12868                        }
12869                    }
12870                    let accept_compression_encodings = self.accept_compression_encodings;
12871                    let send_compression_encodings = self.send_compression_encodings;
12872                    let max_decoding_message_size = self.max_decoding_message_size;
12873                    let max_encoding_message_size = self.max_encoding_message_size;
12874                    let inner = self.inner.clone();
12875                    let fut = async move {
12876                        let method = ListSandboxFixturesSvc(inner);
12877                        let codec = tonic_prost::ProstCodec::default();
12878                        let mut grpc = tonic::server::Grpc::new(codec)
12879                            .apply_compression_config(
12880                                accept_compression_encodings,
12881                                send_compression_encodings,
12882                            )
12883                            .apply_max_message_size_config(
12884                                max_decoding_message_size,
12885                                max_encoding_message_size,
12886                            );
12887                        let res = grpc.unary(method, req).await;
12888                        Ok(res)
12889                    };
12890                    Box::pin(fut)
12891                }
12892                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
12893                    #[allow(non_camel_case_types)]
12894                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
12895                    impl<
12896                        T: OrganizationService,
12897                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
12898                    for ListUserOrganizationsSvc<T> {
12899                        type Response = super::ListUserOrganizationsResponse;
12900                        type Future = BoxFuture<
12901                            tonic::Response<Self::Response>,
12902                            tonic::Status,
12903                        >;
12904                        fn call(
12905                            &mut self,
12906                            request: tonic::Request<super::ListUserOrganizationsRequest>,
12907                        ) -> Self::Future {
12908                            let inner = Arc::clone(&self.0);
12909                            let fut = async move {
12910                                <T as OrganizationService>::list_user_organizations(
12911                                        &inner,
12912                                        request,
12913                                    )
12914                                    .await
12915                            };
12916                            Box::pin(fut)
12917                        }
12918                    }
12919                    let accept_compression_encodings = self.accept_compression_encodings;
12920                    let send_compression_encodings = self.send_compression_encodings;
12921                    let max_decoding_message_size = self.max_decoding_message_size;
12922                    let max_encoding_message_size = self.max_encoding_message_size;
12923                    let inner = self.inner.clone();
12924                    let fut = async move {
12925                        let method = ListUserOrganizationsSvc(inner);
12926                        let codec = tonic_prost::ProstCodec::default();
12927                        let mut grpc = tonic::server::Grpc::new(codec)
12928                            .apply_compression_config(
12929                                accept_compression_encodings,
12930                                send_compression_encodings,
12931                            )
12932                            .apply_max_message_size_config(
12933                                max_decoding_message_size,
12934                                max_encoding_message_size,
12935                            );
12936                        let res = grpc.unary(method, req).await;
12937                        Ok(res)
12938                    };
12939                    Box::pin(fut)
12940                }
12941                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
12942                    #[allow(non_camel_case_types)]
12943                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
12944                    impl<
12945                        T: OrganizationService,
12946                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
12947                    for ListUserSandboxesSvc<T> {
12948                        type Response = super::ListUserSandboxesResponse;
12949                        type Future = BoxFuture<
12950                            tonic::Response<Self::Response>,
12951                            tonic::Status,
12952                        >;
12953                        fn call(
12954                            &mut self,
12955                            request: tonic::Request<super::ListUserSandboxesRequest>,
12956                        ) -> Self::Future {
12957                            let inner = Arc::clone(&self.0);
12958                            let fut = async move {
12959                                <T as OrganizationService>::list_user_sandboxes(
12960                                        &inner,
12961                                        request,
12962                                    )
12963                                    .await
12964                            };
12965                            Box::pin(fut)
12966                        }
12967                    }
12968                    let accept_compression_encodings = self.accept_compression_encodings;
12969                    let send_compression_encodings = self.send_compression_encodings;
12970                    let max_decoding_message_size = self.max_decoding_message_size;
12971                    let max_encoding_message_size = self.max_encoding_message_size;
12972                    let inner = self.inner.clone();
12973                    let fut = async move {
12974                        let method = ListUserSandboxesSvc(inner);
12975                        let codec = tonic_prost::ProstCodec::default();
12976                        let mut grpc = tonic::server::Grpc::new(codec)
12977                            .apply_compression_config(
12978                                accept_compression_encodings,
12979                                send_compression_encodings,
12980                            )
12981                            .apply_max_message_size_config(
12982                                max_decoding_message_size,
12983                                max_encoding_message_size,
12984                            );
12985                        let res = grpc.unary(method, req).await;
12986                        Ok(res)
12987                    };
12988                    Box::pin(fut)
12989                }
12990                _ => {
12991                    Box::pin(async move {
12992                        let mut response = http::Response::new(
12993                            tonic::body::Body::default(),
12994                        );
12995                        let headers = response.headers_mut();
12996                        headers
12997                            .insert(
12998                                tonic::Status::GRPC_STATUS,
12999                                (tonic::Code::Unimplemented as i32).into(),
13000                            );
13001                        headers
13002                            .insert(
13003                                http::header::CONTENT_TYPE,
13004                                tonic::metadata::GRPC_CONTENT_TYPE,
13005                            );
13006                        Ok(response)
13007                    })
13008                }
13009            }
13010        }
13011    }
13012    impl<T> Clone for OrganizationServiceServer<T> {
13013        fn clone(&self) -> Self {
13014            let inner = self.inner.clone();
13015            Self {
13016                inner,
13017                accept_compression_encodings: self.accept_compression_encodings,
13018                send_compression_encodings: self.send_compression_encodings,
13019                max_decoding_message_size: self.max_decoding_message_size,
13020                max_encoding_message_size: self.max_encoding_message_size,
13021            }
13022        }
13023    }
13024    /// Generated gRPC service name
13025    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
13026    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
13027        const NAME: &'static str = SERVICE_NAME;
13028    }
13029}
13030/// Generated client implementations.
13031pub mod render_service_client {
13032    #![allow(
13033        unused_variables,
13034        dead_code,
13035        missing_docs,
13036        clippy::wildcard_imports,
13037        clippy::let_unit_value,
13038    )]
13039    use tonic::codegen::*;
13040    use tonic::codegen::http::Uri;
13041    /** Internal service for batch template rendering.
13042*/
13043    #[derive(Debug, Clone)]
13044    pub struct RenderServiceClient<T> {
13045        inner: tonic::client::Grpc<T>,
13046    }
13047    impl RenderServiceClient<tonic::transport::Channel> {
13048        /// Attempt to create a new client by connecting to a given endpoint.
13049        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13050        where
13051            D: TryInto<tonic::transport::Endpoint>,
13052            D::Error: Into<StdError>,
13053        {
13054            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13055            Ok(Self::new(conn))
13056        }
13057    }
13058    impl<T> RenderServiceClient<T>
13059    where
13060        T: tonic::client::GrpcService<tonic::body::Body>,
13061        T::Error: Into<StdError>,
13062        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13063        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13064    {
13065        pub fn new(inner: T) -> Self {
13066            let inner = tonic::client::Grpc::new(inner);
13067            Self { inner }
13068        }
13069        pub fn with_origin(inner: T, origin: Uri) -> Self {
13070            let inner = tonic::client::Grpc::with_origin(inner, origin);
13071            Self { inner }
13072        }
13073        pub fn with_interceptor<F>(
13074            inner: T,
13075            interceptor: F,
13076        ) -> RenderServiceClient<InterceptedService<T, F>>
13077        where
13078            F: tonic::service::Interceptor,
13079            T::ResponseBody: Default,
13080            T: tonic::codegen::Service<
13081                http::Request<tonic::body::Body>,
13082                Response = http::Response<
13083                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13084                >,
13085            >,
13086            <T as tonic::codegen::Service<
13087                http::Request<tonic::body::Body>,
13088            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13089        {
13090            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
13091        }
13092        /// Compress requests with the given encoding.
13093        ///
13094        /// This requires the server to support it otherwise it might respond with an
13095        /// error.
13096        #[must_use]
13097        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13098            self.inner = self.inner.send_compressed(encoding);
13099            self
13100        }
13101        /// Enable decompressing responses.
13102        #[must_use]
13103        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13104            self.inner = self.inner.accept_compressed(encoding);
13105            self
13106        }
13107        /// Limits the maximum size of a decoded message.
13108        ///
13109        /// Default: `4MB`
13110        #[must_use]
13111        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13112            self.inner = self.inner.max_decoding_message_size(limit);
13113            self
13114        }
13115        /// Limits the maximum size of an encoded message.
13116        ///
13117        /// Default: `usize::MAX`
13118        #[must_use]
13119        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13120            self.inner = self.inner.max_encoding_message_size(limit);
13121            self
13122        }
13123        /** Render a template for multiple users, streaming results as each completes.
13124 Authorization: Internal server-to-server only. Not exposed to external clients.
13125*/
13126        pub async fn render_batch(
13127            &mut self,
13128            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
13129        ) -> std::result::Result<
13130            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
13131            tonic::Status,
13132        > {
13133            self.inner
13134                .ready()
13135                .await
13136                .map_err(|e| {
13137                    tonic::Status::unknown(
13138                        format!("Service was not ready: {}", e.into()),
13139                    )
13140                })?;
13141            let codec = tonic_prost::ProstCodec::default();
13142            let path = http::uri::PathAndQuery::from_static(
13143                "/pidgr.v1.RenderService/RenderBatch",
13144            );
13145            let mut req = request.into_request();
13146            req.extensions_mut()
13147                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
13148            self.inner.server_streaming(req, path, codec).await
13149        }
13150    }
13151}
13152/// Generated server implementations.
13153pub mod render_service_server {
13154    #![allow(
13155        unused_variables,
13156        dead_code,
13157        missing_docs,
13158        clippy::wildcard_imports,
13159        clippy::let_unit_value,
13160    )]
13161    use tonic::codegen::*;
13162    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
13163    #[async_trait]
13164    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
13165        /// Server streaming response type for the RenderBatch method.
13166        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
13167                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
13168            >
13169            + std::marker::Send
13170            + 'static;
13171        /** Render a template for multiple users, streaming results as each completes.
13172 Authorization: Internal server-to-server only. Not exposed to external clients.
13173*/
13174        async fn render_batch(
13175            &self,
13176            request: tonic::Request<super::RenderBatchRequest>,
13177        ) -> std::result::Result<
13178            tonic::Response<Self::RenderBatchStream>,
13179            tonic::Status,
13180        >;
13181    }
13182    /** Internal service for batch template rendering.
13183*/
13184    #[derive(Debug)]
13185    pub struct RenderServiceServer<T> {
13186        inner: Arc<T>,
13187        accept_compression_encodings: EnabledCompressionEncodings,
13188        send_compression_encodings: EnabledCompressionEncodings,
13189        max_decoding_message_size: Option<usize>,
13190        max_encoding_message_size: Option<usize>,
13191    }
13192    impl<T> RenderServiceServer<T> {
13193        pub fn new(inner: T) -> Self {
13194            Self::from_arc(Arc::new(inner))
13195        }
13196        pub fn from_arc(inner: Arc<T>) -> Self {
13197            Self {
13198                inner,
13199                accept_compression_encodings: Default::default(),
13200                send_compression_encodings: Default::default(),
13201                max_decoding_message_size: None,
13202                max_encoding_message_size: None,
13203            }
13204        }
13205        pub fn with_interceptor<F>(
13206            inner: T,
13207            interceptor: F,
13208        ) -> InterceptedService<Self, F>
13209        where
13210            F: tonic::service::Interceptor,
13211        {
13212            InterceptedService::new(Self::new(inner), interceptor)
13213        }
13214        /// Enable decompressing requests with the given encoding.
13215        #[must_use]
13216        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13217            self.accept_compression_encodings.enable(encoding);
13218            self
13219        }
13220        /// Compress responses with the given encoding, if the client supports it.
13221        #[must_use]
13222        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13223            self.send_compression_encodings.enable(encoding);
13224            self
13225        }
13226        /// Limits the maximum size of a decoded message.
13227        ///
13228        /// Default: `4MB`
13229        #[must_use]
13230        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13231            self.max_decoding_message_size = Some(limit);
13232            self
13233        }
13234        /// Limits the maximum size of an encoded message.
13235        ///
13236        /// Default: `usize::MAX`
13237        #[must_use]
13238        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13239            self.max_encoding_message_size = Some(limit);
13240            self
13241        }
13242    }
13243    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
13244    where
13245        T: RenderService,
13246        B: Body + std::marker::Send + 'static,
13247        B::Error: Into<StdError> + std::marker::Send + 'static,
13248    {
13249        type Response = http::Response<tonic::body::Body>;
13250        type Error = std::convert::Infallible;
13251        type Future = BoxFuture<Self::Response, Self::Error>;
13252        fn poll_ready(
13253            &mut self,
13254            _cx: &mut Context<'_>,
13255        ) -> Poll<std::result::Result<(), Self::Error>> {
13256            Poll::Ready(Ok(()))
13257        }
13258        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13259            match req.uri().path() {
13260                "/pidgr.v1.RenderService/RenderBatch" => {
13261                    #[allow(non_camel_case_types)]
13262                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
13263                    impl<
13264                        T: RenderService,
13265                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
13266                    for RenderBatchSvc<T> {
13267                        type Response = super::RenderBatchResponse;
13268                        type ResponseStream = T::RenderBatchStream;
13269                        type Future = BoxFuture<
13270                            tonic::Response<Self::ResponseStream>,
13271                            tonic::Status,
13272                        >;
13273                        fn call(
13274                            &mut self,
13275                            request: tonic::Request<super::RenderBatchRequest>,
13276                        ) -> Self::Future {
13277                            let inner = Arc::clone(&self.0);
13278                            let fut = async move {
13279                                <T as RenderService>::render_batch(&inner, request).await
13280                            };
13281                            Box::pin(fut)
13282                        }
13283                    }
13284                    let accept_compression_encodings = self.accept_compression_encodings;
13285                    let send_compression_encodings = self.send_compression_encodings;
13286                    let max_decoding_message_size = self.max_decoding_message_size;
13287                    let max_encoding_message_size = self.max_encoding_message_size;
13288                    let inner = self.inner.clone();
13289                    let fut = async move {
13290                        let method = RenderBatchSvc(inner);
13291                        let codec = tonic_prost::ProstCodec::default();
13292                        let mut grpc = tonic::server::Grpc::new(codec)
13293                            .apply_compression_config(
13294                                accept_compression_encodings,
13295                                send_compression_encodings,
13296                            )
13297                            .apply_max_message_size_config(
13298                                max_decoding_message_size,
13299                                max_encoding_message_size,
13300                            );
13301                        let res = grpc.server_streaming(method, req).await;
13302                        Ok(res)
13303                    };
13304                    Box::pin(fut)
13305                }
13306                _ => {
13307                    Box::pin(async move {
13308                        let mut response = http::Response::new(
13309                            tonic::body::Body::default(),
13310                        );
13311                        let headers = response.headers_mut();
13312                        headers
13313                            .insert(
13314                                tonic::Status::GRPC_STATUS,
13315                                (tonic::Code::Unimplemented as i32).into(),
13316                            );
13317                        headers
13318                            .insert(
13319                                http::header::CONTENT_TYPE,
13320                                tonic::metadata::GRPC_CONTENT_TYPE,
13321                            );
13322                        Ok(response)
13323                    })
13324                }
13325            }
13326        }
13327    }
13328    impl<T> Clone for RenderServiceServer<T> {
13329        fn clone(&self) -> Self {
13330            let inner = self.inner.clone();
13331            Self {
13332                inner,
13333                accept_compression_encodings: self.accept_compression_encodings,
13334                send_compression_encodings: self.send_compression_encodings,
13335                max_decoding_message_size: self.max_decoding_message_size,
13336                max_encoding_message_size: self.max_encoding_message_size,
13337            }
13338        }
13339    }
13340    /// Generated gRPC service name
13341    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13342    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13343        const NAME: &'static str = SERVICE_NAME;
13344    }
13345}
13346/// Generated client implementations.
13347pub mod replay_service_client {
13348    #![allow(
13349        unused_variables,
13350        dead_code,
13351        missing_docs,
13352        clippy::wildcard_imports,
13353        clippy::let_unit_value,
13354    )]
13355    use tonic::codegen::*;
13356    use tonic::codegen::http::Uri;
13357    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13358 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13359*/
13360    #[derive(Debug, Clone)]
13361    pub struct ReplayServiceClient<T> {
13362        inner: tonic::client::Grpc<T>,
13363    }
13364    impl ReplayServiceClient<tonic::transport::Channel> {
13365        /// Attempt to create a new client by connecting to a given endpoint.
13366        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13367        where
13368            D: TryInto<tonic::transport::Endpoint>,
13369            D::Error: Into<StdError>,
13370        {
13371            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13372            Ok(Self::new(conn))
13373        }
13374    }
13375    impl<T> ReplayServiceClient<T>
13376    where
13377        T: tonic::client::GrpcService<tonic::body::Body>,
13378        T::Error: Into<StdError>,
13379        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13380        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13381    {
13382        pub fn new(inner: T) -> Self {
13383            let inner = tonic::client::Grpc::new(inner);
13384            Self { inner }
13385        }
13386        pub fn with_origin(inner: T, origin: Uri) -> Self {
13387            let inner = tonic::client::Grpc::with_origin(inner, origin);
13388            Self { inner }
13389        }
13390        pub fn with_interceptor<F>(
13391            inner: T,
13392            interceptor: F,
13393        ) -> ReplayServiceClient<InterceptedService<T, F>>
13394        where
13395            F: tonic::service::Interceptor,
13396            T::ResponseBody: Default,
13397            T: tonic::codegen::Service<
13398                http::Request<tonic::body::Body>,
13399                Response = http::Response<
13400                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13401                >,
13402            >,
13403            <T as tonic::codegen::Service<
13404                http::Request<tonic::body::Body>,
13405            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13406        {
13407            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13408        }
13409        /// Compress requests with the given encoding.
13410        ///
13411        /// This requires the server to support it otherwise it might respond with an
13412        /// error.
13413        #[must_use]
13414        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13415            self.inner = self.inner.send_compressed(encoding);
13416            self
13417        }
13418        /// Enable decompressing responses.
13419        #[must_use]
13420        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13421            self.inner = self.inner.accept_compressed(encoding);
13422            self
13423        }
13424        /// Limits the maximum size of a decoded message.
13425        ///
13426        /// Default: `4MB`
13427        #[must_use]
13428        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13429            self.inner = self.inner.max_decoding_message_size(limit);
13430            self
13431        }
13432        /// Limits the maximum size of an encoded message.
13433        ///
13434        /// Default: `usize::MAX`
13435        #[must_use]
13436        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13437            self.inner = self.inner.max_encoding_message_size(limit);
13438            self
13439        }
13440        /** List recent session recordings with optional campaign and time range filters.
13441 Authorization: Requires CAMPAIGNS_READ permission.
13442*/
13443        pub async fn list_session_recordings(
13444            &mut self,
13445            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13446        ) -> std::result::Result<
13447            tonic::Response<super::ListSessionRecordingsResponse>,
13448            tonic::Status,
13449        > {
13450            self.inner
13451                .ready()
13452                .await
13453                .map_err(|e| {
13454                    tonic::Status::unknown(
13455                        format!("Service was not ready: {}", e.into()),
13456                    )
13457                })?;
13458            let codec = tonic_prost::ProstCodec::default();
13459            let path = http::uri::PathAndQuery::from_static(
13460                "/pidgr.v1.ReplayService/ListSessionRecordings",
13461            );
13462            let mut req = request.into_request();
13463            req.extensions_mut()
13464                .insert(
13465                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13466                );
13467            self.inner.unary(req, path, codec).await
13468        }
13469        /** Fetch the full rrweb snapshot data for a single recording.
13470 Authorization: Requires CAMPAIGNS_READ permission.
13471*/
13472        pub async fn get_session_snapshots(
13473            &mut self,
13474            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13475        ) -> std::result::Result<
13476            tonic::Response<super::GetSessionSnapshotsResponse>,
13477            tonic::Status,
13478        > {
13479            self.inner
13480                .ready()
13481                .await
13482                .map_err(|e| {
13483                    tonic::Status::unknown(
13484                        format!("Service was not ready: {}", e.into()),
13485                    )
13486                })?;
13487            let codec = tonic_prost::ProstCodec::default();
13488            let path = http::uri::PathAndQuery::from_static(
13489                "/pidgr.v1.ReplayService/GetSessionSnapshots",
13490            );
13491            let mut req = request.into_request();
13492            req.extensions_mut()
13493                .insert(
13494                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13495                );
13496            self.inner.unary(req, path, codec).await
13497        }
13498    }
13499}
13500/// Generated server implementations.
13501pub mod replay_service_server {
13502    #![allow(
13503        unused_variables,
13504        dead_code,
13505        missing_docs,
13506        clippy::wildcard_imports,
13507        clippy::let_unit_value,
13508    )]
13509    use tonic::codegen::*;
13510    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
13511    #[async_trait]
13512    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13513        /** List recent session recordings with optional campaign and time range filters.
13514 Authorization: Requires CAMPAIGNS_READ permission.
13515*/
13516        async fn list_session_recordings(
13517            &self,
13518            request: tonic::Request<super::ListSessionRecordingsRequest>,
13519        ) -> std::result::Result<
13520            tonic::Response<super::ListSessionRecordingsResponse>,
13521            tonic::Status,
13522        >;
13523        /** Fetch the full rrweb snapshot data for a single recording.
13524 Authorization: Requires CAMPAIGNS_READ permission.
13525*/
13526        async fn get_session_snapshots(
13527            &self,
13528            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13529        ) -> std::result::Result<
13530            tonic::Response<super::GetSessionSnapshotsResponse>,
13531            tonic::Status,
13532        >;
13533    }
13534    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13535 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13536*/
13537    #[derive(Debug)]
13538    pub struct ReplayServiceServer<T> {
13539        inner: Arc<T>,
13540        accept_compression_encodings: EnabledCompressionEncodings,
13541        send_compression_encodings: EnabledCompressionEncodings,
13542        max_decoding_message_size: Option<usize>,
13543        max_encoding_message_size: Option<usize>,
13544    }
13545    impl<T> ReplayServiceServer<T> {
13546        pub fn new(inner: T) -> Self {
13547            Self::from_arc(Arc::new(inner))
13548        }
13549        pub fn from_arc(inner: Arc<T>) -> Self {
13550            Self {
13551                inner,
13552                accept_compression_encodings: Default::default(),
13553                send_compression_encodings: Default::default(),
13554                max_decoding_message_size: None,
13555                max_encoding_message_size: None,
13556            }
13557        }
13558        pub fn with_interceptor<F>(
13559            inner: T,
13560            interceptor: F,
13561        ) -> InterceptedService<Self, F>
13562        where
13563            F: tonic::service::Interceptor,
13564        {
13565            InterceptedService::new(Self::new(inner), interceptor)
13566        }
13567        /// Enable decompressing requests with the given encoding.
13568        #[must_use]
13569        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13570            self.accept_compression_encodings.enable(encoding);
13571            self
13572        }
13573        /// Compress responses with the given encoding, if the client supports it.
13574        #[must_use]
13575        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13576            self.send_compression_encodings.enable(encoding);
13577            self
13578        }
13579        /// Limits the maximum size of a decoded message.
13580        ///
13581        /// Default: `4MB`
13582        #[must_use]
13583        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13584            self.max_decoding_message_size = Some(limit);
13585            self
13586        }
13587        /// Limits the maximum size of an encoded message.
13588        ///
13589        /// Default: `usize::MAX`
13590        #[must_use]
13591        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13592            self.max_encoding_message_size = Some(limit);
13593            self
13594        }
13595    }
13596    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13597    where
13598        T: ReplayService,
13599        B: Body + std::marker::Send + 'static,
13600        B::Error: Into<StdError> + std::marker::Send + 'static,
13601    {
13602        type Response = http::Response<tonic::body::Body>;
13603        type Error = std::convert::Infallible;
13604        type Future = BoxFuture<Self::Response, Self::Error>;
13605        fn poll_ready(
13606            &mut self,
13607            _cx: &mut Context<'_>,
13608        ) -> Poll<std::result::Result<(), Self::Error>> {
13609            Poll::Ready(Ok(()))
13610        }
13611        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13612            match req.uri().path() {
13613                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13614                    #[allow(non_camel_case_types)]
13615                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13616                    impl<
13617                        T: ReplayService,
13618                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13619                    for ListSessionRecordingsSvc<T> {
13620                        type Response = super::ListSessionRecordingsResponse;
13621                        type Future = BoxFuture<
13622                            tonic::Response<Self::Response>,
13623                            tonic::Status,
13624                        >;
13625                        fn call(
13626                            &mut self,
13627                            request: tonic::Request<super::ListSessionRecordingsRequest>,
13628                        ) -> Self::Future {
13629                            let inner = Arc::clone(&self.0);
13630                            let fut = async move {
13631                                <T as ReplayService>::list_session_recordings(
13632                                        &inner,
13633                                        request,
13634                                    )
13635                                    .await
13636                            };
13637                            Box::pin(fut)
13638                        }
13639                    }
13640                    let accept_compression_encodings = self.accept_compression_encodings;
13641                    let send_compression_encodings = self.send_compression_encodings;
13642                    let max_decoding_message_size = self.max_decoding_message_size;
13643                    let max_encoding_message_size = self.max_encoding_message_size;
13644                    let inner = self.inner.clone();
13645                    let fut = async move {
13646                        let method = ListSessionRecordingsSvc(inner);
13647                        let codec = tonic_prost::ProstCodec::default();
13648                        let mut grpc = tonic::server::Grpc::new(codec)
13649                            .apply_compression_config(
13650                                accept_compression_encodings,
13651                                send_compression_encodings,
13652                            )
13653                            .apply_max_message_size_config(
13654                                max_decoding_message_size,
13655                                max_encoding_message_size,
13656                            );
13657                        let res = grpc.unary(method, req).await;
13658                        Ok(res)
13659                    };
13660                    Box::pin(fut)
13661                }
13662                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13663                    #[allow(non_camel_case_types)]
13664                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13665                    impl<
13666                        T: ReplayService,
13667                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13668                    for GetSessionSnapshotsSvc<T> {
13669                        type Response = super::GetSessionSnapshotsResponse;
13670                        type Future = BoxFuture<
13671                            tonic::Response<Self::Response>,
13672                            tonic::Status,
13673                        >;
13674                        fn call(
13675                            &mut self,
13676                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13677                        ) -> Self::Future {
13678                            let inner = Arc::clone(&self.0);
13679                            let fut = async move {
13680                                <T as ReplayService>::get_session_snapshots(&inner, request)
13681                                    .await
13682                            };
13683                            Box::pin(fut)
13684                        }
13685                    }
13686                    let accept_compression_encodings = self.accept_compression_encodings;
13687                    let send_compression_encodings = self.send_compression_encodings;
13688                    let max_decoding_message_size = self.max_decoding_message_size;
13689                    let max_encoding_message_size = self.max_encoding_message_size;
13690                    let inner = self.inner.clone();
13691                    let fut = async move {
13692                        let method = GetSessionSnapshotsSvc(inner);
13693                        let codec = tonic_prost::ProstCodec::default();
13694                        let mut grpc = tonic::server::Grpc::new(codec)
13695                            .apply_compression_config(
13696                                accept_compression_encodings,
13697                                send_compression_encodings,
13698                            )
13699                            .apply_max_message_size_config(
13700                                max_decoding_message_size,
13701                                max_encoding_message_size,
13702                            );
13703                        let res = grpc.unary(method, req).await;
13704                        Ok(res)
13705                    };
13706                    Box::pin(fut)
13707                }
13708                _ => {
13709                    Box::pin(async move {
13710                        let mut response = http::Response::new(
13711                            tonic::body::Body::default(),
13712                        );
13713                        let headers = response.headers_mut();
13714                        headers
13715                            .insert(
13716                                tonic::Status::GRPC_STATUS,
13717                                (tonic::Code::Unimplemented as i32).into(),
13718                            );
13719                        headers
13720                            .insert(
13721                                http::header::CONTENT_TYPE,
13722                                tonic::metadata::GRPC_CONTENT_TYPE,
13723                            );
13724                        Ok(response)
13725                    })
13726                }
13727            }
13728        }
13729    }
13730    impl<T> Clone for ReplayServiceServer<T> {
13731        fn clone(&self) -> Self {
13732            let inner = self.inner.clone();
13733            Self {
13734                inner,
13735                accept_compression_encodings: self.accept_compression_encodings,
13736                send_compression_encodings: self.send_compression_encodings,
13737                max_decoding_message_size: self.max_decoding_message_size,
13738                max_encoding_message_size: self.max_encoding_message_size,
13739            }
13740        }
13741    }
13742    /// Generated gRPC service name
13743    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
13744    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
13745        const NAME: &'static str = SERVICE_NAME;
13746    }
13747}
13748/// Generated client implementations.
13749pub mod role_service_client {
13750    #![allow(
13751        unused_variables,
13752        dead_code,
13753        missing_docs,
13754        clippy::wildcard_imports,
13755        clippy::let_unit_value,
13756    )]
13757    use tonic::codegen::*;
13758    use tonic::codegen::http::Uri;
13759    /** Manages roles and their permissions within an organization.
13760 All RPCs operate within the caller's org (extracted from JWT).
13761*/
13762    #[derive(Debug, Clone)]
13763    pub struct RoleServiceClient<T> {
13764        inner: tonic::client::Grpc<T>,
13765    }
13766    impl RoleServiceClient<tonic::transport::Channel> {
13767        /// Attempt to create a new client by connecting to a given endpoint.
13768        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13769        where
13770            D: TryInto<tonic::transport::Endpoint>,
13771            D::Error: Into<StdError>,
13772        {
13773            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13774            Ok(Self::new(conn))
13775        }
13776    }
13777    impl<T> RoleServiceClient<T>
13778    where
13779        T: tonic::client::GrpcService<tonic::body::Body>,
13780        T::Error: Into<StdError>,
13781        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13782        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13783    {
13784        pub fn new(inner: T) -> Self {
13785            let inner = tonic::client::Grpc::new(inner);
13786            Self { inner }
13787        }
13788        pub fn with_origin(inner: T, origin: Uri) -> Self {
13789            let inner = tonic::client::Grpc::with_origin(inner, origin);
13790            Self { inner }
13791        }
13792        pub fn with_interceptor<F>(
13793            inner: T,
13794            interceptor: F,
13795        ) -> RoleServiceClient<InterceptedService<T, F>>
13796        where
13797            F: tonic::service::Interceptor,
13798            T::ResponseBody: Default,
13799            T: tonic::codegen::Service<
13800                http::Request<tonic::body::Body>,
13801                Response = http::Response<
13802                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13803                >,
13804            >,
13805            <T as tonic::codegen::Service<
13806                http::Request<tonic::body::Body>,
13807            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13808        {
13809            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
13810        }
13811        /// Compress requests with the given encoding.
13812        ///
13813        /// This requires the server to support it otherwise it might respond with an
13814        /// error.
13815        #[must_use]
13816        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13817            self.inner = self.inner.send_compressed(encoding);
13818            self
13819        }
13820        /// Enable decompressing responses.
13821        #[must_use]
13822        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13823            self.inner = self.inner.accept_compressed(encoding);
13824            self
13825        }
13826        /// Limits the maximum size of a decoded message.
13827        ///
13828        /// Default: `4MB`
13829        #[must_use]
13830        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13831            self.inner = self.inner.max_decoding_message_size(limit);
13832            self
13833        }
13834        /// Limits the maximum size of an encoded message.
13835        ///
13836        /// Default: `usize::MAX`
13837        #[must_use]
13838        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13839            self.inner = self.inner.max_encoding_message_size(limit);
13840            self
13841        }
13842        /** List all roles in the organization with their permission sets.
13843 Authorization: Requires PERMISSION_ORG_READ.
13844*/
13845        pub async fn list_roles(
13846            &mut self,
13847            request: impl tonic::IntoRequest<super::ListRolesRequest>,
13848        ) -> std::result::Result<
13849            tonic::Response<super::ListRolesResponse>,
13850            tonic::Status,
13851        > {
13852            self.inner
13853                .ready()
13854                .await
13855                .map_err(|e| {
13856                    tonic::Status::unknown(
13857                        format!("Service was not ready: {}", e.into()),
13858                    )
13859                })?;
13860            let codec = tonic_prost::ProstCodec::default();
13861            let path = http::uri::PathAndQuery::from_static(
13862                "/pidgr.v1.RoleService/ListRoles",
13863            );
13864            let mut req = request.into_request();
13865            req.extensions_mut()
13866                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
13867            self.inner.unary(req, path, codec).await
13868        }
13869        /** Create a new custom role with a name and initial permissions.
13870 Slug is auto-generated from the name and immutable after creation.
13871 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13872*/
13873        pub async fn create_role(
13874            &mut self,
13875            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
13876        ) -> std::result::Result<
13877            tonic::Response<super::CreateRoleResponse>,
13878            tonic::Status,
13879        > {
13880            self.inner
13881                .ready()
13882                .await
13883                .map_err(|e| {
13884                    tonic::Status::unknown(
13885                        format!("Service was not ready: {}", e.into()),
13886                    )
13887                })?;
13888            let codec = tonic_prost::ProstCodec::default();
13889            let path = http::uri::PathAndQuery::from_static(
13890                "/pidgr.v1.RoleService/CreateRole",
13891            );
13892            let mut req = request.into_request();
13893            req.extensions_mut()
13894                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
13895            self.inner.unary(req, path, codec).await
13896        }
13897        /** Update a role's name and/or permissions.
13898 System roles (is_system=true) cannot be updated.
13899 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13900*/
13901        pub async fn update_role(
13902            &mut self,
13903            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
13904        ) -> std::result::Result<
13905            tonic::Response<super::UpdateRoleResponse>,
13906            tonic::Status,
13907        > {
13908            self.inner
13909                .ready()
13910                .await
13911                .map_err(|e| {
13912                    tonic::Status::unknown(
13913                        format!("Service was not ready: {}", e.into()),
13914                    )
13915                })?;
13916            let codec = tonic_prost::ProstCodec::default();
13917            let path = http::uri::PathAndQuery::from_static(
13918                "/pidgr.v1.RoleService/UpdateRole",
13919            );
13920            let mut req = request.into_request();
13921            req.extensions_mut()
13922                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
13923            self.inner.unary(req, path, codec).await
13924        }
13925        /** Delete a role. Fails if any users are assigned to it.
13926 System roles (is_system=true) cannot be deleted.
13927 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13928*/
13929        pub async fn delete_role(
13930            &mut self,
13931            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
13932        ) -> std::result::Result<
13933            tonic::Response<super::DeleteRoleResponse>,
13934            tonic::Status,
13935        > {
13936            self.inner
13937                .ready()
13938                .await
13939                .map_err(|e| {
13940                    tonic::Status::unknown(
13941                        format!("Service was not ready: {}", e.into()),
13942                    )
13943                })?;
13944            let codec = tonic_prost::ProstCodec::default();
13945            let path = http::uri::PathAndQuery::from_static(
13946                "/pidgr.v1.RoleService/DeleteRole",
13947            );
13948            let mut req = request.into_request();
13949            req.extensions_mut()
13950                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
13951            self.inner.unary(req, path, codec).await
13952        }
13953    }
13954}
13955/// Generated server implementations.
13956pub mod role_service_server {
13957    #![allow(
13958        unused_variables,
13959        dead_code,
13960        missing_docs,
13961        clippy::wildcard_imports,
13962        clippy::let_unit_value,
13963    )]
13964    use tonic::codegen::*;
13965    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
13966    #[async_trait]
13967    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
13968        /** List all roles in the organization with their permission sets.
13969 Authorization: Requires PERMISSION_ORG_READ.
13970*/
13971        async fn list_roles(
13972            &self,
13973            request: tonic::Request<super::ListRolesRequest>,
13974        ) -> std::result::Result<
13975            tonic::Response<super::ListRolesResponse>,
13976            tonic::Status,
13977        >;
13978        /** Create a new custom role with a name and initial permissions.
13979 Slug is auto-generated from the name and immutable after creation.
13980 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13981*/
13982        async fn create_role(
13983            &self,
13984            request: tonic::Request<super::CreateRoleRequest>,
13985        ) -> std::result::Result<
13986            tonic::Response<super::CreateRoleResponse>,
13987            tonic::Status,
13988        >;
13989        /** Update a role's name and/or permissions.
13990 System roles (is_system=true) cannot be updated.
13991 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13992*/
13993        async fn update_role(
13994            &self,
13995            request: tonic::Request<super::UpdateRoleRequest>,
13996        ) -> std::result::Result<
13997            tonic::Response<super::UpdateRoleResponse>,
13998            tonic::Status,
13999        >;
14000        /** Delete a role. Fails if any users are assigned to it.
14001 System roles (is_system=true) cannot be deleted.
14002 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14003*/
14004        async fn delete_role(
14005            &self,
14006            request: tonic::Request<super::DeleteRoleRequest>,
14007        ) -> std::result::Result<
14008            tonic::Response<super::DeleteRoleResponse>,
14009            tonic::Status,
14010        >;
14011    }
14012    /** Manages roles and their permissions within an organization.
14013 All RPCs operate within the caller's org (extracted from JWT).
14014*/
14015    #[derive(Debug)]
14016    pub struct RoleServiceServer<T> {
14017        inner: Arc<T>,
14018        accept_compression_encodings: EnabledCompressionEncodings,
14019        send_compression_encodings: EnabledCompressionEncodings,
14020        max_decoding_message_size: Option<usize>,
14021        max_encoding_message_size: Option<usize>,
14022    }
14023    impl<T> RoleServiceServer<T> {
14024        pub fn new(inner: T) -> Self {
14025            Self::from_arc(Arc::new(inner))
14026        }
14027        pub fn from_arc(inner: Arc<T>) -> Self {
14028            Self {
14029                inner,
14030                accept_compression_encodings: Default::default(),
14031                send_compression_encodings: Default::default(),
14032                max_decoding_message_size: None,
14033                max_encoding_message_size: None,
14034            }
14035        }
14036        pub fn with_interceptor<F>(
14037            inner: T,
14038            interceptor: F,
14039        ) -> InterceptedService<Self, F>
14040        where
14041            F: tonic::service::Interceptor,
14042        {
14043            InterceptedService::new(Self::new(inner), interceptor)
14044        }
14045        /// Enable decompressing requests with the given encoding.
14046        #[must_use]
14047        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14048            self.accept_compression_encodings.enable(encoding);
14049            self
14050        }
14051        /// Compress responses with the given encoding, if the client supports it.
14052        #[must_use]
14053        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14054            self.send_compression_encodings.enable(encoding);
14055            self
14056        }
14057        /// Limits the maximum size of a decoded message.
14058        ///
14059        /// Default: `4MB`
14060        #[must_use]
14061        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14062            self.max_decoding_message_size = Some(limit);
14063            self
14064        }
14065        /// Limits the maximum size of an encoded message.
14066        ///
14067        /// Default: `usize::MAX`
14068        #[must_use]
14069        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14070            self.max_encoding_message_size = Some(limit);
14071            self
14072        }
14073    }
14074    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
14075    where
14076        T: RoleService,
14077        B: Body + std::marker::Send + 'static,
14078        B::Error: Into<StdError> + std::marker::Send + 'static,
14079    {
14080        type Response = http::Response<tonic::body::Body>;
14081        type Error = std::convert::Infallible;
14082        type Future = BoxFuture<Self::Response, Self::Error>;
14083        fn poll_ready(
14084            &mut self,
14085            _cx: &mut Context<'_>,
14086        ) -> Poll<std::result::Result<(), Self::Error>> {
14087            Poll::Ready(Ok(()))
14088        }
14089        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14090            match req.uri().path() {
14091                "/pidgr.v1.RoleService/ListRoles" => {
14092                    #[allow(non_camel_case_types)]
14093                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
14094                    impl<
14095                        T: RoleService,
14096                    > tonic::server::UnaryService<super::ListRolesRequest>
14097                    for ListRolesSvc<T> {
14098                        type Response = super::ListRolesResponse;
14099                        type Future = BoxFuture<
14100                            tonic::Response<Self::Response>,
14101                            tonic::Status,
14102                        >;
14103                        fn call(
14104                            &mut self,
14105                            request: tonic::Request<super::ListRolesRequest>,
14106                        ) -> Self::Future {
14107                            let inner = Arc::clone(&self.0);
14108                            let fut = async move {
14109                                <T as RoleService>::list_roles(&inner, request).await
14110                            };
14111                            Box::pin(fut)
14112                        }
14113                    }
14114                    let accept_compression_encodings = self.accept_compression_encodings;
14115                    let send_compression_encodings = self.send_compression_encodings;
14116                    let max_decoding_message_size = self.max_decoding_message_size;
14117                    let max_encoding_message_size = self.max_encoding_message_size;
14118                    let inner = self.inner.clone();
14119                    let fut = async move {
14120                        let method = ListRolesSvc(inner);
14121                        let codec = tonic_prost::ProstCodec::default();
14122                        let mut grpc = tonic::server::Grpc::new(codec)
14123                            .apply_compression_config(
14124                                accept_compression_encodings,
14125                                send_compression_encodings,
14126                            )
14127                            .apply_max_message_size_config(
14128                                max_decoding_message_size,
14129                                max_encoding_message_size,
14130                            );
14131                        let res = grpc.unary(method, req).await;
14132                        Ok(res)
14133                    };
14134                    Box::pin(fut)
14135                }
14136                "/pidgr.v1.RoleService/CreateRole" => {
14137                    #[allow(non_camel_case_types)]
14138                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
14139                    impl<
14140                        T: RoleService,
14141                    > tonic::server::UnaryService<super::CreateRoleRequest>
14142                    for CreateRoleSvc<T> {
14143                        type Response = super::CreateRoleResponse;
14144                        type Future = BoxFuture<
14145                            tonic::Response<Self::Response>,
14146                            tonic::Status,
14147                        >;
14148                        fn call(
14149                            &mut self,
14150                            request: tonic::Request<super::CreateRoleRequest>,
14151                        ) -> Self::Future {
14152                            let inner = Arc::clone(&self.0);
14153                            let fut = async move {
14154                                <T as RoleService>::create_role(&inner, request).await
14155                            };
14156                            Box::pin(fut)
14157                        }
14158                    }
14159                    let accept_compression_encodings = self.accept_compression_encodings;
14160                    let send_compression_encodings = self.send_compression_encodings;
14161                    let max_decoding_message_size = self.max_decoding_message_size;
14162                    let max_encoding_message_size = self.max_encoding_message_size;
14163                    let inner = self.inner.clone();
14164                    let fut = async move {
14165                        let method = CreateRoleSvc(inner);
14166                        let codec = tonic_prost::ProstCodec::default();
14167                        let mut grpc = tonic::server::Grpc::new(codec)
14168                            .apply_compression_config(
14169                                accept_compression_encodings,
14170                                send_compression_encodings,
14171                            )
14172                            .apply_max_message_size_config(
14173                                max_decoding_message_size,
14174                                max_encoding_message_size,
14175                            );
14176                        let res = grpc.unary(method, req).await;
14177                        Ok(res)
14178                    };
14179                    Box::pin(fut)
14180                }
14181                "/pidgr.v1.RoleService/UpdateRole" => {
14182                    #[allow(non_camel_case_types)]
14183                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
14184                    impl<
14185                        T: RoleService,
14186                    > tonic::server::UnaryService<super::UpdateRoleRequest>
14187                    for UpdateRoleSvc<T> {
14188                        type Response = super::UpdateRoleResponse;
14189                        type Future = BoxFuture<
14190                            tonic::Response<Self::Response>,
14191                            tonic::Status,
14192                        >;
14193                        fn call(
14194                            &mut self,
14195                            request: tonic::Request<super::UpdateRoleRequest>,
14196                        ) -> Self::Future {
14197                            let inner = Arc::clone(&self.0);
14198                            let fut = async move {
14199                                <T as RoleService>::update_role(&inner, request).await
14200                            };
14201                            Box::pin(fut)
14202                        }
14203                    }
14204                    let accept_compression_encodings = self.accept_compression_encodings;
14205                    let send_compression_encodings = self.send_compression_encodings;
14206                    let max_decoding_message_size = self.max_decoding_message_size;
14207                    let max_encoding_message_size = self.max_encoding_message_size;
14208                    let inner = self.inner.clone();
14209                    let fut = async move {
14210                        let method = UpdateRoleSvc(inner);
14211                        let codec = tonic_prost::ProstCodec::default();
14212                        let mut grpc = tonic::server::Grpc::new(codec)
14213                            .apply_compression_config(
14214                                accept_compression_encodings,
14215                                send_compression_encodings,
14216                            )
14217                            .apply_max_message_size_config(
14218                                max_decoding_message_size,
14219                                max_encoding_message_size,
14220                            );
14221                        let res = grpc.unary(method, req).await;
14222                        Ok(res)
14223                    };
14224                    Box::pin(fut)
14225                }
14226                "/pidgr.v1.RoleService/DeleteRole" => {
14227                    #[allow(non_camel_case_types)]
14228                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
14229                    impl<
14230                        T: RoleService,
14231                    > tonic::server::UnaryService<super::DeleteRoleRequest>
14232                    for DeleteRoleSvc<T> {
14233                        type Response = super::DeleteRoleResponse;
14234                        type Future = BoxFuture<
14235                            tonic::Response<Self::Response>,
14236                            tonic::Status,
14237                        >;
14238                        fn call(
14239                            &mut self,
14240                            request: tonic::Request<super::DeleteRoleRequest>,
14241                        ) -> Self::Future {
14242                            let inner = Arc::clone(&self.0);
14243                            let fut = async move {
14244                                <T as RoleService>::delete_role(&inner, request).await
14245                            };
14246                            Box::pin(fut)
14247                        }
14248                    }
14249                    let accept_compression_encodings = self.accept_compression_encodings;
14250                    let send_compression_encodings = self.send_compression_encodings;
14251                    let max_decoding_message_size = self.max_decoding_message_size;
14252                    let max_encoding_message_size = self.max_encoding_message_size;
14253                    let inner = self.inner.clone();
14254                    let fut = async move {
14255                        let method = DeleteRoleSvc(inner);
14256                        let codec = tonic_prost::ProstCodec::default();
14257                        let mut grpc = tonic::server::Grpc::new(codec)
14258                            .apply_compression_config(
14259                                accept_compression_encodings,
14260                                send_compression_encodings,
14261                            )
14262                            .apply_max_message_size_config(
14263                                max_decoding_message_size,
14264                                max_encoding_message_size,
14265                            );
14266                        let res = grpc.unary(method, req).await;
14267                        Ok(res)
14268                    };
14269                    Box::pin(fut)
14270                }
14271                _ => {
14272                    Box::pin(async move {
14273                        let mut response = http::Response::new(
14274                            tonic::body::Body::default(),
14275                        );
14276                        let headers = response.headers_mut();
14277                        headers
14278                            .insert(
14279                                tonic::Status::GRPC_STATUS,
14280                                (tonic::Code::Unimplemented as i32).into(),
14281                            );
14282                        headers
14283                            .insert(
14284                                http::header::CONTENT_TYPE,
14285                                tonic::metadata::GRPC_CONTENT_TYPE,
14286                            );
14287                        Ok(response)
14288                    })
14289                }
14290            }
14291        }
14292    }
14293    impl<T> Clone for RoleServiceServer<T> {
14294        fn clone(&self) -> Self {
14295            let inner = self.inner.clone();
14296            Self {
14297                inner,
14298                accept_compression_encodings: self.accept_compression_encodings,
14299                send_compression_encodings: self.send_compression_encodings,
14300                max_decoding_message_size: self.max_decoding_message_size,
14301                max_encoding_message_size: self.max_encoding_message_size,
14302            }
14303        }
14304    }
14305    /// Generated gRPC service name
14306    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
14307    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
14308        const NAME: &'static str = SERVICE_NAME;
14309    }
14310}
14311/// Generated client implementations.
14312pub mod sso_service_client {
14313    #![allow(
14314        unused_variables,
14315        dead_code,
14316        missing_docs,
14317        clippy::wildcard_imports,
14318        clippy::let_unit_value,
14319    )]
14320    use tonic::codegen::*;
14321    use tonic::codegen::http::Uri;
14322    /** Manages SSO identity provider configuration for organizations.
14323*/
14324    #[derive(Debug, Clone)]
14325    pub struct SsoServiceClient<T> {
14326        inner: tonic::client::Grpc<T>,
14327    }
14328    impl SsoServiceClient<tonic::transport::Channel> {
14329        /// Attempt to create a new client by connecting to a given endpoint.
14330        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14331        where
14332            D: TryInto<tonic::transport::Endpoint>,
14333            D::Error: Into<StdError>,
14334        {
14335            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14336            Ok(Self::new(conn))
14337        }
14338    }
14339    impl<T> SsoServiceClient<T>
14340    where
14341        T: tonic::client::GrpcService<tonic::body::Body>,
14342        T::Error: Into<StdError>,
14343        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14344        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14345    {
14346        pub fn new(inner: T) -> Self {
14347            let inner = tonic::client::Grpc::new(inner);
14348            Self { inner }
14349        }
14350        pub fn with_origin(inner: T, origin: Uri) -> Self {
14351            let inner = tonic::client::Grpc::with_origin(inner, origin);
14352            Self { inner }
14353        }
14354        pub fn with_interceptor<F>(
14355            inner: T,
14356            interceptor: F,
14357        ) -> SsoServiceClient<InterceptedService<T, F>>
14358        where
14359            F: tonic::service::Interceptor,
14360            T::ResponseBody: Default,
14361            T: tonic::codegen::Service<
14362                http::Request<tonic::body::Body>,
14363                Response = http::Response<
14364                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14365                >,
14366            >,
14367            <T as tonic::codegen::Service<
14368                http::Request<tonic::body::Body>,
14369            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14370        {
14371            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14372        }
14373        /// Compress requests with the given encoding.
14374        ///
14375        /// This requires the server to support it otherwise it might respond with an
14376        /// error.
14377        #[must_use]
14378        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14379            self.inner = self.inner.send_compressed(encoding);
14380            self
14381        }
14382        /// Enable decompressing responses.
14383        #[must_use]
14384        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14385            self.inner = self.inner.accept_compressed(encoding);
14386            self
14387        }
14388        /// Limits the maximum size of a decoded message.
14389        ///
14390        /// Default: `4MB`
14391        #[must_use]
14392        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14393            self.inner = self.inner.max_decoding_message_size(limit);
14394            self
14395        }
14396        /// Limits the maximum size of an encoded message.
14397        ///
14398        /// Default: `usize::MAX`
14399        #[must_use]
14400        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14401            self.inner = self.inner.max_encoding_message_size(limit);
14402            self
14403        }
14404        /** Check if an email domain has SSO configured.
14405 This is a pre-authentication endpoint — no JWT required.
14406 Authorization: None (public).
14407*/
14408        pub async fn check_sso_by_domain(
14409            &mut self,
14410            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14411        ) -> std::result::Result<
14412            tonic::Response<super::CheckSsoByDomainResponse>,
14413            tonic::Status,
14414        > {
14415            self.inner
14416                .ready()
14417                .await
14418                .map_err(|e| {
14419                    tonic::Status::unknown(
14420                        format!("Service was not ready: {}", e.into()),
14421                    )
14422                })?;
14423            let codec = tonic_prost::ProstCodec::default();
14424            let path = http::uri::PathAndQuery::from_static(
14425                "/pidgr.v1.SSOService/CheckSSOByDomain",
14426            );
14427            let mut req = request.into_request();
14428            req.extensions_mut()
14429                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14430            self.inner.unary(req, path, codec).await
14431        }
14432        /** Create an SSO provider for the organization.
14433 Validates the metadata URL before saving.
14434 Creates the corresponding identity provider in the auth service.
14435 Authorization: Requires PERMISSION_ORG_WRITE.
14436*/
14437        pub async fn create_sso_provider(
14438            &mut self,
14439            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14440        ) -> std::result::Result<
14441            tonic::Response<super::CreateSsoProviderResponse>,
14442            tonic::Status,
14443        > {
14444            self.inner
14445                .ready()
14446                .await
14447                .map_err(|e| {
14448                    tonic::Status::unknown(
14449                        format!("Service was not ready: {}", e.into()),
14450                    )
14451                })?;
14452            let codec = tonic_prost::ProstCodec::default();
14453            let path = http::uri::PathAndQuery::from_static(
14454                "/pidgr.v1.SSOService/CreateSSOProvider",
14455            );
14456            let mut req = request.into_request();
14457            req.extensions_mut()
14458                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14459            self.inner.unary(req, path, codec).await
14460        }
14461        /** Get the organization's SSO provider configuration.
14462 Authorization: Requires PERMISSION_ORG_READ.
14463*/
14464        pub async fn get_sso_provider(
14465            &mut self,
14466            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14467        ) -> std::result::Result<
14468            tonic::Response<super::GetSsoProviderResponse>,
14469            tonic::Status,
14470        > {
14471            self.inner
14472                .ready()
14473                .await
14474                .map_err(|e| {
14475                    tonic::Status::unknown(
14476                        format!("Service was not ready: {}", e.into()),
14477                    )
14478                })?;
14479            let codec = tonic_prost::ProstCodec::default();
14480            let path = http::uri::PathAndQuery::from_static(
14481                "/pidgr.v1.SSOService/GetSSOProvider",
14482            );
14483            let mut req = request.into_request();
14484            req.extensions_mut()
14485                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14486            self.inner.unary(req, path, codec).await
14487        }
14488        /** Delete the organization's SSO provider.
14489 Deletes the corresponding identity provider from the auth service.
14490 Users with that domain fall back to passkey/OTP.
14491 Authorization: Requires PERMISSION_ORG_WRITE.
14492*/
14493        pub async fn delete_sso_provider(
14494            &mut self,
14495            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14496        ) -> std::result::Result<
14497            tonic::Response<super::DeleteSsoProviderResponse>,
14498            tonic::Status,
14499        > {
14500            self.inner
14501                .ready()
14502                .await
14503                .map_err(|e| {
14504                    tonic::Status::unknown(
14505                        format!("Service was not ready: {}", e.into()),
14506                    )
14507                })?;
14508            let codec = tonic_prost::ProstCodec::default();
14509            let path = http::uri::PathAndQuery::from_static(
14510                "/pidgr.v1.SSOService/DeleteSSOProvider",
14511            );
14512            let mut req = request.into_request();
14513            req.extensions_mut()
14514                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14515            self.inner.unary(req, path, codec).await
14516        }
14517    }
14518}
14519/// Generated server implementations.
14520pub mod sso_service_server {
14521    #![allow(
14522        unused_variables,
14523        dead_code,
14524        missing_docs,
14525        clippy::wildcard_imports,
14526        clippy::let_unit_value,
14527    )]
14528    use tonic::codegen::*;
14529    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
14530    #[async_trait]
14531    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14532        /** Check if an email domain has SSO configured.
14533 This is a pre-authentication endpoint — no JWT required.
14534 Authorization: None (public).
14535*/
14536        async fn check_sso_by_domain(
14537            &self,
14538            request: tonic::Request<super::CheckSsoByDomainRequest>,
14539        ) -> std::result::Result<
14540            tonic::Response<super::CheckSsoByDomainResponse>,
14541            tonic::Status,
14542        >;
14543        /** Create an SSO provider for the organization.
14544 Validates the metadata URL before saving.
14545 Creates the corresponding identity provider in the auth service.
14546 Authorization: Requires PERMISSION_ORG_WRITE.
14547*/
14548        async fn create_sso_provider(
14549            &self,
14550            request: tonic::Request<super::CreateSsoProviderRequest>,
14551        ) -> std::result::Result<
14552            tonic::Response<super::CreateSsoProviderResponse>,
14553            tonic::Status,
14554        >;
14555        /** Get the organization's SSO provider configuration.
14556 Authorization: Requires PERMISSION_ORG_READ.
14557*/
14558        async fn get_sso_provider(
14559            &self,
14560            request: tonic::Request<super::GetSsoProviderRequest>,
14561        ) -> std::result::Result<
14562            tonic::Response<super::GetSsoProviderResponse>,
14563            tonic::Status,
14564        >;
14565        /** Delete the organization's SSO provider.
14566 Deletes the corresponding identity provider from the auth service.
14567 Users with that domain fall back to passkey/OTP.
14568 Authorization: Requires PERMISSION_ORG_WRITE.
14569*/
14570        async fn delete_sso_provider(
14571            &self,
14572            request: tonic::Request<super::DeleteSsoProviderRequest>,
14573        ) -> std::result::Result<
14574            tonic::Response<super::DeleteSsoProviderResponse>,
14575            tonic::Status,
14576        >;
14577    }
14578    /** Manages SSO identity provider configuration for organizations.
14579*/
14580    #[derive(Debug)]
14581    pub struct SsoServiceServer<T> {
14582        inner: Arc<T>,
14583        accept_compression_encodings: EnabledCompressionEncodings,
14584        send_compression_encodings: EnabledCompressionEncodings,
14585        max_decoding_message_size: Option<usize>,
14586        max_encoding_message_size: Option<usize>,
14587    }
14588    impl<T> SsoServiceServer<T> {
14589        pub fn new(inner: T) -> Self {
14590            Self::from_arc(Arc::new(inner))
14591        }
14592        pub fn from_arc(inner: Arc<T>) -> Self {
14593            Self {
14594                inner,
14595                accept_compression_encodings: Default::default(),
14596                send_compression_encodings: Default::default(),
14597                max_decoding_message_size: None,
14598                max_encoding_message_size: None,
14599            }
14600        }
14601        pub fn with_interceptor<F>(
14602            inner: T,
14603            interceptor: F,
14604        ) -> InterceptedService<Self, F>
14605        where
14606            F: tonic::service::Interceptor,
14607        {
14608            InterceptedService::new(Self::new(inner), interceptor)
14609        }
14610        /// Enable decompressing requests with the given encoding.
14611        #[must_use]
14612        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14613            self.accept_compression_encodings.enable(encoding);
14614            self
14615        }
14616        /// Compress responses with the given encoding, if the client supports it.
14617        #[must_use]
14618        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14619            self.send_compression_encodings.enable(encoding);
14620            self
14621        }
14622        /// Limits the maximum size of a decoded message.
14623        ///
14624        /// Default: `4MB`
14625        #[must_use]
14626        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14627            self.max_decoding_message_size = Some(limit);
14628            self
14629        }
14630        /// Limits the maximum size of an encoded message.
14631        ///
14632        /// Default: `usize::MAX`
14633        #[must_use]
14634        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14635            self.max_encoding_message_size = Some(limit);
14636            self
14637        }
14638    }
14639    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14640    where
14641        T: SsoService,
14642        B: Body + std::marker::Send + 'static,
14643        B::Error: Into<StdError> + std::marker::Send + 'static,
14644    {
14645        type Response = http::Response<tonic::body::Body>;
14646        type Error = std::convert::Infallible;
14647        type Future = BoxFuture<Self::Response, Self::Error>;
14648        fn poll_ready(
14649            &mut self,
14650            _cx: &mut Context<'_>,
14651        ) -> Poll<std::result::Result<(), Self::Error>> {
14652            Poll::Ready(Ok(()))
14653        }
14654        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14655            match req.uri().path() {
14656                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14657                    #[allow(non_camel_case_types)]
14658                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14659                    impl<
14660                        T: SsoService,
14661                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14662                    for CheckSSOByDomainSvc<T> {
14663                        type Response = super::CheckSsoByDomainResponse;
14664                        type Future = BoxFuture<
14665                            tonic::Response<Self::Response>,
14666                            tonic::Status,
14667                        >;
14668                        fn call(
14669                            &mut self,
14670                            request: tonic::Request<super::CheckSsoByDomainRequest>,
14671                        ) -> Self::Future {
14672                            let inner = Arc::clone(&self.0);
14673                            let fut = async move {
14674                                <T as SsoService>::check_sso_by_domain(&inner, request)
14675                                    .await
14676                            };
14677                            Box::pin(fut)
14678                        }
14679                    }
14680                    let accept_compression_encodings = self.accept_compression_encodings;
14681                    let send_compression_encodings = self.send_compression_encodings;
14682                    let max_decoding_message_size = self.max_decoding_message_size;
14683                    let max_encoding_message_size = self.max_encoding_message_size;
14684                    let inner = self.inner.clone();
14685                    let fut = async move {
14686                        let method = CheckSSOByDomainSvc(inner);
14687                        let codec = tonic_prost::ProstCodec::default();
14688                        let mut grpc = tonic::server::Grpc::new(codec)
14689                            .apply_compression_config(
14690                                accept_compression_encodings,
14691                                send_compression_encodings,
14692                            )
14693                            .apply_max_message_size_config(
14694                                max_decoding_message_size,
14695                                max_encoding_message_size,
14696                            );
14697                        let res = grpc.unary(method, req).await;
14698                        Ok(res)
14699                    };
14700                    Box::pin(fut)
14701                }
14702                "/pidgr.v1.SSOService/CreateSSOProvider" => {
14703                    #[allow(non_camel_case_types)]
14704                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14705                    impl<
14706                        T: SsoService,
14707                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
14708                    for CreateSSOProviderSvc<T> {
14709                        type Response = super::CreateSsoProviderResponse;
14710                        type Future = BoxFuture<
14711                            tonic::Response<Self::Response>,
14712                            tonic::Status,
14713                        >;
14714                        fn call(
14715                            &mut self,
14716                            request: tonic::Request<super::CreateSsoProviderRequest>,
14717                        ) -> Self::Future {
14718                            let inner = Arc::clone(&self.0);
14719                            let fut = async move {
14720                                <T as SsoService>::create_sso_provider(&inner, request)
14721                                    .await
14722                            };
14723                            Box::pin(fut)
14724                        }
14725                    }
14726                    let accept_compression_encodings = self.accept_compression_encodings;
14727                    let send_compression_encodings = self.send_compression_encodings;
14728                    let max_decoding_message_size = self.max_decoding_message_size;
14729                    let max_encoding_message_size = self.max_encoding_message_size;
14730                    let inner = self.inner.clone();
14731                    let fut = async move {
14732                        let method = CreateSSOProviderSvc(inner);
14733                        let codec = tonic_prost::ProstCodec::default();
14734                        let mut grpc = tonic::server::Grpc::new(codec)
14735                            .apply_compression_config(
14736                                accept_compression_encodings,
14737                                send_compression_encodings,
14738                            )
14739                            .apply_max_message_size_config(
14740                                max_decoding_message_size,
14741                                max_encoding_message_size,
14742                            );
14743                        let res = grpc.unary(method, req).await;
14744                        Ok(res)
14745                    };
14746                    Box::pin(fut)
14747                }
14748                "/pidgr.v1.SSOService/GetSSOProvider" => {
14749                    #[allow(non_camel_case_types)]
14750                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
14751                    impl<
14752                        T: SsoService,
14753                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
14754                    for GetSSOProviderSvc<T> {
14755                        type Response = super::GetSsoProviderResponse;
14756                        type Future = BoxFuture<
14757                            tonic::Response<Self::Response>,
14758                            tonic::Status,
14759                        >;
14760                        fn call(
14761                            &mut self,
14762                            request: tonic::Request<super::GetSsoProviderRequest>,
14763                        ) -> Self::Future {
14764                            let inner = Arc::clone(&self.0);
14765                            let fut = async move {
14766                                <T as SsoService>::get_sso_provider(&inner, request).await
14767                            };
14768                            Box::pin(fut)
14769                        }
14770                    }
14771                    let accept_compression_encodings = self.accept_compression_encodings;
14772                    let send_compression_encodings = self.send_compression_encodings;
14773                    let max_decoding_message_size = self.max_decoding_message_size;
14774                    let max_encoding_message_size = self.max_encoding_message_size;
14775                    let inner = self.inner.clone();
14776                    let fut = async move {
14777                        let method = GetSSOProviderSvc(inner);
14778                        let codec = tonic_prost::ProstCodec::default();
14779                        let mut grpc = tonic::server::Grpc::new(codec)
14780                            .apply_compression_config(
14781                                accept_compression_encodings,
14782                                send_compression_encodings,
14783                            )
14784                            .apply_max_message_size_config(
14785                                max_decoding_message_size,
14786                                max_encoding_message_size,
14787                            );
14788                        let res = grpc.unary(method, req).await;
14789                        Ok(res)
14790                    };
14791                    Box::pin(fut)
14792                }
14793                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
14794                    #[allow(non_camel_case_types)]
14795                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
14796                    impl<
14797                        T: SsoService,
14798                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
14799                    for DeleteSSOProviderSvc<T> {
14800                        type Response = super::DeleteSsoProviderResponse;
14801                        type Future = BoxFuture<
14802                            tonic::Response<Self::Response>,
14803                            tonic::Status,
14804                        >;
14805                        fn call(
14806                            &mut self,
14807                            request: tonic::Request<super::DeleteSsoProviderRequest>,
14808                        ) -> Self::Future {
14809                            let inner = Arc::clone(&self.0);
14810                            let fut = async move {
14811                                <T as SsoService>::delete_sso_provider(&inner, request)
14812                                    .await
14813                            };
14814                            Box::pin(fut)
14815                        }
14816                    }
14817                    let accept_compression_encodings = self.accept_compression_encodings;
14818                    let send_compression_encodings = self.send_compression_encodings;
14819                    let max_decoding_message_size = self.max_decoding_message_size;
14820                    let max_encoding_message_size = self.max_encoding_message_size;
14821                    let inner = self.inner.clone();
14822                    let fut = async move {
14823                        let method = DeleteSSOProviderSvc(inner);
14824                        let codec = tonic_prost::ProstCodec::default();
14825                        let mut grpc = tonic::server::Grpc::new(codec)
14826                            .apply_compression_config(
14827                                accept_compression_encodings,
14828                                send_compression_encodings,
14829                            )
14830                            .apply_max_message_size_config(
14831                                max_decoding_message_size,
14832                                max_encoding_message_size,
14833                            );
14834                        let res = grpc.unary(method, req).await;
14835                        Ok(res)
14836                    };
14837                    Box::pin(fut)
14838                }
14839                _ => {
14840                    Box::pin(async move {
14841                        let mut response = http::Response::new(
14842                            tonic::body::Body::default(),
14843                        );
14844                        let headers = response.headers_mut();
14845                        headers
14846                            .insert(
14847                                tonic::Status::GRPC_STATUS,
14848                                (tonic::Code::Unimplemented as i32).into(),
14849                            );
14850                        headers
14851                            .insert(
14852                                http::header::CONTENT_TYPE,
14853                                tonic::metadata::GRPC_CONTENT_TYPE,
14854                            );
14855                        Ok(response)
14856                    })
14857                }
14858            }
14859        }
14860    }
14861    impl<T> Clone for SsoServiceServer<T> {
14862        fn clone(&self) -> Self {
14863            let inner = self.inner.clone();
14864            Self {
14865                inner,
14866                accept_compression_encodings: self.accept_compression_encodings,
14867                send_compression_encodings: self.send_compression_encodings,
14868                max_decoding_message_size: self.max_decoding_message_size,
14869                max_encoding_message_size: self.max_encoding_message_size,
14870            }
14871        }
14872    }
14873    /// Generated gRPC service name
14874    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
14875    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
14876        const NAME: &'static str = SERVICE_NAME;
14877    }
14878}
14879/// Generated client implementations.
14880pub mod team_service_client {
14881    #![allow(
14882        unused_variables,
14883        dead_code,
14884        missing_docs,
14885        clippy::wildcard_imports,
14886        clippy::let_unit_value,
14887    )]
14888    use tonic::codegen::*;
14889    use tonic::codegen::http::Uri;
14890    /** Manages organizational teams (departments, divisions) within an organization.
14891 Teams represent the organizational structure and can serve as sender identity.
14892 All RPCs operate within the caller's org (extracted from JWT).
14893*/
14894    #[derive(Debug, Clone)]
14895    pub struct TeamServiceClient<T> {
14896        inner: tonic::client::Grpc<T>,
14897    }
14898    impl TeamServiceClient<tonic::transport::Channel> {
14899        /// Attempt to create a new client by connecting to a given endpoint.
14900        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14901        where
14902            D: TryInto<tonic::transport::Endpoint>,
14903            D::Error: Into<StdError>,
14904        {
14905            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14906            Ok(Self::new(conn))
14907        }
14908    }
14909    impl<T> TeamServiceClient<T>
14910    where
14911        T: tonic::client::GrpcService<tonic::body::Body>,
14912        T::Error: Into<StdError>,
14913        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14914        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14915    {
14916        pub fn new(inner: T) -> Self {
14917            let inner = tonic::client::Grpc::new(inner);
14918            Self { inner }
14919        }
14920        pub fn with_origin(inner: T, origin: Uri) -> Self {
14921            let inner = tonic::client::Grpc::with_origin(inner, origin);
14922            Self { inner }
14923        }
14924        pub fn with_interceptor<F>(
14925            inner: T,
14926            interceptor: F,
14927        ) -> TeamServiceClient<InterceptedService<T, F>>
14928        where
14929            F: tonic::service::Interceptor,
14930            T::ResponseBody: Default,
14931            T: tonic::codegen::Service<
14932                http::Request<tonic::body::Body>,
14933                Response = http::Response<
14934                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14935                >,
14936            >,
14937            <T as tonic::codegen::Service<
14938                http::Request<tonic::body::Body>,
14939            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14940        {
14941            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
14942        }
14943        /// Compress requests with the given encoding.
14944        ///
14945        /// This requires the server to support it otherwise it might respond with an
14946        /// error.
14947        #[must_use]
14948        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14949            self.inner = self.inner.send_compressed(encoding);
14950            self
14951        }
14952        /// Enable decompressing responses.
14953        #[must_use]
14954        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14955            self.inner = self.inner.accept_compressed(encoding);
14956            self
14957        }
14958        /// Limits the maximum size of a decoded message.
14959        ///
14960        /// Default: `4MB`
14961        #[must_use]
14962        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14963            self.inner = self.inner.max_decoding_message_size(limit);
14964            self
14965        }
14966        /// Limits the maximum size of an encoded message.
14967        ///
14968        /// Default: `usize::MAX`
14969        #[must_use]
14970        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14971            self.inner = self.inner.max_encoding_message_size(limit);
14972            self
14973        }
14974        /** Create a new team in the organization.
14975 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
14976*/
14977        pub async fn create_team(
14978            &mut self,
14979            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
14980        ) -> std::result::Result<
14981            tonic::Response<super::CreateTeamResponse>,
14982            tonic::Status,
14983        > {
14984            self.inner
14985                .ready()
14986                .await
14987                .map_err(|e| {
14988                    tonic::Status::unknown(
14989                        format!("Service was not ready: {}", e.into()),
14990                    )
14991                })?;
14992            let codec = tonic_prost::ProstCodec::default();
14993            let path = http::uri::PathAndQuery::from_static(
14994                "/pidgr.v1.TeamService/CreateTeam",
14995            );
14996            let mut req = request.into_request();
14997            req.extensions_mut()
14998                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
14999            self.inner.unary(req, path, codec).await
15000        }
15001        /** Retrieve a team by ID.
15002 Authorization: Caller must be a member of the team, or have
15003 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15004*/
15005        pub async fn get_team(
15006            &mut self,
15007            request: impl tonic::IntoRequest<super::GetTeamRequest>,
15008        ) -> std::result::Result<
15009            tonic::Response<super::GetTeamResponse>,
15010            tonic::Status,
15011        > {
15012            self.inner
15013                .ready()
15014                .await
15015                .map_err(|e| {
15016                    tonic::Status::unknown(
15017                        format!("Service was not ready: {}", e.into()),
15018                    )
15019                })?;
15020            let codec = tonic_prost::ProstCodec::default();
15021            let path = http::uri::PathAndQuery::from_static(
15022                "/pidgr.v1.TeamService/GetTeam",
15023            );
15024            let mut req = request.into_request();
15025            req.extensions_mut()
15026                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
15027            self.inner.unary(req, path, codec).await
15028        }
15029        /** List teams in the organization with pagination.
15030 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15031*/
15032        pub async fn list_teams(
15033            &mut self,
15034            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
15035        ) -> std::result::Result<
15036            tonic::Response<super::ListTeamsResponse>,
15037            tonic::Status,
15038        > {
15039            self.inner
15040                .ready()
15041                .await
15042                .map_err(|e| {
15043                    tonic::Status::unknown(
15044                        format!("Service was not ready: {}", e.into()),
15045                    )
15046                })?;
15047            let codec = tonic_prost::ProstCodec::default();
15048            let path = http::uri::PathAndQuery::from_static(
15049                "/pidgr.v1.TeamService/ListTeams",
15050            );
15051            let mut req = request.into_request();
15052            req.extensions_mut()
15053                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
15054            self.inner.unary(req, path, codec).await
15055        }
15056        /** Update a team's name and/or description.
15057 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15058*/
15059        pub async fn update_team(
15060            &mut self,
15061            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
15062        ) -> std::result::Result<
15063            tonic::Response<super::UpdateTeamResponse>,
15064            tonic::Status,
15065        > {
15066            self.inner
15067                .ready()
15068                .await
15069                .map_err(|e| {
15070                    tonic::Status::unknown(
15071                        format!("Service was not ready: {}", e.into()),
15072                    )
15073                })?;
15074            let codec = tonic_prost::ProstCodec::default();
15075            let path = http::uri::PathAndQuery::from_static(
15076                "/pidgr.v1.TeamService/UpdateTeam",
15077            );
15078            let mut req = request.into_request();
15079            req.extensions_mut()
15080                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
15081            self.inner.unary(req, path, codec).await
15082        }
15083        /** Delete a team and all its membership records. Default teams cannot be deleted.
15084 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15085*/
15086        pub async fn delete_team(
15087            &mut self,
15088            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
15089        ) -> std::result::Result<
15090            tonic::Response<super::DeleteTeamResponse>,
15091            tonic::Status,
15092        > {
15093            self.inner
15094                .ready()
15095                .await
15096                .map_err(|e| {
15097                    tonic::Status::unknown(
15098                        format!("Service was not ready: {}", e.into()),
15099                    )
15100                })?;
15101            let codec = tonic_prost::ProstCodec::default();
15102            let path = http::uri::PathAndQuery::from_static(
15103                "/pidgr.v1.TeamService/DeleteTeam",
15104            );
15105            let mut req = request.into_request();
15106            req.extensions_mut()
15107                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
15108            self.inner.unary(req, path, codec).await
15109        }
15110        /** Add one or more users to a team (idempotent).
15111 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15112*/
15113        pub async fn add_team_members(
15114            &mut self,
15115            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
15116        ) -> std::result::Result<
15117            tonic::Response<super::AddTeamMembersResponse>,
15118            tonic::Status,
15119        > {
15120            self.inner
15121                .ready()
15122                .await
15123                .map_err(|e| {
15124                    tonic::Status::unknown(
15125                        format!("Service was not ready: {}", e.into()),
15126                    )
15127                })?;
15128            let codec = tonic_prost::ProstCodec::default();
15129            let path = http::uri::PathAndQuery::from_static(
15130                "/pidgr.v1.TeamService/AddTeamMembers",
15131            );
15132            let mut req = request.into_request();
15133            req.extensions_mut()
15134                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
15135            self.inner.unary(req, path, codec).await
15136        }
15137        /** Remove one or more users from a team (idempotent).
15138 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15139*/
15140        pub async fn remove_team_members(
15141            &mut self,
15142            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
15143        ) -> std::result::Result<
15144            tonic::Response<super::RemoveTeamMembersResponse>,
15145            tonic::Status,
15146        > {
15147            self.inner
15148                .ready()
15149                .await
15150                .map_err(|e| {
15151                    tonic::Status::unknown(
15152                        format!("Service was not ready: {}", e.into()),
15153                    )
15154                })?;
15155            let codec = tonic_prost::ProstCodec::default();
15156            let path = http::uri::PathAndQuery::from_static(
15157                "/pidgr.v1.TeamService/RemoveTeamMembers",
15158            );
15159            let mut req = request.into_request();
15160            req.extensions_mut()
15161                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
15162            self.inner.unary(req, path, codec).await
15163        }
15164        /** List members of a team with pagination.
15165 Authorization: Caller must be a member of the team, or have
15166 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15167*/
15168        pub async fn list_team_members(
15169            &mut self,
15170            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
15171        ) -> std::result::Result<
15172            tonic::Response<super::ListTeamMembersResponse>,
15173            tonic::Status,
15174        > {
15175            self.inner
15176                .ready()
15177                .await
15178                .map_err(|e| {
15179                    tonic::Status::unknown(
15180                        format!("Service was not ready: {}", e.into()),
15181                    )
15182                })?;
15183            let codec = tonic_prost::ProstCodec::default();
15184            let path = http::uri::PathAndQuery::from_static(
15185                "/pidgr.v1.TeamService/ListTeamMembers",
15186            );
15187            let mut req = request.into_request();
15188            req.extensions_mut()
15189                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
15190            self.inner.unary(req, path, codec).await
15191        }
15192    }
15193}
15194/// Generated server implementations.
15195pub mod team_service_server {
15196    #![allow(
15197        unused_variables,
15198        dead_code,
15199        missing_docs,
15200        clippy::wildcard_imports,
15201        clippy::let_unit_value,
15202    )]
15203    use tonic::codegen::*;
15204    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
15205    #[async_trait]
15206    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
15207        /** Create a new team in the organization.
15208 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15209*/
15210        async fn create_team(
15211            &self,
15212            request: tonic::Request<super::CreateTeamRequest>,
15213        ) -> std::result::Result<
15214            tonic::Response<super::CreateTeamResponse>,
15215            tonic::Status,
15216        >;
15217        /** Retrieve a team by ID.
15218 Authorization: Caller must be a member of the team, or have
15219 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15220*/
15221        async fn get_team(
15222            &self,
15223            request: tonic::Request<super::GetTeamRequest>,
15224        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
15225        /** List teams in the organization with pagination.
15226 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15227*/
15228        async fn list_teams(
15229            &self,
15230            request: tonic::Request<super::ListTeamsRequest>,
15231        ) -> std::result::Result<
15232            tonic::Response<super::ListTeamsResponse>,
15233            tonic::Status,
15234        >;
15235        /** Update a team's name and/or description.
15236 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15237*/
15238        async fn update_team(
15239            &self,
15240            request: tonic::Request<super::UpdateTeamRequest>,
15241        ) -> std::result::Result<
15242            tonic::Response<super::UpdateTeamResponse>,
15243            tonic::Status,
15244        >;
15245        /** Delete a team and all its membership records. Default teams cannot be deleted.
15246 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15247*/
15248        async fn delete_team(
15249            &self,
15250            request: tonic::Request<super::DeleteTeamRequest>,
15251        ) -> std::result::Result<
15252            tonic::Response<super::DeleteTeamResponse>,
15253            tonic::Status,
15254        >;
15255        /** Add one or more users to a team (idempotent).
15256 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15257*/
15258        async fn add_team_members(
15259            &self,
15260            request: tonic::Request<super::AddTeamMembersRequest>,
15261        ) -> std::result::Result<
15262            tonic::Response<super::AddTeamMembersResponse>,
15263            tonic::Status,
15264        >;
15265        /** Remove one or more users from a team (idempotent).
15266 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15267*/
15268        async fn remove_team_members(
15269            &self,
15270            request: tonic::Request<super::RemoveTeamMembersRequest>,
15271        ) -> std::result::Result<
15272            tonic::Response<super::RemoveTeamMembersResponse>,
15273            tonic::Status,
15274        >;
15275        /** List members of a team with pagination.
15276 Authorization: Caller must be a member of the team, or have
15277 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15278*/
15279        async fn list_team_members(
15280            &self,
15281            request: tonic::Request<super::ListTeamMembersRequest>,
15282        ) -> std::result::Result<
15283            tonic::Response<super::ListTeamMembersResponse>,
15284            tonic::Status,
15285        >;
15286    }
15287    /** Manages organizational teams (departments, divisions) within an organization.
15288 Teams represent the organizational structure and can serve as sender identity.
15289 All RPCs operate within the caller's org (extracted from JWT).
15290*/
15291    #[derive(Debug)]
15292    pub struct TeamServiceServer<T> {
15293        inner: Arc<T>,
15294        accept_compression_encodings: EnabledCompressionEncodings,
15295        send_compression_encodings: EnabledCompressionEncodings,
15296        max_decoding_message_size: Option<usize>,
15297        max_encoding_message_size: Option<usize>,
15298    }
15299    impl<T> TeamServiceServer<T> {
15300        pub fn new(inner: T) -> Self {
15301            Self::from_arc(Arc::new(inner))
15302        }
15303        pub fn from_arc(inner: Arc<T>) -> Self {
15304            Self {
15305                inner,
15306                accept_compression_encodings: Default::default(),
15307                send_compression_encodings: Default::default(),
15308                max_decoding_message_size: None,
15309                max_encoding_message_size: None,
15310            }
15311        }
15312        pub fn with_interceptor<F>(
15313            inner: T,
15314            interceptor: F,
15315        ) -> InterceptedService<Self, F>
15316        where
15317            F: tonic::service::Interceptor,
15318        {
15319            InterceptedService::new(Self::new(inner), interceptor)
15320        }
15321        /// Enable decompressing requests with the given encoding.
15322        #[must_use]
15323        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15324            self.accept_compression_encodings.enable(encoding);
15325            self
15326        }
15327        /// Compress responses with the given encoding, if the client supports it.
15328        #[must_use]
15329        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15330            self.send_compression_encodings.enable(encoding);
15331            self
15332        }
15333        /// Limits the maximum size of a decoded message.
15334        ///
15335        /// Default: `4MB`
15336        #[must_use]
15337        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15338            self.max_decoding_message_size = Some(limit);
15339            self
15340        }
15341        /// Limits the maximum size of an encoded message.
15342        ///
15343        /// Default: `usize::MAX`
15344        #[must_use]
15345        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15346            self.max_encoding_message_size = Some(limit);
15347            self
15348        }
15349    }
15350    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15351    where
15352        T: TeamService,
15353        B: Body + std::marker::Send + 'static,
15354        B::Error: Into<StdError> + std::marker::Send + 'static,
15355    {
15356        type Response = http::Response<tonic::body::Body>;
15357        type Error = std::convert::Infallible;
15358        type Future = BoxFuture<Self::Response, Self::Error>;
15359        fn poll_ready(
15360            &mut self,
15361            _cx: &mut Context<'_>,
15362        ) -> Poll<std::result::Result<(), Self::Error>> {
15363            Poll::Ready(Ok(()))
15364        }
15365        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15366            match req.uri().path() {
15367                "/pidgr.v1.TeamService/CreateTeam" => {
15368                    #[allow(non_camel_case_types)]
15369                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15370                    impl<
15371                        T: TeamService,
15372                    > tonic::server::UnaryService<super::CreateTeamRequest>
15373                    for CreateTeamSvc<T> {
15374                        type Response = super::CreateTeamResponse;
15375                        type Future = BoxFuture<
15376                            tonic::Response<Self::Response>,
15377                            tonic::Status,
15378                        >;
15379                        fn call(
15380                            &mut self,
15381                            request: tonic::Request<super::CreateTeamRequest>,
15382                        ) -> Self::Future {
15383                            let inner = Arc::clone(&self.0);
15384                            let fut = async move {
15385                                <T as TeamService>::create_team(&inner, request).await
15386                            };
15387                            Box::pin(fut)
15388                        }
15389                    }
15390                    let accept_compression_encodings = self.accept_compression_encodings;
15391                    let send_compression_encodings = self.send_compression_encodings;
15392                    let max_decoding_message_size = self.max_decoding_message_size;
15393                    let max_encoding_message_size = self.max_encoding_message_size;
15394                    let inner = self.inner.clone();
15395                    let fut = async move {
15396                        let method = CreateTeamSvc(inner);
15397                        let codec = tonic_prost::ProstCodec::default();
15398                        let mut grpc = tonic::server::Grpc::new(codec)
15399                            .apply_compression_config(
15400                                accept_compression_encodings,
15401                                send_compression_encodings,
15402                            )
15403                            .apply_max_message_size_config(
15404                                max_decoding_message_size,
15405                                max_encoding_message_size,
15406                            );
15407                        let res = grpc.unary(method, req).await;
15408                        Ok(res)
15409                    };
15410                    Box::pin(fut)
15411                }
15412                "/pidgr.v1.TeamService/GetTeam" => {
15413                    #[allow(non_camel_case_types)]
15414                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15415                    impl<
15416                        T: TeamService,
15417                    > tonic::server::UnaryService<super::GetTeamRequest>
15418                    for GetTeamSvc<T> {
15419                        type Response = super::GetTeamResponse;
15420                        type Future = BoxFuture<
15421                            tonic::Response<Self::Response>,
15422                            tonic::Status,
15423                        >;
15424                        fn call(
15425                            &mut self,
15426                            request: tonic::Request<super::GetTeamRequest>,
15427                        ) -> Self::Future {
15428                            let inner = Arc::clone(&self.0);
15429                            let fut = async move {
15430                                <T as TeamService>::get_team(&inner, request).await
15431                            };
15432                            Box::pin(fut)
15433                        }
15434                    }
15435                    let accept_compression_encodings = self.accept_compression_encodings;
15436                    let send_compression_encodings = self.send_compression_encodings;
15437                    let max_decoding_message_size = self.max_decoding_message_size;
15438                    let max_encoding_message_size = self.max_encoding_message_size;
15439                    let inner = self.inner.clone();
15440                    let fut = async move {
15441                        let method = GetTeamSvc(inner);
15442                        let codec = tonic_prost::ProstCodec::default();
15443                        let mut grpc = tonic::server::Grpc::new(codec)
15444                            .apply_compression_config(
15445                                accept_compression_encodings,
15446                                send_compression_encodings,
15447                            )
15448                            .apply_max_message_size_config(
15449                                max_decoding_message_size,
15450                                max_encoding_message_size,
15451                            );
15452                        let res = grpc.unary(method, req).await;
15453                        Ok(res)
15454                    };
15455                    Box::pin(fut)
15456                }
15457                "/pidgr.v1.TeamService/ListTeams" => {
15458                    #[allow(non_camel_case_types)]
15459                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15460                    impl<
15461                        T: TeamService,
15462                    > tonic::server::UnaryService<super::ListTeamsRequest>
15463                    for ListTeamsSvc<T> {
15464                        type Response = super::ListTeamsResponse;
15465                        type Future = BoxFuture<
15466                            tonic::Response<Self::Response>,
15467                            tonic::Status,
15468                        >;
15469                        fn call(
15470                            &mut self,
15471                            request: tonic::Request<super::ListTeamsRequest>,
15472                        ) -> Self::Future {
15473                            let inner = Arc::clone(&self.0);
15474                            let fut = async move {
15475                                <T as TeamService>::list_teams(&inner, request).await
15476                            };
15477                            Box::pin(fut)
15478                        }
15479                    }
15480                    let accept_compression_encodings = self.accept_compression_encodings;
15481                    let send_compression_encodings = self.send_compression_encodings;
15482                    let max_decoding_message_size = self.max_decoding_message_size;
15483                    let max_encoding_message_size = self.max_encoding_message_size;
15484                    let inner = self.inner.clone();
15485                    let fut = async move {
15486                        let method = ListTeamsSvc(inner);
15487                        let codec = tonic_prost::ProstCodec::default();
15488                        let mut grpc = tonic::server::Grpc::new(codec)
15489                            .apply_compression_config(
15490                                accept_compression_encodings,
15491                                send_compression_encodings,
15492                            )
15493                            .apply_max_message_size_config(
15494                                max_decoding_message_size,
15495                                max_encoding_message_size,
15496                            );
15497                        let res = grpc.unary(method, req).await;
15498                        Ok(res)
15499                    };
15500                    Box::pin(fut)
15501                }
15502                "/pidgr.v1.TeamService/UpdateTeam" => {
15503                    #[allow(non_camel_case_types)]
15504                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15505                    impl<
15506                        T: TeamService,
15507                    > tonic::server::UnaryService<super::UpdateTeamRequest>
15508                    for UpdateTeamSvc<T> {
15509                        type Response = super::UpdateTeamResponse;
15510                        type Future = BoxFuture<
15511                            tonic::Response<Self::Response>,
15512                            tonic::Status,
15513                        >;
15514                        fn call(
15515                            &mut self,
15516                            request: tonic::Request<super::UpdateTeamRequest>,
15517                        ) -> Self::Future {
15518                            let inner = Arc::clone(&self.0);
15519                            let fut = async move {
15520                                <T as TeamService>::update_team(&inner, request).await
15521                            };
15522                            Box::pin(fut)
15523                        }
15524                    }
15525                    let accept_compression_encodings = self.accept_compression_encodings;
15526                    let send_compression_encodings = self.send_compression_encodings;
15527                    let max_decoding_message_size = self.max_decoding_message_size;
15528                    let max_encoding_message_size = self.max_encoding_message_size;
15529                    let inner = self.inner.clone();
15530                    let fut = async move {
15531                        let method = UpdateTeamSvc(inner);
15532                        let codec = tonic_prost::ProstCodec::default();
15533                        let mut grpc = tonic::server::Grpc::new(codec)
15534                            .apply_compression_config(
15535                                accept_compression_encodings,
15536                                send_compression_encodings,
15537                            )
15538                            .apply_max_message_size_config(
15539                                max_decoding_message_size,
15540                                max_encoding_message_size,
15541                            );
15542                        let res = grpc.unary(method, req).await;
15543                        Ok(res)
15544                    };
15545                    Box::pin(fut)
15546                }
15547                "/pidgr.v1.TeamService/DeleteTeam" => {
15548                    #[allow(non_camel_case_types)]
15549                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15550                    impl<
15551                        T: TeamService,
15552                    > tonic::server::UnaryService<super::DeleteTeamRequest>
15553                    for DeleteTeamSvc<T> {
15554                        type Response = super::DeleteTeamResponse;
15555                        type Future = BoxFuture<
15556                            tonic::Response<Self::Response>,
15557                            tonic::Status,
15558                        >;
15559                        fn call(
15560                            &mut self,
15561                            request: tonic::Request<super::DeleteTeamRequest>,
15562                        ) -> Self::Future {
15563                            let inner = Arc::clone(&self.0);
15564                            let fut = async move {
15565                                <T as TeamService>::delete_team(&inner, request).await
15566                            };
15567                            Box::pin(fut)
15568                        }
15569                    }
15570                    let accept_compression_encodings = self.accept_compression_encodings;
15571                    let send_compression_encodings = self.send_compression_encodings;
15572                    let max_decoding_message_size = self.max_decoding_message_size;
15573                    let max_encoding_message_size = self.max_encoding_message_size;
15574                    let inner = self.inner.clone();
15575                    let fut = async move {
15576                        let method = DeleteTeamSvc(inner);
15577                        let codec = tonic_prost::ProstCodec::default();
15578                        let mut grpc = tonic::server::Grpc::new(codec)
15579                            .apply_compression_config(
15580                                accept_compression_encodings,
15581                                send_compression_encodings,
15582                            )
15583                            .apply_max_message_size_config(
15584                                max_decoding_message_size,
15585                                max_encoding_message_size,
15586                            );
15587                        let res = grpc.unary(method, req).await;
15588                        Ok(res)
15589                    };
15590                    Box::pin(fut)
15591                }
15592                "/pidgr.v1.TeamService/AddTeamMembers" => {
15593                    #[allow(non_camel_case_types)]
15594                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15595                    impl<
15596                        T: TeamService,
15597                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
15598                    for AddTeamMembersSvc<T> {
15599                        type Response = super::AddTeamMembersResponse;
15600                        type Future = BoxFuture<
15601                            tonic::Response<Self::Response>,
15602                            tonic::Status,
15603                        >;
15604                        fn call(
15605                            &mut self,
15606                            request: tonic::Request<super::AddTeamMembersRequest>,
15607                        ) -> Self::Future {
15608                            let inner = Arc::clone(&self.0);
15609                            let fut = async move {
15610                                <T as TeamService>::add_team_members(&inner, request).await
15611                            };
15612                            Box::pin(fut)
15613                        }
15614                    }
15615                    let accept_compression_encodings = self.accept_compression_encodings;
15616                    let send_compression_encodings = self.send_compression_encodings;
15617                    let max_decoding_message_size = self.max_decoding_message_size;
15618                    let max_encoding_message_size = self.max_encoding_message_size;
15619                    let inner = self.inner.clone();
15620                    let fut = async move {
15621                        let method = AddTeamMembersSvc(inner);
15622                        let codec = tonic_prost::ProstCodec::default();
15623                        let mut grpc = tonic::server::Grpc::new(codec)
15624                            .apply_compression_config(
15625                                accept_compression_encodings,
15626                                send_compression_encodings,
15627                            )
15628                            .apply_max_message_size_config(
15629                                max_decoding_message_size,
15630                                max_encoding_message_size,
15631                            );
15632                        let res = grpc.unary(method, req).await;
15633                        Ok(res)
15634                    };
15635                    Box::pin(fut)
15636                }
15637                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15638                    #[allow(non_camel_case_types)]
15639                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15640                    impl<
15641                        T: TeamService,
15642                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15643                    for RemoveTeamMembersSvc<T> {
15644                        type Response = super::RemoveTeamMembersResponse;
15645                        type Future = BoxFuture<
15646                            tonic::Response<Self::Response>,
15647                            tonic::Status,
15648                        >;
15649                        fn call(
15650                            &mut self,
15651                            request: tonic::Request<super::RemoveTeamMembersRequest>,
15652                        ) -> Self::Future {
15653                            let inner = Arc::clone(&self.0);
15654                            let fut = async move {
15655                                <T as TeamService>::remove_team_members(&inner, request)
15656                                    .await
15657                            };
15658                            Box::pin(fut)
15659                        }
15660                    }
15661                    let accept_compression_encodings = self.accept_compression_encodings;
15662                    let send_compression_encodings = self.send_compression_encodings;
15663                    let max_decoding_message_size = self.max_decoding_message_size;
15664                    let max_encoding_message_size = self.max_encoding_message_size;
15665                    let inner = self.inner.clone();
15666                    let fut = async move {
15667                        let method = RemoveTeamMembersSvc(inner);
15668                        let codec = tonic_prost::ProstCodec::default();
15669                        let mut grpc = tonic::server::Grpc::new(codec)
15670                            .apply_compression_config(
15671                                accept_compression_encodings,
15672                                send_compression_encodings,
15673                            )
15674                            .apply_max_message_size_config(
15675                                max_decoding_message_size,
15676                                max_encoding_message_size,
15677                            );
15678                        let res = grpc.unary(method, req).await;
15679                        Ok(res)
15680                    };
15681                    Box::pin(fut)
15682                }
15683                "/pidgr.v1.TeamService/ListTeamMembers" => {
15684                    #[allow(non_camel_case_types)]
15685                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15686                    impl<
15687                        T: TeamService,
15688                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
15689                    for ListTeamMembersSvc<T> {
15690                        type Response = super::ListTeamMembersResponse;
15691                        type Future = BoxFuture<
15692                            tonic::Response<Self::Response>,
15693                            tonic::Status,
15694                        >;
15695                        fn call(
15696                            &mut self,
15697                            request: tonic::Request<super::ListTeamMembersRequest>,
15698                        ) -> Self::Future {
15699                            let inner = Arc::clone(&self.0);
15700                            let fut = async move {
15701                                <T as TeamService>::list_team_members(&inner, request).await
15702                            };
15703                            Box::pin(fut)
15704                        }
15705                    }
15706                    let accept_compression_encodings = self.accept_compression_encodings;
15707                    let send_compression_encodings = self.send_compression_encodings;
15708                    let max_decoding_message_size = self.max_decoding_message_size;
15709                    let max_encoding_message_size = self.max_encoding_message_size;
15710                    let inner = self.inner.clone();
15711                    let fut = async move {
15712                        let method = ListTeamMembersSvc(inner);
15713                        let codec = tonic_prost::ProstCodec::default();
15714                        let mut grpc = tonic::server::Grpc::new(codec)
15715                            .apply_compression_config(
15716                                accept_compression_encodings,
15717                                send_compression_encodings,
15718                            )
15719                            .apply_max_message_size_config(
15720                                max_decoding_message_size,
15721                                max_encoding_message_size,
15722                            );
15723                        let res = grpc.unary(method, req).await;
15724                        Ok(res)
15725                    };
15726                    Box::pin(fut)
15727                }
15728                _ => {
15729                    Box::pin(async move {
15730                        let mut response = http::Response::new(
15731                            tonic::body::Body::default(),
15732                        );
15733                        let headers = response.headers_mut();
15734                        headers
15735                            .insert(
15736                                tonic::Status::GRPC_STATUS,
15737                                (tonic::Code::Unimplemented as i32).into(),
15738                            );
15739                        headers
15740                            .insert(
15741                                http::header::CONTENT_TYPE,
15742                                tonic::metadata::GRPC_CONTENT_TYPE,
15743                            );
15744                        Ok(response)
15745                    })
15746                }
15747            }
15748        }
15749    }
15750    impl<T> Clone for TeamServiceServer<T> {
15751        fn clone(&self) -> Self {
15752            let inner = self.inner.clone();
15753            Self {
15754                inner,
15755                accept_compression_encodings: self.accept_compression_encodings,
15756                send_compression_encodings: self.send_compression_encodings,
15757                max_decoding_message_size: self.max_decoding_message_size,
15758                max_encoding_message_size: self.max_encoding_message_size,
15759            }
15760        }
15761    }
15762    /// Generated gRPC service name
15763    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
15764    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
15765        const NAME: &'static str = SERVICE_NAME;
15766    }
15767}
15768/// Generated client implementations.
15769pub mod template_service_client {
15770    #![allow(
15771        unused_variables,
15772        dead_code,
15773        missing_docs,
15774        clippy::wildcard_imports,
15775        clippy::let_unit_value,
15776    )]
15777    use tonic::codegen::*;
15778    use tonic::codegen::http::Uri;
15779    /** Manages versioned message templates used by campaigns.
15780 Templates are append-only — updates create new versions while preserving history.
15781*/
15782    #[derive(Debug, Clone)]
15783    pub struct TemplateServiceClient<T> {
15784        inner: tonic::client::Grpc<T>,
15785    }
15786    impl TemplateServiceClient<tonic::transport::Channel> {
15787        /// Attempt to create a new client by connecting to a given endpoint.
15788        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15789        where
15790            D: TryInto<tonic::transport::Endpoint>,
15791            D::Error: Into<StdError>,
15792        {
15793            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15794            Ok(Self::new(conn))
15795        }
15796    }
15797    impl<T> TemplateServiceClient<T>
15798    where
15799        T: tonic::client::GrpcService<tonic::body::Body>,
15800        T::Error: Into<StdError>,
15801        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15802        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15803    {
15804        pub fn new(inner: T) -> Self {
15805            let inner = tonic::client::Grpc::new(inner);
15806            Self { inner }
15807        }
15808        pub fn with_origin(inner: T, origin: Uri) -> Self {
15809            let inner = tonic::client::Grpc::with_origin(inner, origin);
15810            Self { inner }
15811        }
15812        pub fn with_interceptor<F>(
15813            inner: T,
15814            interceptor: F,
15815        ) -> TemplateServiceClient<InterceptedService<T, F>>
15816        where
15817            F: tonic::service::Interceptor,
15818            T::ResponseBody: Default,
15819            T: tonic::codegen::Service<
15820                http::Request<tonic::body::Body>,
15821                Response = http::Response<
15822                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15823                >,
15824            >,
15825            <T as tonic::codegen::Service<
15826                http::Request<tonic::body::Body>,
15827            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15828        {
15829            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
15830        }
15831        /// Compress requests with the given encoding.
15832        ///
15833        /// This requires the server to support it otherwise it might respond with an
15834        /// error.
15835        #[must_use]
15836        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15837            self.inner = self.inner.send_compressed(encoding);
15838            self
15839        }
15840        /// Enable decompressing responses.
15841        #[must_use]
15842        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15843            self.inner = self.inner.accept_compressed(encoding);
15844            self
15845        }
15846        /// Limits the maximum size of a decoded message.
15847        ///
15848        /// Default: `4MB`
15849        #[must_use]
15850        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15851            self.inner = self.inner.max_decoding_message_size(limit);
15852            self
15853        }
15854        /// Limits the maximum size of an encoded message.
15855        ///
15856        /// Default: `usize::MAX`
15857        #[must_use]
15858        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15859            self.inner = self.inner.max_encoding_message_size(limit);
15860            self
15861        }
15862        /** Create a new template with a body and variable definitions.
15863 Authorization: Requires MANAGER+ role.
15864*/
15865        pub async fn create_template(
15866            &mut self,
15867            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
15868        ) -> std::result::Result<
15869            tonic::Response<super::CreateTemplateResponse>,
15870            tonic::Status,
15871        > {
15872            self.inner
15873                .ready()
15874                .await
15875                .map_err(|e| {
15876                    tonic::Status::unknown(
15877                        format!("Service was not ready: {}", e.into()),
15878                    )
15879                })?;
15880            let codec = tonic_prost::ProstCodec::default();
15881            let path = http::uri::PathAndQuery::from_static(
15882                "/pidgr.v1.TemplateService/CreateTemplate",
15883            );
15884            let mut req = request.into_request();
15885            req.extensions_mut()
15886                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
15887            self.inner.unary(req, path, codec).await
15888        }
15889        /** Update an existing template, creating a new version.
15890 Authorization: Requires MANAGER+ role.
15891*/
15892        pub async fn update_template(
15893            &mut self,
15894            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
15895        ) -> std::result::Result<
15896            tonic::Response<super::UpdateTemplateResponse>,
15897            tonic::Status,
15898        > {
15899            self.inner
15900                .ready()
15901                .await
15902                .map_err(|e| {
15903                    tonic::Status::unknown(
15904                        format!("Service was not ready: {}", e.into()),
15905                    )
15906                })?;
15907            let codec = tonic_prost::ProstCodec::default();
15908            let path = http::uri::PathAndQuery::from_static(
15909                "/pidgr.v1.TemplateService/UpdateTemplate",
15910            );
15911            let mut req = request.into_request();
15912            req.extensions_mut()
15913                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
15914            self.inner.unary(req, path, codec).await
15915        }
15916        /** Retrieve a specific template by ID and optional version.
15917 Authorization: Authenticated user within the organization.
15918*/
15919        pub async fn get_template(
15920            &mut self,
15921            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
15922        ) -> std::result::Result<
15923            tonic::Response<super::GetTemplateResponse>,
15924            tonic::Status,
15925        > {
15926            self.inner
15927                .ready()
15928                .await
15929                .map_err(|e| {
15930                    tonic::Status::unknown(
15931                        format!("Service was not ready: {}", e.into()),
15932                    )
15933                })?;
15934            let codec = tonic_prost::ProstCodec::default();
15935            let path = http::uri::PathAndQuery::from_static(
15936                "/pidgr.v1.TemplateService/GetTemplate",
15937            );
15938            let mut req = request.into_request();
15939            req.extensions_mut()
15940                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
15941            self.inner.unary(req, path, codec).await
15942        }
15943        /** List all templates for the organization with pagination.
15944 Authorization: Authenticated user within the organization.
15945*/
15946        pub async fn list_templates(
15947            &mut self,
15948            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
15949        ) -> std::result::Result<
15950            tonic::Response<super::ListTemplatesResponse>,
15951            tonic::Status,
15952        > {
15953            self.inner
15954                .ready()
15955                .await
15956                .map_err(|e| {
15957                    tonic::Status::unknown(
15958                        format!("Service was not ready: {}", e.into()),
15959                    )
15960                })?;
15961            let codec = tonic_prost::ProstCodec::default();
15962            let path = http::uri::PathAndQuery::from_static(
15963                "/pidgr.v1.TemplateService/ListTemplates",
15964            );
15965            let mut req = request.into_request();
15966            req.extensions_mut()
15967                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
15968            self.inner.unary(req, path, codec).await
15969        }
15970        /** Create a locale-specific translation of a template.
15971 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15972*/
15973        pub async fn create_template_translation(
15974            &mut self,
15975            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
15976        ) -> std::result::Result<
15977            tonic::Response<super::CreateTemplateTranslationResponse>,
15978            tonic::Status,
15979        > {
15980            self.inner
15981                .ready()
15982                .await
15983                .map_err(|e| {
15984                    tonic::Status::unknown(
15985                        format!("Service was not ready: {}", e.into()),
15986                    )
15987                })?;
15988            let codec = tonic_prost::ProstCodec::default();
15989            let path = http::uri::PathAndQuery::from_static(
15990                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
15991            );
15992            let mut req = request.into_request();
15993            req.extensions_mut()
15994                .insert(
15995                    GrpcMethod::new(
15996                        "pidgr.v1.TemplateService",
15997                        "CreateTemplateTranslation",
15998                    ),
15999                );
16000            self.inner.unary(req, path, codec).await
16001        }
16002        /** Update an existing template translation.
16003 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16004*/
16005        pub async fn update_template_translation(
16006            &mut self,
16007            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
16008        ) -> std::result::Result<
16009            tonic::Response<super::UpdateTemplateTranslationResponse>,
16010            tonic::Status,
16011        > {
16012            self.inner
16013                .ready()
16014                .await
16015                .map_err(|e| {
16016                    tonic::Status::unknown(
16017                        format!("Service was not ready: {}", e.into()),
16018                    )
16019                })?;
16020            let codec = tonic_prost::ProstCodec::default();
16021            let path = http::uri::PathAndQuery::from_static(
16022                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
16023            );
16024            let mut req = request.into_request();
16025            req.extensions_mut()
16026                .insert(
16027                    GrpcMethod::new(
16028                        "pidgr.v1.TemplateService",
16029                        "UpdateTemplateTranslation",
16030                    ),
16031                );
16032            self.inner.unary(req, path, codec).await
16033        }
16034        /** List all translations for a template version.
16035 Authorization: Requires PERMISSION_TEMPLATES_READ.
16036*/
16037        pub async fn list_template_translations(
16038            &mut self,
16039            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
16040        ) -> std::result::Result<
16041            tonic::Response<super::ListTemplateTranslationsResponse>,
16042            tonic::Status,
16043        > {
16044            self.inner
16045                .ready()
16046                .await
16047                .map_err(|e| {
16048                    tonic::Status::unknown(
16049                        format!("Service was not ready: {}", e.into()),
16050                    )
16051                })?;
16052            let codec = tonic_prost::ProstCodec::default();
16053            let path = http::uri::PathAndQuery::from_static(
16054                "/pidgr.v1.TemplateService/ListTemplateTranslations",
16055            );
16056            let mut req = request.into_request();
16057            req.extensions_mut()
16058                .insert(
16059                    GrpcMethod::new(
16060                        "pidgr.v1.TemplateService",
16061                        "ListTemplateTranslations",
16062                    ),
16063                );
16064            self.inner.unary(req, path, codec).await
16065        }
16066        /** Approve a template translation for use in campaigns.
16067 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16068*/
16069        pub async fn approve_template_translation(
16070            &mut self,
16071            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
16072        ) -> std::result::Result<
16073            tonic::Response<super::ApproveTemplateTranslationResponse>,
16074            tonic::Status,
16075        > {
16076            self.inner
16077                .ready()
16078                .await
16079                .map_err(|e| {
16080                    tonic::Status::unknown(
16081                        format!("Service was not ready: {}", e.into()),
16082                    )
16083                })?;
16084            let codec = tonic_prost::ProstCodec::default();
16085            let path = http::uri::PathAndQuery::from_static(
16086                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
16087            );
16088            let mut req = request.into_request();
16089            req.extensions_mut()
16090                .insert(
16091                    GrpcMethod::new(
16092                        "pidgr.v1.TemplateService",
16093                        "ApproveTemplateTranslation",
16094                    ),
16095                );
16096            self.inner.unary(req, path, codec).await
16097        }
16098    }
16099}
16100/// Generated server implementations.
16101pub mod template_service_server {
16102    #![allow(
16103        unused_variables,
16104        dead_code,
16105        missing_docs,
16106        clippy::wildcard_imports,
16107        clippy::let_unit_value,
16108    )]
16109    use tonic::codegen::*;
16110    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
16111    #[async_trait]
16112    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
16113        /** Create a new template with a body and variable definitions.
16114 Authorization: Requires MANAGER+ role.
16115*/
16116        async fn create_template(
16117            &self,
16118            request: tonic::Request<super::CreateTemplateRequest>,
16119        ) -> std::result::Result<
16120            tonic::Response<super::CreateTemplateResponse>,
16121            tonic::Status,
16122        >;
16123        /** Update an existing template, creating a new version.
16124 Authorization: Requires MANAGER+ role.
16125*/
16126        async fn update_template(
16127            &self,
16128            request: tonic::Request<super::UpdateTemplateRequest>,
16129        ) -> std::result::Result<
16130            tonic::Response<super::UpdateTemplateResponse>,
16131            tonic::Status,
16132        >;
16133        /** Retrieve a specific template by ID and optional version.
16134 Authorization: Authenticated user within the organization.
16135*/
16136        async fn get_template(
16137            &self,
16138            request: tonic::Request<super::GetTemplateRequest>,
16139        ) -> std::result::Result<
16140            tonic::Response<super::GetTemplateResponse>,
16141            tonic::Status,
16142        >;
16143        /** List all templates for the organization with pagination.
16144 Authorization: Authenticated user within the organization.
16145*/
16146        async fn list_templates(
16147            &self,
16148            request: tonic::Request<super::ListTemplatesRequest>,
16149        ) -> std::result::Result<
16150            tonic::Response<super::ListTemplatesResponse>,
16151            tonic::Status,
16152        >;
16153        /** Create a locale-specific translation of a template.
16154 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16155*/
16156        async fn create_template_translation(
16157            &self,
16158            request: tonic::Request<super::CreateTemplateTranslationRequest>,
16159        ) -> std::result::Result<
16160            tonic::Response<super::CreateTemplateTranslationResponse>,
16161            tonic::Status,
16162        >;
16163        /** Update an existing template translation.
16164 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16165*/
16166        async fn update_template_translation(
16167            &self,
16168            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
16169        ) -> std::result::Result<
16170            tonic::Response<super::UpdateTemplateTranslationResponse>,
16171            tonic::Status,
16172        >;
16173        /** List all translations for a template version.
16174 Authorization: Requires PERMISSION_TEMPLATES_READ.
16175*/
16176        async fn list_template_translations(
16177            &self,
16178            request: tonic::Request<super::ListTemplateTranslationsRequest>,
16179        ) -> std::result::Result<
16180            tonic::Response<super::ListTemplateTranslationsResponse>,
16181            tonic::Status,
16182        >;
16183        /** Approve a template translation for use in campaigns.
16184 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16185*/
16186        async fn approve_template_translation(
16187            &self,
16188            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
16189        ) -> std::result::Result<
16190            tonic::Response<super::ApproveTemplateTranslationResponse>,
16191            tonic::Status,
16192        >;
16193    }
16194    /** Manages versioned message templates used by campaigns.
16195 Templates are append-only — updates create new versions while preserving history.
16196*/
16197    #[derive(Debug)]
16198    pub struct TemplateServiceServer<T> {
16199        inner: Arc<T>,
16200        accept_compression_encodings: EnabledCompressionEncodings,
16201        send_compression_encodings: EnabledCompressionEncodings,
16202        max_decoding_message_size: Option<usize>,
16203        max_encoding_message_size: Option<usize>,
16204    }
16205    impl<T> TemplateServiceServer<T> {
16206        pub fn new(inner: T) -> Self {
16207            Self::from_arc(Arc::new(inner))
16208        }
16209        pub fn from_arc(inner: Arc<T>) -> Self {
16210            Self {
16211                inner,
16212                accept_compression_encodings: Default::default(),
16213                send_compression_encodings: Default::default(),
16214                max_decoding_message_size: None,
16215                max_encoding_message_size: None,
16216            }
16217        }
16218        pub fn with_interceptor<F>(
16219            inner: T,
16220            interceptor: F,
16221        ) -> InterceptedService<Self, F>
16222        where
16223            F: tonic::service::Interceptor,
16224        {
16225            InterceptedService::new(Self::new(inner), interceptor)
16226        }
16227        /// Enable decompressing requests with the given encoding.
16228        #[must_use]
16229        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16230            self.accept_compression_encodings.enable(encoding);
16231            self
16232        }
16233        /// Compress responses with the given encoding, if the client supports it.
16234        #[must_use]
16235        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16236            self.send_compression_encodings.enable(encoding);
16237            self
16238        }
16239        /// Limits the maximum size of a decoded message.
16240        ///
16241        /// Default: `4MB`
16242        #[must_use]
16243        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16244            self.max_decoding_message_size = Some(limit);
16245            self
16246        }
16247        /// Limits the maximum size of an encoded message.
16248        ///
16249        /// Default: `usize::MAX`
16250        #[must_use]
16251        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16252            self.max_encoding_message_size = Some(limit);
16253            self
16254        }
16255    }
16256    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
16257    where
16258        T: TemplateService,
16259        B: Body + std::marker::Send + 'static,
16260        B::Error: Into<StdError> + std::marker::Send + 'static,
16261    {
16262        type Response = http::Response<tonic::body::Body>;
16263        type Error = std::convert::Infallible;
16264        type Future = BoxFuture<Self::Response, Self::Error>;
16265        fn poll_ready(
16266            &mut self,
16267            _cx: &mut Context<'_>,
16268        ) -> Poll<std::result::Result<(), Self::Error>> {
16269            Poll::Ready(Ok(()))
16270        }
16271        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16272            match req.uri().path() {
16273                "/pidgr.v1.TemplateService/CreateTemplate" => {
16274                    #[allow(non_camel_case_types)]
16275                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
16276                    impl<
16277                        T: TemplateService,
16278                    > tonic::server::UnaryService<super::CreateTemplateRequest>
16279                    for CreateTemplateSvc<T> {
16280                        type Response = super::CreateTemplateResponse;
16281                        type Future = BoxFuture<
16282                            tonic::Response<Self::Response>,
16283                            tonic::Status,
16284                        >;
16285                        fn call(
16286                            &mut self,
16287                            request: tonic::Request<super::CreateTemplateRequest>,
16288                        ) -> Self::Future {
16289                            let inner = Arc::clone(&self.0);
16290                            let fut = async move {
16291                                <T as TemplateService>::create_template(&inner, request)
16292                                    .await
16293                            };
16294                            Box::pin(fut)
16295                        }
16296                    }
16297                    let accept_compression_encodings = self.accept_compression_encodings;
16298                    let send_compression_encodings = self.send_compression_encodings;
16299                    let max_decoding_message_size = self.max_decoding_message_size;
16300                    let max_encoding_message_size = self.max_encoding_message_size;
16301                    let inner = self.inner.clone();
16302                    let fut = async move {
16303                        let method = CreateTemplateSvc(inner);
16304                        let codec = tonic_prost::ProstCodec::default();
16305                        let mut grpc = tonic::server::Grpc::new(codec)
16306                            .apply_compression_config(
16307                                accept_compression_encodings,
16308                                send_compression_encodings,
16309                            )
16310                            .apply_max_message_size_config(
16311                                max_decoding_message_size,
16312                                max_encoding_message_size,
16313                            );
16314                        let res = grpc.unary(method, req).await;
16315                        Ok(res)
16316                    };
16317                    Box::pin(fut)
16318                }
16319                "/pidgr.v1.TemplateService/UpdateTemplate" => {
16320                    #[allow(non_camel_case_types)]
16321                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
16322                    impl<
16323                        T: TemplateService,
16324                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
16325                    for UpdateTemplateSvc<T> {
16326                        type Response = super::UpdateTemplateResponse;
16327                        type Future = BoxFuture<
16328                            tonic::Response<Self::Response>,
16329                            tonic::Status,
16330                        >;
16331                        fn call(
16332                            &mut self,
16333                            request: tonic::Request<super::UpdateTemplateRequest>,
16334                        ) -> Self::Future {
16335                            let inner = Arc::clone(&self.0);
16336                            let fut = async move {
16337                                <T as TemplateService>::update_template(&inner, request)
16338                                    .await
16339                            };
16340                            Box::pin(fut)
16341                        }
16342                    }
16343                    let accept_compression_encodings = self.accept_compression_encodings;
16344                    let send_compression_encodings = self.send_compression_encodings;
16345                    let max_decoding_message_size = self.max_decoding_message_size;
16346                    let max_encoding_message_size = self.max_encoding_message_size;
16347                    let inner = self.inner.clone();
16348                    let fut = async move {
16349                        let method = UpdateTemplateSvc(inner);
16350                        let codec = tonic_prost::ProstCodec::default();
16351                        let mut grpc = tonic::server::Grpc::new(codec)
16352                            .apply_compression_config(
16353                                accept_compression_encodings,
16354                                send_compression_encodings,
16355                            )
16356                            .apply_max_message_size_config(
16357                                max_decoding_message_size,
16358                                max_encoding_message_size,
16359                            );
16360                        let res = grpc.unary(method, req).await;
16361                        Ok(res)
16362                    };
16363                    Box::pin(fut)
16364                }
16365                "/pidgr.v1.TemplateService/GetTemplate" => {
16366                    #[allow(non_camel_case_types)]
16367                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16368                    impl<
16369                        T: TemplateService,
16370                    > tonic::server::UnaryService<super::GetTemplateRequest>
16371                    for GetTemplateSvc<T> {
16372                        type Response = super::GetTemplateResponse;
16373                        type Future = BoxFuture<
16374                            tonic::Response<Self::Response>,
16375                            tonic::Status,
16376                        >;
16377                        fn call(
16378                            &mut self,
16379                            request: tonic::Request<super::GetTemplateRequest>,
16380                        ) -> Self::Future {
16381                            let inner = Arc::clone(&self.0);
16382                            let fut = async move {
16383                                <T as TemplateService>::get_template(&inner, request).await
16384                            };
16385                            Box::pin(fut)
16386                        }
16387                    }
16388                    let accept_compression_encodings = self.accept_compression_encodings;
16389                    let send_compression_encodings = self.send_compression_encodings;
16390                    let max_decoding_message_size = self.max_decoding_message_size;
16391                    let max_encoding_message_size = self.max_encoding_message_size;
16392                    let inner = self.inner.clone();
16393                    let fut = async move {
16394                        let method = GetTemplateSvc(inner);
16395                        let codec = tonic_prost::ProstCodec::default();
16396                        let mut grpc = tonic::server::Grpc::new(codec)
16397                            .apply_compression_config(
16398                                accept_compression_encodings,
16399                                send_compression_encodings,
16400                            )
16401                            .apply_max_message_size_config(
16402                                max_decoding_message_size,
16403                                max_encoding_message_size,
16404                            );
16405                        let res = grpc.unary(method, req).await;
16406                        Ok(res)
16407                    };
16408                    Box::pin(fut)
16409                }
16410                "/pidgr.v1.TemplateService/ListTemplates" => {
16411                    #[allow(non_camel_case_types)]
16412                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16413                    impl<
16414                        T: TemplateService,
16415                    > tonic::server::UnaryService<super::ListTemplatesRequest>
16416                    for ListTemplatesSvc<T> {
16417                        type Response = super::ListTemplatesResponse;
16418                        type Future = BoxFuture<
16419                            tonic::Response<Self::Response>,
16420                            tonic::Status,
16421                        >;
16422                        fn call(
16423                            &mut self,
16424                            request: tonic::Request<super::ListTemplatesRequest>,
16425                        ) -> Self::Future {
16426                            let inner = Arc::clone(&self.0);
16427                            let fut = async move {
16428                                <T as TemplateService>::list_templates(&inner, request)
16429                                    .await
16430                            };
16431                            Box::pin(fut)
16432                        }
16433                    }
16434                    let accept_compression_encodings = self.accept_compression_encodings;
16435                    let send_compression_encodings = self.send_compression_encodings;
16436                    let max_decoding_message_size = self.max_decoding_message_size;
16437                    let max_encoding_message_size = self.max_encoding_message_size;
16438                    let inner = self.inner.clone();
16439                    let fut = async move {
16440                        let method = ListTemplatesSvc(inner);
16441                        let codec = tonic_prost::ProstCodec::default();
16442                        let mut grpc = tonic::server::Grpc::new(codec)
16443                            .apply_compression_config(
16444                                accept_compression_encodings,
16445                                send_compression_encodings,
16446                            )
16447                            .apply_max_message_size_config(
16448                                max_decoding_message_size,
16449                                max_encoding_message_size,
16450                            );
16451                        let res = grpc.unary(method, req).await;
16452                        Ok(res)
16453                    };
16454                    Box::pin(fut)
16455                }
16456                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16457                    #[allow(non_camel_case_types)]
16458                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16459                    impl<
16460                        T: TemplateService,
16461                    > tonic::server::UnaryService<
16462                        super::CreateTemplateTranslationRequest,
16463                    > for CreateTemplateTranslationSvc<T> {
16464                        type Response = super::CreateTemplateTranslationResponse;
16465                        type Future = BoxFuture<
16466                            tonic::Response<Self::Response>,
16467                            tonic::Status,
16468                        >;
16469                        fn call(
16470                            &mut self,
16471                            request: tonic::Request<
16472                                super::CreateTemplateTranslationRequest,
16473                            >,
16474                        ) -> Self::Future {
16475                            let inner = Arc::clone(&self.0);
16476                            let fut = async move {
16477                                <T as TemplateService>::create_template_translation(
16478                                        &inner,
16479                                        request,
16480                                    )
16481                                    .await
16482                            };
16483                            Box::pin(fut)
16484                        }
16485                    }
16486                    let accept_compression_encodings = self.accept_compression_encodings;
16487                    let send_compression_encodings = self.send_compression_encodings;
16488                    let max_decoding_message_size = self.max_decoding_message_size;
16489                    let max_encoding_message_size = self.max_encoding_message_size;
16490                    let inner = self.inner.clone();
16491                    let fut = async move {
16492                        let method = CreateTemplateTranslationSvc(inner);
16493                        let codec = tonic_prost::ProstCodec::default();
16494                        let mut grpc = tonic::server::Grpc::new(codec)
16495                            .apply_compression_config(
16496                                accept_compression_encodings,
16497                                send_compression_encodings,
16498                            )
16499                            .apply_max_message_size_config(
16500                                max_decoding_message_size,
16501                                max_encoding_message_size,
16502                            );
16503                        let res = grpc.unary(method, req).await;
16504                        Ok(res)
16505                    };
16506                    Box::pin(fut)
16507                }
16508                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16509                    #[allow(non_camel_case_types)]
16510                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16511                    impl<
16512                        T: TemplateService,
16513                    > tonic::server::UnaryService<
16514                        super::UpdateTemplateTranslationRequest,
16515                    > for UpdateTemplateTranslationSvc<T> {
16516                        type Response = super::UpdateTemplateTranslationResponse;
16517                        type Future = BoxFuture<
16518                            tonic::Response<Self::Response>,
16519                            tonic::Status,
16520                        >;
16521                        fn call(
16522                            &mut self,
16523                            request: tonic::Request<
16524                                super::UpdateTemplateTranslationRequest,
16525                            >,
16526                        ) -> Self::Future {
16527                            let inner = Arc::clone(&self.0);
16528                            let fut = async move {
16529                                <T as TemplateService>::update_template_translation(
16530                                        &inner,
16531                                        request,
16532                                    )
16533                                    .await
16534                            };
16535                            Box::pin(fut)
16536                        }
16537                    }
16538                    let accept_compression_encodings = self.accept_compression_encodings;
16539                    let send_compression_encodings = self.send_compression_encodings;
16540                    let max_decoding_message_size = self.max_decoding_message_size;
16541                    let max_encoding_message_size = self.max_encoding_message_size;
16542                    let inner = self.inner.clone();
16543                    let fut = async move {
16544                        let method = UpdateTemplateTranslationSvc(inner);
16545                        let codec = tonic_prost::ProstCodec::default();
16546                        let mut grpc = tonic::server::Grpc::new(codec)
16547                            .apply_compression_config(
16548                                accept_compression_encodings,
16549                                send_compression_encodings,
16550                            )
16551                            .apply_max_message_size_config(
16552                                max_decoding_message_size,
16553                                max_encoding_message_size,
16554                            );
16555                        let res = grpc.unary(method, req).await;
16556                        Ok(res)
16557                    };
16558                    Box::pin(fut)
16559                }
16560                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16561                    #[allow(non_camel_case_types)]
16562                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16563                    impl<
16564                        T: TemplateService,
16565                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16566                    for ListTemplateTranslationsSvc<T> {
16567                        type Response = super::ListTemplateTranslationsResponse;
16568                        type Future = BoxFuture<
16569                            tonic::Response<Self::Response>,
16570                            tonic::Status,
16571                        >;
16572                        fn call(
16573                            &mut self,
16574                            request: tonic::Request<
16575                                super::ListTemplateTranslationsRequest,
16576                            >,
16577                        ) -> Self::Future {
16578                            let inner = Arc::clone(&self.0);
16579                            let fut = async move {
16580                                <T as TemplateService>::list_template_translations(
16581                                        &inner,
16582                                        request,
16583                                    )
16584                                    .await
16585                            };
16586                            Box::pin(fut)
16587                        }
16588                    }
16589                    let accept_compression_encodings = self.accept_compression_encodings;
16590                    let send_compression_encodings = self.send_compression_encodings;
16591                    let max_decoding_message_size = self.max_decoding_message_size;
16592                    let max_encoding_message_size = self.max_encoding_message_size;
16593                    let inner = self.inner.clone();
16594                    let fut = async move {
16595                        let method = ListTemplateTranslationsSvc(inner);
16596                        let codec = tonic_prost::ProstCodec::default();
16597                        let mut grpc = tonic::server::Grpc::new(codec)
16598                            .apply_compression_config(
16599                                accept_compression_encodings,
16600                                send_compression_encodings,
16601                            )
16602                            .apply_max_message_size_config(
16603                                max_decoding_message_size,
16604                                max_encoding_message_size,
16605                            );
16606                        let res = grpc.unary(method, req).await;
16607                        Ok(res)
16608                    };
16609                    Box::pin(fut)
16610                }
16611                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16612                    #[allow(non_camel_case_types)]
16613                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16614                    impl<
16615                        T: TemplateService,
16616                    > tonic::server::UnaryService<
16617                        super::ApproveTemplateTranslationRequest,
16618                    > for ApproveTemplateTranslationSvc<T> {
16619                        type Response = super::ApproveTemplateTranslationResponse;
16620                        type Future = BoxFuture<
16621                            tonic::Response<Self::Response>,
16622                            tonic::Status,
16623                        >;
16624                        fn call(
16625                            &mut self,
16626                            request: tonic::Request<
16627                                super::ApproveTemplateTranslationRequest,
16628                            >,
16629                        ) -> Self::Future {
16630                            let inner = Arc::clone(&self.0);
16631                            let fut = async move {
16632                                <T as TemplateService>::approve_template_translation(
16633                                        &inner,
16634                                        request,
16635                                    )
16636                                    .await
16637                            };
16638                            Box::pin(fut)
16639                        }
16640                    }
16641                    let accept_compression_encodings = self.accept_compression_encodings;
16642                    let send_compression_encodings = self.send_compression_encodings;
16643                    let max_decoding_message_size = self.max_decoding_message_size;
16644                    let max_encoding_message_size = self.max_encoding_message_size;
16645                    let inner = self.inner.clone();
16646                    let fut = async move {
16647                        let method = ApproveTemplateTranslationSvc(inner);
16648                        let codec = tonic_prost::ProstCodec::default();
16649                        let mut grpc = tonic::server::Grpc::new(codec)
16650                            .apply_compression_config(
16651                                accept_compression_encodings,
16652                                send_compression_encodings,
16653                            )
16654                            .apply_max_message_size_config(
16655                                max_decoding_message_size,
16656                                max_encoding_message_size,
16657                            );
16658                        let res = grpc.unary(method, req).await;
16659                        Ok(res)
16660                    };
16661                    Box::pin(fut)
16662                }
16663                _ => {
16664                    Box::pin(async move {
16665                        let mut response = http::Response::new(
16666                            tonic::body::Body::default(),
16667                        );
16668                        let headers = response.headers_mut();
16669                        headers
16670                            .insert(
16671                                tonic::Status::GRPC_STATUS,
16672                                (tonic::Code::Unimplemented as i32).into(),
16673                            );
16674                        headers
16675                            .insert(
16676                                http::header::CONTENT_TYPE,
16677                                tonic::metadata::GRPC_CONTENT_TYPE,
16678                            );
16679                        Ok(response)
16680                    })
16681                }
16682            }
16683        }
16684    }
16685    impl<T> Clone for TemplateServiceServer<T> {
16686        fn clone(&self) -> Self {
16687            let inner = self.inner.clone();
16688            Self {
16689                inner,
16690                accept_compression_encodings: self.accept_compression_encodings,
16691                send_compression_encodings: self.send_compression_encodings,
16692                max_decoding_message_size: self.max_decoding_message_size,
16693                max_encoding_message_size: self.max_encoding_message_size,
16694            }
16695        }
16696    }
16697    /// Generated gRPC service name
16698    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16699    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16700        const NAME: &'static str = SERVICE_NAME;
16701    }
16702}
16703/// Generated client implementations.
16704pub mod token_service_client {
16705    #![allow(
16706        unused_variables,
16707        dead_code,
16708        missing_docs,
16709        clippy::wildcard_imports,
16710        clippy::let_unit_value,
16711    )]
16712    use tonic::codegen::*;
16713    use tonic::codegen::http::Uri;
16714    /** HMAC-signed deeplink-token signing and validation.
16715
16716 Deeplink tokens carry the (campaign, recipient, step) tuple that
16717 authorizes a third-party-channel deeplink
16718 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16719 pidgr-api with a per-org HMAC key managed by the platform's key store;
16720 rotation is automatic with a 7-day overlap window so callers do not
16721 have to coordinate.
16722*/
16723    #[derive(Debug, Clone)]
16724    pub struct TokenServiceClient<T> {
16725        inner: tonic::client::Grpc<T>,
16726    }
16727    impl TokenServiceClient<tonic::transport::Channel> {
16728        /// Attempt to create a new client by connecting to a given endpoint.
16729        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16730        where
16731            D: TryInto<tonic::transport::Endpoint>,
16732            D::Error: Into<StdError>,
16733        {
16734            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16735            Ok(Self::new(conn))
16736        }
16737    }
16738    impl<T> TokenServiceClient<T>
16739    where
16740        T: tonic::client::GrpcService<tonic::body::Body>,
16741        T::Error: Into<StdError>,
16742        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16743        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16744    {
16745        pub fn new(inner: T) -> Self {
16746            let inner = tonic::client::Grpc::new(inner);
16747            Self { inner }
16748        }
16749        pub fn with_origin(inner: T, origin: Uri) -> Self {
16750            let inner = tonic::client::Grpc::with_origin(inner, origin);
16751            Self { inner }
16752        }
16753        pub fn with_interceptor<F>(
16754            inner: T,
16755            interceptor: F,
16756        ) -> TokenServiceClient<InterceptedService<T, F>>
16757        where
16758            F: tonic::service::Interceptor,
16759            T::ResponseBody: Default,
16760            T: tonic::codegen::Service<
16761                http::Request<tonic::body::Body>,
16762                Response = http::Response<
16763                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16764                >,
16765            >,
16766            <T as tonic::codegen::Service<
16767                http::Request<tonic::body::Body>,
16768            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16769        {
16770            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
16771        }
16772        /// Compress requests with the given encoding.
16773        ///
16774        /// This requires the server to support it otherwise it might respond with an
16775        /// error.
16776        #[must_use]
16777        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16778            self.inner = self.inner.send_compressed(encoding);
16779            self
16780        }
16781        /// Enable decompressing responses.
16782        #[must_use]
16783        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16784            self.inner = self.inner.accept_compressed(encoding);
16785            self
16786        }
16787        /// Limits the maximum size of a decoded message.
16788        ///
16789        /// Default: `4MB`
16790        #[must_use]
16791        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16792            self.inner = self.inner.max_decoding_message_size(limit);
16793            self
16794        }
16795        /// Limits the maximum size of an encoded message.
16796        ///
16797        /// Default: `usize::MAX`
16798        #[must_use]
16799        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16800            self.inner = self.inner.max_encoding_message_size(limit);
16801            self
16802        }
16803        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16804 the dispatch layer assembling a deeplink during message
16805 composition).
16806*/
16807        pub async fn sign_deeplink_token(
16808            &mut self,
16809            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
16810        ) -> std::result::Result<
16811            tonic::Response<super::SignDeeplinkTokenResponse>,
16812            tonic::Status,
16813        > {
16814            self.inner
16815                .ready()
16816                .await
16817                .map_err(|e| {
16818                    tonic::Status::unknown(
16819                        format!("Service was not ready: {}", e.into()),
16820                    )
16821                })?;
16822            let codec = tonic_prost::ProstCodec::default();
16823            let path = http::uri::PathAndQuery::from_static(
16824                "/pidgr.v1.TokenService/SignDeeplinkToken",
16825            );
16826            let mut req = request.into_request();
16827            req.extensions_mut()
16828                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
16829            self.inner.unary(req, path, codec).await
16830        }
16831        /** Validate a deeplink token. Authorization: unauthenticated (caller
16832 is the native app validating before showing the auth gate). The
16833 token IS the lookup key; valid responses carry the decoded payload.
16834*/
16835        pub async fn validate_deeplink_token(
16836            &mut self,
16837            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
16838        ) -> std::result::Result<
16839            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16840            tonic::Status,
16841        > {
16842            self.inner
16843                .ready()
16844                .await
16845                .map_err(|e| {
16846                    tonic::Status::unknown(
16847                        format!("Service was not ready: {}", e.into()),
16848                    )
16849                })?;
16850            let codec = tonic_prost::ProstCodec::default();
16851            let path = http::uri::PathAndQuery::from_static(
16852                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
16853            );
16854            let mut req = request.into_request();
16855            req.extensions_mut()
16856                .insert(
16857                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
16858                );
16859            self.inner.unary(req, path, codec).await
16860        }
16861    }
16862}
16863/// Generated server implementations.
16864pub mod token_service_server {
16865    #![allow(
16866        unused_variables,
16867        dead_code,
16868        missing_docs,
16869        clippy::wildcard_imports,
16870        clippy::let_unit_value,
16871    )]
16872    use tonic::codegen::*;
16873    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
16874    #[async_trait]
16875    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
16876        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16877 the dispatch layer assembling a deeplink during message
16878 composition).
16879*/
16880        async fn sign_deeplink_token(
16881            &self,
16882            request: tonic::Request<super::SignDeeplinkTokenRequest>,
16883        ) -> std::result::Result<
16884            tonic::Response<super::SignDeeplinkTokenResponse>,
16885            tonic::Status,
16886        >;
16887        /** Validate a deeplink token. Authorization: unauthenticated (caller
16888 is the native app validating before showing the auth gate). The
16889 token IS the lookup key; valid responses carry the decoded payload.
16890*/
16891        async fn validate_deeplink_token(
16892            &self,
16893            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16894        ) -> std::result::Result<
16895            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16896            tonic::Status,
16897        >;
16898    }
16899    /** HMAC-signed deeplink-token signing and validation.
16900
16901 Deeplink tokens carry the (campaign, recipient, step) tuple that
16902 authorizes a third-party-channel deeplink
16903 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16904 pidgr-api with a per-org HMAC key managed by the platform's key store;
16905 rotation is automatic with a 7-day overlap window so callers do not
16906 have to coordinate.
16907*/
16908    #[derive(Debug)]
16909    pub struct TokenServiceServer<T> {
16910        inner: Arc<T>,
16911        accept_compression_encodings: EnabledCompressionEncodings,
16912        send_compression_encodings: EnabledCompressionEncodings,
16913        max_decoding_message_size: Option<usize>,
16914        max_encoding_message_size: Option<usize>,
16915    }
16916    impl<T> TokenServiceServer<T> {
16917        pub fn new(inner: T) -> Self {
16918            Self::from_arc(Arc::new(inner))
16919        }
16920        pub fn from_arc(inner: Arc<T>) -> Self {
16921            Self {
16922                inner,
16923                accept_compression_encodings: Default::default(),
16924                send_compression_encodings: Default::default(),
16925                max_decoding_message_size: None,
16926                max_encoding_message_size: None,
16927            }
16928        }
16929        pub fn with_interceptor<F>(
16930            inner: T,
16931            interceptor: F,
16932        ) -> InterceptedService<Self, F>
16933        where
16934            F: tonic::service::Interceptor,
16935        {
16936            InterceptedService::new(Self::new(inner), interceptor)
16937        }
16938        /// Enable decompressing requests with the given encoding.
16939        #[must_use]
16940        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16941            self.accept_compression_encodings.enable(encoding);
16942            self
16943        }
16944        /// Compress responses with the given encoding, if the client supports it.
16945        #[must_use]
16946        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16947            self.send_compression_encodings.enable(encoding);
16948            self
16949        }
16950        /// Limits the maximum size of a decoded message.
16951        ///
16952        /// Default: `4MB`
16953        #[must_use]
16954        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16955            self.max_decoding_message_size = Some(limit);
16956            self
16957        }
16958        /// Limits the maximum size of an encoded message.
16959        ///
16960        /// Default: `usize::MAX`
16961        #[must_use]
16962        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16963            self.max_encoding_message_size = Some(limit);
16964            self
16965        }
16966    }
16967    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
16968    where
16969        T: TokenService,
16970        B: Body + std::marker::Send + 'static,
16971        B::Error: Into<StdError> + std::marker::Send + 'static,
16972    {
16973        type Response = http::Response<tonic::body::Body>;
16974        type Error = std::convert::Infallible;
16975        type Future = BoxFuture<Self::Response, Self::Error>;
16976        fn poll_ready(
16977            &mut self,
16978            _cx: &mut Context<'_>,
16979        ) -> Poll<std::result::Result<(), Self::Error>> {
16980            Poll::Ready(Ok(()))
16981        }
16982        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16983            match req.uri().path() {
16984                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
16985                    #[allow(non_camel_case_types)]
16986                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16987                    impl<
16988                        T: TokenService,
16989                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
16990                    for SignDeeplinkTokenSvc<T> {
16991                        type Response = super::SignDeeplinkTokenResponse;
16992                        type Future = BoxFuture<
16993                            tonic::Response<Self::Response>,
16994                            tonic::Status,
16995                        >;
16996                        fn call(
16997                            &mut self,
16998                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
16999                        ) -> Self::Future {
17000                            let inner = Arc::clone(&self.0);
17001                            let fut = async move {
17002                                <T as TokenService>::sign_deeplink_token(&inner, request)
17003                                    .await
17004                            };
17005                            Box::pin(fut)
17006                        }
17007                    }
17008                    let accept_compression_encodings = self.accept_compression_encodings;
17009                    let send_compression_encodings = self.send_compression_encodings;
17010                    let max_decoding_message_size = self.max_decoding_message_size;
17011                    let max_encoding_message_size = self.max_encoding_message_size;
17012                    let inner = self.inner.clone();
17013                    let fut = async move {
17014                        let method = SignDeeplinkTokenSvc(inner);
17015                        let codec = tonic_prost::ProstCodec::default();
17016                        let mut grpc = tonic::server::Grpc::new(codec)
17017                            .apply_compression_config(
17018                                accept_compression_encodings,
17019                                send_compression_encodings,
17020                            )
17021                            .apply_max_message_size_config(
17022                                max_decoding_message_size,
17023                                max_encoding_message_size,
17024                            );
17025                        let res = grpc.unary(method, req).await;
17026                        Ok(res)
17027                    };
17028                    Box::pin(fut)
17029                }
17030                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
17031                    #[allow(non_camel_case_types)]
17032                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17033                    impl<
17034                        T: TokenService,
17035                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
17036                    for ValidateDeeplinkTokenSvc<T> {
17037                        type Response = super::ValidateDeeplinkTokenResponse;
17038                        type Future = BoxFuture<
17039                            tonic::Response<Self::Response>,
17040                            tonic::Status,
17041                        >;
17042                        fn call(
17043                            &mut self,
17044                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17045                        ) -> Self::Future {
17046                            let inner = Arc::clone(&self.0);
17047                            let fut = async move {
17048                                <T as TokenService>::validate_deeplink_token(
17049                                        &inner,
17050                                        request,
17051                                    )
17052                                    .await
17053                            };
17054                            Box::pin(fut)
17055                        }
17056                    }
17057                    let accept_compression_encodings = self.accept_compression_encodings;
17058                    let send_compression_encodings = self.send_compression_encodings;
17059                    let max_decoding_message_size = self.max_decoding_message_size;
17060                    let max_encoding_message_size = self.max_encoding_message_size;
17061                    let inner = self.inner.clone();
17062                    let fut = async move {
17063                        let method = ValidateDeeplinkTokenSvc(inner);
17064                        let codec = tonic_prost::ProstCodec::default();
17065                        let mut grpc = tonic::server::Grpc::new(codec)
17066                            .apply_compression_config(
17067                                accept_compression_encodings,
17068                                send_compression_encodings,
17069                            )
17070                            .apply_max_message_size_config(
17071                                max_decoding_message_size,
17072                                max_encoding_message_size,
17073                            );
17074                        let res = grpc.unary(method, req).await;
17075                        Ok(res)
17076                    };
17077                    Box::pin(fut)
17078                }
17079                _ => {
17080                    Box::pin(async move {
17081                        let mut response = http::Response::new(
17082                            tonic::body::Body::default(),
17083                        );
17084                        let headers = response.headers_mut();
17085                        headers
17086                            .insert(
17087                                tonic::Status::GRPC_STATUS,
17088                                (tonic::Code::Unimplemented as i32).into(),
17089                            );
17090                        headers
17091                            .insert(
17092                                http::header::CONTENT_TYPE,
17093                                tonic::metadata::GRPC_CONTENT_TYPE,
17094                            );
17095                        Ok(response)
17096                    })
17097                }
17098            }
17099        }
17100    }
17101    impl<T> Clone for TokenServiceServer<T> {
17102        fn clone(&self) -> Self {
17103            let inner = self.inner.clone();
17104            Self {
17105                inner,
17106                accept_compression_encodings: self.accept_compression_encodings,
17107                send_compression_encodings: self.send_compression_encodings,
17108                max_decoding_message_size: self.max_decoding_message_size,
17109                max_encoding_message_size: self.max_encoding_message_size,
17110            }
17111        }
17112    }
17113    /// Generated gRPC service name
17114    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
17115    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
17116        const NAME: &'static str = SERVICE_NAME;
17117    }
17118}