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        /** Check whether an organization is currently suspended. Serving backends
3132 may answer from a short-TTL cache, so callers can observe bounded
3133 staleness after a suspension state change.
3134*/
3135        pub async fn check_org_suspended(
3136            &mut self,
3137            request: impl tonic::IntoRequest<super::CheckOrgSuspendedRequest>,
3138        ) -> std::result::Result<
3139            tonic::Response<super::CheckOrgSuspendedResponse>,
3140            tonic::Status,
3141        > {
3142            self.inner
3143                .ready()
3144                .await
3145                .map_err(|e| {
3146                    tonic::Status::unknown(
3147                        format!("Service was not ready: {}", e.into()),
3148                    )
3149                })?;
3150            let codec = tonic_prost::ProstCodec::default();
3151            let path = http::uri::PathAndQuery::from_static(
3152                "/pidgr.v1.AuthorizationService/CheckOrgSuspended",
3153            );
3154            let mut req = request.into_request();
3155            req.extensions_mut()
3156                .insert(
3157                    GrpcMethod::new("pidgr.v1.AuthorizationService", "CheckOrgSuspended"),
3158                );
3159            self.inner.unary(req, path, codec).await
3160        }
3161    }
3162}
3163/// Generated server implementations.
3164pub mod authorization_service_server {
3165    #![allow(
3166        unused_variables,
3167        dead_code,
3168        missing_docs,
3169        clippy::wildcard_imports,
3170        clippy::let_unit_value,
3171    )]
3172    use tonic::codegen::*;
3173    /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer.
3174    #[async_trait]
3175    pub trait AuthorizationService: std::marker::Send + std::marker::Sync + 'static {
3176        /** Resolve the effective permissions for one (subject, org, principal type).
3177*/
3178        async fn resolve_principal_permissions(
3179            &self,
3180            request: tonic::Request<super::ResolvePrincipalPermissionsRequest>,
3181        ) -> std::result::Result<
3182            tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3183            tonic::Status,
3184        >;
3185        /** Check whether an organization is currently suspended. Serving backends
3186 may answer from a short-TTL cache, so callers can observe bounded
3187 staleness after a suspension state change.
3188*/
3189        async fn check_org_suspended(
3190            &self,
3191            request: tonic::Request<super::CheckOrgSuspendedRequest>,
3192        ) -> std::result::Result<
3193            tonic::Response<super::CheckOrgSuspendedResponse>,
3194            tonic::Status,
3195        >;
3196    }
3197    /** AuthorizationService resolves the effective permission set for a principal
3198 so a resource server can make authorization decisions without owning the
3199 role and permission data itself.
3200
3201 AUTH: INTERNAL service-to-service only. This service is served by the core
3202 API and called by other backend services. It MUST NOT be exposed on the
3203 public ingress to JWT-authenticated end-user clients.
3204*/
3205    #[derive(Debug)]
3206    pub struct AuthorizationServiceServer<T> {
3207        inner: Arc<T>,
3208        accept_compression_encodings: EnabledCompressionEncodings,
3209        send_compression_encodings: EnabledCompressionEncodings,
3210        max_decoding_message_size: Option<usize>,
3211        max_encoding_message_size: Option<usize>,
3212    }
3213    impl<T> AuthorizationServiceServer<T> {
3214        pub fn new(inner: T) -> Self {
3215            Self::from_arc(Arc::new(inner))
3216        }
3217        pub fn from_arc(inner: Arc<T>) -> Self {
3218            Self {
3219                inner,
3220                accept_compression_encodings: Default::default(),
3221                send_compression_encodings: Default::default(),
3222                max_decoding_message_size: None,
3223                max_encoding_message_size: None,
3224            }
3225        }
3226        pub fn with_interceptor<F>(
3227            inner: T,
3228            interceptor: F,
3229        ) -> InterceptedService<Self, F>
3230        where
3231            F: tonic::service::Interceptor,
3232        {
3233            InterceptedService::new(Self::new(inner), interceptor)
3234        }
3235        /// Enable decompressing requests with the given encoding.
3236        #[must_use]
3237        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3238            self.accept_compression_encodings.enable(encoding);
3239            self
3240        }
3241        /// Compress responses with the given encoding, if the client supports it.
3242        #[must_use]
3243        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3244            self.send_compression_encodings.enable(encoding);
3245            self
3246        }
3247        /// Limits the maximum size of a decoded message.
3248        ///
3249        /// Default: `4MB`
3250        #[must_use]
3251        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3252            self.max_decoding_message_size = Some(limit);
3253            self
3254        }
3255        /// Limits the maximum size of an encoded message.
3256        ///
3257        /// Default: `usize::MAX`
3258        #[must_use]
3259        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3260            self.max_encoding_message_size = Some(limit);
3261            self
3262        }
3263    }
3264    impl<T, B> tonic::codegen::Service<http::Request<B>>
3265    for AuthorizationServiceServer<T>
3266    where
3267        T: AuthorizationService,
3268        B: Body + std::marker::Send + 'static,
3269        B::Error: Into<StdError> + std::marker::Send + 'static,
3270    {
3271        type Response = http::Response<tonic::body::Body>;
3272        type Error = std::convert::Infallible;
3273        type Future = BoxFuture<Self::Response, Self::Error>;
3274        fn poll_ready(
3275            &mut self,
3276            _cx: &mut Context<'_>,
3277        ) -> Poll<std::result::Result<(), Self::Error>> {
3278            Poll::Ready(Ok(()))
3279        }
3280        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3281            match req.uri().path() {
3282                "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions" => {
3283                    #[allow(non_camel_case_types)]
3284                    struct ResolvePrincipalPermissionsSvc<T: AuthorizationService>(
3285                        pub Arc<T>,
3286                    );
3287                    impl<
3288                        T: AuthorizationService,
3289                    > tonic::server::UnaryService<
3290                        super::ResolvePrincipalPermissionsRequest,
3291                    > for ResolvePrincipalPermissionsSvc<T> {
3292                        type Response = super::ResolvePrincipalPermissionsResponse;
3293                        type Future = BoxFuture<
3294                            tonic::Response<Self::Response>,
3295                            tonic::Status,
3296                        >;
3297                        fn call(
3298                            &mut self,
3299                            request: tonic::Request<
3300                                super::ResolvePrincipalPermissionsRequest,
3301                            >,
3302                        ) -> Self::Future {
3303                            let inner = Arc::clone(&self.0);
3304                            let fut = async move {
3305                                <T as AuthorizationService>::resolve_principal_permissions(
3306                                        &inner,
3307                                        request,
3308                                    )
3309                                    .await
3310                            };
3311                            Box::pin(fut)
3312                        }
3313                    }
3314                    let accept_compression_encodings = self.accept_compression_encodings;
3315                    let send_compression_encodings = self.send_compression_encodings;
3316                    let max_decoding_message_size = self.max_decoding_message_size;
3317                    let max_encoding_message_size = self.max_encoding_message_size;
3318                    let inner = self.inner.clone();
3319                    let fut = async move {
3320                        let method = ResolvePrincipalPermissionsSvc(inner);
3321                        let codec = tonic_prost::ProstCodec::default();
3322                        let mut grpc = tonic::server::Grpc::new(codec)
3323                            .apply_compression_config(
3324                                accept_compression_encodings,
3325                                send_compression_encodings,
3326                            )
3327                            .apply_max_message_size_config(
3328                                max_decoding_message_size,
3329                                max_encoding_message_size,
3330                            );
3331                        let res = grpc.unary(method, req).await;
3332                        Ok(res)
3333                    };
3334                    Box::pin(fut)
3335                }
3336                "/pidgr.v1.AuthorizationService/CheckOrgSuspended" => {
3337                    #[allow(non_camel_case_types)]
3338                    struct CheckOrgSuspendedSvc<T: AuthorizationService>(pub Arc<T>);
3339                    impl<
3340                        T: AuthorizationService,
3341                    > tonic::server::UnaryService<super::CheckOrgSuspendedRequest>
3342                    for CheckOrgSuspendedSvc<T> {
3343                        type Response = super::CheckOrgSuspendedResponse;
3344                        type Future = BoxFuture<
3345                            tonic::Response<Self::Response>,
3346                            tonic::Status,
3347                        >;
3348                        fn call(
3349                            &mut self,
3350                            request: tonic::Request<super::CheckOrgSuspendedRequest>,
3351                        ) -> Self::Future {
3352                            let inner = Arc::clone(&self.0);
3353                            let fut = async move {
3354                                <T as AuthorizationService>::check_org_suspended(
3355                                        &inner,
3356                                        request,
3357                                    )
3358                                    .await
3359                            };
3360                            Box::pin(fut)
3361                        }
3362                    }
3363                    let accept_compression_encodings = self.accept_compression_encodings;
3364                    let send_compression_encodings = self.send_compression_encodings;
3365                    let max_decoding_message_size = self.max_decoding_message_size;
3366                    let max_encoding_message_size = self.max_encoding_message_size;
3367                    let inner = self.inner.clone();
3368                    let fut = async move {
3369                        let method = CheckOrgSuspendedSvc(inner);
3370                        let codec = tonic_prost::ProstCodec::default();
3371                        let mut grpc = tonic::server::Grpc::new(codec)
3372                            .apply_compression_config(
3373                                accept_compression_encodings,
3374                                send_compression_encodings,
3375                            )
3376                            .apply_max_message_size_config(
3377                                max_decoding_message_size,
3378                                max_encoding_message_size,
3379                            );
3380                        let res = grpc.unary(method, req).await;
3381                        Ok(res)
3382                    };
3383                    Box::pin(fut)
3384                }
3385                _ => {
3386                    Box::pin(async move {
3387                        let mut response = http::Response::new(
3388                            tonic::body::Body::default(),
3389                        );
3390                        let headers = response.headers_mut();
3391                        headers
3392                            .insert(
3393                                tonic::Status::GRPC_STATUS,
3394                                (tonic::Code::Unimplemented as i32).into(),
3395                            );
3396                        headers
3397                            .insert(
3398                                http::header::CONTENT_TYPE,
3399                                tonic::metadata::GRPC_CONTENT_TYPE,
3400                            );
3401                        Ok(response)
3402                    })
3403                }
3404            }
3405        }
3406    }
3407    impl<T> Clone for AuthorizationServiceServer<T> {
3408        fn clone(&self) -> Self {
3409            let inner = self.inner.clone();
3410            Self {
3411                inner,
3412                accept_compression_encodings: self.accept_compression_encodings,
3413                send_compression_encodings: self.send_compression_encodings,
3414                max_decoding_message_size: self.max_decoding_message_size,
3415                max_encoding_message_size: self.max_encoding_message_size,
3416            }
3417        }
3418    }
3419    /// Generated gRPC service name
3420    pub const SERVICE_NAME: &str = "pidgr.v1.AuthorizationService";
3421    impl<T> tonic::server::NamedService for AuthorizationServiceServer<T> {
3422        const NAME: &'static str = SERVICE_NAME;
3423    }
3424}
3425/// Generated client implementations.
3426pub mod campaign_service_client {
3427    #![allow(
3428        unused_variables,
3429        dead_code,
3430        missing_docs,
3431        clippy::wildcard_imports,
3432        clippy::let_unit_value,
3433    )]
3434    use tonic::codegen::*;
3435    use tonic::codegen::http::Uri;
3436    /** Manages the full lifecycle of communication campaigns — creation,
3437 execution, monitoring, and cancellation.
3438*/
3439    #[derive(Debug, Clone)]
3440    pub struct CampaignServiceClient<T> {
3441        inner: tonic::client::Grpc<T>,
3442    }
3443    impl CampaignServiceClient<tonic::transport::Channel> {
3444        /// Attempt to create a new client by connecting to a given endpoint.
3445        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3446        where
3447            D: TryInto<tonic::transport::Endpoint>,
3448            D::Error: Into<StdError>,
3449        {
3450            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3451            Ok(Self::new(conn))
3452        }
3453    }
3454    impl<T> CampaignServiceClient<T>
3455    where
3456        T: tonic::client::GrpcService<tonic::body::Body>,
3457        T::Error: Into<StdError>,
3458        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3459        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3460    {
3461        pub fn new(inner: T) -> Self {
3462            let inner = tonic::client::Grpc::new(inner);
3463            Self { inner }
3464        }
3465        pub fn with_origin(inner: T, origin: Uri) -> Self {
3466            let inner = tonic::client::Grpc::with_origin(inner, origin);
3467            Self { inner }
3468        }
3469        pub fn with_interceptor<F>(
3470            inner: T,
3471            interceptor: F,
3472        ) -> CampaignServiceClient<InterceptedService<T, F>>
3473        where
3474            F: tonic::service::Interceptor,
3475            T::ResponseBody: Default,
3476            T: tonic::codegen::Service<
3477                http::Request<tonic::body::Body>,
3478                Response = http::Response<
3479                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3480                >,
3481            >,
3482            <T as tonic::codegen::Service<
3483                http::Request<tonic::body::Body>,
3484            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3485        {
3486            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3487        }
3488        /// Compress requests with the given encoding.
3489        ///
3490        /// This requires the server to support it otherwise it might respond with an
3491        /// error.
3492        #[must_use]
3493        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3494            self.inner = self.inner.send_compressed(encoding);
3495            self
3496        }
3497        /// Enable decompressing responses.
3498        #[must_use]
3499        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3500            self.inner = self.inner.accept_compressed(encoding);
3501            self
3502        }
3503        /// Limits the maximum size of a decoded message.
3504        ///
3505        /// Default: `4MB`
3506        #[must_use]
3507        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3508            self.inner = self.inner.max_decoding_message_size(limit);
3509            self
3510        }
3511        /// Limits the maximum size of an encoded message.
3512        ///
3513        /// Default: `usize::MAX`
3514        #[must_use]
3515        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3516            self.inner = self.inner.max_encoding_message_size(limit);
3517            self
3518        }
3519        /** Create a new campaign with a template, audience, and workflow.
3520 Authorization: Requires MANAGER+ role.
3521*/
3522        pub async fn create_campaign(
3523            &mut self,
3524            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3525        ) -> std::result::Result<
3526            tonic::Response<super::CreateCampaignResponse>,
3527            tonic::Status,
3528        > {
3529            self.inner
3530                .ready()
3531                .await
3532                .map_err(|e| {
3533                    tonic::Status::unknown(
3534                        format!("Service was not ready: {}", e.into()),
3535                    )
3536                })?;
3537            let codec = tonic_prost::ProstCodec::default();
3538            let path = http::uri::PathAndQuery::from_static(
3539                "/pidgr.v1.CampaignService/CreateCampaign",
3540            );
3541            let mut req = request.into_request();
3542            req.extensions_mut()
3543                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3544            self.inner.unary(req, path, codec).await
3545        }
3546        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3547 Authorization: Requires MANAGER+ role.
3548*/
3549        pub async fn start_campaign(
3550            &mut self,
3551            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3552        ) -> std::result::Result<
3553            tonic::Response<super::StartCampaignResponse>,
3554            tonic::Status,
3555        > {
3556            self.inner
3557                .ready()
3558                .await
3559                .map_err(|e| {
3560                    tonic::Status::unknown(
3561                        format!("Service was not ready: {}", e.into()),
3562                    )
3563                })?;
3564            let codec = tonic_prost::ProstCodec::default();
3565            let path = http::uri::PathAndQuery::from_static(
3566                "/pidgr.v1.CampaignService/StartCampaign",
3567            );
3568            let mut req = request.into_request();
3569            req.extensions_mut()
3570                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3571            self.inner.unary(req, path, codec).await
3572        }
3573        /** Retrieve a single campaign by ID.
3574 Authorization: Authenticated user within the organization.
3575*/
3576        pub async fn get_campaign(
3577            &mut self,
3578            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3579        ) -> std::result::Result<
3580            tonic::Response<super::GetCampaignResponse>,
3581            tonic::Status,
3582        > {
3583            self.inner
3584                .ready()
3585                .await
3586                .map_err(|e| {
3587                    tonic::Status::unknown(
3588                        format!("Service was not ready: {}", e.into()),
3589                    )
3590                })?;
3591            let codec = tonic_prost::ProstCodec::default();
3592            let path = http::uri::PathAndQuery::from_static(
3593                "/pidgr.v1.CampaignService/GetCampaign",
3594            );
3595            let mut req = request.into_request();
3596            req.extensions_mut()
3597                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3598            self.inner.unary(req, path, codec).await
3599        }
3600        /** List campaigns for the organization with pagination.
3601 Authorization: Authenticated user within the organization.
3602*/
3603        pub async fn list_campaigns(
3604            &mut self,
3605            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3606        ) -> std::result::Result<
3607            tonic::Response<super::ListCampaignsResponse>,
3608            tonic::Status,
3609        > {
3610            self.inner
3611                .ready()
3612                .await
3613                .map_err(|e| {
3614                    tonic::Status::unknown(
3615                        format!("Service was not ready: {}", e.into()),
3616                    )
3617                })?;
3618            let codec = tonic_prost::ProstCodec::default();
3619            let path = http::uri::PathAndQuery::from_static(
3620                "/pidgr.v1.CampaignService/ListCampaigns",
3621            );
3622            let mut req = request.into_request();
3623            req.extensions_mut()
3624                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3625            self.inner.unary(req, path, codec).await
3626        }
3627        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3628 Authorization: Requires MANAGER+ role.
3629*/
3630        pub async fn update_campaign(
3631            &mut self,
3632            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3633        ) -> std::result::Result<
3634            tonic::Response<super::UpdateCampaignResponse>,
3635            tonic::Status,
3636        > {
3637            self.inner
3638                .ready()
3639                .await
3640                .map_err(|e| {
3641                    tonic::Status::unknown(
3642                        format!("Service was not ready: {}", e.into()),
3643                    )
3644                })?;
3645            let codec = tonic_prost::ProstCodec::default();
3646            let path = http::uri::PathAndQuery::from_static(
3647                "/pidgr.v1.CampaignService/UpdateCampaign",
3648            );
3649            let mut req = request.into_request();
3650            req.extensions_mut()
3651                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3652            self.inner.unary(req, path, codec).await
3653        }
3654        /** Read a campaign's frozen audience snapshot, enriched with member
3655 identity so clients can render and edit it. Empty for campaigns
3656 without a snapshot.
3657 Authorization: Authenticated user within the organization.
3658*/
3659        pub async fn get_campaign_audience(
3660            &mut self,
3661            request: impl tonic::IntoRequest<super::GetCampaignAudienceRequest>,
3662        ) -> std::result::Result<
3663            tonic::Response<super::GetCampaignAudienceResponse>,
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/GetCampaignAudience",
3677            );
3678            let mut req = request.into_request();
3679            req.extensions_mut()
3680                .insert(
3681                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignAudience"),
3682                );
3683            self.inner.unary(req, path, codec).await
3684        }
3685        /** Cancel a running campaign, stopping further deliveries and reminders.
3686 Authorization: Requires MANAGER+ role.
3687*/
3688        pub async fn cancel_campaign(
3689            &mut self,
3690            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3691        ) -> std::result::Result<
3692            tonic::Response<super::CancelCampaignResponse>,
3693            tonic::Status,
3694        > {
3695            self.inner
3696                .ready()
3697                .await
3698                .map_err(|e| {
3699                    tonic::Status::unknown(
3700                        format!("Service was not ready: {}", e.into()),
3701                    )
3702                })?;
3703            let codec = tonic_prost::ProstCodec::default();
3704            let path = http::uri::PathAndQuery::from_static(
3705                "/pidgr.v1.CampaignService/CancelCampaign",
3706            );
3707            let mut req = request.into_request();
3708            req.extensions_mut()
3709                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3710            self.inner.unary(req, path, codec).await
3711        }
3712        /** List delivery records for a campaign, optionally filtered by status.
3713 Authorization: Authenticated user within the organization.
3714*/
3715        pub async fn list_deliveries(
3716            &mut self,
3717            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3718        ) -> std::result::Result<
3719            tonic::Response<super::ListDeliveriesResponse>,
3720            tonic::Status,
3721        > {
3722            self.inner
3723                .ready()
3724                .await
3725                .map_err(|e| {
3726                    tonic::Status::unknown(
3727                        format!("Service was not ready: {}", e.into()),
3728                    )
3729                })?;
3730            let codec = tonic_prost::ProstCodec::default();
3731            let path = http::uri::PathAndQuery::from_static(
3732                "/pidgr.v1.CampaignService/ListDeliveries",
3733            );
3734            let mut req = request.into_request();
3735            req.extensions_mut()
3736                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3737            self.inner.unary(req, path, codec).await
3738        }
3739        /** Break down a campaign's recipients by current archetype membership
3740 and return ack-rate per bucket, with k-anonymity gate applied.
3741 Only valid for campaigns whose originating_archetype is set.
3742 Authorization: Authenticated user within the organization.
3743*/
3744        pub async fn get_campaign_archetype_breakdown(
3745            &mut self,
3746            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3747        ) -> std::result::Result<
3748            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3749            tonic::Status,
3750        > {
3751            self.inner
3752                .ready()
3753                .await
3754                .map_err(|e| {
3755                    tonic::Status::unknown(
3756                        format!("Service was not ready: {}", e.into()),
3757                    )
3758                })?;
3759            let codec = tonic_prost::ProstCodec::default();
3760            let path = http::uri::PathAndQuery::from_static(
3761                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3762            );
3763            let mut req = request.into_request();
3764            req.extensions_mut()
3765                .insert(
3766                    GrpcMethod::new(
3767                        "pidgr.v1.CampaignService",
3768                        "GetCampaignArchetypeBreakdown",
3769                    ),
3770                );
3771            self.inner.unary(req, path, codec).await
3772        }
3773        /** Resolve a campaign's 8-character base62 short-code, lazily
3774 generating one on the first call. Stable for the campaign's
3775 lifetime; the same campaign always returns the same code.
3776 Authorization: Internal-service callers only (mTLS-gated). The
3777 dispatch layer calls this when assembling a third-party-channel
3778 deeplink.
3779*/
3780        pub async fn resolve_or_create_short_code(
3781            &mut self,
3782            request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3783        ) -> std::result::Result<
3784            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3785            tonic::Status,
3786        > {
3787            self.inner
3788                .ready()
3789                .await
3790                .map_err(|e| {
3791                    tonic::Status::unknown(
3792                        format!("Service was not ready: {}", e.into()),
3793                    )
3794                })?;
3795            let codec = tonic_prost::ProstCodec::default();
3796            let path = http::uri::PathAndQuery::from_static(
3797                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3798            );
3799            let mut req = request.into_request();
3800            req.extensions_mut()
3801                .insert(
3802                    GrpcMethod::new(
3803                        "pidgr.v1.CampaignService",
3804                        "ResolveOrCreateShortCode",
3805                    ),
3806                );
3807            self.inner.unary(req, path, codec).await
3808        }
3809        /** Look up a campaign by its short-code. Returns minimal, non-PII
3810 metadata sufficient for the native app to route a tapped
3811 third-party-channel deeplink to the correct campaign card and
3812 show org branding before the auth gate.
3813 Authorization: Unauthenticated. The short-code IS the lookup key;
3814 returned fields are already visible to the recipient via their
3815 inbox or the org's public profile.
3816*/
3817        pub async fn get_campaign_by_short_code(
3818            &mut self,
3819            request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3820        ) -> std::result::Result<
3821            tonic::Response<super::GetCampaignByShortCodeResponse>,
3822            tonic::Status,
3823        > {
3824            self.inner
3825                .ready()
3826                .await
3827                .map_err(|e| {
3828                    tonic::Status::unknown(
3829                        format!("Service was not ready: {}", e.into()),
3830                    )
3831                })?;
3832            let codec = tonic_prost::ProstCodec::default();
3833            let path = http::uri::PathAndQuery::from_static(
3834                "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3835            );
3836            let mut req = request.into_request();
3837            req.extensions_mut()
3838                .insert(
3839                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3840                );
3841            self.inner.unary(req, path, codec).await
3842        }
3843    }
3844}
3845/// Generated server implementations.
3846pub mod campaign_service_server {
3847    #![allow(
3848        unused_variables,
3849        dead_code,
3850        missing_docs,
3851        clippy::wildcard_imports,
3852        clippy::let_unit_value,
3853    )]
3854    use tonic::codegen::*;
3855    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3856    #[async_trait]
3857    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3858        /** Create a new campaign with a template, audience, and workflow.
3859 Authorization: Requires MANAGER+ role.
3860*/
3861        async fn create_campaign(
3862            &self,
3863            request: tonic::Request<super::CreateCampaignRequest>,
3864        ) -> std::result::Result<
3865            tonic::Response<super::CreateCampaignResponse>,
3866            tonic::Status,
3867        >;
3868        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3869 Authorization: Requires MANAGER+ role.
3870*/
3871        async fn start_campaign(
3872            &self,
3873            request: tonic::Request<super::StartCampaignRequest>,
3874        ) -> std::result::Result<
3875            tonic::Response<super::StartCampaignResponse>,
3876            tonic::Status,
3877        >;
3878        /** Retrieve a single campaign by ID.
3879 Authorization: Authenticated user within the organization.
3880*/
3881        async fn get_campaign(
3882            &self,
3883            request: tonic::Request<super::GetCampaignRequest>,
3884        ) -> std::result::Result<
3885            tonic::Response<super::GetCampaignResponse>,
3886            tonic::Status,
3887        >;
3888        /** List campaigns for the organization with pagination.
3889 Authorization: Authenticated user within the organization.
3890*/
3891        async fn list_campaigns(
3892            &self,
3893            request: tonic::Request<super::ListCampaignsRequest>,
3894        ) -> std::result::Result<
3895            tonic::Response<super::ListCampaignsResponse>,
3896            tonic::Status,
3897        >;
3898        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3899 Authorization: Requires MANAGER+ role.
3900*/
3901        async fn update_campaign(
3902            &self,
3903            request: tonic::Request<super::UpdateCampaignRequest>,
3904        ) -> std::result::Result<
3905            tonic::Response<super::UpdateCampaignResponse>,
3906            tonic::Status,
3907        >;
3908        /** Read a campaign's frozen audience snapshot, enriched with member
3909 identity so clients can render and edit it. Empty for campaigns
3910 without a snapshot.
3911 Authorization: Authenticated user within the organization.
3912*/
3913        async fn get_campaign_audience(
3914            &self,
3915            request: tonic::Request<super::GetCampaignAudienceRequest>,
3916        ) -> std::result::Result<
3917            tonic::Response<super::GetCampaignAudienceResponse>,
3918            tonic::Status,
3919        >;
3920        /** Cancel a running campaign, stopping further deliveries and reminders.
3921 Authorization: Requires MANAGER+ role.
3922*/
3923        async fn cancel_campaign(
3924            &self,
3925            request: tonic::Request<super::CancelCampaignRequest>,
3926        ) -> std::result::Result<
3927            tonic::Response<super::CancelCampaignResponse>,
3928            tonic::Status,
3929        >;
3930        /** List delivery records for a campaign, optionally filtered by status.
3931 Authorization: Authenticated user within the organization.
3932*/
3933        async fn list_deliveries(
3934            &self,
3935            request: tonic::Request<super::ListDeliveriesRequest>,
3936        ) -> std::result::Result<
3937            tonic::Response<super::ListDeliveriesResponse>,
3938            tonic::Status,
3939        >;
3940        /** Break down a campaign's recipients by current archetype membership
3941 and return ack-rate per bucket, with k-anonymity gate applied.
3942 Only valid for campaigns whose originating_archetype is set.
3943 Authorization: Authenticated user within the organization.
3944*/
3945        async fn get_campaign_archetype_breakdown(
3946            &self,
3947            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3948        ) -> std::result::Result<
3949            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3950            tonic::Status,
3951        >;
3952        /** Resolve a campaign's 8-character base62 short-code, lazily
3953 generating one on the first call. Stable for the campaign's
3954 lifetime; the same campaign always returns the same code.
3955 Authorization: Internal-service callers only (mTLS-gated). The
3956 dispatch layer calls this when assembling a third-party-channel
3957 deeplink.
3958*/
3959        async fn resolve_or_create_short_code(
3960            &self,
3961            request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3962        ) -> std::result::Result<
3963            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3964            tonic::Status,
3965        >;
3966        /** Look up a campaign by its short-code. Returns minimal, non-PII
3967 metadata sufficient for the native app to route a tapped
3968 third-party-channel deeplink to the correct campaign card and
3969 show org branding before the auth gate.
3970 Authorization: Unauthenticated. The short-code IS the lookup key;
3971 returned fields are already visible to the recipient via their
3972 inbox or the org's public profile.
3973*/
3974        async fn get_campaign_by_short_code(
3975            &self,
3976            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3977        ) -> std::result::Result<
3978            tonic::Response<super::GetCampaignByShortCodeResponse>,
3979            tonic::Status,
3980        >;
3981    }
3982    /** Manages the full lifecycle of communication campaigns — creation,
3983 execution, monitoring, and cancellation.
3984*/
3985    #[derive(Debug)]
3986    pub struct CampaignServiceServer<T> {
3987        inner: Arc<T>,
3988        accept_compression_encodings: EnabledCompressionEncodings,
3989        send_compression_encodings: EnabledCompressionEncodings,
3990        max_decoding_message_size: Option<usize>,
3991        max_encoding_message_size: Option<usize>,
3992    }
3993    impl<T> CampaignServiceServer<T> {
3994        pub fn new(inner: T) -> Self {
3995            Self::from_arc(Arc::new(inner))
3996        }
3997        pub fn from_arc(inner: Arc<T>) -> Self {
3998            Self {
3999                inner,
4000                accept_compression_encodings: Default::default(),
4001                send_compression_encodings: Default::default(),
4002                max_decoding_message_size: None,
4003                max_encoding_message_size: None,
4004            }
4005        }
4006        pub fn with_interceptor<F>(
4007            inner: T,
4008            interceptor: F,
4009        ) -> InterceptedService<Self, F>
4010        where
4011            F: tonic::service::Interceptor,
4012        {
4013            InterceptedService::new(Self::new(inner), interceptor)
4014        }
4015        /// Enable decompressing requests with the given encoding.
4016        #[must_use]
4017        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4018            self.accept_compression_encodings.enable(encoding);
4019            self
4020        }
4021        /// Compress responses with the given encoding, if the client supports it.
4022        #[must_use]
4023        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4024            self.send_compression_encodings.enable(encoding);
4025            self
4026        }
4027        /// Limits the maximum size of a decoded message.
4028        ///
4029        /// Default: `4MB`
4030        #[must_use]
4031        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4032            self.max_decoding_message_size = Some(limit);
4033            self
4034        }
4035        /// Limits the maximum size of an encoded message.
4036        ///
4037        /// Default: `usize::MAX`
4038        #[must_use]
4039        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4040            self.max_encoding_message_size = Some(limit);
4041            self
4042        }
4043    }
4044    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
4045    where
4046        T: CampaignService,
4047        B: Body + std::marker::Send + 'static,
4048        B::Error: Into<StdError> + std::marker::Send + 'static,
4049    {
4050        type Response = http::Response<tonic::body::Body>;
4051        type Error = std::convert::Infallible;
4052        type Future = BoxFuture<Self::Response, Self::Error>;
4053        fn poll_ready(
4054            &mut self,
4055            _cx: &mut Context<'_>,
4056        ) -> Poll<std::result::Result<(), Self::Error>> {
4057            Poll::Ready(Ok(()))
4058        }
4059        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4060            match req.uri().path() {
4061                "/pidgr.v1.CampaignService/CreateCampaign" => {
4062                    #[allow(non_camel_case_types)]
4063                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
4064                    impl<
4065                        T: CampaignService,
4066                    > tonic::server::UnaryService<super::CreateCampaignRequest>
4067                    for CreateCampaignSvc<T> {
4068                        type Response = super::CreateCampaignResponse;
4069                        type Future = BoxFuture<
4070                            tonic::Response<Self::Response>,
4071                            tonic::Status,
4072                        >;
4073                        fn call(
4074                            &mut self,
4075                            request: tonic::Request<super::CreateCampaignRequest>,
4076                        ) -> Self::Future {
4077                            let inner = Arc::clone(&self.0);
4078                            let fut = async move {
4079                                <T as CampaignService>::create_campaign(&inner, request)
4080                                    .await
4081                            };
4082                            Box::pin(fut)
4083                        }
4084                    }
4085                    let accept_compression_encodings = self.accept_compression_encodings;
4086                    let send_compression_encodings = self.send_compression_encodings;
4087                    let max_decoding_message_size = self.max_decoding_message_size;
4088                    let max_encoding_message_size = self.max_encoding_message_size;
4089                    let inner = self.inner.clone();
4090                    let fut = async move {
4091                        let method = CreateCampaignSvc(inner);
4092                        let codec = tonic_prost::ProstCodec::default();
4093                        let mut grpc = tonic::server::Grpc::new(codec)
4094                            .apply_compression_config(
4095                                accept_compression_encodings,
4096                                send_compression_encodings,
4097                            )
4098                            .apply_max_message_size_config(
4099                                max_decoding_message_size,
4100                                max_encoding_message_size,
4101                            );
4102                        let res = grpc.unary(method, req).await;
4103                        Ok(res)
4104                    };
4105                    Box::pin(fut)
4106                }
4107                "/pidgr.v1.CampaignService/StartCampaign" => {
4108                    #[allow(non_camel_case_types)]
4109                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
4110                    impl<
4111                        T: CampaignService,
4112                    > tonic::server::UnaryService<super::StartCampaignRequest>
4113                    for StartCampaignSvc<T> {
4114                        type Response = super::StartCampaignResponse;
4115                        type Future = BoxFuture<
4116                            tonic::Response<Self::Response>,
4117                            tonic::Status,
4118                        >;
4119                        fn call(
4120                            &mut self,
4121                            request: tonic::Request<super::StartCampaignRequest>,
4122                        ) -> Self::Future {
4123                            let inner = Arc::clone(&self.0);
4124                            let fut = async move {
4125                                <T as CampaignService>::start_campaign(&inner, request)
4126                                    .await
4127                            };
4128                            Box::pin(fut)
4129                        }
4130                    }
4131                    let accept_compression_encodings = self.accept_compression_encodings;
4132                    let send_compression_encodings = self.send_compression_encodings;
4133                    let max_decoding_message_size = self.max_decoding_message_size;
4134                    let max_encoding_message_size = self.max_encoding_message_size;
4135                    let inner = self.inner.clone();
4136                    let fut = async move {
4137                        let method = StartCampaignSvc(inner);
4138                        let codec = tonic_prost::ProstCodec::default();
4139                        let mut grpc = tonic::server::Grpc::new(codec)
4140                            .apply_compression_config(
4141                                accept_compression_encodings,
4142                                send_compression_encodings,
4143                            )
4144                            .apply_max_message_size_config(
4145                                max_decoding_message_size,
4146                                max_encoding_message_size,
4147                            );
4148                        let res = grpc.unary(method, req).await;
4149                        Ok(res)
4150                    };
4151                    Box::pin(fut)
4152                }
4153                "/pidgr.v1.CampaignService/GetCampaign" => {
4154                    #[allow(non_camel_case_types)]
4155                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
4156                    impl<
4157                        T: CampaignService,
4158                    > tonic::server::UnaryService<super::GetCampaignRequest>
4159                    for GetCampaignSvc<T> {
4160                        type Response = super::GetCampaignResponse;
4161                        type Future = BoxFuture<
4162                            tonic::Response<Self::Response>,
4163                            tonic::Status,
4164                        >;
4165                        fn call(
4166                            &mut self,
4167                            request: tonic::Request<super::GetCampaignRequest>,
4168                        ) -> Self::Future {
4169                            let inner = Arc::clone(&self.0);
4170                            let fut = async move {
4171                                <T as CampaignService>::get_campaign(&inner, request).await
4172                            };
4173                            Box::pin(fut)
4174                        }
4175                    }
4176                    let accept_compression_encodings = self.accept_compression_encodings;
4177                    let send_compression_encodings = self.send_compression_encodings;
4178                    let max_decoding_message_size = self.max_decoding_message_size;
4179                    let max_encoding_message_size = self.max_encoding_message_size;
4180                    let inner = self.inner.clone();
4181                    let fut = async move {
4182                        let method = GetCampaignSvc(inner);
4183                        let codec = tonic_prost::ProstCodec::default();
4184                        let mut grpc = tonic::server::Grpc::new(codec)
4185                            .apply_compression_config(
4186                                accept_compression_encodings,
4187                                send_compression_encodings,
4188                            )
4189                            .apply_max_message_size_config(
4190                                max_decoding_message_size,
4191                                max_encoding_message_size,
4192                            );
4193                        let res = grpc.unary(method, req).await;
4194                        Ok(res)
4195                    };
4196                    Box::pin(fut)
4197                }
4198                "/pidgr.v1.CampaignService/ListCampaigns" => {
4199                    #[allow(non_camel_case_types)]
4200                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
4201                    impl<
4202                        T: CampaignService,
4203                    > tonic::server::UnaryService<super::ListCampaignsRequest>
4204                    for ListCampaignsSvc<T> {
4205                        type Response = super::ListCampaignsResponse;
4206                        type Future = BoxFuture<
4207                            tonic::Response<Self::Response>,
4208                            tonic::Status,
4209                        >;
4210                        fn call(
4211                            &mut self,
4212                            request: tonic::Request<super::ListCampaignsRequest>,
4213                        ) -> Self::Future {
4214                            let inner = Arc::clone(&self.0);
4215                            let fut = async move {
4216                                <T as CampaignService>::list_campaigns(&inner, request)
4217                                    .await
4218                            };
4219                            Box::pin(fut)
4220                        }
4221                    }
4222                    let accept_compression_encodings = self.accept_compression_encodings;
4223                    let send_compression_encodings = self.send_compression_encodings;
4224                    let max_decoding_message_size = self.max_decoding_message_size;
4225                    let max_encoding_message_size = self.max_encoding_message_size;
4226                    let inner = self.inner.clone();
4227                    let fut = async move {
4228                        let method = ListCampaignsSvc(inner);
4229                        let codec = tonic_prost::ProstCodec::default();
4230                        let mut grpc = tonic::server::Grpc::new(codec)
4231                            .apply_compression_config(
4232                                accept_compression_encodings,
4233                                send_compression_encodings,
4234                            )
4235                            .apply_max_message_size_config(
4236                                max_decoding_message_size,
4237                                max_encoding_message_size,
4238                            );
4239                        let res = grpc.unary(method, req).await;
4240                        Ok(res)
4241                    };
4242                    Box::pin(fut)
4243                }
4244                "/pidgr.v1.CampaignService/UpdateCampaign" => {
4245                    #[allow(non_camel_case_types)]
4246                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
4247                    impl<
4248                        T: CampaignService,
4249                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
4250                    for UpdateCampaignSvc<T> {
4251                        type Response = super::UpdateCampaignResponse;
4252                        type Future = BoxFuture<
4253                            tonic::Response<Self::Response>,
4254                            tonic::Status,
4255                        >;
4256                        fn call(
4257                            &mut self,
4258                            request: tonic::Request<super::UpdateCampaignRequest>,
4259                        ) -> Self::Future {
4260                            let inner = Arc::clone(&self.0);
4261                            let fut = async move {
4262                                <T as CampaignService>::update_campaign(&inner, request)
4263                                    .await
4264                            };
4265                            Box::pin(fut)
4266                        }
4267                    }
4268                    let accept_compression_encodings = self.accept_compression_encodings;
4269                    let send_compression_encodings = self.send_compression_encodings;
4270                    let max_decoding_message_size = self.max_decoding_message_size;
4271                    let max_encoding_message_size = self.max_encoding_message_size;
4272                    let inner = self.inner.clone();
4273                    let fut = async move {
4274                        let method = UpdateCampaignSvc(inner);
4275                        let codec = tonic_prost::ProstCodec::default();
4276                        let mut grpc = tonic::server::Grpc::new(codec)
4277                            .apply_compression_config(
4278                                accept_compression_encodings,
4279                                send_compression_encodings,
4280                            )
4281                            .apply_max_message_size_config(
4282                                max_decoding_message_size,
4283                                max_encoding_message_size,
4284                            );
4285                        let res = grpc.unary(method, req).await;
4286                        Ok(res)
4287                    };
4288                    Box::pin(fut)
4289                }
4290                "/pidgr.v1.CampaignService/GetCampaignAudience" => {
4291                    #[allow(non_camel_case_types)]
4292                    struct GetCampaignAudienceSvc<T: CampaignService>(pub Arc<T>);
4293                    impl<
4294                        T: CampaignService,
4295                    > tonic::server::UnaryService<super::GetCampaignAudienceRequest>
4296                    for GetCampaignAudienceSvc<T> {
4297                        type Response = super::GetCampaignAudienceResponse;
4298                        type Future = BoxFuture<
4299                            tonic::Response<Self::Response>,
4300                            tonic::Status,
4301                        >;
4302                        fn call(
4303                            &mut self,
4304                            request: tonic::Request<super::GetCampaignAudienceRequest>,
4305                        ) -> Self::Future {
4306                            let inner = Arc::clone(&self.0);
4307                            let fut = async move {
4308                                <T as CampaignService>::get_campaign_audience(
4309                                        &inner,
4310                                        request,
4311                                    )
4312                                    .await
4313                            };
4314                            Box::pin(fut)
4315                        }
4316                    }
4317                    let accept_compression_encodings = self.accept_compression_encodings;
4318                    let send_compression_encodings = self.send_compression_encodings;
4319                    let max_decoding_message_size = self.max_decoding_message_size;
4320                    let max_encoding_message_size = self.max_encoding_message_size;
4321                    let inner = self.inner.clone();
4322                    let fut = async move {
4323                        let method = GetCampaignAudienceSvc(inner);
4324                        let codec = tonic_prost::ProstCodec::default();
4325                        let mut grpc = tonic::server::Grpc::new(codec)
4326                            .apply_compression_config(
4327                                accept_compression_encodings,
4328                                send_compression_encodings,
4329                            )
4330                            .apply_max_message_size_config(
4331                                max_decoding_message_size,
4332                                max_encoding_message_size,
4333                            );
4334                        let res = grpc.unary(method, req).await;
4335                        Ok(res)
4336                    };
4337                    Box::pin(fut)
4338                }
4339                "/pidgr.v1.CampaignService/CancelCampaign" => {
4340                    #[allow(non_camel_case_types)]
4341                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
4342                    impl<
4343                        T: CampaignService,
4344                    > tonic::server::UnaryService<super::CancelCampaignRequest>
4345                    for CancelCampaignSvc<T> {
4346                        type Response = super::CancelCampaignResponse;
4347                        type Future = BoxFuture<
4348                            tonic::Response<Self::Response>,
4349                            tonic::Status,
4350                        >;
4351                        fn call(
4352                            &mut self,
4353                            request: tonic::Request<super::CancelCampaignRequest>,
4354                        ) -> Self::Future {
4355                            let inner = Arc::clone(&self.0);
4356                            let fut = async move {
4357                                <T as CampaignService>::cancel_campaign(&inner, request)
4358                                    .await
4359                            };
4360                            Box::pin(fut)
4361                        }
4362                    }
4363                    let accept_compression_encodings = self.accept_compression_encodings;
4364                    let send_compression_encodings = self.send_compression_encodings;
4365                    let max_decoding_message_size = self.max_decoding_message_size;
4366                    let max_encoding_message_size = self.max_encoding_message_size;
4367                    let inner = self.inner.clone();
4368                    let fut = async move {
4369                        let method = CancelCampaignSvc(inner);
4370                        let codec = tonic_prost::ProstCodec::default();
4371                        let mut grpc = tonic::server::Grpc::new(codec)
4372                            .apply_compression_config(
4373                                accept_compression_encodings,
4374                                send_compression_encodings,
4375                            )
4376                            .apply_max_message_size_config(
4377                                max_decoding_message_size,
4378                                max_encoding_message_size,
4379                            );
4380                        let res = grpc.unary(method, req).await;
4381                        Ok(res)
4382                    };
4383                    Box::pin(fut)
4384                }
4385                "/pidgr.v1.CampaignService/ListDeliveries" => {
4386                    #[allow(non_camel_case_types)]
4387                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
4388                    impl<
4389                        T: CampaignService,
4390                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
4391                    for ListDeliveriesSvc<T> {
4392                        type Response = super::ListDeliveriesResponse;
4393                        type Future = BoxFuture<
4394                            tonic::Response<Self::Response>,
4395                            tonic::Status,
4396                        >;
4397                        fn call(
4398                            &mut self,
4399                            request: tonic::Request<super::ListDeliveriesRequest>,
4400                        ) -> Self::Future {
4401                            let inner = Arc::clone(&self.0);
4402                            let fut = async move {
4403                                <T as CampaignService>::list_deliveries(&inner, request)
4404                                    .await
4405                            };
4406                            Box::pin(fut)
4407                        }
4408                    }
4409                    let accept_compression_encodings = self.accept_compression_encodings;
4410                    let send_compression_encodings = self.send_compression_encodings;
4411                    let max_decoding_message_size = self.max_decoding_message_size;
4412                    let max_encoding_message_size = self.max_encoding_message_size;
4413                    let inner = self.inner.clone();
4414                    let fut = async move {
4415                        let method = ListDeliveriesSvc(inner);
4416                        let codec = tonic_prost::ProstCodec::default();
4417                        let mut grpc = tonic::server::Grpc::new(codec)
4418                            .apply_compression_config(
4419                                accept_compression_encodings,
4420                                send_compression_encodings,
4421                            )
4422                            .apply_max_message_size_config(
4423                                max_decoding_message_size,
4424                                max_encoding_message_size,
4425                            );
4426                        let res = grpc.unary(method, req).await;
4427                        Ok(res)
4428                    };
4429                    Box::pin(fut)
4430                }
4431                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
4432                    #[allow(non_camel_case_types)]
4433                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
4434                        pub Arc<T>,
4435                    );
4436                    impl<
4437                        T: CampaignService,
4438                    > tonic::server::UnaryService<
4439                        super::GetCampaignArchetypeBreakdownRequest,
4440                    > for GetCampaignArchetypeBreakdownSvc<T> {
4441                        type Response = super::GetCampaignArchetypeBreakdownResponse;
4442                        type Future = BoxFuture<
4443                            tonic::Response<Self::Response>,
4444                            tonic::Status,
4445                        >;
4446                        fn call(
4447                            &mut self,
4448                            request: tonic::Request<
4449                                super::GetCampaignArchetypeBreakdownRequest,
4450                            >,
4451                        ) -> Self::Future {
4452                            let inner = Arc::clone(&self.0);
4453                            let fut = async move {
4454                                <T as CampaignService>::get_campaign_archetype_breakdown(
4455                                        &inner,
4456                                        request,
4457                                    )
4458                                    .await
4459                            };
4460                            Box::pin(fut)
4461                        }
4462                    }
4463                    let accept_compression_encodings = self.accept_compression_encodings;
4464                    let send_compression_encodings = self.send_compression_encodings;
4465                    let max_decoding_message_size = self.max_decoding_message_size;
4466                    let max_encoding_message_size = self.max_encoding_message_size;
4467                    let inner = self.inner.clone();
4468                    let fut = async move {
4469                        let method = GetCampaignArchetypeBreakdownSvc(inner);
4470                        let codec = tonic_prost::ProstCodec::default();
4471                        let mut grpc = tonic::server::Grpc::new(codec)
4472                            .apply_compression_config(
4473                                accept_compression_encodings,
4474                                send_compression_encodings,
4475                            )
4476                            .apply_max_message_size_config(
4477                                max_decoding_message_size,
4478                                max_encoding_message_size,
4479                            );
4480                        let res = grpc.unary(method, req).await;
4481                        Ok(res)
4482                    };
4483                    Box::pin(fut)
4484                }
4485                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
4486                    #[allow(non_camel_case_types)]
4487                    struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
4488                    impl<
4489                        T: CampaignService,
4490                    > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
4491                    for ResolveOrCreateShortCodeSvc<T> {
4492                        type Response = super::ResolveOrCreateShortCodeResponse;
4493                        type Future = BoxFuture<
4494                            tonic::Response<Self::Response>,
4495                            tonic::Status,
4496                        >;
4497                        fn call(
4498                            &mut self,
4499                            request: tonic::Request<
4500                                super::ResolveOrCreateShortCodeRequest,
4501                            >,
4502                        ) -> Self::Future {
4503                            let inner = Arc::clone(&self.0);
4504                            let fut = async move {
4505                                <T as CampaignService>::resolve_or_create_short_code(
4506                                        &inner,
4507                                        request,
4508                                    )
4509                                    .await
4510                            };
4511                            Box::pin(fut)
4512                        }
4513                    }
4514                    let accept_compression_encodings = self.accept_compression_encodings;
4515                    let send_compression_encodings = self.send_compression_encodings;
4516                    let max_decoding_message_size = self.max_decoding_message_size;
4517                    let max_encoding_message_size = self.max_encoding_message_size;
4518                    let inner = self.inner.clone();
4519                    let fut = async move {
4520                        let method = ResolveOrCreateShortCodeSvc(inner);
4521                        let codec = tonic_prost::ProstCodec::default();
4522                        let mut grpc = tonic::server::Grpc::new(codec)
4523                            .apply_compression_config(
4524                                accept_compression_encodings,
4525                                send_compression_encodings,
4526                            )
4527                            .apply_max_message_size_config(
4528                                max_decoding_message_size,
4529                                max_encoding_message_size,
4530                            );
4531                        let res = grpc.unary(method, req).await;
4532                        Ok(res)
4533                    };
4534                    Box::pin(fut)
4535                }
4536                "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
4537                    #[allow(non_camel_case_types)]
4538                    struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4539                    impl<
4540                        T: CampaignService,
4541                    > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4542                    for GetCampaignByShortCodeSvc<T> {
4543                        type Response = super::GetCampaignByShortCodeResponse;
4544                        type Future = BoxFuture<
4545                            tonic::Response<Self::Response>,
4546                            tonic::Status,
4547                        >;
4548                        fn call(
4549                            &mut self,
4550                            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4551                        ) -> Self::Future {
4552                            let inner = Arc::clone(&self.0);
4553                            let fut = async move {
4554                                <T as CampaignService>::get_campaign_by_short_code(
4555                                        &inner,
4556                                        request,
4557                                    )
4558                                    .await
4559                            };
4560                            Box::pin(fut)
4561                        }
4562                    }
4563                    let accept_compression_encodings = self.accept_compression_encodings;
4564                    let send_compression_encodings = self.send_compression_encodings;
4565                    let max_decoding_message_size = self.max_decoding_message_size;
4566                    let max_encoding_message_size = self.max_encoding_message_size;
4567                    let inner = self.inner.clone();
4568                    let fut = async move {
4569                        let method = GetCampaignByShortCodeSvc(inner);
4570                        let codec = tonic_prost::ProstCodec::default();
4571                        let mut grpc = tonic::server::Grpc::new(codec)
4572                            .apply_compression_config(
4573                                accept_compression_encodings,
4574                                send_compression_encodings,
4575                            )
4576                            .apply_max_message_size_config(
4577                                max_decoding_message_size,
4578                                max_encoding_message_size,
4579                            );
4580                        let res = grpc.unary(method, req).await;
4581                        Ok(res)
4582                    };
4583                    Box::pin(fut)
4584                }
4585                _ => {
4586                    Box::pin(async move {
4587                        let mut response = http::Response::new(
4588                            tonic::body::Body::default(),
4589                        );
4590                        let headers = response.headers_mut();
4591                        headers
4592                            .insert(
4593                                tonic::Status::GRPC_STATUS,
4594                                (tonic::Code::Unimplemented as i32).into(),
4595                            );
4596                        headers
4597                            .insert(
4598                                http::header::CONTENT_TYPE,
4599                                tonic::metadata::GRPC_CONTENT_TYPE,
4600                            );
4601                        Ok(response)
4602                    })
4603                }
4604            }
4605        }
4606    }
4607    impl<T> Clone for CampaignServiceServer<T> {
4608        fn clone(&self) -> Self {
4609            let inner = self.inner.clone();
4610            Self {
4611                inner,
4612                accept_compression_encodings: self.accept_compression_encodings,
4613                send_compression_encodings: self.send_compression_encodings,
4614                max_decoding_message_size: self.max_decoding_message_size,
4615                max_encoding_message_size: self.max_encoding_message_size,
4616            }
4617        }
4618    }
4619    /// Generated gRPC service name
4620    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4621    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4622        const NAME: &'static str = SERVICE_NAME;
4623    }
4624}
4625/// Generated client implementations.
4626pub mod device_service_client {
4627    #![allow(
4628        unused_variables,
4629        dead_code,
4630        missing_docs,
4631        clippy::wildcard_imports,
4632        clippy::let_unit_value,
4633    )]
4634    use tonic::codegen::*;
4635    use tonic::codegen::http::Uri;
4636    /** Manages push notification device registration.
4637 Used by the mobile app to register push tokens and manage device lifecycle.
4638*/
4639    #[derive(Debug, Clone)]
4640    pub struct DeviceServiceClient<T> {
4641        inner: tonic::client::Grpc<T>,
4642    }
4643    impl DeviceServiceClient<tonic::transport::Channel> {
4644        /// Attempt to create a new client by connecting to a given endpoint.
4645        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4646        where
4647            D: TryInto<tonic::transport::Endpoint>,
4648            D::Error: Into<StdError>,
4649        {
4650            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4651            Ok(Self::new(conn))
4652        }
4653    }
4654    impl<T> DeviceServiceClient<T>
4655    where
4656        T: tonic::client::GrpcService<tonic::body::Body>,
4657        T::Error: Into<StdError>,
4658        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4659        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4660    {
4661        pub fn new(inner: T) -> Self {
4662            let inner = tonic::client::Grpc::new(inner);
4663            Self { inner }
4664        }
4665        pub fn with_origin(inner: T, origin: Uri) -> Self {
4666            let inner = tonic::client::Grpc::with_origin(inner, origin);
4667            Self { inner }
4668        }
4669        pub fn with_interceptor<F>(
4670            inner: T,
4671            interceptor: F,
4672        ) -> DeviceServiceClient<InterceptedService<T, F>>
4673        where
4674            F: tonic::service::Interceptor,
4675            T::ResponseBody: Default,
4676            T: tonic::codegen::Service<
4677                http::Request<tonic::body::Body>,
4678                Response = http::Response<
4679                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4680                >,
4681            >,
4682            <T as tonic::codegen::Service<
4683                http::Request<tonic::body::Body>,
4684            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4685        {
4686            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4687        }
4688        /// Compress requests with the given encoding.
4689        ///
4690        /// This requires the server to support it otherwise it might respond with an
4691        /// error.
4692        #[must_use]
4693        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4694            self.inner = self.inner.send_compressed(encoding);
4695            self
4696        }
4697        /// Enable decompressing responses.
4698        #[must_use]
4699        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4700            self.inner = self.inner.accept_compressed(encoding);
4701            self
4702        }
4703        /// Limits the maximum size of a decoded message.
4704        ///
4705        /// Default: `4MB`
4706        #[must_use]
4707        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4708            self.inner = self.inner.max_decoding_message_size(limit);
4709            self
4710        }
4711        /// Limits the maximum size of an encoded message.
4712        ///
4713        /// Default: `usize::MAX`
4714        #[must_use]
4715        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4716            self.inner = self.inner.max_encoding_message_size(limit);
4717            self
4718        }
4719        /** Register a device with its push token for receiving notifications.
4720 Authorization: Authenticated user (own devices only).
4721*/
4722        pub async fn register(
4723            &mut self,
4724            request: impl tonic::IntoRequest<super::RegisterRequest>,
4725        ) -> std::result::Result<
4726            tonic::Response<super::RegisterResponse>,
4727            tonic::Status,
4728        > {
4729            self.inner
4730                .ready()
4731                .await
4732                .map_err(|e| {
4733                    tonic::Status::unknown(
4734                        format!("Service was not ready: {}", e.into()),
4735                    )
4736                })?;
4737            let codec = tonic_prost::ProstCodec::default();
4738            let path = http::uri::PathAndQuery::from_static(
4739                "/pidgr.v1.DeviceService/Register",
4740            );
4741            let mut req = request.into_request();
4742            req.extensions_mut()
4743                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4744            self.inner.unary(req, path, codec).await
4745        }
4746        /** Deactivate a device, preventing further push notifications.
4747 Authorization: Authenticated user (own devices only).
4748*/
4749        pub async fn deactivate(
4750            &mut self,
4751            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4752        ) -> std::result::Result<
4753            tonic::Response<super::DeactivateResponse>,
4754            tonic::Status,
4755        > {
4756            self.inner
4757                .ready()
4758                .await
4759                .map_err(|e| {
4760                    tonic::Status::unknown(
4761                        format!("Service was not ready: {}", e.into()),
4762                    )
4763                })?;
4764            let codec = tonic_prost::ProstCodec::default();
4765            let path = http::uri::PathAndQuery::from_static(
4766                "/pidgr.v1.DeviceService/Deactivate",
4767            );
4768            let mut req = request.into_request();
4769            req.extensions_mut()
4770                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4771            self.inner.unary(req, path, codec).await
4772        }
4773        /** List all devices registered to the authenticated user.
4774 Authorization: Authenticated user (own devices only).
4775*/
4776        pub async fn list_devices(
4777            &mut self,
4778            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4779        ) -> std::result::Result<
4780            tonic::Response<super::ListDevicesResponse>,
4781            tonic::Status,
4782        > {
4783            self.inner
4784                .ready()
4785                .await
4786                .map_err(|e| {
4787                    tonic::Status::unknown(
4788                        format!("Service was not ready: {}", e.into()),
4789                    )
4790                })?;
4791            let codec = tonic_prost::ProstCodec::default();
4792            let path = http::uri::PathAndQuery::from_static(
4793                "/pidgr.v1.DeviceService/ListDevices",
4794            );
4795            let mut req = request.into_request();
4796            req.extensions_mut()
4797                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4798            self.inner.unary(req, path, codec).await
4799        }
4800        /** List all devices for a specific organization member.
4801 Authorization: Requires MEMBERS_READ permission.
4802*/
4803        pub async fn list_member_devices(
4804            &mut self,
4805            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4806        ) -> std::result::Result<
4807            tonic::Response<super::ListMemberDevicesResponse>,
4808            tonic::Status,
4809        > {
4810            self.inner
4811                .ready()
4812                .await
4813                .map_err(|e| {
4814                    tonic::Status::unknown(
4815                        format!("Service was not ready: {}", e.into()),
4816                    )
4817                })?;
4818            let codec = tonic_prost::ProstCodec::default();
4819            let path = http::uri::PathAndQuery::from_static(
4820                "/pidgr.v1.DeviceService/ListMemberDevices",
4821            );
4822            let mut req = request.into_request();
4823            req.extensions_mut()
4824                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4825            self.inner.unary(req, path, codec).await
4826        }
4827    }
4828}
4829/// Generated server implementations.
4830pub mod device_service_server {
4831    #![allow(
4832        unused_variables,
4833        dead_code,
4834        missing_docs,
4835        clippy::wildcard_imports,
4836        clippy::let_unit_value,
4837    )]
4838    use tonic::codegen::*;
4839    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4840    #[async_trait]
4841    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4842        /** Register a device with its push token for receiving notifications.
4843 Authorization: Authenticated user (own devices only).
4844*/
4845        async fn register(
4846            &self,
4847            request: tonic::Request<super::RegisterRequest>,
4848        ) -> std::result::Result<
4849            tonic::Response<super::RegisterResponse>,
4850            tonic::Status,
4851        >;
4852        /** Deactivate a device, preventing further push notifications.
4853 Authorization: Authenticated user (own devices only).
4854*/
4855        async fn deactivate(
4856            &self,
4857            request: tonic::Request<super::DeactivateRequest>,
4858        ) -> std::result::Result<
4859            tonic::Response<super::DeactivateResponse>,
4860            tonic::Status,
4861        >;
4862        /** List all devices registered to the authenticated user.
4863 Authorization: Authenticated user (own devices only).
4864*/
4865        async fn list_devices(
4866            &self,
4867            request: tonic::Request<super::ListDevicesRequest>,
4868        ) -> std::result::Result<
4869            tonic::Response<super::ListDevicesResponse>,
4870            tonic::Status,
4871        >;
4872        /** List all devices for a specific organization member.
4873 Authorization: Requires MEMBERS_READ permission.
4874*/
4875        async fn list_member_devices(
4876            &self,
4877            request: tonic::Request<super::ListMemberDevicesRequest>,
4878        ) -> std::result::Result<
4879            tonic::Response<super::ListMemberDevicesResponse>,
4880            tonic::Status,
4881        >;
4882    }
4883    /** Manages push notification device registration.
4884 Used by the mobile app to register push tokens and manage device lifecycle.
4885*/
4886    #[derive(Debug)]
4887    pub struct DeviceServiceServer<T> {
4888        inner: Arc<T>,
4889        accept_compression_encodings: EnabledCompressionEncodings,
4890        send_compression_encodings: EnabledCompressionEncodings,
4891        max_decoding_message_size: Option<usize>,
4892        max_encoding_message_size: Option<usize>,
4893    }
4894    impl<T> DeviceServiceServer<T> {
4895        pub fn new(inner: T) -> Self {
4896            Self::from_arc(Arc::new(inner))
4897        }
4898        pub fn from_arc(inner: Arc<T>) -> Self {
4899            Self {
4900                inner,
4901                accept_compression_encodings: Default::default(),
4902                send_compression_encodings: Default::default(),
4903                max_decoding_message_size: None,
4904                max_encoding_message_size: None,
4905            }
4906        }
4907        pub fn with_interceptor<F>(
4908            inner: T,
4909            interceptor: F,
4910        ) -> InterceptedService<Self, F>
4911        where
4912            F: tonic::service::Interceptor,
4913        {
4914            InterceptedService::new(Self::new(inner), interceptor)
4915        }
4916        /// Enable decompressing requests with the given encoding.
4917        #[must_use]
4918        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4919            self.accept_compression_encodings.enable(encoding);
4920            self
4921        }
4922        /// Compress responses with the given encoding, if the client supports it.
4923        #[must_use]
4924        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4925            self.send_compression_encodings.enable(encoding);
4926            self
4927        }
4928        /// Limits the maximum size of a decoded message.
4929        ///
4930        /// Default: `4MB`
4931        #[must_use]
4932        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4933            self.max_decoding_message_size = Some(limit);
4934            self
4935        }
4936        /// Limits the maximum size of an encoded message.
4937        ///
4938        /// Default: `usize::MAX`
4939        #[must_use]
4940        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4941            self.max_encoding_message_size = Some(limit);
4942            self
4943        }
4944    }
4945    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4946    where
4947        T: DeviceService,
4948        B: Body + std::marker::Send + 'static,
4949        B::Error: Into<StdError> + std::marker::Send + 'static,
4950    {
4951        type Response = http::Response<tonic::body::Body>;
4952        type Error = std::convert::Infallible;
4953        type Future = BoxFuture<Self::Response, Self::Error>;
4954        fn poll_ready(
4955            &mut self,
4956            _cx: &mut Context<'_>,
4957        ) -> Poll<std::result::Result<(), Self::Error>> {
4958            Poll::Ready(Ok(()))
4959        }
4960        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4961            match req.uri().path() {
4962                "/pidgr.v1.DeviceService/Register" => {
4963                    #[allow(non_camel_case_types)]
4964                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4965                    impl<
4966                        T: DeviceService,
4967                    > tonic::server::UnaryService<super::RegisterRequest>
4968                    for RegisterSvc<T> {
4969                        type Response = super::RegisterResponse;
4970                        type Future = BoxFuture<
4971                            tonic::Response<Self::Response>,
4972                            tonic::Status,
4973                        >;
4974                        fn call(
4975                            &mut self,
4976                            request: tonic::Request<super::RegisterRequest>,
4977                        ) -> Self::Future {
4978                            let inner = Arc::clone(&self.0);
4979                            let fut = async move {
4980                                <T as DeviceService>::register(&inner, request).await
4981                            };
4982                            Box::pin(fut)
4983                        }
4984                    }
4985                    let accept_compression_encodings = self.accept_compression_encodings;
4986                    let send_compression_encodings = self.send_compression_encodings;
4987                    let max_decoding_message_size = self.max_decoding_message_size;
4988                    let max_encoding_message_size = self.max_encoding_message_size;
4989                    let inner = self.inner.clone();
4990                    let fut = async move {
4991                        let method = RegisterSvc(inner);
4992                        let codec = tonic_prost::ProstCodec::default();
4993                        let mut grpc = tonic::server::Grpc::new(codec)
4994                            .apply_compression_config(
4995                                accept_compression_encodings,
4996                                send_compression_encodings,
4997                            )
4998                            .apply_max_message_size_config(
4999                                max_decoding_message_size,
5000                                max_encoding_message_size,
5001                            );
5002                        let res = grpc.unary(method, req).await;
5003                        Ok(res)
5004                    };
5005                    Box::pin(fut)
5006                }
5007                "/pidgr.v1.DeviceService/Deactivate" => {
5008                    #[allow(non_camel_case_types)]
5009                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
5010                    impl<
5011                        T: DeviceService,
5012                    > tonic::server::UnaryService<super::DeactivateRequest>
5013                    for DeactivateSvc<T> {
5014                        type Response = super::DeactivateResponse;
5015                        type Future = BoxFuture<
5016                            tonic::Response<Self::Response>,
5017                            tonic::Status,
5018                        >;
5019                        fn call(
5020                            &mut self,
5021                            request: tonic::Request<super::DeactivateRequest>,
5022                        ) -> Self::Future {
5023                            let inner = Arc::clone(&self.0);
5024                            let fut = async move {
5025                                <T as DeviceService>::deactivate(&inner, request).await
5026                            };
5027                            Box::pin(fut)
5028                        }
5029                    }
5030                    let accept_compression_encodings = self.accept_compression_encodings;
5031                    let send_compression_encodings = self.send_compression_encodings;
5032                    let max_decoding_message_size = self.max_decoding_message_size;
5033                    let max_encoding_message_size = self.max_encoding_message_size;
5034                    let inner = self.inner.clone();
5035                    let fut = async move {
5036                        let method = DeactivateSvc(inner);
5037                        let codec = tonic_prost::ProstCodec::default();
5038                        let mut grpc = tonic::server::Grpc::new(codec)
5039                            .apply_compression_config(
5040                                accept_compression_encodings,
5041                                send_compression_encodings,
5042                            )
5043                            .apply_max_message_size_config(
5044                                max_decoding_message_size,
5045                                max_encoding_message_size,
5046                            );
5047                        let res = grpc.unary(method, req).await;
5048                        Ok(res)
5049                    };
5050                    Box::pin(fut)
5051                }
5052                "/pidgr.v1.DeviceService/ListDevices" => {
5053                    #[allow(non_camel_case_types)]
5054                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
5055                    impl<
5056                        T: DeviceService,
5057                    > tonic::server::UnaryService<super::ListDevicesRequest>
5058                    for ListDevicesSvc<T> {
5059                        type Response = super::ListDevicesResponse;
5060                        type Future = BoxFuture<
5061                            tonic::Response<Self::Response>,
5062                            tonic::Status,
5063                        >;
5064                        fn call(
5065                            &mut self,
5066                            request: tonic::Request<super::ListDevicesRequest>,
5067                        ) -> Self::Future {
5068                            let inner = Arc::clone(&self.0);
5069                            let fut = async move {
5070                                <T as DeviceService>::list_devices(&inner, request).await
5071                            };
5072                            Box::pin(fut)
5073                        }
5074                    }
5075                    let accept_compression_encodings = self.accept_compression_encodings;
5076                    let send_compression_encodings = self.send_compression_encodings;
5077                    let max_decoding_message_size = self.max_decoding_message_size;
5078                    let max_encoding_message_size = self.max_encoding_message_size;
5079                    let inner = self.inner.clone();
5080                    let fut = async move {
5081                        let method = ListDevicesSvc(inner);
5082                        let codec = tonic_prost::ProstCodec::default();
5083                        let mut grpc = tonic::server::Grpc::new(codec)
5084                            .apply_compression_config(
5085                                accept_compression_encodings,
5086                                send_compression_encodings,
5087                            )
5088                            .apply_max_message_size_config(
5089                                max_decoding_message_size,
5090                                max_encoding_message_size,
5091                            );
5092                        let res = grpc.unary(method, req).await;
5093                        Ok(res)
5094                    };
5095                    Box::pin(fut)
5096                }
5097                "/pidgr.v1.DeviceService/ListMemberDevices" => {
5098                    #[allow(non_camel_case_types)]
5099                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
5100                    impl<
5101                        T: DeviceService,
5102                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
5103                    for ListMemberDevicesSvc<T> {
5104                        type Response = super::ListMemberDevicesResponse;
5105                        type Future = BoxFuture<
5106                            tonic::Response<Self::Response>,
5107                            tonic::Status,
5108                        >;
5109                        fn call(
5110                            &mut self,
5111                            request: tonic::Request<super::ListMemberDevicesRequest>,
5112                        ) -> Self::Future {
5113                            let inner = Arc::clone(&self.0);
5114                            let fut = async move {
5115                                <T as DeviceService>::list_member_devices(&inner, request)
5116                                    .await
5117                            };
5118                            Box::pin(fut)
5119                        }
5120                    }
5121                    let accept_compression_encodings = self.accept_compression_encodings;
5122                    let send_compression_encodings = self.send_compression_encodings;
5123                    let max_decoding_message_size = self.max_decoding_message_size;
5124                    let max_encoding_message_size = self.max_encoding_message_size;
5125                    let inner = self.inner.clone();
5126                    let fut = async move {
5127                        let method = ListMemberDevicesSvc(inner);
5128                        let codec = tonic_prost::ProstCodec::default();
5129                        let mut grpc = tonic::server::Grpc::new(codec)
5130                            .apply_compression_config(
5131                                accept_compression_encodings,
5132                                send_compression_encodings,
5133                            )
5134                            .apply_max_message_size_config(
5135                                max_decoding_message_size,
5136                                max_encoding_message_size,
5137                            );
5138                        let res = grpc.unary(method, req).await;
5139                        Ok(res)
5140                    };
5141                    Box::pin(fut)
5142                }
5143                _ => {
5144                    Box::pin(async move {
5145                        let mut response = http::Response::new(
5146                            tonic::body::Body::default(),
5147                        );
5148                        let headers = response.headers_mut();
5149                        headers
5150                            .insert(
5151                                tonic::Status::GRPC_STATUS,
5152                                (tonic::Code::Unimplemented as i32).into(),
5153                            );
5154                        headers
5155                            .insert(
5156                                http::header::CONTENT_TYPE,
5157                                tonic::metadata::GRPC_CONTENT_TYPE,
5158                            );
5159                        Ok(response)
5160                    })
5161                }
5162            }
5163        }
5164    }
5165    impl<T> Clone for DeviceServiceServer<T> {
5166        fn clone(&self) -> Self {
5167            let inner = self.inner.clone();
5168            Self {
5169                inner,
5170                accept_compression_encodings: self.accept_compression_encodings,
5171                send_compression_encodings: self.send_compression_encodings,
5172                max_decoding_message_size: self.max_decoding_message_size,
5173                max_encoding_message_size: self.max_encoding_message_size,
5174            }
5175        }
5176    }
5177    /// Generated gRPC service name
5178    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
5179    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
5180        const NAME: &'static str = SERVICE_NAME;
5181    }
5182}
5183/// Generated client implementations.
5184pub mod group_service_client {
5185    #![allow(
5186        unused_variables,
5187        dead_code,
5188        missing_docs,
5189        clippy::wildcard_imports,
5190        clippy::let_unit_value,
5191    )]
5192    use tonic::codegen::*;
5193    use tonic::codegen::http::Uri;
5194    /** Manages groups and group membership within an organization.
5195 Groups are recipient collections used for campaign audience targeting.
5196 All RPCs operate within the caller's org (extracted from JWT).
5197*/
5198    #[derive(Debug, Clone)]
5199    pub struct GroupServiceClient<T> {
5200        inner: tonic::client::Grpc<T>,
5201    }
5202    impl GroupServiceClient<tonic::transport::Channel> {
5203        /// Attempt to create a new client by connecting to a given endpoint.
5204        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5205        where
5206            D: TryInto<tonic::transport::Endpoint>,
5207            D::Error: Into<StdError>,
5208        {
5209            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5210            Ok(Self::new(conn))
5211        }
5212    }
5213    impl<T> GroupServiceClient<T>
5214    where
5215        T: tonic::client::GrpcService<tonic::body::Body>,
5216        T::Error: Into<StdError>,
5217        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5218        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5219    {
5220        pub fn new(inner: T) -> Self {
5221            let inner = tonic::client::Grpc::new(inner);
5222            Self { inner }
5223        }
5224        pub fn with_origin(inner: T, origin: Uri) -> Self {
5225            let inner = tonic::client::Grpc::with_origin(inner, origin);
5226            Self { inner }
5227        }
5228        pub fn with_interceptor<F>(
5229            inner: T,
5230            interceptor: F,
5231        ) -> GroupServiceClient<InterceptedService<T, F>>
5232        where
5233            F: tonic::service::Interceptor,
5234            T::ResponseBody: Default,
5235            T: tonic::codegen::Service<
5236                http::Request<tonic::body::Body>,
5237                Response = http::Response<
5238                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5239                >,
5240            >,
5241            <T as tonic::codegen::Service<
5242                http::Request<tonic::body::Body>,
5243            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5244        {
5245            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
5246        }
5247        /// Compress requests with the given encoding.
5248        ///
5249        /// This requires the server to support it otherwise it might respond with an
5250        /// error.
5251        #[must_use]
5252        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5253            self.inner = self.inner.send_compressed(encoding);
5254            self
5255        }
5256        /// Enable decompressing responses.
5257        #[must_use]
5258        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5259            self.inner = self.inner.accept_compressed(encoding);
5260            self
5261        }
5262        /// Limits the maximum size of a decoded message.
5263        ///
5264        /// Default: `4MB`
5265        #[must_use]
5266        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5267            self.inner = self.inner.max_decoding_message_size(limit);
5268            self
5269        }
5270        /// Limits the maximum size of an encoded message.
5271        ///
5272        /// Default: `usize::MAX`
5273        #[must_use]
5274        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5275            self.inner = self.inner.max_encoding_message_size(limit);
5276            self
5277        }
5278        /** Create a new group in the organization.
5279 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5280*/
5281        pub async fn create_group(
5282            &mut self,
5283            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
5284        ) -> std::result::Result<
5285            tonic::Response<super::CreateGroupResponse>,
5286            tonic::Status,
5287        > {
5288            self.inner
5289                .ready()
5290                .await
5291                .map_err(|e| {
5292                    tonic::Status::unknown(
5293                        format!("Service was not ready: {}", e.into()),
5294                    )
5295                })?;
5296            let codec = tonic_prost::ProstCodec::default();
5297            let path = http::uri::PathAndQuery::from_static(
5298                "/pidgr.v1.GroupService/CreateGroup",
5299            );
5300            let mut req = request.into_request();
5301            req.extensions_mut()
5302                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
5303            self.inner.unary(req, path, codec).await
5304        }
5305        /** Retrieve a group by ID.
5306 Authorization: Caller must be a member of the group, or have
5307 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5308*/
5309        pub async fn get_group(
5310            &mut self,
5311            request: impl tonic::IntoRequest<super::GetGroupRequest>,
5312        ) -> std::result::Result<
5313            tonic::Response<super::GetGroupResponse>,
5314            tonic::Status,
5315        > {
5316            self.inner
5317                .ready()
5318                .await
5319                .map_err(|e| {
5320                    tonic::Status::unknown(
5321                        format!("Service was not ready: {}", e.into()),
5322                    )
5323                })?;
5324            let codec = tonic_prost::ProstCodec::default();
5325            let path = http::uri::PathAndQuery::from_static(
5326                "/pidgr.v1.GroupService/GetGroup",
5327            );
5328            let mut req = request.into_request();
5329            req.extensions_mut()
5330                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
5331            self.inner.unary(req, path, codec).await
5332        }
5333        /** List groups in the organization with pagination.
5334 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5335*/
5336        pub async fn list_groups(
5337            &mut self,
5338            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
5339        ) -> std::result::Result<
5340            tonic::Response<super::ListGroupsResponse>,
5341            tonic::Status,
5342        > {
5343            self.inner
5344                .ready()
5345                .await
5346                .map_err(|e| {
5347                    tonic::Status::unknown(
5348                        format!("Service was not ready: {}", e.into()),
5349                    )
5350                })?;
5351            let codec = tonic_prost::ProstCodec::default();
5352            let path = http::uri::PathAndQuery::from_static(
5353                "/pidgr.v1.GroupService/ListGroups",
5354            );
5355            let mut req = request.into_request();
5356            req.extensions_mut()
5357                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
5358            self.inner.unary(req, path, codec).await
5359        }
5360        /** Update a group's name and/or description.
5361 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5362*/
5363        pub async fn update_group(
5364            &mut self,
5365            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
5366        ) -> std::result::Result<
5367            tonic::Response<super::UpdateGroupResponse>,
5368            tonic::Status,
5369        > {
5370            self.inner
5371                .ready()
5372                .await
5373                .map_err(|e| {
5374                    tonic::Status::unknown(
5375                        format!("Service was not ready: {}", e.into()),
5376                    )
5377                })?;
5378            let codec = tonic_prost::ProstCodec::default();
5379            let path = http::uri::PathAndQuery::from_static(
5380                "/pidgr.v1.GroupService/UpdateGroup",
5381            );
5382            let mut req = request.into_request();
5383            req.extensions_mut()
5384                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
5385            self.inner.unary(req, path, codec).await
5386        }
5387        /** Delete a group and all its membership records. Default groups cannot be deleted.
5388 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5389*/
5390        pub async fn delete_group(
5391            &mut self,
5392            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
5393        ) -> std::result::Result<
5394            tonic::Response<super::DeleteGroupResponse>,
5395            tonic::Status,
5396        > {
5397            self.inner
5398                .ready()
5399                .await
5400                .map_err(|e| {
5401                    tonic::Status::unknown(
5402                        format!("Service was not ready: {}", e.into()),
5403                    )
5404                })?;
5405            let codec = tonic_prost::ProstCodec::default();
5406            let path = http::uri::PathAndQuery::from_static(
5407                "/pidgr.v1.GroupService/DeleteGroup",
5408            );
5409            let mut req = request.into_request();
5410            req.extensions_mut()
5411                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
5412            self.inner.unary(req, path, codec).await
5413        }
5414        /** Add one or more users to a group (idempotent).
5415 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5416*/
5417        pub async fn add_group_members(
5418            &mut self,
5419            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
5420        ) -> std::result::Result<
5421            tonic::Response<super::AddGroupMembersResponse>,
5422            tonic::Status,
5423        > {
5424            self.inner
5425                .ready()
5426                .await
5427                .map_err(|e| {
5428                    tonic::Status::unknown(
5429                        format!("Service was not ready: {}", e.into()),
5430                    )
5431                })?;
5432            let codec = tonic_prost::ProstCodec::default();
5433            let path = http::uri::PathAndQuery::from_static(
5434                "/pidgr.v1.GroupService/AddGroupMembers",
5435            );
5436            let mut req = request.into_request();
5437            req.extensions_mut()
5438                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
5439            self.inner.unary(req, path, codec).await
5440        }
5441        /** Remove one or more users from a group (idempotent).
5442 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5443*/
5444        pub async fn remove_group_members(
5445            &mut self,
5446            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
5447        ) -> std::result::Result<
5448            tonic::Response<super::RemoveGroupMembersResponse>,
5449            tonic::Status,
5450        > {
5451            self.inner
5452                .ready()
5453                .await
5454                .map_err(|e| {
5455                    tonic::Status::unknown(
5456                        format!("Service was not ready: {}", e.into()),
5457                    )
5458                })?;
5459            let codec = tonic_prost::ProstCodec::default();
5460            let path = http::uri::PathAndQuery::from_static(
5461                "/pidgr.v1.GroupService/RemoveGroupMembers",
5462            );
5463            let mut req = request.into_request();
5464            req.extensions_mut()
5465                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
5466            self.inner.unary(req, path, codec).await
5467        }
5468        /** List members of a group with pagination.
5469 Authorization: Caller must be a member of the group, or have
5470 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5471*/
5472        pub async fn list_group_members(
5473            &mut self,
5474            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
5475        ) -> std::result::Result<
5476            tonic::Response<super::ListGroupMembersResponse>,
5477            tonic::Status,
5478        > {
5479            self.inner
5480                .ready()
5481                .await
5482                .map_err(|e| {
5483                    tonic::Status::unknown(
5484                        format!("Service was not ready: {}", e.into()),
5485                    )
5486                })?;
5487            let codec = tonic_prost::ProstCodec::default();
5488            let path = http::uri::PathAndQuery::from_static(
5489                "/pidgr.v1.GroupService/ListGroupMembers",
5490            );
5491            let mut req = request.into_request();
5492            req.extensions_mut()
5493                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
5494            self.inner.unary(req, path, codec).await
5495        }
5496        /** Get group memberships for a batch of users.
5497 Used by campaign audience to show group badges.
5498 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5499*/
5500        pub async fn get_user_group_memberships(
5501            &mut self,
5502            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
5503        ) -> std::result::Result<
5504            tonic::Response<super::GetUserGroupMembershipsResponse>,
5505            tonic::Status,
5506        > {
5507            self.inner
5508                .ready()
5509                .await
5510                .map_err(|e| {
5511                    tonic::Status::unknown(
5512                        format!("Service was not ready: {}", e.into()),
5513                    )
5514                })?;
5515            let codec = tonic_prost::ProstCodec::default();
5516            let path = http::uri::PathAndQuery::from_static(
5517                "/pidgr.v1.GroupService/GetUserGroupMemberships",
5518            );
5519            let mut req = request.into_request();
5520            req.extensions_mut()
5521                .insert(
5522                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5523                );
5524            self.inner.unary(req, path, codec).await
5525        }
5526    }
5527}
5528/// Generated server implementations.
5529pub mod group_service_server {
5530    #![allow(
5531        unused_variables,
5532        dead_code,
5533        missing_docs,
5534        clippy::wildcard_imports,
5535        clippy::let_unit_value,
5536    )]
5537    use tonic::codegen::*;
5538    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
5539    #[async_trait]
5540    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5541        /** Create a new group in the organization.
5542 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5543*/
5544        async fn create_group(
5545            &self,
5546            request: tonic::Request<super::CreateGroupRequest>,
5547        ) -> std::result::Result<
5548            tonic::Response<super::CreateGroupResponse>,
5549            tonic::Status,
5550        >;
5551        /** Retrieve a group by ID.
5552 Authorization: Caller must be a member of the group, or have
5553 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5554*/
5555        async fn get_group(
5556            &self,
5557            request: tonic::Request<super::GetGroupRequest>,
5558        ) -> std::result::Result<
5559            tonic::Response<super::GetGroupResponse>,
5560            tonic::Status,
5561        >;
5562        /** List groups in the organization with pagination.
5563 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5564*/
5565        async fn list_groups(
5566            &self,
5567            request: tonic::Request<super::ListGroupsRequest>,
5568        ) -> std::result::Result<
5569            tonic::Response<super::ListGroupsResponse>,
5570            tonic::Status,
5571        >;
5572        /** Update a group's name and/or description.
5573 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5574*/
5575        async fn update_group(
5576            &self,
5577            request: tonic::Request<super::UpdateGroupRequest>,
5578        ) -> std::result::Result<
5579            tonic::Response<super::UpdateGroupResponse>,
5580            tonic::Status,
5581        >;
5582        /** Delete a group and all its membership records. Default groups cannot be deleted.
5583 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5584*/
5585        async fn delete_group(
5586            &self,
5587            request: tonic::Request<super::DeleteGroupRequest>,
5588        ) -> std::result::Result<
5589            tonic::Response<super::DeleteGroupResponse>,
5590            tonic::Status,
5591        >;
5592        /** Add one or more users to a group (idempotent).
5593 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5594*/
5595        async fn add_group_members(
5596            &self,
5597            request: tonic::Request<super::AddGroupMembersRequest>,
5598        ) -> std::result::Result<
5599            tonic::Response<super::AddGroupMembersResponse>,
5600            tonic::Status,
5601        >;
5602        /** Remove one or more users from a group (idempotent).
5603 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5604*/
5605        async fn remove_group_members(
5606            &self,
5607            request: tonic::Request<super::RemoveGroupMembersRequest>,
5608        ) -> std::result::Result<
5609            tonic::Response<super::RemoveGroupMembersResponse>,
5610            tonic::Status,
5611        >;
5612        /** List members of a group with pagination.
5613 Authorization: Caller must be a member of the group, or have
5614 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5615*/
5616        async fn list_group_members(
5617            &self,
5618            request: tonic::Request<super::ListGroupMembersRequest>,
5619        ) -> std::result::Result<
5620            tonic::Response<super::ListGroupMembersResponse>,
5621            tonic::Status,
5622        >;
5623        /** Get group memberships for a batch of users.
5624 Used by campaign audience to show group badges.
5625 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5626*/
5627        async fn get_user_group_memberships(
5628            &self,
5629            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5630        ) -> std::result::Result<
5631            tonic::Response<super::GetUserGroupMembershipsResponse>,
5632            tonic::Status,
5633        >;
5634    }
5635    /** Manages groups and group membership within an organization.
5636 Groups are recipient collections used for campaign audience targeting.
5637 All RPCs operate within the caller's org (extracted from JWT).
5638*/
5639    #[derive(Debug)]
5640    pub struct GroupServiceServer<T> {
5641        inner: Arc<T>,
5642        accept_compression_encodings: EnabledCompressionEncodings,
5643        send_compression_encodings: EnabledCompressionEncodings,
5644        max_decoding_message_size: Option<usize>,
5645        max_encoding_message_size: Option<usize>,
5646    }
5647    impl<T> GroupServiceServer<T> {
5648        pub fn new(inner: T) -> Self {
5649            Self::from_arc(Arc::new(inner))
5650        }
5651        pub fn from_arc(inner: Arc<T>) -> Self {
5652            Self {
5653                inner,
5654                accept_compression_encodings: Default::default(),
5655                send_compression_encodings: Default::default(),
5656                max_decoding_message_size: None,
5657                max_encoding_message_size: None,
5658            }
5659        }
5660        pub fn with_interceptor<F>(
5661            inner: T,
5662            interceptor: F,
5663        ) -> InterceptedService<Self, F>
5664        where
5665            F: tonic::service::Interceptor,
5666        {
5667            InterceptedService::new(Self::new(inner), interceptor)
5668        }
5669        /// Enable decompressing requests with the given encoding.
5670        #[must_use]
5671        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5672            self.accept_compression_encodings.enable(encoding);
5673            self
5674        }
5675        /// Compress responses with the given encoding, if the client supports it.
5676        #[must_use]
5677        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5678            self.send_compression_encodings.enable(encoding);
5679            self
5680        }
5681        /// Limits the maximum size of a decoded message.
5682        ///
5683        /// Default: `4MB`
5684        #[must_use]
5685        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5686            self.max_decoding_message_size = Some(limit);
5687            self
5688        }
5689        /// Limits the maximum size of an encoded message.
5690        ///
5691        /// Default: `usize::MAX`
5692        #[must_use]
5693        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5694            self.max_encoding_message_size = Some(limit);
5695            self
5696        }
5697    }
5698    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5699    where
5700        T: GroupService,
5701        B: Body + std::marker::Send + 'static,
5702        B::Error: Into<StdError> + std::marker::Send + 'static,
5703    {
5704        type Response = http::Response<tonic::body::Body>;
5705        type Error = std::convert::Infallible;
5706        type Future = BoxFuture<Self::Response, Self::Error>;
5707        fn poll_ready(
5708            &mut self,
5709            _cx: &mut Context<'_>,
5710        ) -> Poll<std::result::Result<(), Self::Error>> {
5711            Poll::Ready(Ok(()))
5712        }
5713        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5714            match req.uri().path() {
5715                "/pidgr.v1.GroupService/CreateGroup" => {
5716                    #[allow(non_camel_case_types)]
5717                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5718                    impl<
5719                        T: GroupService,
5720                    > tonic::server::UnaryService<super::CreateGroupRequest>
5721                    for CreateGroupSvc<T> {
5722                        type Response = super::CreateGroupResponse;
5723                        type Future = BoxFuture<
5724                            tonic::Response<Self::Response>,
5725                            tonic::Status,
5726                        >;
5727                        fn call(
5728                            &mut self,
5729                            request: tonic::Request<super::CreateGroupRequest>,
5730                        ) -> Self::Future {
5731                            let inner = Arc::clone(&self.0);
5732                            let fut = async move {
5733                                <T as GroupService>::create_group(&inner, request).await
5734                            };
5735                            Box::pin(fut)
5736                        }
5737                    }
5738                    let accept_compression_encodings = self.accept_compression_encodings;
5739                    let send_compression_encodings = self.send_compression_encodings;
5740                    let max_decoding_message_size = self.max_decoding_message_size;
5741                    let max_encoding_message_size = self.max_encoding_message_size;
5742                    let inner = self.inner.clone();
5743                    let fut = async move {
5744                        let method = CreateGroupSvc(inner);
5745                        let codec = tonic_prost::ProstCodec::default();
5746                        let mut grpc = tonic::server::Grpc::new(codec)
5747                            .apply_compression_config(
5748                                accept_compression_encodings,
5749                                send_compression_encodings,
5750                            )
5751                            .apply_max_message_size_config(
5752                                max_decoding_message_size,
5753                                max_encoding_message_size,
5754                            );
5755                        let res = grpc.unary(method, req).await;
5756                        Ok(res)
5757                    };
5758                    Box::pin(fut)
5759                }
5760                "/pidgr.v1.GroupService/GetGroup" => {
5761                    #[allow(non_camel_case_types)]
5762                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5763                    impl<
5764                        T: GroupService,
5765                    > tonic::server::UnaryService<super::GetGroupRequest>
5766                    for GetGroupSvc<T> {
5767                        type Response = super::GetGroupResponse;
5768                        type Future = BoxFuture<
5769                            tonic::Response<Self::Response>,
5770                            tonic::Status,
5771                        >;
5772                        fn call(
5773                            &mut self,
5774                            request: tonic::Request<super::GetGroupRequest>,
5775                        ) -> Self::Future {
5776                            let inner = Arc::clone(&self.0);
5777                            let fut = async move {
5778                                <T as GroupService>::get_group(&inner, request).await
5779                            };
5780                            Box::pin(fut)
5781                        }
5782                    }
5783                    let accept_compression_encodings = self.accept_compression_encodings;
5784                    let send_compression_encodings = self.send_compression_encodings;
5785                    let max_decoding_message_size = self.max_decoding_message_size;
5786                    let max_encoding_message_size = self.max_encoding_message_size;
5787                    let inner = self.inner.clone();
5788                    let fut = async move {
5789                        let method = GetGroupSvc(inner);
5790                        let codec = tonic_prost::ProstCodec::default();
5791                        let mut grpc = tonic::server::Grpc::new(codec)
5792                            .apply_compression_config(
5793                                accept_compression_encodings,
5794                                send_compression_encodings,
5795                            )
5796                            .apply_max_message_size_config(
5797                                max_decoding_message_size,
5798                                max_encoding_message_size,
5799                            );
5800                        let res = grpc.unary(method, req).await;
5801                        Ok(res)
5802                    };
5803                    Box::pin(fut)
5804                }
5805                "/pidgr.v1.GroupService/ListGroups" => {
5806                    #[allow(non_camel_case_types)]
5807                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5808                    impl<
5809                        T: GroupService,
5810                    > tonic::server::UnaryService<super::ListGroupsRequest>
5811                    for ListGroupsSvc<T> {
5812                        type Response = super::ListGroupsResponse;
5813                        type Future = BoxFuture<
5814                            tonic::Response<Self::Response>,
5815                            tonic::Status,
5816                        >;
5817                        fn call(
5818                            &mut self,
5819                            request: tonic::Request<super::ListGroupsRequest>,
5820                        ) -> Self::Future {
5821                            let inner = Arc::clone(&self.0);
5822                            let fut = async move {
5823                                <T as GroupService>::list_groups(&inner, request).await
5824                            };
5825                            Box::pin(fut)
5826                        }
5827                    }
5828                    let accept_compression_encodings = self.accept_compression_encodings;
5829                    let send_compression_encodings = self.send_compression_encodings;
5830                    let max_decoding_message_size = self.max_decoding_message_size;
5831                    let max_encoding_message_size = self.max_encoding_message_size;
5832                    let inner = self.inner.clone();
5833                    let fut = async move {
5834                        let method = ListGroupsSvc(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/UpdateGroup" => {
5851                    #[allow(non_camel_case_types)]
5852                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5853                    impl<
5854                        T: GroupService,
5855                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5856                    for UpdateGroupSvc<T> {
5857                        type Response = super::UpdateGroupResponse;
5858                        type Future = BoxFuture<
5859                            tonic::Response<Self::Response>,
5860                            tonic::Status,
5861                        >;
5862                        fn call(
5863                            &mut self,
5864                            request: tonic::Request<super::UpdateGroupRequest>,
5865                        ) -> Self::Future {
5866                            let inner = Arc::clone(&self.0);
5867                            let fut = async move {
5868                                <T as GroupService>::update_group(&inner, request).await
5869                            };
5870                            Box::pin(fut)
5871                        }
5872                    }
5873                    let accept_compression_encodings = self.accept_compression_encodings;
5874                    let send_compression_encodings = self.send_compression_encodings;
5875                    let max_decoding_message_size = self.max_decoding_message_size;
5876                    let max_encoding_message_size = self.max_encoding_message_size;
5877                    let inner = self.inner.clone();
5878                    let fut = async move {
5879                        let method = UpdateGroupSvc(inner);
5880                        let codec = tonic_prost::ProstCodec::default();
5881                        let mut grpc = tonic::server::Grpc::new(codec)
5882                            .apply_compression_config(
5883                                accept_compression_encodings,
5884                                send_compression_encodings,
5885                            )
5886                            .apply_max_message_size_config(
5887                                max_decoding_message_size,
5888                                max_encoding_message_size,
5889                            );
5890                        let res = grpc.unary(method, req).await;
5891                        Ok(res)
5892                    };
5893                    Box::pin(fut)
5894                }
5895                "/pidgr.v1.GroupService/DeleteGroup" => {
5896                    #[allow(non_camel_case_types)]
5897                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5898                    impl<
5899                        T: GroupService,
5900                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5901                    for DeleteGroupSvc<T> {
5902                        type Response = super::DeleteGroupResponse;
5903                        type Future = BoxFuture<
5904                            tonic::Response<Self::Response>,
5905                            tonic::Status,
5906                        >;
5907                        fn call(
5908                            &mut self,
5909                            request: tonic::Request<super::DeleteGroupRequest>,
5910                        ) -> Self::Future {
5911                            let inner = Arc::clone(&self.0);
5912                            let fut = async move {
5913                                <T as GroupService>::delete_group(&inner, request).await
5914                            };
5915                            Box::pin(fut)
5916                        }
5917                    }
5918                    let accept_compression_encodings = self.accept_compression_encodings;
5919                    let send_compression_encodings = self.send_compression_encodings;
5920                    let max_decoding_message_size = self.max_decoding_message_size;
5921                    let max_encoding_message_size = self.max_encoding_message_size;
5922                    let inner = self.inner.clone();
5923                    let fut = async move {
5924                        let method = DeleteGroupSvc(inner);
5925                        let codec = tonic_prost::ProstCodec::default();
5926                        let mut grpc = tonic::server::Grpc::new(codec)
5927                            .apply_compression_config(
5928                                accept_compression_encodings,
5929                                send_compression_encodings,
5930                            )
5931                            .apply_max_message_size_config(
5932                                max_decoding_message_size,
5933                                max_encoding_message_size,
5934                            );
5935                        let res = grpc.unary(method, req).await;
5936                        Ok(res)
5937                    };
5938                    Box::pin(fut)
5939                }
5940                "/pidgr.v1.GroupService/AddGroupMembers" => {
5941                    #[allow(non_camel_case_types)]
5942                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5943                    impl<
5944                        T: GroupService,
5945                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5946                    for AddGroupMembersSvc<T> {
5947                        type Response = super::AddGroupMembersResponse;
5948                        type Future = BoxFuture<
5949                            tonic::Response<Self::Response>,
5950                            tonic::Status,
5951                        >;
5952                        fn call(
5953                            &mut self,
5954                            request: tonic::Request<super::AddGroupMembersRequest>,
5955                        ) -> Self::Future {
5956                            let inner = Arc::clone(&self.0);
5957                            let fut = async move {
5958                                <T as GroupService>::add_group_members(&inner, request)
5959                                    .await
5960                            };
5961                            Box::pin(fut)
5962                        }
5963                    }
5964                    let accept_compression_encodings = self.accept_compression_encodings;
5965                    let send_compression_encodings = self.send_compression_encodings;
5966                    let max_decoding_message_size = self.max_decoding_message_size;
5967                    let max_encoding_message_size = self.max_encoding_message_size;
5968                    let inner = self.inner.clone();
5969                    let fut = async move {
5970                        let method = AddGroupMembersSvc(inner);
5971                        let codec = tonic_prost::ProstCodec::default();
5972                        let mut grpc = tonic::server::Grpc::new(codec)
5973                            .apply_compression_config(
5974                                accept_compression_encodings,
5975                                send_compression_encodings,
5976                            )
5977                            .apply_max_message_size_config(
5978                                max_decoding_message_size,
5979                                max_encoding_message_size,
5980                            );
5981                        let res = grpc.unary(method, req).await;
5982                        Ok(res)
5983                    };
5984                    Box::pin(fut)
5985                }
5986                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5987                    #[allow(non_camel_case_types)]
5988                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5989                    impl<
5990                        T: GroupService,
5991                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5992                    for RemoveGroupMembersSvc<T> {
5993                        type Response = super::RemoveGroupMembersResponse;
5994                        type Future = BoxFuture<
5995                            tonic::Response<Self::Response>,
5996                            tonic::Status,
5997                        >;
5998                        fn call(
5999                            &mut self,
6000                            request: tonic::Request<super::RemoveGroupMembersRequest>,
6001                        ) -> Self::Future {
6002                            let inner = Arc::clone(&self.0);
6003                            let fut = async move {
6004                                <T as GroupService>::remove_group_members(&inner, request)
6005                                    .await
6006                            };
6007                            Box::pin(fut)
6008                        }
6009                    }
6010                    let accept_compression_encodings = self.accept_compression_encodings;
6011                    let send_compression_encodings = self.send_compression_encodings;
6012                    let max_decoding_message_size = self.max_decoding_message_size;
6013                    let max_encoding_message_size = self.max_encoding_message_size;
6014                    let inner = self.inner.clone();
6015                    let fut = async move {
6016                        let method = RemoveGroupMembersSvc(inner);
6017                        let codec = tonic_prost::ProstCodec::default();
6018                        let mut grpc = tonic::server::Grpc::new(codec)
6019                            .apply_compression_config(
6020                                accept_compression_encodings,
6021                                send_compression_encodings,
6022                            )
6023                            .apply_max_message_size_config(
6024                                max_decoding_message_size,
6025                                max_encoding_message_size,
6026                            );
6027                        let res = grpc.unary(method, req).await;
6028                        Ok(res)
6029                    };
6030                    Box::pin(fut)
6031                }
6032                "/pidgr.v1.GroupService/ListGroupMembers" => {
6033                    #[allow(non_camel_case_types)]
6034                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
6035                    impl<
6036                        T: GroupService,
6037                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
6038                    for ListGroupMembersSvc<T> {
6039                        type Response = super::ListGroupMembersResponse;
6040                        type Future = BoxFuture<
6041                            tonic::Response<Self::Response>,
6042                            tonic::Status,
6043                        >;
6044                        fn call(
6045                            &mut self,
6046                            request: tonic::Request<super::ListGroupMembersRequest>,
6047                        ) -> Self::Future {
6048                            let inner = Arc::clone(&self.0);
6049                            let fut = async move {
6050                                <T as GroupService>::list_group_members(&inner, request)
6051                                    .await
6052                            };
6053                            Box::pin(fut)
6054                        }
6055                    }
6056                    let accept_compression_encodings = self.accept_compression_encodings;
6057                    let send_compression_encodings = self.send_compression_encodings;
6058                    let max_decoding_message_size = self.max_decoding_message_size;
6059                    let max_encoding_message_size = self.max_encoding_message_size;
6060                    let inner = self.inner.clone();
6061                    let fut = async move {
6062                        let method = ListGroupMembersSvc(inner);
6063                        let codec = tonic_prost::ProstCodec::default();
6064                        let mut grpc = tonic::server::Grpc::new(codec)
6065                            .apply_compression_config(
6066                                accept_compression_encodings,
6067                                send_compression_encodings,
6068                            )
6069                            .apply_max_message_size_config(
6070                                max_decoding_message_size,
6071                                max_encoding_message_size,
6072                            );
6073                        let res = grpc.unary(method, req).await;
6074                        Ok(res)
6075                    };
6076                    Box::pin(fut)
6077                }
6078                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
6079                    #[allow(non_camel_case_types)]
6080                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
6081                    impl<
6082                        T: GroupService,
6083                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
6084                    for GetUserGroupMembershipsSvc<T> {
6085                        type Response = super::GetUserGroupMembershipsResponse;
6086                        type Future = BoxFuture<
6087                            tonic::Response<Self::Response>,
6088                            tonic::Status,
6089                        >;
6090                        fn call(
6091                            &mut self,
6092                            request: tonic::Request<
6093                                super::GetUserGroupMembershipsRequest,
6094                            >,
6095                        ) -> Self::Future {
6096                            let inner = Arc::clone(&self.0);
6097                            let fut = async move {
6098                                <T as GroupService>::get_user_group_memberships(
6099                                        &inner,
6100                                        request,
6101                                    )
6102                                    .await
6103                            };
6104                            Box::pin(fut)
6105                        }
6106                    }
6107                    let accept_compression_encodings = self.accept_compression_encodings;
6108                    let send_compression_encodings = self.send_compression_encodings;
6109                    let max_decoding_message_size = self.max_decoding_message_size;
6110                    let max_encoding_message_size = self.max_encoding_message_size;
6111                    let inner = self.inner.clone();
6112                    let fut = async move {
6113                        let method = GetUserGroupMembershipsSvc(inner);
6114                        let codec = tonic_prost::ProstCodec::default();
6115                        let mut grpc = tonic::server::Grpc::new(codec)
6116                            .apply_compression_config(
6117                                accept_compression_encodings,
6118                                send_compression_encodings,
6119                            )
6120                            .apply_max_message_size_config(
6121                                max_decoding_message_size,
6122                                max_encoding_message_size,
6123                            );
6124                        let res = grpc.unary(method, req).await;
6125                        Ok(res)
6126                    };
6127                    Box::pin(fut)
6128                }
6129                _ => {
6130                    Box::pin(async move {
6131                        let mut response = http::Response::new(
6132                            tonic::body::Body::default(),
6133                        );
6134                        let headers = response.headers_mut();
6135                        headers
6136                            .insert(
6137                                tonic::Status::GRPC_STATUS,
6138                                (tonic::Code::Unimplemented as i32).into(),
6139                            );
6140                        headers
6141                            .insert(
6142                                http::header::CONTENT_TYPE,
6143                                tonic::metadata::GRPC_CONTENT_TYPE,
6144                            );
6145                        Ok(response)
6146                    })
6147                }
6148            }
6149        }
6150    }
6151    impl<T> Clone for GroupServiceServer<T> {
6152        fn clone(&self) -> Self {
6153            let inner = self.inner.clone();
6154            Self {
6155                inner,
6156                accept_compression_encodings: self.accept_compression_encodings,
6157                send_compression_encodings: self.send_compression_encodings,
6158                max_decoding_message_size: self.max_decoding_message_size,
6159                max_encoding_message_size: self.max_encoding_message_size,
6160            }
6161        }
6162    }
6163    /// Generated gRPC service name
6164    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
6165    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
6166        const NAME: &'static str = SERVICE_NAME;
6167    }
6168}
6169/// Generated client implementations.
6170pub mod heatmap_service_client {
6171    #![allow(
6172        unused_variables,
6173        dead_code,
6174        missing_docs,
6175        clippy::wildcard_imports,
6176        clippy::let_unit_value,
6177    )]
6178    use tonic::codegen::*;
6179    use tonic::codegen::http::Uri;
6180    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6181 for mobile app interaction analytics.
6182*/
6183    #[derive(Debug, Clone)]
6184    pub struct HeatmapServiceClient<T> {
6185        inner: tonic::client::Grpc<T>,
6186    }
6187    impl HeatmapServiceClient<tonic::transport::Channel> {
6188        /// Attempt to create a new client by connecting to a given endpoint.
6189        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6190        where
6191            D: TryInto<tonic::transport::Endpoint>,
6192            D::Error: Into<StdError>,
6193        {
6194            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6195            Ok(Self::new(conn))
6196        }
6197    }
6198    impl<T> HeatmapServiceClient<T>
6199    where
6200        T: tonic::client::GrpcService<tonic::body::Body>,
6201        T::Error: Into<StdError>,
6202        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6203        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6204    {
6205        pub fn new(inner: T) -> Self {
6206            let inner = tonic::client::Grpc::new(inner);
6207            Self { inner }
6208        }
6209        pub fn with_origin(inner: T, origin: Uri) -> Self {
6210            let inner = tonic::client::Grpc::with_origin(inner, origin);
6211            Self { inner }
6212        }
6213        pub fn with_interceptor<F>(
6214            inner: T,
6215            interceptor: F,
6216        ) -> HeatmapServiceClient<InterceptedService<T, F>>
6217        where
6218            F: tonic::service::Interceptor,
6219            T::ResponseBody: Default,
6220            T: tonic::codegen::Service<
6221                http::Request<tonic::body::Body>,
6222                Response = http::Response<
6223                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6224                >,
6225            >,
6226            <T as tonic::codegen::Service<
6227                http::Request<tonic::body::Body>,
6228            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6229        {
6230            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
6231        }
6232        /// Compress requests with the given encoding.
6233        ///
6234        /// This requires the server to support it otherwise it might respond with an
6235        /// error.
6236        #[must_use]
6237        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6238            self.inner = self.inner.send_compressed(encoding);
6239            self
6240        }
6241        /// Enable decompressing responses.
6242        #[must_use]
6243        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6244            self.inner = self.inner.accept_compressed(encoding);
6245            self
6246        }
6247        /// Limits the maximum size of a decoded message.
6248        ///
6249        /// Default: `4MB`
6250        #[must_use]
6251        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6252            self.inner = self.inner.max_decoding_message_size(limit);
6253            self
6254        }
6255        /// Limits the maximum size of an encoded message.
6256        ///
6257        /// Default: `usize::MAX`
6258        #[must_use]
6259        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6260            self.inner = self.inner.max_encoding_message_size(limit);
6261            self
6262        }
6263        /** Ingest a batch of touch events from the mobile app.
6264 Authorization: Authenticated mobile user.
6265*/
6266        pub async fn ingest_touch_events(
6267            &mut self,
6268            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
6269        ) -> std::result::Result<
6270            tonic::Response<super::IngestTouchEventsResponse>,
6271            tonic::Status,
6272        > {
6273            self.inner
6274                .ready()
6275                .await
6276                .map_err(|e| {
6277                    tonic::Status::unknown(
6278                        format!("Service was not ready: {}", e.into()),
6279                    )
6280                })?;
6281            let codec = tonic_prost::ProstCodec::default();
6282            let path = http::uri::PathAndQuery::from_static(
6283                "/pidgr.v1.HeatmapService/IngestTouchEvents",
6284            );
6285            let mut req = request.into_request();
6286            req.extensions_mut()
6287                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
6288            self.inner.unary(req, path, codec).await
6289        }
6290        /** Query aggregated touch data for heatmap rendering.
6291 Authorization: Requires CAMPAIGNS_READ permission.
6292*/
6293        pub async fn query_heatmap_data(
6294            &mut self,
6295            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
6296        ) -> std::result::Result<
6297            tonic::Response<super::QueryHeatmapDataResponse>,
6298            tonic::Status,
6299        > {
6300            self.inner
6301                .ready()
6302                .await
6303                .map_err(|e| {
6304                    tonic::Status::unknown(
6305                        format!("Service was not ready: {}", e.into()),
6306                    )
6307                })?;
6308            let codec = tonic_prost::ProstCodec::default();
6309            let path = http::uri::PathAndQuery::from_static(
6310                "/pidgr.v1.HeatmapService/QueryHeatmapData",
6311            );
6312            let mut req = request.into_request();
6313            req.extensions_mut()
6314                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
6315            self.inner.unary(req, path, codec).await
6316        }
6317        /** List available screen screenshots for heatmap backgrounds.
6318 Authorization: Requires CAMPAIGNS_READ permission.
6319*/
6320        pub async fn list_screenshots(
6321            &mut self,
6322            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
6323        ) -> std::result::Result<
6324            tonic::Response<super::ListScreenshotsResponse>,
6325            tonic::Status,
6326        > {
6327            self.inner
6328                .ready()
6329                .await
6330                .map_err(|e| {
6331                    tonic::Status::unknown(
6332                        format!("Service was not ready: {}", e.into()),
6333                    )
6334                })?;
6335            let codec = tonic_prost::ProstCodec::default();
6336            let path = http::uri::PathAndQuery::from_static(
6337                "/pidgr.v1.HeatmapService/ListScreenshots",
6338            );
6339            let mut req = request.into_request();
6340            req.extensions_mut()
6341                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
6342            self.inner.unary(req, path, codec).await
6343        }
6344        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6345 Authorization: Authenticated mobile user.
6346*/
6347        pub async fn upload_screenshot(
6348            &mut self,
6349            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
6350        ) -> std::result::Result<
6351            tonic::Response<super::UploadScreenshotResponse>,
6352            tonic::Status,
6353        > {
6354            self.inner
6355                .ready()
6356                .await
6357                .map_err(|e| {
6358                    tonic::Status::unknown(
6359                        format!("Service was not ready: {}", e.into()),
6360                    )
6361                })?;
6362            let codec = tonic_prost::ProstCodec::default();
6363            let path = http::uri::PathAndQuery::from_static(
6364                "/pidgr.v1.HeatmapService/UploadScreenshot",
6365            );
6366            let mut req = request.into_request();
6367            req.extensions_mut()
6368                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
6369            self.inner.unary(req, path, codec).await
6370        }
6371    }
6372}
6373/// Generated server implementations.
6374pub mod heatmap_service_server {
6375    #![allow(
6376        unused_variables,
6377        dead_code,
6378        missing_docs,
6379        clippy::wildcard_imports,
6380        clippy::let_unit_value,
6381    )]
6382    use tonic::codegen::*;
6383    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
6384    #[async_trait]
6385    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
6386        /** Ingest a batch of touch events from the mobile app.
6387 Authorization: Authenticated mobile user.
6388*/
6389        async fn ingest_touch_events(
6390            &self,
6391            request: tonic::Request<super::IngestTouchEventsRequest>,
6392        ) -> std::result::Result<
6393            tonic::Response<super::IngestTouchEventsResponse>,
6394            tonic::Status,
6395        >;
6396        /** Query aggregated touch data for heatmap rendering.
6397 Authorization: Requires CAMPAIGNS_READ permission.
6398*/
6399        async fn query_heatmap_data(
6400            &self,
6401            request: tonic::Request<super::QueryHeatmapDataRequest>,
6402        ) -> std::result::Result<
6403            tonic::Response<super::QueryHeatmapDataResponse>,
6404            tonic::Status,
6405        >;
6406        /** List available screen screenshots for heatmap backgrounds.
6407 Authorization: Requires CAMPAIGNS_READ permission.
6408*/
6409        async fn list_screenshots(
6410            &self,
6411            request: tonic::Request<super::ListScreenshotsRequest>,
6412        ) -> std::result::Result<
6413            tonic::Response<super::ListScreenshotsResponse>,
6414            tonic::Status,
6415        >;
6416        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6417 Authorization: Authenticated mobile user.
6418*/
6419        async fn upload_screenshot(
6420            &self,
6421            request: tonic::Request<super::UploadScreenshotRequest>,
6422        ) -> std::result::Result<
6423            tonic::Response<super::UploadScreenshotResponse>,
6424            tonic::Status,
6425        >;
6426    }
6427    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6428 for mobile app interaction analytics.
6429*/
6430    #[derive(Debug)]
6431    pub struct HeatmapServiceServer<T> {
6432        inner: Arc<T>,
6433        accept_compression_encodings: EnabledCompressionEncodings,
6434        send_compression_encodings: EnabledCompressionEncodings,
6435        max_decoding_message_size: Option<usize>,
6436        max_encoding_message_size: Option<usize>,
6437    }
6438    impl<T> HeatmapServiceServer<T> {
6439        pub fn new(inner: T) -> Self {
6440            Self::from_arc(Arc::new(inner))
6441        }
6442        pub fn from_arc(inner: Arc<T>) -> Self {
6443            Self {
6444                inner,
6445                accept_compression_encodings: Default::default(),
6446                send_compression_encodings: Default::default(),
6447                max_decoding_message_size: None,
6448                max_encoding_message_size: None,
6449            }
6450        }
6451        pub fn with_interceptor<F>(
6452            inner: T,
6453            interceptor: F,
6454        ) -> InterceptedService<Self, F>
6455        where
6456            F: tonic::service::Interceptor,
6457        {
6458            InterceptedService::new(Self::new(inner), interceptor)
6459        }
6460        /// Enable decompressing requests with the given encoding.
6461        #[must_use]
6462        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6463            self.accept_compression_encodings.enable(encoding);
6464            self
6465        }
6466        /// Compress responses with the given encoding, if the client supports it.
6467        #[must_use]
6468        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6469            self.send_compression_encodings.enable(encoding);
6470            self
6471        }
6472        /// Limits the maximum size of a decoded message.
6473        ///
6474        /// Default: `4MB`
6475        #[must_use]
6476        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6477            self.max_decoding_message_size = Some(limit);
6478            self
6479        }
6480        /// Limits the maximum size of an encoded message.
6481        ///
6482        /// Default: `usize::MAX`
6483        #[must_use]
6484        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6485            self.max_encoding_message_size = Some(limit);
6486            self
6487        }
6488    }
6489    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
6490    where
6491        T: HeatmapService,
6492        B: Body + std::marker::Send + 'static,
6493        B::Error: Into<StdError> + std::marker::Send + 'static,
6494    {
6495        type Response = http::Response<tonic::body::Body>;
6496        type Error = std::convert::Infallible;
6497        type Future = BoxFuture<Self::Response, Self::Error>;
6498        fn poll_ready(
6499            &mut self,
6500            _cx: &mut Context<'_>,
6501        ) -> Poll<std::result::Result<(), Self::Error>> {
6502            Poll::Ready(Ok(()))
6503        }
6504        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6505            match req.uri().path() {
6506                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
6507                    #[allow(non_camel_case_types)]
6508                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6509                    impl<
6510                        T: HeatmapService,
6511                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6512                    for IngestTouchEventsSvc<T> {
6513                        type Response = super::IngestTouchEventsResponse;
6514                        type Future = BoxFuture<
6515                            tonic::Response<Self::Response>,
6516                            tonic::Status,
6517                        >;
6518                        fn call(
6519                            &mut self,
6520                            request: tonic::Request<super::IngestTouchEventsRequest>,
6521                        ) -> Self::Future {
6522                            let inner = Arc::clone(&self.0);
6523                            let fut = async move {
6524                                <T as HeatmapService>::ingest_touch_events(&inner, request)
6525                                    .await
6526                            };
6527                            Box::pin(fut)
6528                        }
6529                    }
6530                    let accept_compression_encodings = self.accept_compression_encodings;
6531                    let send_compression_encodings = self.send_compression_encodings;
6532                    let max_decoding_message_size = self.max_decoding_message_size;
6533                    let max_encoding_message_size = self.max_encoding_message_size;
6534                    let inner = self.inner.clone();
6535                    let fut = async move {
6536                        let method = IngestTouchEventsSvc(inner);
6537                        let codec = tonic_prost::ProstCodec::default();
6538                        let mut grpc = tonic::server::Grpc::new(codec)
6539                            .apply_compression_config(
6540                                accept_compression_encodings,
6541                                send_compression_encodings,
6542                            )
6543                            .apply_max_message_size_config(
6544                                max_decoding_message_size,
6545                                max_encoding_message_size,
6546                            );
6547                        let res = grpc.unary(method, req).await;
6548                        Ok(res)
6549                    };
6550                    Box::pin(fut)
6551                }
6552                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6553                    #[allow(non_camel_case_types)]
6554                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6555                    impl<
6556                        T: HeatmapService,
6557                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6558                    for QueryHeatmapDataSvc<T> {
6559                        type Response = super::QueryHeatmapDataResponse;
6560                        type Future = BoxFuture<
6561                            tonic::Response<Self::Response>,
6562                            tonic::Status,
6563                        >;
6564                        fn call(
6565                            &mut self,
6566                            request: tonic::Request<super::QueryHeatmapDataRequest>,
6567                        ) -> Self::Future {
6568                            let inner = Arc::clone(&self.0);
6569                            let fut = async move {
6570                                <T as HeatmapService>::query_heatmap_data(&inner, request)
6571                                    .await
6572                            };
6573                            Box::pin(fut)
6574                        }
6575                    }
6576                    let accept_compression_encodings = self.accept_compression_encodings;
6577                    let send_compression_encodings = self.send_compression_encodings;
6578                    let max_decoding_message_size = self.max_decoding_message_size;
6579                    let max_encoding_message_size = self.max_encoding_message_size;
6580                    let inner = self.inner.clone();
6581                    let fut = async move {
6582                        let method = QueryHeatmapDataSvc(inner);
6583                        let codec = tonic_prost::ProstCodec::default();
6584                        let mut grpc = tonic::server::Grpc::new(codec)
6585                            .apply_compression_config(
6586                                accept_compression_encodings,
6587                                send_compression_encodings,
6588                            )
6589                            .apply_max_message_size_config(
6590                                max_decoding_message_size,
6591                                max_encoding_message_size,
6592                            );
6593                        let res = grpc.unary(method, req).await;
6594                        Ok(res)
6595                    };
6596                    Box::pin(fut)
6597                }
6598                "/pidgr.v1.HeatmapService/ListScreenshots" => {
6599                    #[allow(non_camel_case_types)]
6600                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6601                    impl<
6602                        T: HeatmapService,
6603                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
6604                    for ListScreenshotsSvc<T> {
6605                        type Response = super::ListScreenshotsResponse;
6606                        type Future = BoxFuture<
6607                            tonic::Response<Self::Response>,
6608                            tonic::Status,
6609                        >;
6610                        fn call(
6611                            &mut self,
6612                            request: tonic::Request<super::ListScreenshotsRequest>,
6613                        ) -> Self::Future {
6614                            let inner = Arc::clone(&self.0);
6615                            let fut = async move {
6616                                <T as HeatmapService>::list_screenshots(&inner, request)
6617                                    .await
6618                            };
6619                            Box::pin(fut)
6620                        }
6621                    }
6622                    let accept_compression_encodings = self.accept_compression_encodings;
6623                    let send_compression_encodings = self.send_compression_encodings;
6624                    let max_decoding_message_size = self.max_decoding_message_size;
6625                    let max_encoding_message_size = self.max_encoding_message_size;
6626                    let inner = self.inner.clone();
6627                    let fut = async move {
6628                        let method = ListScreenshotsSvc(inner);
6629                        let codec = tonic_prost::ProstCodec::default();
6630                        let mut grpc = tonic::server::Grpc::new(codec)
6631                            .apply_compression_config(
6632                                accept_compression_encodings,
6633                                send_compression_encodings,
6634                            )
6635                            .apply_max_message_size_config(
6636                                max_decoding_message_size,
6637                                max_encoding_message_size,
6638                            );
6639                        let res = grpc.unary(method, req).await;
6640                        Ok(res)
6641                    };
6642                    Box::pin(fut)
6643                }
6644                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6645                    #[allow(non_camel_case_types)]
6646                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6647                    impl<
6648                        T: HeatmapService,
6649                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
6650                    for UploadScreenshotSvc<T> {
6651                        type Response = super::UploadScreenshotResponse;
6652                        type Future = BoxFuture<
6653                            tonic::Response<Self::Response>,
6654                            tonic::Status,
6655                        >;
6656                        fn call(
6657                            &mut self,
6658                            request: tonic::Request<super::UploadScreenshotRequest>,
6659                        ) -> Self::Future {
6660                            let inner = Arc::clone(&self.0);
6661                            let fut = async move {
6662                                <T as HeatmapService>::upload_screenshot(&inner, request)
6663                                    .await
6664                            };
6665                            Box::pin(fut)
6666                        }
6667                    }
6668                    let accept_compression_encodings = self.accept_compression_encodings;
6669                    let send_compression_encodings = self.send_compression_encodings;
6670                    let max_decoding_message_size = self.max_decoding_message_size;
6671                    let max_encoding_message_size = self.max_encoding_message_size;
6672                    let inner = self.inner.clone();
6673                    let fut = async move {
6674                        let method = UploadScreenshotSvc(inner);
6675                        let codec = tonic_prost::ProstCodec::default();
6676                        let mut grpc = tonic::server::Grpc::new(codec)
6677                            .apply_compression_config(
6678                                accept_compression_encodings,
6679                                send_compression_encodings,
6680                            )
6681                            .apply_max_message_size_config(
6682                                max_decoding_message_size,
6683                                max_encoding_message_size,
6684                            );
6685                        let res = grpc.unary(method, req).await;
6686                        Ok(res)
6687                    };
6688                    Box::pin(fut)
6689                }
6690                _ => {
6691                    Box::pin(async move {
6692                        let mut response = http::Response::new(
6693                            tonic::body::Body::default(),
6694                        );
6695                        let headers = response.headers_mut();
6696                        headers
6697                            .insert(
6698                                tonic::Status::GRPC_STATUS,
6699                                (tonic::Code::Unimplemented as i32).into(),
6700                            );
6701                        headers
6702                            .insert(
6703                                http::header::CONTENT_TYPE,
6704                                tonic::metadata::GRPC_CONTENT_TYPE,
6705                            );
6706                        Ok(response)
6707                    })
6708                }
6709            }
6710        }
6711    }
6712    impl<T> Clone for HeatmapServiceServer<T> {
6713        fn clone(&self) -> Self {
6714            let inner = self.inner.clone();
6715            Self {
6716                inner,
6717                accept_compression_encodings: self.accept_compression_encodings,
6718                send_compression_encodings: self.send_compression_encodings,
6719                max_decoding_message_size: self.max_decoding_message_size,
6720                max_encoding_message_size: self.max_encoding_message_size,
6721            }
6722        }
6723    }
6724    /// Generated gRPC service name
6725    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6726    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6727        const NAME: &'static str = SERVICE_NAME;
6728    }
6729}
6730/// Generated client implementations.
6731pub mod inbox_service_client {
6732    #![allow(
6733        unused_variables,
6734        dead_code,
6735        missing_docs,
6736        clippy::wildcard_imports,
6737        clippy::let_unit_value,
6738    )]
6739    use tonic::codegen::*;
6740    use tonic::codegen::http::Uri;
6741    /** Provides the mobile app's inbox experience — syncing messages,
6742 tracking read status, and retrieving individual entries.
6743*/
6744    #[derive(Debug, Clone)]
6745    pub struct InboxServiceClient<T> {
6746        inner: tonic::client::Grpc<T>,
6747    }
6748    impl InboxServiceClient<tonic::transport::Channel> {
6749        /// Attempt to create a new client by connecting to a given endpoint.
6750        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6751        where
6752            D: TryInto<tonic::transport::Endpoint>,
6753            D::Error: Into<StdError>,
6754        {
6755            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6756            Ok(Self::new(conn))
6757        }
6758    }
6759    impl<T> InboxServiceClient<T>
6760    where
6761        T: tonic::client::GrpcService<tonic::body::Body>,
6762        T::Error: Into<StdError>,
6763        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6764        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6765    {
6766        pub fn new(inner: T) -> Self {
6767            let inner = tonic::client::Grpc::new(inner);
6768            Self { inner }
6769        }
6770        pub fn with_origin(inner: T, origin: Uri) -> Self {
6771            let inner = tonic::client::Grpc::with_origin(inner, origin);
6772            Self { inner }
6773        }
6774        pub fn with_interceptor<F>(
6775            inner: T,
6776            interceptor: F,
6777        ) -> InboxServiceClient<InterceptedService<T, F>>
6778        where
6779            F: tonic::service::Interceptor,
6780            T::ResponseBody: Default,
6781            T: tonic::codegen::Service<
6782                http::Request<tonic::body::Body>,
6783                Response = http::Response<
6784                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6785                >,
6786            >,
6787            <T as tonic::codegen::Service<
6788                http::Request<tonic::body::Body>,
6789            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6790        {
6791            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6792        }
6793        /// Compress requests with the given encoding.
6794        ///
6795        /// This requires the server to support it otherwise it might respond with an
6796        /// error.
6797        #[must_use]
6798        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6799            self.inner = self.inner.send_compressed(encoding);
6800            self
6801        }
6802        /// Enable decompressing responses.
6803        #[must_use]
6804        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6805            self.inner = self.inner.accept_compressed(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.inner = self.inner.max_decoding_message_size(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.inner = self.inner.max_encoding_message_size(limit);
6822            self
6823        }
6824        /** Sync inbox entries since a given timestamp for incremental updates.
6825 Authorization: Authenticated user (own inbox only).
6826*/
6827        pub async fn sync(
6828            &mut self,
6829            request: impl tonic::IntoRequest<super::SyncRequest>,
6830        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6831            self.inner
6832                .ready()
6833                .await
6834                .map_err(|e| {
6835                    tonic::Status::unknown(
6836                        format!("Service was not ready: {}", e.into()),
6837                    )
6838                })?;
6839            let codec = tonic_prost::ProstCodec::default();
6840            let path = http::uri::PathAndQuery::from_static(
6841                "/pidgr.v1.InboxService/Sync",
6842            );
6843            let mut req = request.into_request();
6844            req.extensions_mut()
6845                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6846            self.inner.unary(req, path, codec).await
6847        }
6848        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6849 Authorization: Authenticated user (own inbox only).
6850*/
6851        pub async fn mark_read(
6852            &mut self,
6853            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6854        ) -> std::result::Result<
6855            tonic::Response<super::MarkReadResponse>,
6856            tonic::Status,
6857        > {
6858            self.inner
6859                .ready()
6860                .await
6861                .map_err(|e| {
6862                    tonic::Status::unknown(
6863                        format!("Service was not ready: {}", e.into()),
6864                    )
6865                })?;
6866            let codec = tonic_prost::ProstCodec::default();
6867            let path = http::uri::PathAndQuery::from_static(
6868                "/pidgr.v1.InboxService/MarkRead",
6869            );
6870            let mut req = request.into_request();
6871            req.extensions_mut()
6872                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6873            self.inner.unary(req, path, codec).await
6874        }
6875        /** Retrieve a single inbox entry by delivery ID.
6876 Authorization: Authenticated user (own inbox only).
6877*/
6878        pub async fn get_message(
6879            &mut self,
6880            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6881        ) -> std::result::Result<
6882            tonic::Response<super::GetMessageResponse>,
6883            tonic::Status,
6884        > {
6885            self.inner
6886                .ready()
6887                .await
6888                .map_err(|e| {
6889                    tonic::Status::unknown(
6890                        format!("Service was not ready: {}", e.into()),
6891                    )
6892                })?;
6893            let codec = tonic_prost::ProstCodec::default();
6894            let path = http::uri::PathAndQuery::from_static(
6895                "/pidgr.v1.InboxService/GetMessage",
6896            );
6897            let mut req = request.into_request();
6898            req.extensions_mut()
6899                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6900            self.inner.unary(req, path, codec).await
6901        }
6902    }
6903}
6904/// Generated server implementations.
6905pub mod inbox_service_server {
6906    #![allow(
6907        unused_variables,
6908        dead_code,
6909        missing_docs,
6910        clippy::wildcard_imports,
6911        clippy::let_unit_value,
6912    )]
6913    use tonic::codegen::*;
6914    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6915    #[async_trait]
6916    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6917        /** Sync inbox entries since a given timestamp for incremental updates.
6918 Authorization: Authenticated user (own inbox only).
6919*/
6920        async fn sync(
6921            &self,
6922            request: tonic::Request<super::SyncRequest>,
6923        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6924        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6925 Authorization: Authenticated user (own inbox only).
6926*/
6927        async fn mark_read(
6928            &self,
6929            request: tonic::Request<super::MarkReadRequest>,
6930        ) -> std::result::Result<
6931            tonic::Response<super::MarkReadResponse>,
6932            tonic::Status,
6933        >;
6934        /** Retrieve a single inbox entry by delivery ID.
6935 Authorization: Authenticated user (own inbox only).
6936*/
6937        async fn get_message(
6938            &self,
6939            request: tonic::Request<super::GetMessageRequest>,
6940        ) -> std::result::Result<
6941            tonic::Response<super::GetMessageResponse>,
6942            tonic::Status,
6943        >;
6944    }
6945    /** Provides the mobile app's inbox experience — syncing messages,
6946 tracking read status, and retrieving individual entries.
6947*/
6948    #[derive(Debug)]
6949    pub struct InboxServiceServer<T> {
6950        inner: Arc<T>,
6951        accept_compression_encodings: EnabledCompressionEncodings,
6952        send_compression_encodings: EnabledCompressionEncodings,
6953        max_decoding_message_size: Option<usize>,
6954        max_encoding_message_size: Option<usize>,
6955    }
6956    impl<T> InboxServiceServer<T> {
6957        pub fn new(inner: T) -> Self {
6958            Self::from_arc(Arc::new(inner))
6959        }
6960        pub fn from_arc(inner: Arc<T>) -> Self {
6961            Self {
6962                inner,
6963                accept_compression_encodings: Default::default(),
6964                send_compression_encodings: Default::default(),
6965                max_decoding_message_size: None,
6966                max_encoding_message_size: None,
6967            }
6968        }
6969        pub fn with_interceptor<F>(
6970            inner: T,
6971            interceptor: F,
6972        ) -> InterceptedService<Self, F>
6973        where
6974            F: tonic::service::Interceptor,
6975        {
6976            InterceptedService::new(Self::new(inner), interceptor)
6977        }
6978        /// Enable decompressing requests with the given encoding.
6979        #[must_use]
6980        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6981            self.accept_compression_encodings.enable(encoding);
6982            self
6983        }
6984        /// Compress responses with the given encoding, if the client supports it.
6985        #[must_use]
6986        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6987            self.send_compression_encodings.enable(encoding);
6988            self
6989        }
6990        /// Limits the maximum size of a decoded message.
6991        ///
6992        /// Default: `4MB`
6993        #[must_use]
6994        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6995            self.max_decoding_message_size = Some(limit);
6996            self
6997        }
6998        /// Limits the maximum size of an encoded message.
6999        ///
7000        /// Default: `usize::MAX`
7001        #[must_use]
7002        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7003            self.max_encoding_message_size = Some(limit);
7004            self
7005        }
7006    }
7007    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
7008    where
7009        T: InboxService,
7010        B: Body + std::marker::Send + 'static,
7011        B::Error: Into<StdError> + std::marker::Send + 'static,
7012    {
7013        type Response = http::Response<tonic::body::Body>;
7014        type Error = std::convert::Infallible;
7015        type Future = BoxFuture<Self::Response, Self::Error>;
7016        fn poll_ready(
7017            &mut self,
7018            _cx: &mut Context<'_>,
7019        ) -> Poll<std::result::Result<(), Self::Error>> {
7020            Poll::Ready(Ok(()))
7021        }
7022        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7023            match req.uri().path() {
7024                "/pidgr.v1.InboxService/Sync" => {
7025                    #[allow(non_camel_case_types)]
7026                    struct SyncSvc<T: InboxService>(pub Arc<T>);
7027                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
7028                    for SyncSvc<T> {
7029                        type Response = super::SyncResponse;
7030                        type Future = BoxFuture<
7031                            tonic::Response<Self::Response>,
7032                            tonic::Status,
7033                        >;
7034                        fn call(
7035                            &mut self,
7036                            request: tonic::Request<super::SyncRequest>,
7037                        ) -> Self::Future {
7038                            let inner = Arc::clone(&self.0);
7039                            let fut = async move {
7040                                <T as InboxService>::sync(&inner, request).await
7041                            };
7042                            Box::pin(fut)
7043                        }
7044                    }
7045                    let accept_compression_encodings = self.accept_compression_encodings;
7046                    let send_compression_encodings = self.send_compression_encodings;
7047                    let max_decoding_message_size = self.max_decoding_message_size;
7048                    let max_encoding_message_size = self.max_encoding_message_size;
7049                    let inner = self.inner.clone();
7050                    let fut = async move {
7051                        let method = SyncSvc(inner);
7052                        let codec = tonic_prost::ProstCodec::default();
7053                        let mut grpc = tonic::server::Grpc::new(codec)
7054                            .apply_compression_config(
7055                                accept_compression_encodings,
7056                                send_compression_encodings,
7057                            )
7058                            .apply_max_message_size_config(
7059                                max_decoding_message_size,
7060                                max_encoding_message_size,
7061                            );
7062                        let res = grpc.unary(method, req).await;
7063                        Ok(res)
7064                    };
7065                    Box::pin(fut)
7066                }
7067                "/pidgr.v1.InboxService/MarkRead" => {
7068                    #[allow(non_camel_case_types)]
7069                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
7070                    impl<
7071                        T: InboxService,
7072                    > tonic::server::UnaryService<super::MarkReadRequest>
7073                    for MarkReadSvc<T> {
7074                        type Response = super::MarkReadResponse;
7075                        type Future = BoxFuture<
7076                            tonic::Response<Self::Response>,
7077                            tonic::Status,
7078                        >;
7079                        fn call(
7080                            &mut self,
7081                            request: tonic::Request<super::MarkReadRequest>,
7082                        ) -> Self::Future {
7083                            let inner = Arc::clone(&self.0);
7084                            let fut = async move {
7085                                <T as InboxService>::mark_read(&inner, request).await
7086                            };
7087                            Box::pin(fut)
7088                        }
7089                    }
7090                    let accept_compression_encodings = self.accept_compression_encodings;
7091                    let send_compression_encodings = self.send_compression_encodings;
7092                    let max_decoding_message_size = self.max_decoding_message_size;
7093                    let max_encoding_message_size = self.max_encoding_message_size;
7094                    let inner = self.inner.clone();
7095                    let fut = async move {
7096                        let method = MarkReadSvc(inner);
7097                        let codec = tonic_prost::ProstCodec::default();
7098                        let mut grpc = tonic::server::Grpc::new(codec)
7099                            .apply_compression_config(
7100                                accept_compression_encodings,
7101                                send_compression_encodings,
7102                            )
7103                            .apply_max_message_size_config(
7104                                max_decoding_message_size,
7105                                max_encoding_message_size,
7106                            );
7107                        let res = grpc.unary(method, req).await;
7108                        Ok(res)
7109                    };
7110                    Box::pin(fut)
7111                }
7112                "/pidgr.v1.InboxService/GetMessage" => {
7113                    #[allow(non_camel_case_types)]
7114                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
7115                    impl<
7116                        T: InboxService,
7117                    > tonic::server::UnaryService<super::GetMessageRequest>
7118                    for GetMessageSvc<T> {
7119                        type Response = super::GetMessageResponse;
7120                        type Future = BoxFuture<
7121                            tonic::Response<Self::Response>,
7122                            tonic::Status,
7123                        >;
7124                        fn call(
7125                            &mut self,
7126                            request: tonic::Request<super::GetMessageRequest>,
7127                        ) -> Self::Future {
7128                            let inner = Arc::clone(&self.0);
7129                            let fut = async move {
7130                                <T as InboxService>::get_message(&inner, request).await
7131                            };
7132                            Box::pin(fut)
7133                        }
7134                    }
7135                    let accept_compression_encodings = self.accept_compression_encodings;
7136                    let send_compression_encodings = self.send_compression_encodings;
7137                    let max_decoding_message_size = self.max_decoding_message_size;
7138                    let max_encoding_message_size = self.max_encoding_message_size;
7139                    let inner = self.inner.clone();
7140                    let fut = async move {
7141                        let method = GetMessageSvc(inner);
7142                        let codec = tonic_prost::ProstCodec::default();
7143                        let mut grpc = tonic::server::Grpc::new(codec)
7144                            .apply_compression_config(
7145                                accept_compression_encodings,
7146                                send_compression_encodings,
7147                            )
7148                            .apply_max_message_size_config(
7149                                max_decoding_message_size,
7150                                max_encoding_message_size,
7151                            );
7152                        let res = grpc.unary(method, req).await;
7153                        Ok(res)
7154                    };
7155                    Box::pin(fut)
7156                }
7157                _ => {
7158                    Box::pin(async move {
7159                        let mut response = http::Response::new(
7160                            tonic::body::Body::default(),
7161                        );
7162                        let headers = response.headers_mut();
7163                        headers
7164                            .insert(
7165                                tonic::Status::GRPC_STATUS,
7166                                (tonic::Code::Unimplemented as i32).into(),
7167                            );
7168                        headers
7169                            .insert(
7170                                http::header::CONTENT_TYPE,
7171                                tonic::metadata::GRPC_CONTENT_TYPE,
7172                            );
7173                        Ok(response)
7174                    })
7175                }
7176            }
7177        }
7178    }
7179    impl<T> Clone for InboxServiceServer<T> {
7180        fn clone(&self) -> Self {
7181            let inner = self.inner.clone();
7182            Self {
7183                inner,
7184                accept_compression_encodings: self.accept_compression_encodings,
7185                send_compression_encodings: self.send_compression_encodings,
7186                max_decoding_message_size: self.max_decoding_message_size,
7187                max_encoding_message_size: self.max_encoding_message_size,
7188            }
7189        }
7190    }
7191    /// Generated gRPC service name
7192    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
7193    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
7194        const NAME: &'static str = SERVICE_NAME;
7195    }
7196}
7197/// Generated client implementations.
7198pub mod insights_service_client {
7199    #![allow(
7200        unused_variables,
7201        dead_code,
7202        missing_docs,
7203        clippy::wildcard_imports,
7204        clippy::let_unit_value,
7205    )]
7206    use tonic::codegen::*;
7207    use tonic::codegen::http::Uri;
7208    /** Provides cohort-level AI insights for campaign planning and optimization.
7209 All predictions are aggregate — no individual-level profiling.
7210 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7211 All RPCs operate within the caller's org (extracted from JWT).
7212*/
7213    #[derive(Debug, Clone)]
7214    pub struct InsightsServiceClient<T> {
7215        inner: tonic::client::Grpc<T>,
7216    }
7217    impl InsightsServiceClient<tonic::transport::Channel> {
7218        /// Attempt to create a new client by connecting to a given endpoint.
7219        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7220        where
7221            D: TryInto<tonic::transport::Endpoint>,
7222            D::Error: Into<StdError>,
7223        {
7224            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7225            Ok(Self::new(conn))
7226        }
7227    }
7228    impl<T> InsightsServiceClient<T>
7229    where
7230        T: tonic::client::GrpcService<tonic::body::Body>,
7231        T::Error: Into<StdError>,
7232        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7233        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7234    {
7235        pub fn new(inner: T) -> Self {
7236            let inner = tonic::client::Grpc::new(inner);
7237            Self { inner }
7238        }
7239        pub fn with_origin(inner: T, origin: Uri) -> Self {
7240            let inner = tonic::client::Grpc::with_origin(inner, origin);
7241            Self { inner }
7242        }
7243        pub fn with_interceptor<F>(
7244            inner: T,
7245            interceptor: F,
7246        ) -> InsightsServiceClient<InterceptedService<T, F>>
7247        where
7248            F: tonic::service::Interceptor,
7249            T::ResponseBody: Default,
7250            T: tonic::codegen::Service<
7251                http::Request<tonic::body::Body>,
7252                Response = http::Response<
7253                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7254                >,
7255            >,
7256            <T as tonic::codegen::Service<
7257                http::Request<tonic::body::Body>,
7258            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7259        {
7260            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
7261        }
7262        /// Compress requests with the given encoding.
7263        ///
7264        /// This requires the server to support it otherwise it might respond with an
7265        /// error.
7266        #[must_use]
7267        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7268            self.inner = self.inner.send_compressed(encoding);
7269            self
7270        }
7271        /// Enable decompressing responses.
7272        #[must_use]
7273        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7274            self.inner = self.inner.accept_compressed(encoding);
7275            self
7276        }
7277        /// Limits the maximum size of a decoded message.
7278        ///
7279        /// Default: `4MB`
7280        #[must_use]
7281        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7282            self.inner = self.inner.max_decoding_message_size(limit);
7283            self
7284        }
7285        /// Limits the maximum size of an encoded message.
7286        ///
7287        /// Default: `usize::MAX`
7288        #[must_use]
7289        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7290            self.inner = self.inner.max_encoding_message_size(limit);
7291            self
7292        }
7293        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7294 Returns empty archetypes if insufficient data (cold start).
7295 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7296*/
7297        pub async fn get_group_archetypes(
7298            &mut self,
7299            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
7300        ) -> std::result::Result<
7301            tonic::Response<super::GetGroupArchetypesResponse>,
7302            tonic::Status,
7303        > {
7304            self.inner
7305                .ready()
7306                .await
7307                .map_err(|e| {
7308                    tonic::Status::unknown(
7309                        format!("Service was not ready: {}", e.into()),
7310                    )
7311                })?;
7312            let codec = tonic_prost::ProstCodec::default();
7313            let path = http::uri::PathAndQuery::from_static(
7314                "/pidgr.v1.InsightsService/GetGroupArchetypes",
7315            );
7316            let mut req = request.into_request();
7317            req.extensions_mut()
7318                .insert(
7319                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
7320                );
7321            self.inner.unary(req, path, codec).await
7322        }
7323        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7324 Returns a confidence interval that narrows as more campaign data accumulates.
7325 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7326*/
7327        pub async fn predict_campaign_ack(
7328            &mut self,
7329            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
7330        ) -> std::result::Result<
7331            tonic::Response<super::PredictCampaignAckResponse>,
7332            tonic::Status,
7333        > {
7334            self.inner
7335                .ready()
7336                .await
7337                .map_err(|e| {
7338                    tonic::Status::unknown(
7339                        format!("Service was not ready: {}", e.into()),
7340                    )
7341                })?;
7342            let codec = tonic_prost::ProstCodec::default();
7343            let path = http::uri::PathAndQuery::from_static(
7344                "/pidgr.v1.InsightsService/PredictCampaignACK",
7345            );
7346            let mut req = request.into_request();
7347            req.extensions_mut()
7348                .insert(
7349                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
7350                );
7351            self.inner.unary(req, path, codec).await
7352        }
7353        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7354 Advisory is informational only — never drives automated decisions.
7355 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7356*/
7357        pub async fn get_campaign_advisory(
7358            &mut self,
7359            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
7360        ) -> std::result::Result<
7361            tonic::Response<super::GetCampaignAdvisoryResponse>,
7362            tonic::Status,
7363        > {
7364            self.inner
7365                .ready()
7366                .await
7367                .map_err(|e| {
7368                    tonic::Status::unknown(
7369                        format!("Service was not ready: {}", e.into()),
7370                    )
7371                })?;
7372            let codec = tonic_prost::ProstCodec::default();
7373            let path = http::uri::PathAndQuery::from_static(
7374                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
7375            );
7376            let mut req = request.into_request();
7377            req.extensions_mut()
7378                .insert(
7379                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
7380                );
7381            self.inner.unary(req, path, codec).await
7382        }
7383        /** Generate an AI-powered narrative summary of a group's insights.
7384 Combines archetype, prediction, and campaign data into human-readable analysis.
7385 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7386*/
7387        pub async fn get_insight_narrative(
7388            &mut self,
7389            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
7390        ) -> std::result::Result<
7391            tonic::Response<super::GetInsightNarrativeResponse>,
7392            tonic::Status,
7393        > {
7394            self.inner
7395                .ready()
7396                .await
7397                .map_err(|e| {
7398                    tonic::Status::unknown(
7399                        format!("Service was not ready: {}", e.into()),
7400                    )
7401                })?;
7402            let codec = tonic_prost::ProstCodec::default();
7403            let path = http::uri::PathAndQuery::from_static(
7404                "/pidgr.v1.InsightsService/GetInsightNarrative",
7405            );
7406            let mut req = request.into_request();
7407            req.extensions_mut()
7408                .insert(
7409                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
7410                );
7411            self.inner.unary(req, path, codec).await
7412        }
7413        /** Manually trigger the ML training pipeline for the caller's organization.
7414 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7415 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7416*/
7417        pub async fn trigger_ml_pipeline(
7418            &mut self,
7419            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
7420        ) -> std::result::Result<
7421            tonic::Response<super::TriggerMlPipelineResponse>,
7422            tonic::Status,
7423        > {
7424            self.inner
7425                .ready()
7426                .await
7427                .map_err(|e| {
7428                    tonic::Status::unknown(
7429                        format!("Service was not ready: {}", e.into()),
7430                    )
7431                })?;
7432            let codec = tonic_prost::ProstCodec::default();
7433            let path = http::uri::PathAndQuery::from_static(
7434                "/pidgr.v1.InsightsService/TriggerMLPipeline",
7435            );
7436            let mut req = request.into_request();
7437            req.extensions_mut()
7438                .insert(
7439                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
7440                );
7441            self.inner.unary(req, path, codec).await
7442        }
7443        /** Manually retrigger archetype clustering for a single group, reusing
7444 the already-deployed SageMaker clustering model. Cheaper than a
7445 full TriggerMLPipeline run because no training happens. Shares the
7446 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7447 get N manual retrains per month across both RPCs.
7448 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7449*/
7450        pub async fn trigger_archetype_clustering(
7451            &mut self,
7452            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7453        ) -> std::result::Result<
7454            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7455            tonic::Status,
7456        > {
7457            self.inner
7458                .ready()
7459                .await
7460                .map_err(|e| {
7461                    tonic::Status::unknown(
7462                        format!("Service was not ready: {}", e.into()),
7463                    )
7464                })?;
7465            let codec = tonic_prost::ProstCodec::default();
7466            let path = http::uri::PathAndQuery::from_static(
7467                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7468            );
7469            let mut req = request.into_request();
7470            req.extensions_mut()
7471                .insert(
7472                    GrpcMethod::new(
7473                        "pidgr.v1.InsightsService",
7474                        "TriggerArchetypeClustering",
7475                    ),
7476                );
7477            self.inner.unary(req, path, codec).await
7478        }
7479        /** Draft a campaign body for the given archetype using Bedrock with the
7480 campaign-for-archetype prompt template. Used by the Compass
7481 "Target this archetype" CTA to pre-fill the wizard's body field.
7482 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7483 returns NOT_FOUND.
7484 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7485*/
7486        pub async fn generate_campaign_body_draft(
7487            &mut self,
7488            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7489        ) -> std::result::Result<
7490            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7491            tonic::Status,
7492        > {
7493            self.inner
7494                .ready()
7495                .await
7496                .map_err(|e| {
7497                    tonic::Status::unknown(
7498                        format!("Service was not ready: {}", e.into()),
7499                    )
7500                })?;
7501            let codec = tonic_prost::ProstCodec::default();
7502            let path = http::uri::PathAndQuery::from_static(
7503                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7504            );
7505            let mut req = request.into_request();
7506            req.extensions_mut()
7507                .insert(
7508                    GrpcMethod::new(
7509                        "pidgr.v1.InsightsService",
7510                        "GenerateCampaignBodyDraft",
7511                    ),
7512                );
7513            self.inner.unary(req, path, codec).await
7514        }
7515        /** Organization-wide communication profile: which kinds of messages the
7516 organization sends, and how much messaging lands on one person.
7517 Requires no configuration by the organization.
7518 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7519*/
7520        pub async fn get_org_communication_profile(
7521            &mut self,
7522            request: impl tonic::IntoRequest<super::GetOrgCommunicationProfileRequest>,
7523        ) -> std::result::Result<
7524            tonic::Response<super::GetOrgCommunicationProfileResponse>,
7525            tonic::Status,
7526        > {
7527            self.inner
7528                .ready()
7529                .await
7530                .map_err(|e| {
7531                    tonic::Status::unknown(
7532                        format!("Service was not ready: {}", e.into()),
7533                    )
7534                })?;
7535            let codec = tonic_prost::ProstCodec::default();
7536            let path = http::uri::PathAndQuery::from_static(
7537                "/pidgr.v1.InsightsService/GetOrgCommunicationProfile",
7538            );
7539            let mut req = request.into_request();
7540            req.extensions_mut()
7541                .insert(
7542                    GrpcMethod::new(
7543                        "pidgr.v1.InsightsService",
7544                        "GetOrgCommunicationProfile",
7545                    ),
7546                );
7547            self.inner.unary(req, path, codec).await
7548        }
7549    }
7550}
7551/// Generated server implementations.
7552pub mod insights_service_server {
7553    #![allow(
7554        unused_variables,
7555        dead_code,
7556        missing_docs,
7557        clippy::wildcard_imports,
7558        clippy::let_unit_value,
7559    )]
7560    use tonic::codegen::*;
7561    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7562    #[async_trait]
7563    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7564        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7565 Returns empty archetypes if insufficient data (cold start).
7566 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7567*/
7568        async fn get_group_archetypes(
7569            &self,
7570            request: tonic::Request<super::GetGroupArchetypesRequest>,
7571        ) -> std::result::Result<
7572            tonic::Response<super::GetGroupArchetypesResponse>,
7573            tonic::Status,
7574        >;
7575        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7576 Returns a confidence interval that narrows as more campaign data accumulates.
7577 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7578*/
7579        async fn predict_campaign_ack(
7580            &self,
7581            request: tonic::Request<super::PredictCampaignAckRequest>,
7582        ) -> std::result::Result<
7583            tonic::Response<super::PredictCampaignAckResponse>,
7584            tonic::Status,
7585        >;
7586        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7587 Advisory is informational only — never drives automated decisions.
7588 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7589*/
7590        async fn get_campaign_advisory(
7591            &self,
7592            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7593        ) -> std::result::Result<
7594            tonic::Response<super::GetCampaignAdvisoryResponse>,
7595            tonic::Status,
7596        >;
7597        /** Generate an AI-powered narrative summary of a group's insights.
7598 Combines archetype, prediction, and campaign data into human-readable analysis.
7599 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7600*/
7601        async fn get_insight_narrative(
7602            &self,
7603            request: tonic::Request<super::GetInsightNarrativeRequest>,
7604        ) -> std::result::Result<
7605            tonic::Response<super::GetInsightNarrativeResponse>,
7606            tonic::Status,
7607        >;
7608        /** Manually trigger the ML training pipeline for the caller's organization.
7609 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7610 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7611*/
7612        async fn trigger_ml_pipeline(
7613            &self,
7614            request: tonic::Request<super::TriggerMlPipelineRequest>,
7615        ) -> std::result::Result<
7616            tonic::Response<super::TriggerMlPipelineResponse>,
7617            tonic::Status,
7618        >;
7619        /** Manually retrigger archetype clustering for a single group, reusing
7620 the already-deployed SageMaker clustering model. Cheaper than a
7621 full TriggerMLPipeline run because no training happens. Shares the
7622 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7623 get N manual retrains per month across both RPCs.
7624 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7625*/
7626        async fn trigger_archetype_clustering(
7627            &self,
7628            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7629        ) -> std::result::Result<
7630            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7631            tonic::Status,
7632        >;
7633        /** Draft a campaign body for the given archetype using Bedrock with the
7634 campaign-for-archetype prompt template. Used by the Compass
7635 "Target this archetype" CTA to pre-fill the wizard's body field.
7636 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7637 returns NOT_FOUND.
7638 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7639*/
7640        async fn generate_campaign_body_draft(
7641            &self,
7642            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7643        ) -> std::result::Result<
7644            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7645            tonic::Status,
7646        >;
7647        /** Organization-wide communication profile: which kinds of messages the
7648 organization sends, and how much messaging lands on one person.
7649 Requires no configuration by the organization.
7650 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7651*/
7652        async fn get_org_communication_profile(
7653            &self,
7654            request: tonic::Request<super::GetOrgCommunicationProfileRequest>,
7655        ) -> std::result::Result<
7656            tonic::Response<super::GetOrgCommunicationProfileResponse>,
7657            tonic::Status,
7658        >;
7659    }
7660    /** Provides cohort-level AI insights for campaign planning and optimization.
7661 All predictions are aggregate — no individual-level profiling.
7662 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7663 All RPCs operate within the caller's org (extracted from JWT).
7664*/
7665    #[derive(Debug)]
7666    pub struct InsightsServiceServer<T> {
7667        inner: Arc<T>,
7668        accept_compression_encodings: EnabledCompressionEncodings,
7669        send_compression_encodings: EnabledCompressionEncodings,
7670        max_decoding_message_size: Option<usize>,
7671        max_encoding_message_size: Option<usize>,
7672    }
7673    impl<T> InsightsServiceServer<T> {
7674        pub fn new(inner: T) -> Self {
7675            Self::from_arc(Arc::new(inner))
7676        }
7677        pub fn from_arc(inner: Arc<T>) -> Self {
7678            Self {
7679                inner,
7680                accept_compression_encodings: Default::default(),
7681                send_compression_encodings: Default::default(),
7682                max_decoding_message_size: None,
7683                max_encoding_message_size: None,
7684            }
7685        }
7686        pub fn with_interceptor<F>(
7687            inner: T,
7688            interceptor: F,
7689        ) -> InterceptedService<Self, F>
7690        where
7691            F: tonic::service::Interceptor,
7692        {
7693            InterceptedService::new(Self::new(inner), interceptor)
7694        }
7695        /// Enable decompressing requests with the given encoding.
7696        #[must_use]
7697        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7698            self.accept_compression_encodings.enable(encoding);
7699            self
7700        }
7701        /// Compress responses with the given encoding, if the client supports it.
7702        #[must_use]
7703        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7704            self.send_compression_encodings.enable(encoding);
7705            self
7706        }
7707        /// Limits the maximum size of a decoded message.
7708        ///
7709        /// Default: `4MB`
7710        #[must_use]
7711        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7712            self.max_decoding_message_size = Some(limit);
7713            self
7714        }
7715        /// Limits the maximum size of an encoded message.
7716        ///
7717        /// Default: `usize::MAX`
7718        #[must_use]
7719        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7720            self.max_encoding_message_size = Some(limit);
7721            self
7722        }
7723    }
7724    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7725    where
7726        T: InsightsService,
7727        B: Body + std::marker::Send + 'static,
7728        B::Error: Into<StdError> + std::marker::Send + 'static,
7729    {
7730        type Response = http::Response<tonic::body::Body>;
7731        type Error = std::convert::Infallible;
7732        type Future = BoxFuture<Self::Response, Self::Error>;
7733        fn poll_ready(
7734            &mut self,
7735            _cx: &mut Context<'_>,
7736        ) -> Poll<std::result::Result<(), Self::Error>> {
7737            Poll::Ready(Ok(()))
7738        }
7739        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7740            match req.uri().path() {
7741                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7742                    #[allow(non_camel_case_types)]
7743                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7744                    impl<
7745                        T: InsightsService,
7746                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7747                    for GetGroupArchetypesSvc<T> {
7748                        type Response = super::GetGroupArchetypesResponse;
7749                        type Future = BoxFuture<
7750                            tonic::Response<Self::Response>,
7751                            tonic::Status,
7752                        >;
7753                        fn call(
7754                            &mut self,
7755                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7756                        ) -> Self::Future {
7757                            let inner = Arc::clone(&self.0);
7758                            let fut = async move {
7759                                <T as InsightsService>::get_group_archetypes(
7760                                        &inner,
7761                                        request,
7762                                    )
7763                                    .await
7764                            };
7765                            Box::pin(fut)
7766                        }
7767                    }
7768                    let accept_compression_encodings = self.accept_compression_encodings;
7769                    let send_compression_encodings = self.send_compression_encodings;
7770                    let max_decoding_message_size = self.max_decoding_message_size;
7771                    let max_encoding_message_size = self.max_encoding_message_size;
7772                    let inner = self.inner.clone();
7773                    let fut = async move {
7774                        let method = GetGroupArchetypesSvc(inner);
7775                        let codec = tonic_prost::ProstCodec::default();
7776                        let mut grpc = tonic::server::Grpc::new(codec)
7777                            .apply_compression_config(
7778                                accept_compression_encodings,
7779                                send_compression_encodings,
7780                            )
7781                            .apply_max_message_size_config(
7782                                max_decoding_message_size,
7783                                max_encoding_message_size,
7784                            );
7785                        let res = grpc.unary(method, req).await;
7786                        Ok(res)
7787                    };
7788                    Box::pin(fut)
7789                }
7790                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7791                    #[allow(non_camel_case_types)]
7792                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7793                    impl<
7794                        T: InsightsService,
7795                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7796                    for PredictCampaignACKSvc<T> {
7797                        type Response = super::PredictCampaignAckResponse;
7798                        type Future = BoxFuture<
7799                            tonic::Response<Self::Response>,
7800                            tonic::Status,
7801                        >;
7802                        fn call(
7803                            &mut self,
7804                            request: tonic::Request<super::PredictCampaignAckRequest>,
7805                        ) -> Self::Future {
7806                            let inner = Arc::clone(&self.0);
7807                            let fut = async move {
7808                                <T as InsightsService>::predict_campaign_ack(
7809                                        &inner,
7810                                        request,
7811                                    )
7812                                    .await
7813                            };
7814                            Box::pin(fut)
7815                        }
7816                    }
7817                    let accept_compression_encodings = self.accept_compression_encodings;
7818                    let send_compression_encodings = self.send_compression_encodings;
7819                    let max_decoding_message_size = self.max_decoding_message_size;
7820                    let max_encoding_message_size = self.max_encoding_message_size;
7821                    let inner = self.inner.clone();
7822                    let fut = async move {
7823                        let method = PredictCampaignACKSvc(inner);
7824                        let codec = tonic_prost::ProstCodec::default();
7825                        let mut grpc = tonic::server::Grpc::new(codec)
7826                            .apply_compression_config(
7827                                accept_compression_encodings,
7828                                send_compression_encodings,
7829                            )
7830                            .apply_max_message_size_config(
7831                                max_decoding_message_size,
7832                                max_encoding_message_size,
7833                            );
7834                        let res = grpc.unary(method, req).await;
7835                        Ok(res)
7836                    };
7837                    Box::pin(fut)
7838                }
7839                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7840                    #[allow(non_camel_case_types)]
7841                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7842                    impl<
7843                        T: InsightsService,
7844                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7845                    for GetCampaignAdvisorySvc<T> {
7846                        type Response = super::GetCampaignAdvisoryResponse;
7847                        type Future = BoxFuture<
7848                            tonic::Response<Self::Response>,
7849                            tonic::Status,
7850                        >;
7851                        fn call(
7852                            &mut self,
7853                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7854                        ) -> Self::Future {
7855                            let inner = Arc::clone(&self.0);
7856                            let fut = async move {
7857                                <T as InsightsService>::get_campaign_advisory(
7858                                        &inner,
7859                                        request,
7860                                    )
7861                                    .await
7862                            };
7863                            Box::pin(fut)
7864                        }
7865                    }
7866                    let accept_compression_encodings = self.accept_compression_encodings;
7867                    let send_compression_encodings = self.send_compression_encodings;
7868                    let max_decoding_message_size = self.max_decoding_message_size;
7869                    let max_encoding_message_size = self.max_encoding_message_size;
7870                    let inner = self.inner.clone();
7871                    let fut = async move {
7872                        let method = GetCampaignAdvisorySvc(inner);
7873                        let codec = tonic_prost::ProstCodec::default();
7874                        let mut grpc = tonic::server::Grpc::new(codec)
7875                            .apply_compression_config(
7876                                accept_compression_encodings,
7877                                send_compression_encodings,
7878                            )
7879                            .apply_max_message_size_config(
7880                                max_decoding_message_size,
7881                                max_encoding_message_size,
7882                            );
7883                        let res = grpc.unary(method, req).await;
7884                        Ok(res)
7885                    };
7886                    Box::pin(fut)
7887                }
7888                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7889                    #[allow(non_camel_case_types)]
7890                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7891                    impl<
7892                        T: InsightsService,
7893                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7894                    for GetInsightNarrativeSvc<T> {
7895                        type Response = super::GetInsightNarrativeResponse;
7896                        type Future = BoxFuture<
7897                            tonic::Response<Self::Response>,
7898                            tonic::Status,
7899                        >;
7900                        fn call(
7901                            &mut self,
7902                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7903                        ) -> Self::Future {
7904                            let inner = Arc::clone(&self.0);
7905                            let fut = async move {
7906                                <T as InsightsService>::get_insight_narrative(
7907                                        &inner,
7908                                        request,
7909                                    )
7910                                    .await
7911                            };
7912                            Box::pin(fut)
7913                        }
7914                    }
7915                    let accept_compression_encodings = self.accept_compression_encodings;
7916                    let send_compression_encodings = self.send_compression_encodings;
7917                    let max_decoding_message_size = self.max_decoding_message_size;
7918                    let max_encoding_message_size = self.max_encoding_message_size;
7919                    let inner = self.inner.clone();
7920                    let fut = async move {
7921                        let method = GetInsightNarrativeSvc(inner);
7922                        let codec = tonic_prost::ProstCodec::default();
7923                        let mut grpc = tonic::server::Grpc::new(codec)
7924                            .apply_compression_config(
7925                                accept_compression_encodings,
7926                                send_compression_encodings,
7927                            )
7928                            .apply_max_message_size_config(
7929                                max_decoding_message_size,
7930                                max_encoding_message_size,
7931                            );
7932                        let res = grpc.unary(method, req).await;
7933                        Ok(res)
7934                    };
7935                    Box::pin(fut)
7936                }
7937                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7938                    #[allow(non_camel_case_types)]
7939                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7940                    impl<
7941                        T: InsightsService,
7942                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7943                    for TriggerMLPipelineSvc<T> {
7944                        type Response = super::TriggerMlPipelineResponse;
7945                        type Future = BoxFuture<
7946                            tonic::Response<Self::Response>,
7947                            tonic::Status,
7948                        >;
7949                        fn call(
7950                            &mut self,
7951                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7952                        ) -> Self::Future {
7953                            let inner = Arc::clone(&self.0);
7954                            let fut = async move {
7955                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7956                                    .await
7957                            };
7958                            Box::pin(fut)
7959                        }
7960                    }
7961                    let accept_compression_encodings = self.accept_compression_encodings;
7962                    let send_compression_encodings = self.send_compression_encodings;
7963                    let max_decoding_message_size = self.max_decoding_message_size;
7964                    let max_encoding_message_size = self.max_encoding_message_size;
7965                    let inner = self.inner.clone();
7966                    let fut = async move {
7967                        let method = TriggerMLPipelineSvc(inner);
7968                        let codec = tonic_prost::ProstCodec::default();
7969                        let mut grpc = tonic::server::Grpc::new(codec)
7970                            .apply_compression_config(
7971                                accept_compression_encodings,
7972                                send_compression_encodings,
7973                            )
7974                            .apply_max_message_size_config(
7975                                max_decoding_message_size,
7976                                max_encoding_message_size,
7977                            );
7978                        let res = grpc.unary(method, req).await;
7979                        Ok(res)
7980                    };
7981                    Box::pin(fut)
7982                }
7983                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7984                    #[allow(non_camel_case_types)]
7985                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7986                    impl<
7987                        T: InsightsService,
7988                    > tonic::server::UnaryService<
7989                        super::TriggerArchetypeClusteringRequest,
7990                    > for TriggerArchetypeClusteringSvc<T> {
7991                        type Response = super::TriggerArchetypeClusteringResponse;
7992                        type Future = BoxFuture<
7993                            tonic::Response<Self::Response>,
7994                            tonic::Status,
7995                        >;
7996                        fn call(
7997                            &mut self,
7998                            request: tonic::Request<
7999                                super::TriggerArchetypeClusteringRequest,
8000                            >,
8001                        ) -> Self::Future {
8002                            let inner = Arc::clone(&self.0);
8003                            let fut = async move {
8004                                <T as InsightsService>::trigger_archetype_clustering(
8005                                        &inner,
8006                                        request,
8007                                    )
8008                                    .await
8009                            };
8010                            Box::pin(fut)
8011                        }
8012                    }
8013                    let accept_compression_encodings = self.accept_compression_encodings;
8014                    let send_compression_encodings = self.send_compression_encodings;
8015                    let max_decoding_message_size = self.max_decoding_message_size;
8016                    let max_encoding_message_size = self.max_encoding_message_size;
8017                    let inner = self.inner.clone();
8018                    let fut = async move {
8019                        let method = TriggerArchetypeClusteringSvc(inner);
8020                        let codec = tonic_prost::ProstCodec::default();
8021                        let mut grpc = tonic::server::Grpc::new(codec)
8022                            .apply_compression_config(
8023                                accept_compression_encodings,
8024                                send_compression_encodings,
8025                            )
8026                            .apply_max_message_size_config(
8027                                max_decoding_message_size,
8028                                max_encoding_message_size,
8029                            );
8030                        let res = grpc.unary(method, req).await;
8031                        Ok(res)
8032                    };
8033                    Box::pin(fut)
8034                }
8035                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
8036                    #[allow(non_camel_case_types)]
8037                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
8038                    impl<
8039                        T: InsightsService,
8040                    > tonic::server::UnaryService<
8041                        super::GenerateCampaignBodyDraftRequest,
8042                    > for GenerateCampaignBodyDraftSvc<T> {
8043                        type Response = super::GenerateCampaignBodyDraftResponse;
8044                        type Future = BoxFuture<
8045                            tonic::Response<Self::Response>,
8046                            tonic::Status,
8047                        >;
8048                        fn call(
8049                            &mut self,
8050                            request: tonic::Request<
8051                                super::GenerateCampaignBodyDraftRequest,
8052                            >,
8053                        ) -> Self::Future {
8054                            let inner = Arc::clone(&self.0);
8055                            let fut = async move {
8056                                <T as InsightsService>::generate_campaign_body_draft(
8057                                        &inner,
8058                                        request,
8059                                    )
8060                                    .await
8061                            };
8062                            Box::pin(fut)
8063                        }
8064                    }
8065                    let accept_compression_encodings = self.accept_compression_encodings;
8066                    let send_compression_encodings = self.send_compression_encodings;
8067                    let max_decoding_message_size = self.max_decoding_message_size;
8068                    let max_encoding_message_size = self.max_encoding_message_size;
8069                    let inner = self.inner.clone();
8070                    let fut = async move {
8071                        let method = GenerateCampaignBodyDraftSvc(inner);
8072                        let codec = tonic_prost::ProstCodec::default();
8073                        let mut grpc = tonic::server::Grpc::new(codec)
8074                            .apply_compression_config(
8075                                accept_compression_encodings,
8076                                send_compression_encodings,
8077                            )
8078                            .apply_max_message_size_config(
8079                                max_decoding_message_size,
8080                                max_encoding_message_size,
8081                            );
8082                        let res = grpc.unary(method, req).await;
8083                        Ok(res)
8084                    };
8085                    Box::pin(fut)
8086                }
8087                "/pidgr.v1.InsightsService/GetOrgCommunicationProfile" => {
8088                    #[allow(non_camel_case_types)]
8089                    struct GetOrgCommunicationProfileSvc<T: InsightsService>(pub Arc<T>);
8090                    impl<
8091                        T: InsightsService,
8092                    > tonic::server::UnaryService<
8093                        super::GetOrgCommunicationProfileRequest,
8094                    > for GetOrgCommunicationProfileSvc<T> {
8095                        type Response = super::GetOrgCommunicationProfileResponse;
8096                        type Future = BoxFuture<
8097                            tonic::Response<Self::Response>,
8098                            tonic::Status,
8099                        >;
8100                        fn call(
8101                            &mut self,
8102                            request: tonic::Request<
8103                                super::GetOrgCommunicationProfileRequest,
8104                            >,
8105                        ) -> Self::Future {
8106                            let inner = Arc::clone(&self.0);
8107                            let fut = async move {
8108                                <T as InsightsService>::get_org_communication_profile(
8109                                        &inner,
8110                                        request,
8111                                    )
8112                                    .await
8113                            };
8114                            Box::pin(fut)
8115                        }
8116                    }
8117                    let accept_compression_encodings = self.accept_compression_encodings;
8118                    let send_compression_encodings = self.send_compression_encodings;
8119                    let max_decoding_message_size = self.max_decoding_message_size;
8120                    let max_encoding_message_size = self.max_encoding_message_size;
8121                    let inner = self.inner.clone();
8122                    let fut = async move {
8123                        let method = GetOrgCommunicationProfileSvc(inner);
8124                        let codec = tonic_prost::ProstCodec::default();
8125                        let mut grpc = tonic::server::Grpc::new(codec)
8126                            .apply_compression_config(
8127                                accept_compression_encodings,
8128                                send_compression_encodings,
8129                            )
8130                            .apply_max_message_size_config(
8131                                max_decoding_message_size,
8132                                max_encoding_message_size,
8133                            );
8134                        let res = grpc.unary(method, req).await;
8135                        Ok(res)
8136                    };
8137                    Box::pin(fut)
8138                }
8139                _ => {
8140                    Box::pin(async move {
8141                        let mut response = http::Response::new(
8142                            tonic::body::Body::default(),
8143                        );
8144                        let headers = response.headers_mut();
8145                        headers
8146                            .insert(
8147                                tonic::Status::GRPC_STATUS,
8148                                (tonic::Code::Unimplemented as i32).into(),
8149                            );
8150                        headers
8151                            .insert(
8152                                http::header::CONTENT_TYPE,
8153                                tonic::metadata::GRPC_CONTENT_TYPE,
8154                            );
8155                        Ok(response)
8156                    })
8157                }
8158            }
8159        }
8160    }
8161    impl<T> Clone for InsightsServiceServer<T> {
8162        fn clone(&self) -> Self {
8163            let inner = self.inner.clone();
8164            Self {
8165                inner,
8166                accept_compression_encodings: self.accept_compression_encodings,
8167                send_compression_encodings: self.send_compression_encodings,
8168                max_decoding_message_size: self.max_decoding_message_size,
8169                max_encoding_message_size: self.max_encoding_message_size,
8170            }
8171        }
8172    }
8173    /// Generated gRPC service name
8174    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
8175    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
8176        const NAME: &'static str = SERVICE_NAME;
8177    }
8178}
8179/// Generated client implementations.
8180pub mod integrations_service_client {
8181    #![allow(
8182        unused_variables,
8183        dead_code,
8184        missing_docs,
8185        clippy::wildcard_imports,
8186        clippy::let_unit_value,
8187    )]
8188    use tonic::codegen::*;
8189    use tonic::codegen::http::Uri;
8190    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8191
8192 Auth model:
8193   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8194     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8195   - UpsertReachability / RemoveReachability / GetReachability /
8196     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8197     caller's `custom:org_id` claim).
8198   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8199     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8200     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8201
8202 Cross-org access is denied with `permission_denied`.
8203*/
8204    #[derive(Debug, Clone)]
8205    pub struct IntegrationsServiceClient<T> {
8206        inner: tonic::client::Grpc<T>,
8207    }
8208    impl IntegrationsServiceClient<tonic::transport::Channel> {
8209        /// Attempt to create a new client by connecting to a given endpoint.
8210        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8211        where
8212            D: TryInto<tonic::transport::Endpoint>,
8213            D::Error: Into<StdError>,
8214        {
8215            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8216            Ok(Self::new(conn))
8217        }
8218    }
8219    impl<T> IntegrationsServiceClient<T>
8220    where
8221        T: tonic::client::GrpcService<tonic::body::Body>,
8222        T::Error: Into<StdError>,
8223        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8224        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8225    {
8226        pub fn new(inner: T) -> Self {
8227            let inner = tonic::client::Grpc::new(inner);
8228            Self { inner }
8229        }
8230        pub fn with_origin(inner: T, origin: Uri) -> Self {
8231            let inner = tonic::client::Grpc::with_origin(inner, origin);
8232            Self { inner }
8233        }
8234        pub fn with_interceptor<F>(
8235            inner: T,
8236            interceptor: F,
8237        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
8238        where
8239            F: tonic::service::Interceptor,
8240            T::ResponseBody: Default,
8241            T: tonic::codegen::Service<
8242                http::Request<tonic::body::Body>,
8243                Response = http::Response<
8244                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8245                >,
8246            >,
8247            <T as tonic::codegen::Service<
8248                http::Request<tonic::body::Body>,
8249            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8250        {
8251            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
8252        }
8253        /// Compress requests with the given encoding.
8254        ///
8255        /// This requires the server to support it otherwise it might respond with an
8256        /// error.
8257        #[must_use]
8258        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8259            self.inner = self.inner.send_compressed(encoding);
8260            self
8261        }
8262        /// Enable decompressing responses.
8263        #[must_use]
8264        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8265            self.inner = self.inner.accept_compressed(encoding);
8266            self
8267        }
8268        /// Limits the maximum size of a decoded message.
8269        ///
8270        /// Default: `4MB`
8271        #[must_use]
8272        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8273            self.inner = self.inner.max_decoding_message_size(limit);
8274            self
8275        }
8276        /// Limits the maximum size of an encoded message.
8277        ///
8278        /// Default: `usize::MAX`
8279        #[must_use]
8280        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8281            self.inner = self.inner.max_encoding_message_size(limit);
8282            self
8283        }
8284        /** Dispatch a single rendered message to one channel. Idempotent on
8285 `dispatch_id`. Internal-mTLS only.
8286*/
8287        pub async fn dispatch_to_channel(
8288            &mut self,
8289            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8290        ) -> std::result::Result<
8291            tonic::Response<super::DispatchToChannelResponse>,
8292            tonic::Status,
8293        > {
8294            self.inner
8295                .ready()
8296                .await
8297                .map_err(|e| {
8298                    tonic::Status::unknown(
8299                        format!("Service was not ready: {}", e.into()),
8300                    )
8301                })?;
8302            let codec = tonic_prost::ProstCodec::default();
8303            let path = http::uri::PathAndQuery::from_static(
8304                "/pidgr.v1.IntegrationsService/DispatchToChannel",
8305            );
8306            let mut req = request.into_request();
8307            req.extensions_mut()
8308                .insert(
8309                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8310                );
8311            self.inner.unary(req, path, codec).await
8312        }
8313        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8314 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8315 audit row BEFORE the registry commit.
8316*/
8317        pub async fn upsert_reachability(
8318            &mut self,
8319            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8320        ) -> std::result::Result<
8321            tonic::Response<super::UpsertReachabilityResponse>,
8322            tonic::Status,
8323        > {
8324            self.inner
8325                .ready()
8326                .await
8327                .map_err(|e| {
8328                    tonic::Status::unknown(
8329                        format!("Service was not ready: {}", e.into()),
8330                    )
8331                })?;
8332            let codec = tonic_prost::ProstCodec::default();
8333            let path = http::uri::PathAndQuery::from_static(
8334                "/pidgr.v1.IntegrationsService/UpsertReachability",
8335            );
8336            let mut req = request.into_request();
8337            req.extensions_mut()
8338                .insert(
8339                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8340                );
8341            self.inner.unary(req, path, codec).await
8342        }
8343        /** Remove a reachability identifier. Idempotent. Emits a
8344 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8345*/
8346        pub async fn remove_reachability(
8347            &mut self,
8348            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8349        ) -> std::result::Result<
8350            tonic::Response<super::RemoveReachabilityResponse>,
8351            tonic::Status,
8352        > {
8353            self.inner
8354                .ready()
8355                .await
8356                .map_err(|e| {
8357                    tonic::Status::unknown(
8358                        format!("Service was not ready: {}", e.into()),
8359                    )
8360                })?;
8361            let codec = tonic_prost::ProstCodec::default();
8362            let path = http::uri::PathAndQuery::from_static(
8363                "/pidgr.v1.IntegrationsService/RemoveReachability",
8364            );
8365            let mut req = request.into_request();
8366            req.extensions_mut()
8367                .insert(
8368                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8369                );
8370            self.inner.unary(req, path, codec).await
8371        }
8372        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8373 Does not return plaintext or envelope ciphertext.
8374*/
8375        pub async fn get_reachability(
8376            &mut self,
8377            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8378        ) -> std::result::Result<
8379            tonic::Response<super::GetReachabilityResponse>,
8380            tonic::Status,
8381        > {
8382            self.inner
8383                .ready()
8384                .await
8385                .map_err(|e| {
8386                    tonic::Status::unknown(
8387                        format!("Service was not ready: {}", e.into()),
8388                    )
8389                })?;
8390            let codec = tonic_prost::ProstCodec::default();
8391            let path = http::uri::PathAndQuery::from_static(
8392                "/pidgr.v1.IntegrationsService/GetReachability",
8393            );
8394            let mut req = request.into_request();
8395            req.extensions_mut()
8396                .insert(
8397                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8398                );
8399            self.inner.unary(req, path, codec).await
8400        }
8401        /** List per-channel reachability metadata for a single user. Used by the
8402 admin per-user matrix view. Does not return plaintext or ciphertext.
8403*/
8404        pub async fn list_reachability_for_user(
8405            &mut self,
8406            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8407        ) -> std::result::Result<
8408            tonic::Response<super::ListReachabilityForUserResponse>,
8409            tonic::Status,
8410        > {
8411            self.inner
8412                .ready()
8413                .await
8414                .map_err(|e| {
8415                    tonic::Status::unknown(
8416                        format!("Service was not ready: {}", e.into()),
8417                    )
8418                })?;
8419            let codec = tonic_prost::ProstCodec::default();
8420            let path = http::uri::PathAndQuery::from_static(
8421                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8422            );
8423            let mut req = request.into_request();
8424            req.extensions_mut()
8425                .insert(
8426                    GrpcMethod::new(
8427                        "pidgr.v1.IntegrationsService",
8428                        "ListReachabilityForUser",
8429                    ),
8430                );
8431            self.inner.unary(req, path, codec).await
8432        }
8433        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8434 no policy is configured — NOT a NOT_FOUND.
8435*/
8436        pub async fn get_region_policy(
8437            &mut self,
8438            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8439        ) -> std::result::Result<
8440            tonic::Response<super::GetRegionPolicyResponse>,
8441            tonic::Status,
8442        > {
8443            self.inner
8444                .ready()
8445                .await
8446                .map_err(|e| {
8447                    tonic::Status::unknown(
8448                        format!("Service was not ready: {}", e.into()),
8449                    )
8450                })?;
8451            let codec = tonic_prost::ProstCodec::default();
8452            let path = http::uri::PathAndQuery::from_static(
8453                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8454            );
8455            let mut req = request.into_request();
8456            req.extensions_mut()
8457                .insert(
8458                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8459                );
8460            self.inner.unary(req, path, codec).await
8461        }
8462        /** Admin-only upsert of the per-(org, channel) region allowlist.
8463*/
8464        pub async fn set_region_policy(
8465            &mut self,
8466            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8467        ) -> std::result::Result<
8468            tonic::Response<super::SetRegionPolicyResponse>,
8469            tonic::Status,
8470        > {
8471            self.inner
8472                .ready()
8473                .await
8474                .map_err(|e| {
8475                    tonic::Status::unknown(
8476                        format!("Service was not ready: {}", e.into()),
8477                    )
8478                })?;
8479            let codec = tonic_prost::ProstCodec::default();
8480            let path = http::uri::PathAndQuery::from_static(
8481                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8482            );
8483            let mut req = request.into_request();
8484            req.extensions_mut()
8485                .insert(
8486                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8487                );
8488            self.inner.unary(req, path, codec).await
8489        }
8490        /** Read the current calendar-month cost-cap state. Returns the channel
8491 default cap when no row exists; never NOT_FOUND.
8492*/
8493        pub async fn get_cost_cap_policy(
8494            &mut self,
8495            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8496        ) -> std::result::Result<
8497            tonic::Response<super::GetCostCapPolicyResponse>,
8498            tonic::Status,
8499        > {
8500            self.inner
8501                .ready()
8502                .await
8503                .map_err(|e| {
8504                    tonic::Status::unknown(
8505                        format!("Service was not ready: {}", e.into()),
8506                    )
8507                })?;
8508            let codec = tonic_prost::ProstCodec::default();
8509            let path = http::uri::PathAndQuery::from_static(
8510                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8511            );
8512            let mut req = request.into_request();
8513            req.extensions_mut()
8514                .insert(
8515                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8516                );
8517            self.inner.unary(req, path, codec).await
8518        }
8519        /** Admin-only upsert of the current calendar-month cost cap.
8520*/
8521        pub async fn set_cost_cap_policy(
8522            &mut self,
8523            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8524        ) -> std::result::Result<
8525            tonic::Response<super::SetCostCapPolicyResponse>,
8526            tonic::Status,
8527        > {
8528            self.inner
8529                .ready()
8530                .await
8531                .map_err(|e| {
8532                    tonic::Status::unknown(
8533                        format!("Service was not ready: {}", e.into()),
8534                    )
8535                })?;
8536            let codec = tonic_prost::ProstCodec::default();
8537            let path = http::uri::PathAndQuery::from_static(
8538                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8539            );
8540            let mut req = request.into_request();
8541            req.extensions_mut()
8542                .insert(
8543                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8544                );
8545            self.inner.unary(req, path, codec).await
8546        }
8547        /** Read the org's generic-webhook channel configuration. The signing secret
8548 is never returned. Returns an empty-url config when none exists — NOT a
8549 NOT_FOUND.
8550*/
8551        pub async fn get_org_webhook_config(
8552            &mut self,
8553            request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8554        ) -> std::result::Result<
8555            tonic::Response<super::GetOrgWebhookConfigResponse>,
8556            tonic::Status,
8557        > {
8558            self.inner
8559                .ready()
8560                .await
8561                .map_err(|e| {
8562                    tonic::Status::unknown(
8563                        format!("Service was not ready: {}", e.into()),
8564                    )
8565                })?;
8566            let codec = tonic_prost::ProstCodec::default();
8567            let path = http::uri::PathAndQuery::from_static(
8568                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8569            );
8570            let mut req = request.into_request();
8571            req.extensions_mut()
8572                .insert(
8573                    GrpcMethod::new(
8574                        "pidgr.v1.IntegrationsService",
8575                        "GetOrgWebhookConfig",
8576                    ),
8577                );
8578            self.inner.unary(req, path, codec).await
8579        }
8580        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8581 the destination URL (https-only, public hosts) and envelope-encrypts the
8582 secret at rest.
8583*/
8584        pub async fn set_org_webhook_config(
8585            &mut self,
8586            request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8587        ) -> std::result::Result<
8588            tonic::Response<super::SetOrgWebhookConfigResponse>,
8589            tonic::Status,
8590        > {
8591            self.inner
8592                .ready()
8593                .await
8594                .map_err(|e| {
8595                    tonic::Status::unknown(
8596                        format!("Service was not ready: {}", e.into()),
8597                    )
8598                })?;
8599            let codec = tonic_prost::ProstCodec::default();
8600            let path = http::uri::PathAndQuery::from_static(
8601                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8602            );
8603            let mut req = request.into_request();
8604            req.extensions_mut()
8605                .insert(
8606                    GrpcMethod::new(
8607                        "pidgr.v1.IntegrationsService",
8608                        "SetOrgWebhookConfig",
8609                    ),
8610                );
8611            self.inner.unary(req, path, codec).await
8612        }
8613        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8614 user follows to bind a third-party channel (Telegram bot-follow, Slack
8615 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8616 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8617 are rejected with `invalid_argument`.
8618*/
8619        pub async fn create_channel_connect_link(
8620            &mut self,
8621            request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8622        ) -> std::result::Result<
8623            tonic::Response<super::CreateChannelConnectLinkResponse>,
8624            tonic::Status,
8625        > {
8626            self.inner
8627                .ready()
8628                .await
8629                .map_err(|e| {
8630                    tonic::Status::unknown(
8631                        format!("Service was not ready: {}", e.into()),
8632                    )
8633                })?;
8634            let codec = tonic_prost::ProstCodec::default();
8635            let path = http::uri::PathAndQuery::from_static(
8636                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8637            );
8638            let mut req = request.into_request();
8639            req.extensions_mut()
8640                .insert(
8641                    GrpcMethod::new(
8642                        "pidgr.v1.IntegrationsService",
8643                        "CreateChannelConnectLink",
8644                    ),
8645                );
8646            self.inner.unary(req, path, codec).await
8647        }
8648        /** CreateSlackWorkspaceInstallAuthorization mints a short-lived HMAC token
8649 authorizing a Slack workspace install into the caller's authorized org.
8650 The admin passes it to the integrations install-start endpoint, which
8651 verifies it and installs the bot into THAT org — fixing the multi-org
8652 mis-routing where the install always landed on the caller's JWT home org.
8653 Cognito JWT (admin only, org-scoped); cross-org is permission_denied.
8654*/
8655        pub async fn create_slack_workspace_install_authorization(
8656            &mut self,
8657            request: impl tonic::IntoRequest<
8658                super::CreateSlackWorkspaceInstallAuthorizationRequest,
8659            >,
8660        ) -> std::result::Result<
8661            tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
8662            tonic::Status,
8663        > {
8664            self.inner
8665                .ready()
8666                .await
8667                .map_err(|e| {
8668                    tonic::Status::unknown(
8669                        format!("Service was not ready: {}", e.into()),
8670                    )
8671                })?;
8672            let codec = tonic_prost::ProstCodec::default();
8673            let path = http::uri::PathAndQuery::from_static(
8674                "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization",
8675            );
8676            let mut req = request.into_request();
8677            req.extensions_mut()
8678                .insert(
8679                    GrpcMethod::new(
8680                        "pidgr.v1.IntegrationsService",
8681                        "CreateSlackWorkspaceInstallAuthorization",
8682                    ),
8683                );
8684            self.inner.unary(req, path, codec).await
8685        }
8686    }
8687}
8688/// Generated server implementations.
8689pub mod integrations_service_server {
8690    #![allow(
8691        unused_variables,
8692        dead_code,
8693        missing_docs,
8694        clippy::wildcard_imports,
8695        clippy::let_unit_value,
8696    )]
8697    use tonic::codegen::*;
8698    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8699    #[async_trait]
8700    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8701        /** Dispatch a single rendered message to one channel. Idempotent on
8702 `dispatch_id`. Internal-mTLS only.
8703*/
8704        async fn dispatch_to_channel(
8705            &self,
8706            request: tonic::Request<super::DispatchToChannelRequest>,
8707        ) -> std::result::Result<
8708            tonic::Response<super::DispatchToChannelResponse>,
8709            tonic::Status,
8710        >;
8711        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8712 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8713 audit row BEFORE the registry commit.
8714*/
8715        async fn upsert_reachability(
8716            &self,
8717            request: tonic::Request<super::UpsertReachabilityRequest>,
8718        ) -> std::result::Result<
8719            tonic::Response<super::UpsertReachabilityResponse>,
8720            tonic::Status,
8721        >;
8722        /** Remove a reachability identifier. Idempotent. Emits a
8723 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8724*/
8725        async fn remove_reachability(
8726            &self,
8727            request: tonic::Request<super::RemoveReachabilityRequest>,
8728        ) -> std::result::Result<
8729            tonic::Response<super::RemoveReachabilityResponse>,
8730            tonic::Status,
8731        >;
8732        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8733 Does not return plaintext or envelope ciphertext.
8734*/
8735        async fn get_reachability(
8736            &self,
8737            request: tonic::Request<super::GetReachabilityRequest>,
8738        ) -> std::result::Result<
8739            tonic::Response<super::GetReachabilityResponse>,
8740            tonic::Status,
8741        >;
8742        /** List per-channel reachability metadata for a single user. Used by the
8743 admin per-user matrix view. Does not return plaintext or ciphertext.
8744*/
8745        async fn list_reachability_for_user(
8746            &self,
8747            request: tonic::Request<super::ListReachabilityForUserRequest>,
8748        ) -> std::result::Result<
8749            tonic::Response<super::ListReachabilityForUserResponse>,
8750            tonic::Status,
8751        >;
8752        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8753 no policy is configured — NOT a NOT_FOUND.
8754*/
8755        async fn get_region_policy(
8756            &self,
8757            request: tonic::Request<super::GetRegionPolicyRequest>,
8758        ) -> std::result::Result<
8759            tonic::Response<super::GetRegionPolicyResponse>,
8760            tonic::Status,
8761        >;
8762        /** Admin-only upsert of the per-(org, channel) region allowlist.
8763*/
8764        async fn set_region_policy(
8765            &self,
8766            request: tonic::Request<super::SetRegionPolicyRequest>,
8767        ) -> std::result::Result<
8768            tonic::Response<super::SetRegionPolicyResponse>,
8769            tonic::Status,
8770        >;
8771        /** Read the current calendar-month cost-cap state. Returns the channel
8772 default cap when no row exists; never NOT_FOUND.
8773*/
8774        async fn get_cost_cap_policy(
8775            &self,
8776            request: tonic::Request<super::GetCostCapPolicyRequest>,
8777        ) -> std::result::Result<
8778            tonic::Response<super::GetCostCapPolicyResponse>,
8779            tonic::Status,
8780        >;
8781        /** Admin-only upsert of the current calendar-month cost cap.
8782*/
8783        async fn set_cost_cap_policy(
8784            &self,
8785            request: tonic::Request<super::SetCostCapPolicyRequest>,
8786        ) -> std::result::Result<
8787            tonic::Response<super::SetCostCapPolicyResponse>,
8788            tonic::Status,
8789        >;
8790        /** Read the org's generic-webhook channel configuration. The signing secret
8791 is never returned. Returns an empty-url config when none exists — NOT a
8792 NOT_FOUND.
8793*/
8794        async fn get_org_webhook_config(
8795            &self,
8796            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8797        ) -> std::result::Result<
8798            tonic::Response<super::GetOrgWebhookConfigResponse>,
8799            tonic::Status,
8800        >;
8801        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8802 the destination URL (https-only, public hosts) and envelope-encrypts the
8803 secret at rest.
8804*/
8805        async fn set_org_webhook_config(
8806            &self,
8807            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8808        ) -> std::result::Result<
8809            tonic::Response<super::SetOrgWebhookConfigResponse>,
8810            tonic::Status,
8811        >;
8812        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8813 user follows to bind a third-party channel (Telegram bot-follow, Slack
8814 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8815 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8816 are rejected with `invalid_argument`.
8817*/
8818        async fn create_channel_connect_link(
8819            &self,
8820            request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8821        ) -> std::result::Result<
8822            tonic::Response<super::CreateChannelConnectLinkResponse>,
8823            tonic::Status,
8824        >;
8825        /** CreateSlackWorkspaceInstallAuthorization mints a short-lived HMAC token
8826 authorizing a Slack workspace install into the caller's authorized org.
8827 The admin passes it to the integrations install-start endpoint, which
8828 verifies it and installs the bot into THAT org — fixing the multi-org
8829 mis-routing where the install always landed on the caller's JWT home org.
8830 Cognito JWT (admin only, org-scoped); cross-org is permission_denied.
8831*/
8832        async fn create_slack_workspace_install_authorization(
8833            &self,
8834            request: tonic::Request<
8835                super::CreateSlackWorkspaceInstallAuthorizationRequest,
8836            >,
8837        ) -> std::result::Result<
8838            tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
8839            tonic::Status,
8840        >;
8841    }
8842    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8843
8844 Auth model:
8845   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8846     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8847   - UpsertReachability / RemoveReachability / GetReachability /
8848     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8849     caller's `custom:org_id` claim).
8850   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8851     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8852     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8853
8854 Cross-org access is denied with `permission_denied`.
8855*/
8856    #[derive(Debug)]
8857    pub struct IntegrationsServiceServer<T> {
8858        inner: Arc<T>,
8859        accept_compression_encodings: EnabledCompressionEncodings,
8860        send_compression_encodings: EnabledCompressionEncodings,
8861        max_decoding_message_size: Option<usize>,
8862        max_encoding_message_size: Option<usize>,
8863    }
8864    impl<T> IntegrationsServiceServer<T> {
8865        pub fn new(inner: T) -> Self {
8866            Self::from_arc(Arc::new(inner))
8867        }
8868        pub fn from_arc(inner: Arc<T>) -> Self {
8869            Self {
8870                inner,
8871                accept_compression_encodings: Default::default(),
8872                send_compression_encodings: Default::default(),
8873                max_decoding_message_size: None,
8874                max_encoding_message_size: None,
8875            }
8876        }
8877        pub fn with_interceptor<F>(
8878            inner: T,
8879            interceptor: F,
8880        ) -> InterceptedService<Self, F>
8881        where
8882            F: tonic::service::Interceptor,
8883        {
8884            InterceptedService::new(Self::new(inner), interceptor)
8885        }
8886        /// Enable decompressing requests with the given encoding.
8887        #[must_use]
8888        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8889            self.accept_compression_encodings.enable(encoding);
8890            self
8891        }
8892        /// Compress responses with the given encoding, if the client supports it.
8893        #[must_use]
8894        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8895            self.send_compression_encodings.enable(encoding);
8896            self
8897        }
8898        /// Limits the maximum size of a decoded message.
8899        ///
8900        /// Default: `4MB`
8901        #[must_use]
8902        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8903            self.max_decoding_message_size = Some(limit);
8904            self
8905        }
8906        /// Limits the maximum size of an encoded message.
8907        ///
8908        /// Default: `usize::MAX`
8909        #[must_use]
8910        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8911            self.max_encoding_message_size = Some(limit);
8912            self
8913        }
8914    }
8915    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8916    where
8917        T: IntegrationsService,
8918        B: Body + std::marker::Send + 'static,
8919        B::Error: Into<StdError> + std::marker::Send + 'static,
8920    {
8921        type Response = http::Response<tonic::body::Body>;
8922        type Error = std::convert::Infallible;
8923        type Future = BoxFuture<Self::Response, Self::Error>;
8924        fn poll_ready(
8925            &mut self,
8926            _cx: &mut Context<'_>,
8927        ) -> Poll<std::result::Result<(), Self::Error>> {
8928            Poll::Ready(Ok(()))
8929        }
8930        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8931            match req.uri().path() {
8932                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8933                    #[allow(non_camel_case_types)]
8934                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8935                    impl<
8936                        T: IntegrationsService,
8937                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
8938                    for DispatchToChannelSvc<T> {
8939                        type Response = super::DispatchToChannelResponse;
8940                        type Future = BoxFuture<
8941                            tonic::Response<Self::Response>,
8942                            tonic::Status,
8943                        >;
8944                        fn call(
8945                            &mut self,
8946                            request: tonic::Request<super::DispatchToChannelRequest>,
8947                        ) -> Self::Future {
8948                            let inner = Arc::clone(&self.0);
8949                            let fut = async move {
8950                                <T as IntegrationsService>::dispatch_to_channel(
8951                                        &inner,
8952                                        request,
8953                                    )
8954                                    .await
8955                            };
8956                            Box::pin(fut)
8957                        }
8958                    }
8959                    let accept_compression_encodings = self.accept_compression_encodings;
8960                    let send_compression_encodings = self.send_compression_encodings;
8961                    let max_decoding_message_size = self.max_decoding_message_size;
8962                    let max_encoding_message_size = self.max_encoding_message_size;
8963                    let inner = self.inner.clone();
8964                    let fut = async move {
8965                        let method = DispatchToChannelSvc(inner);
8966                        let codec = tonic_prost::ProstCodec::default();
8967                        let mut grpc = tonic::server::Grpc::new(codec)
8968                            .apply_compression_config(
8969                                accept_compression_encodings,
8970                                send_compression_encodings,
8971                            )
8972                            .apply_max_message_size_config(
8973                                max_decoding_message_size,
8974                                max_encoding_message_size,
8975                            );
8976                        let res = grpc.unary(method, req).await;
8977                        Ok(res)
8978                    };
8979                    Box::pin(fut)
8980                }
8981                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8982                    #[allow(non_camel_case_types)]
8983                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8984                    impl<
8985                        T: IntegrationsService,
8986                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8987                    for UpsertReachabilitySvc<T> {
8988                        type Response = super::UpsertReachabilityResponse;
8989                        type Future = BoxFuture<
8990                            tonic::Response<Self::Response>,
8991                            tonic::Status,
8992                        >;
8993                        fn call(
8994                            &mut self,
8995                            request: tonic::Request<super::UpsertReachabilityRequest>,
8996                        ) -> Self::Future {
8997                            let inner = Arc::clone(&self.0);
8998                            let fut = async move {
8999                                <T as IntegrationsService>::upsert_reachability(
9000                                        &inner,
9001                                        request,
9002                                    )
9003                                    .await
9004                            };
9005                            Box::pin(fut)
9006                        }
9007                    }
9008                    let accept_compression_encodings = self.accept_compression_encodings;
9009                    let send_compression_encodings = self.send_compression_encodings;
9010                    let max_decoding_message_size = self.max_decoding_message_size;
9011                    let max_encoding_message_size = self.max_encoding_message_size;
9012                    let inner = self.inner.clone();
9013                    let fut = async move {
9014                        let method = UpsertReachabilitySvc(inner);
9015                        let codec = tonic_prost::ProstCodec::default();
9016                        let mut grpc = tonic::server::Grpc::new(codec)
9017                            .apply_compression_config(
9018                                accept_compression_encodings,
9019                                send_compression_encodings,
9020                            )
9021                            .apply_max_message_size_config(
9022                                max_decoding_message_size,
9023                                max_encoding_message_size,
9024                            );
9025                        let res = grpc.unary(method, req).await;
9026                        Ok(res)
9027                    };
9028                    Box::pin(fut)
9029                }
9030                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
9031                    #[allow(non_camel_case_types)]
9032                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
9033                    impl<
9034                        T: IntegrationsService,
9035                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
9036                    for RemoveReachabilitySvc<T> {
9037                        type Response = super::RemoveReachabilityResponse;
9038                        type Future = BoxFuture<
9039                            tonic::Response<Self::Response>,
9040                            tonic::Status,
9041                        >;
9042                        fn call(
9043                            &mut self,
9044                            request: tonic::Request<super::RemoveReachabilityRequest>,
9045                        ) -> Self::Future {
9046                            let inner = Arc::clone(&self.0);
9047                            let fut = async move {
9048                                <T as IntegrationsService>::remove_reachability(
9049                                        &inner,
9050                                        request,
9051                                    )
9052                                    .await
9053                            };
9054                            Box::pin(fut)
9055                        }
9056                    }
9057                    let accept_compression_encodings = self.accept_compression_encodings;
9058                    let send_compression_encodings = self.send_compression_encodings;
9059                    let max_decoding_message_size = self.max_decoding_message_size;
9060                    let max_encoding_message_size = self.max_encoding_message_size;
9061                    let inner = self.inner.clone();
9062                    let fut = async move {
9063                        let method = RemoveReachabilitySvc(inner);
9064                        let codec = tonic_prost::ProstCodec::default();
9065                        let mut grpc = tonic::server::Grpc::new(codec)
9066                            .apply_compression_config(
9067                                accept_compression_encodings,
9068                                send_compression_encodings,
9069                            )
9070                            .apply_max_message_size_config(
9071                                max_decoding_message_size,
9072                                max_encoding_message_size,
9073                            );
9074                        let res = grpc.unary(method, req).await;
9075                        Ok(res)
9076                    };
9077                    Box::pin(fut)
9078                }
9079                "/pidgr.v1.IntegrationsService/GetReachability" => {
9080                    #[allow(non_camel_case_types)]
9081                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
9082                    impl<
9083                        T: IntegrationsService,
9084                    > tonic::server::UnaryService<super::GetReachabilityRequest>
9085                    for GetReachabilitySvc<T> {
9086                        type Response = super::GetReachabilityResponse;
9087                        type Future = BoxFuture<
9088                            tonic::Response<Self::Response>,
9089                            tonic::Status,
9090                        >;
9091                        fn call(
9092                            &mut self,
9093                            request: tonic::Request<super::GetReachabilityRequest>,
9094                        ) -> Self::Future {
9095                            let inner = Arc::clone(&self.0);
9096                            let fut = async move {
9097                                <T as IntegrationsService>::get_reachability(
9098                                        &inner,
9099                                        request,
9100                                    )
9101                                    .await
9102                            };
9103                            Box::pin(fut)
9104                        }
9105                    }
9106                    let accept_compression_encodings = self.accept_compression_encodings;
9107                    let send_compression_encodings = self.send_compression_encodings;
9108                    let max_decoding_message_size = self.max_decoding_message_size;
9109                    let max_encoding_message_size = self.max_encoding_message_size;
9110                    let inner = self.inner.clone();
9111                    let fut = async move {
9112                        let method = GetReachabilitySvc(inner);
9113                        let codec = tonic_prost::ProstCodec::default();
9114                        let mut grpc = tonic::server::Grpc::new(codec)
9115                            .apply_compression_config(
9116                                accept_compression_encodings,
9117                                send_compression_encodings,
9118                            )
9119                            .apply_max_message_size_config(
9120                                max_decoding_message_size,
9121                                max_encoding_message_size,
9122                            );
9123                        let res = grpc.unary(method, req).await;
9124                        Ok(res)
9125                    };
9126                    Box::pin(fut)
9127                }
9128                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
9129                    #[allow(non_camel_case_types)]
9130                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
9131                        pub Arc<T>,
9132                    );
9133                    impl<
9134                        T: IntegrationsService,
9135                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
9136                    for ListReachabilityForUserSvc<T> {
9137                        type Response = super::ListReachabilityForUserResponse;
9138                        type Future = BoxFuture<
9139                            tonic::Response<Self::Response>,
9140                            tonic::Status,
9141                        >;
9142                        fn call(
9143                            &mut self,
9144                            request: tonic::Request<
9145                                super::ListReachabilityForUserRequest,
9146                            >,
9147                        ) -> Self::Future {
9148                            let inner = Arc::clone(&self.0);
9149                            let fut = async move {
9150                                <T as IntegrationsService>::list_reachability_for_user(
9151                                        &inner,
9152                                        request,
9153                                    )
9154                                    .await
9155                            };
9156                            Box::pin(fut)
9157                        }
9158                    }
9159                    let accept_compression_encodings = self.accept_compression_encodings;
9160                    let send_compression_encodings = self.send_compression_encodings;
9161                    let max_decoding_message_size = self.max_decoding_message_size;
9162                    let max_encoding_message_size = self.max_encoding_message_size;
9163                    let inner = self.inner.clone();
9164                    let fut = async move {
9165                        let method = ListReachabilityForUserSvc(inner);
9166                        let codec = tonic_prost::ProstCodec::default();
9167                        let mut grpc = tonic::server::Grpc::new(codec)
9168                            .apply_compression_config(
9169                                accept_compression_encodings,
9170                                send_compression_encodings,
9171                            )
9172                            .apply_max_message_size_config(
9173                                max_decoding_message_size,
9174                                max_encoding_message_size,
9175                            );
9176                        let res = grpc.unary(method, req).await;
9177                        Ok(res)
9178                    };
9179                    Box::pin(fut)
9180                }
9181                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
9182                    #[allow(non_camel_case_types)]
9183                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9184                    impl<
9185                        T: IntegrationsService,
9186                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
9187                    for GetRegionPolicySvc<T> {
9188                        type Response = super::GetRegionPolicyResponse;
9189                        type Future = BoxFuture<
9190                            tonic::Response<Self::Response>,
9191                            tonic::Status,
9192                        >;
9193                        fn call(
9194                            &mut self,
9195                            request: tonic::Request<super::GetRegionPolicyRequest>,
9196                        ) -> Self::Future {
9197                            let inner = Arc::clone(&self.0);
9198                            let fut = async move {
9199                                <T as IntegrationsService>::get_region_policy(
9200                                        &inner,
9201                                        request,
9202                                    )
9203                                    .await
9204                            };
9205                            Box::pin(fut)
9206                        }
9207                    }
9208                    let accept_compression_encodings = self.accept_compression_encodings;
9209                    let send_compression_encodings = self.send_compression_encodings;
9210                    let max_decoding_message_size = self.max_decoding_message_size;
9211                    let max_encoding_message_size = self.max_encoding_message_size;
9212                    let inner = self.inner.clone();
9213                    let fut = async move {
9214                        let method = GetRegionPolicySvc(inner);
9215                        let codec = tonic_prost::ProstCodec::default();
9216                        let mut grpc = tonic::server::Grpc::new(codec)
9217                            .apply_compression_config(
9218                                accept_compression_encodings,
9219                                send_compression_encodings,
9220                            )
9221                            .apply_max_message_size_config(
9222                                max_decoding_message_size,
9223                                max_encoding_message_size,
9224                            );
9225                        let res = grpc.unary(method, req).await;
9226                        Ok(res)
9227                    };
9228                    Box::pin(fut)
9229                }
9230                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
9231                    #[allow(non_camel_case_types)]
9232                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9233                    impl<
9234                        T: IntegrationsService,
9235                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
9236                    for SetRegionPolicySvc<T> {
9237                        type Response = super::SetRegionPolicyResponse;
9238                        type Future = BoxFuture<
9239                            tonic::Response<Self::Response>,
9240                            tonic::Status,
9241                        >;
9242                        fn call(
9243                            &mut self,
9244                            request: tonic::Request<super::SetRegionPolicyRequest>,
9245                        ) -> Self::Future {
9246                            let inner = Arc::clone(&self.0);
9247                            let fut = async move {
9248                                <T as IntegrationsService>::set_region_policy(
9249                                        &inner,
9250                                        request,
9251                                    )
9252                                    .await
9253                            };
9254                            Box::pin(fut)
9255                        }
9256                    }
9257                    let accept_compression_encodings = self.accept_compression_encodings;
9258                    let send_compression_encodings = self.send_compression_encodings;
9259                    let max_decoding_message_size = self.max_decoding_message_size;
9260                    let max_encoding_message_size = self.max_encoding_message_size;
9261                    let inner = self.inner.clone();
9262                    let fut = async move {
9263                        let method = SetRegionPolicySvc(inner);
9264                        let codec = tonic_prost::ProstCodec::default();
9265                        let mut grpc = tonic::server::Grpc::new(codec)
9266                            .apply_compression_config(
9267                                accept_compression_encodings,
9268                                send_compression_encodings,
9269                            )
9270                            .apply_max_message_size_config(
9271                                max_decoding_message_size,
9272                                max_encoding_message_size,
9273                            );
9274                        let res = grpc.unary(method, req).await;
9275                        Ok(res)
9276                    };
9277                    Box::pin(fut)
9278                }
9279                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
9280                    #[allow(non_camel_case_types)]
9281                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9282                    impl<
9283                        T: IntegrationsService,
9284                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
9285                    for GetCostCapPolicySvc<T> {
9286                        type Response = super::GetCostCapPolicyResponse;
9287                        type Future = BoxFuture<
9288                            tonic::Response<Self::Response>,
9289                            tonic::Status,
9290                        >;
9291                        fn call(
9292                            &mut self,
9293                            request: tonic::Request<super::GetCostCapPolicyRequest>,
9294                        ) -> Self::Future {
9295                            let inner = Arc::clone(&self.0);
9296                            let fut = async move {
9297                                <T as IntegrationsService>::get_cost_cap_policy(
9298                                        &inner,
9299                                        request,
9300                                    )
9301                                    .await
9302                            };
9303                            Box::pin(fut)
9304                        }
9305                    }
9306                    let accept_compression_encodings = self.accept_compression_encodings;
9307                    let send_compression_encodings = self.send_compression_encodings;
9308                    let max_decoding_message_size = self.max_decoding_message_size;
9309                    let max_encoding_message_size = self.max_encoding_message_size;
9310                    let inner = self.inner.clone();
9311                    let fut = async move {
9312                        let method = GetCostCapPolicySvc(inner);
9313                        let codec = tonic_prost::ProstCodec::default();
9314                        let mut grpc = tonic::server::Grpc::new(codec)
9315                            .apply_compression_config(
9316                                accept_compression_encodings,
9317                                send_compression_encodings,
9318                            )
9319                            .apply_max_message_size_config(
9320                                max_decoding_message_size,
9321                                max_encoding_message_size,
9322                            );
9323                        let res = grpc.unary(method, req).await;
9324                        Ok(res)
9325                    };
9326                    Box::pin(fut)
9327                }
9328                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
9329                    #[allow(non_camel_case_types)]
9330                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9331                    impl<
9332                        T: IntegrationsService,
9333                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9334                    for SetCostCapPolicySvc<T> {
9335                        type Response = super::SetCostCapPolicyResponse;
9336                        type Future = BoxFuture<
9337                            tonic::Response<Self::Response>,
9338                            tonic::Status,
9339                        >;
9340                        fn call(
9341                            &mut self,
9342                            request: tonic::Request<super::SetCostCapPolicyRequest>,
9343                        ) -> Self::Future {
9344                            let inner = Arc::clone(&self.0);
9345                            let fut = async move {
9346                                <T as IntegrationsService>::set_cost_cap_policy(
9347                                        &inner,
9348                                        request,
9349                                    )
9350                                    .await
9351                            };
9352                            Box::pin(fut)
9353                        }
9354                    }
9355                    let accept_compression_encodings = self.accept_compression_encodings;
9356                    let send_compression_encodings = self.send_compression_encodings;
9357                    let max_decoding_message_size = self.max_decoding_message_size;
9358                    let max_encoding_message_size = self.max_encoding_message_size;
9359                    let inner = self.inner.clone();
9360                    let fut = async move {
9361                        let method = SetCostCapPolicySvc(inner);
9362                        let codec = tonic_prost::ProstCodec::default();
9363                        let mut grpc = tonic::server::Grpc::new(codec)
9364                            .apply_compression_config(
9365                                accept_compression_encodings,
9366                                send_compression_encodings,
9367                            )
9368                            .apply_max_message_size_config(
9369                                max_decoding_message_size,
9370                                max_encoding_message_size,
9371                            );
9372                        let res = grpc.unary(method, req).await;
9373                        Ok(res)
9374                    };
9375                    Box::pin(fut)
9376                }
9377                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9378                    #[allow(non_camel_case_types)]
9379                    struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9380                    impl<
9381                        T: IntegrationsService,
9382                    > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9383                    for GetOrgWebhookConfigSvc<T> {
9384                        type Response = super::GetOrgWebhookConfigResponse;
9385                        type Future = BoxFuture<
9386                            tonic::Response<Self::Response>,
9387                            tonic::Status,
9388                        >;
9389                        fn call(
9390                            &mut self,
9391                            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9392                        ) -> Self::Future {
9393                            let inner = Arc::clone(&self.0);
9394                            let fut = async move {
9395                                <T as IntegrationsService>::get_org_webhook_config(
9396                                        &inner,
9397                                        request,
9398                                    )
9399                                    .await
9400                            };
9401                            Box::pin(fut)
9402                        }
9403                    }
9404                    let accept_compression_encodings = self.accept_compression_encodings;
9405                    let send_compression_encodings = self.send_compression_encodings;
9406                    let max_decoding_message_size = self.max_decoding_message_size;
9407                    let max_encoding_message_size = self.max_encoding_message_size;
9408                    let inner = self.inner.clone();
9409                    let fut = async move {
9410                        let method = GetOrgWebhookConfigSvc(inner);
9411                        let codec = tonic_prost::ProstCodec::default();
9412                        let mut grpc = tonic::server::Grpc::new(codec)
9413                            .apply_compression_config(
9414                                accept_compression_encodings,
9415                                send_compression_encodings,
9416                            )
9417                            .apply_max_message_size_config(
9418                                max_decoding_message_size,
9419                                max_encoding_message_size,
9420                            );
9421                        let res = grpc.unary(method, req).await;
9422                        Ok(res)
9423                    };
9424                    Box::pin(fut)
9425                }
9426                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9427                    #[allow(non_camel_case_types)]
9428                    struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9429                    impl<
9430                        T: IntegrationsService,
9431                    > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9432                    for SetOrgWebhookConfigSvc<T> {
9433                        type Response = super::SetOrgWebhookConfigResponse;
9434                        type Future = BoxFuture<
9435                            tonic::Response<Self::Response>,
9436                            tonic::Status,
9437                        >;
9438                        fn call(
9439                            &mut self,
9440                            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9441                        ) -> Self::Future {
9442                            let inner = Arc::clone(&self.0);
9443                            let fut = async move {
9444                                <T as IntegrationsService>::set_org_webhook_config(
9445                                        &inner,
9446                                        request,
9447                                    )
9448                                    .await
9449                            };
9450                            Box::pin(fut)
9451                        }
9452                    }
9453                    let accept_compression_encodings = self.accept_compression_encodings;
9454                    let send_compression_encodings = self.send_compression_encodings;
9455                    let max_decoding_message_size = self.max_decoding_message_size;
9456                    let max_encoding_message_size = self.max_encoding_message_size;
9457                    let inner = self.inner.clone();
9458                    let fut = async move {
9459                        let method = SetOrgWebhookConfigSvc(inner);
9460                        let codec = tonic_prost::ProstCodec::default();
9461                        let mut grpc = tonic::server::Grpc::new(codec)
9462                            .apply_compression_config(
9463                                accept_compression_encodings,
9464                                send_compression_encodings,
9465                            )
9466                            .apply_max_message_size_config(
9467                                max_decoding_message_size,
9468                                max_encoding_message_size,
9469                            );
9470                        let res = grpc.unary(method, req).await;
9471                        Ok(res)
9472                    };
9473                    Box::pin(fut)
9474                }
9475                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9476                    #[allow(non_camel_case_types)]
9477                    struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9478                        pub Arc<T>,
9479                    );
9480                    impl<
9481                        T: IntegrationsService,
9482                    > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9483                    for CreateChannelConnectLinkSvc<T> {
9484                        type Response = super::CreateChannelConnectLinkResponse;
9485                        type Future = BoxFuture<
9486                            tonic::Response<Self::Response>,
9487                            tonic::Status,
9488                        >;
9489                        fn call(
9490                            &mut self,
9491                            request: tonic::Request<
9492                                super::CreateChannelConnectLinkRequest,
9493                            >,
9494                        ) -> Self::Future {
9495                            let inner = Arc::clone(&self.0);
9496                            let fut = async move {
9497                                <T as IntegrationsService>::create_channel_connect_link(
9498                                        &inner,
9499                                        request,
9500                                    )
9501                                    .await
9502                            };
9503                            Box::pin(fut)
9504                        }
9505                    }
9506                    let accept_compression_encodings = self.accept_compression_encodings;
9507                    let send_compression_encodings = self.send_compression_encodings;
9508                    let max_decoding_message_size = self.max_decoding_message_size;
9509                    let max_encoding_message_size = self.max_encoding_message_size;
9510                    let inner = self.inner.clone();
9511                    let fut = async move {
9512                        let method = CreateChannelConnectLinkSvc(inner);
9513                        let codec = tonic_prost::ProstCodec::default();
9514                        let mut grpc = tonic::server::Grpc::new(codec)
9515                            .apply_compression_config(
9516                                accept_compression_encodings,
9517                                send_compression_encodings,
9518                            )
9519                            .apply_max_message_size_config(
9520                                max_decoding_message_size,
9521                                max_encoding_message_size,
9522                            );
9523                        let res = grpc.unary(method, req).await;
9524                        Ok(res)
9525                    };
9526                    Box::pin(fut)
9527                }
9528                "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization" => {
9529                    #[allow(non_camel_case_types)]
9530                    struct CreateSlackWorkspaceInstallAuthorizationSvc<
9531                        T: IntegrationsService,
9532                    >(
9533                        pub Arc<T>,
9534                    );
9535                    impl<
9536                        T: IntegrationsService,
9537                    > tonic::server::UnaryService<
9538                        super::CreateSlackWorkspaceInstallAuthorizationRequest,
9539                    > for CreateSlackWorkspaceInstallAuthorizationSvc<T> {
9540                        type Response = super::CreateSlackWorkspaceInstallAuthorizationResponse;
9541                        type Future = BoxFuture<
9542                            tonic::Response<Self::Response>,
9543                            tonic::Status,
9544                        >;
9545                        fn call(
9546                            &mut self,
9547                            request: tonic::Request<
9548                                super::CreateSlackWorkspaceInstallAuthorizationRequest,
9549                            >,
9550                        ) -> Self::Future {
9551                            let inner = Arc::clone(&self.0);
9552                            let fut = async move {
9553                                <T as IntegrationsService>::create_slack_workspace_install_authorization(
9554                                        &inner,
9555                                        request,
9556                                    )
9557                                    .await
9558                            };
9559                            Box::pin(fut)
9560                        }
9561                    }
9562                    let accept_compression_encodings = self.accept_compression_encodings;
9563                    let send_compression_encodings = self.send_compression_encodings;
9564                    let max_decoding_message_size = self.max_decoding_message_size;
9565                    let max_encoding_message_size = self.max_encoding_message_size;
9566                    let inner = self.inner.clone();
9567                    let fut = async move {
9568                        let method = CreateSlackWorkspaceInstallAuthorizationSvc(inner);
9569                        let codec = tonic_prost::ProstCodec::default();
9570                        let mut grpc = tonic::server::Grpc::new(codec)
9571                            .apply_compression_config(
9572                                accept_compression_encodings,
9573                                send_compression_encodings,
9574                            )
9575                            .apply_max_message_size_config(
9576                                max_decoding_message_size,
9577                                max_encoding_message_size,
9578                            );
9579                        let res = grpc.unary(method, req).await;
9580                        Ok(res)
9581                    };
9582                    Box::pin(fut)
9583                }
9584                _ => {
9585                    Box::pin(async move {
9586                        let mut response = http::Response::new(
9587                            tonic::body::Body::default(),
9588                        );
9589                        let headers = response.headers_mut();
9590                        headers
9591                            .insert(
9592                                tonic::Status::GRPC_STATUS,
9593                                (tonic::Code::Unimplemented as i32).into(),
9594                            );
9595                        headers
9596                            .insert(
9597                                http::header::CONTENT_TYPE,
9598                                tonic::metadata::GRPC_CONTENT_TYPE,
9599                            );
9600                        Ok(response)
9601                    })
9602                }
9603            }
9604        }
9605    }
9606    impl<T> Clone for IntegrationsServiceServer<T> {
9607        fn clone(&self) -> Self {
9608            let inner = self.inner.clone();
9609            Self {
9610                inner,
9611                accept_compression_encodings: self.accept_compression_encodings,
9612                send_compression_encodings: self.send_compression_encodings,
9613                max_decoding_message_size: self.max_decoding_message_size,
9614                max_encoding_message_size: self.max_encoding_message_size,
9615            }
9616        }
9617    }
9618    /// Generated gRPC service name
9619    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9620    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9621        const NAME: &'static str = SERVICE_NAME;
9622    }
9623}
9624/// Generated client implementations.
9625pub mod invite_link_service_client {
9626    #![allow(
9627        unused_variables,
9628        dead_code,
9629        missing_docs,
9630        clippy::wildcard_imports,
9631        clippy::let_unit_value,
9632    )]
9633    use tonic::codegen::*;
9634    use tonic::codegen::http::Uri;
9635    /** Manages shareable invite links for organization self-join.
9636 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9637 ValidateInviteLink is unauthenticated — the token IS the authorization.
9638 RedeemInviteLink requires a valid JWT.
9639*/
9640    #[derive(Debug, Clone)]
9641    pub struct InviteLinkServiceClient<T> {
9642        inner: tonic::client::Grpc<T>,
9643    }
9644    impl InviteLinkServiceClient<tonic::transport::Channel> {
9645        /// Attempt to create a new client by connecting to a given endpoint.
9646        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9647        where
9648            D: TryInto<tonic::transport::Endpoint>,
9649            D::Error: Into<StdError>,
9650        {
9651            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9652            Ok(Self::new(conn))
9653        }
9654    }
9655    impl<T> InviteLinkServiceClient<T>
9656    where
9657        T: tonic::client::GrpcService<tonic::body::Body>,
9658        T::Error: Into<StdError>,
9659        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9660        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9661    {
9662        pub fn new(inner: T) -> Self {
9663            let inner = tonic::client::Grpc::new(inner);
9664            Self { inner }
9665        }
9666        pub fn with_origin(inner: T, origin: Uri) -> Self {
9667            let inner = tonic::client::Grpc::with_origin(inner, origin);
9668            Self { inner }
9669        }
9670        pub fn with_interceptor<F>(
9671            inner: T,
9672            interceptor: F,
9673        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9674        where
9675            F: tonic::service::Interceptor,
9676            T::ResponseBody: Default,
9677            T: tonic::codegen::Service<
9678                http::Request<tonic::body::Body>,
9679                Response = http::Response<
9680                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9681                >,
9682            >,
9683            <T as tonic::codegen::Service<
9684                http::Request<tonic::body::Body>,
9685            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9686        {
9687            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9688        }
9689        /// Compress requests with the given encoding.
9690        ///
9691        /// This requires the server to support it otherwise it might respond with an
9692        /// error.
9693        #[must_use]
9694        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9695            self.inner = self.inner.send_compressed(encoding);
9696            self
9697        }
9698        /// Enable decompressing responses.
9699        #[must_use]
9700        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9701            self.inner = self.inner.accept_compressed(encoding);
9702            self
9703        }
9704        /// Limits the maximum size of a decoded message.
9705        ///
9706        /// Default: `4MB`
9707        #[must_use]
9708        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9709            self.inner = self.inner.max_decoding_message_size(limit);
9710            self
9711        }
9712        /// Limits the maximum size of an encoded message.
9713        ///
9714        /// Default: `usize::MAX`
9715        #[must_use]
9716        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9717            self.inner = self.inner.max_encoding_message_size(limit);
9718            self
9719        }
9720        /** Create a new shareable invite link for the organization.
9721 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9722*/
9723        pub async fn create_invite_link(
9724            &mut self,
9725            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9726        ) -> std::result::Result<
9727            tonic::Response<super::CreateInviteLinkResponse>,
9728            tonic::Status,
9729        > {
9730            self.inner
9731                .ready()
9732                .await
9733                .map_err(|e| {
9734                    tonic::Status::unknown(
9735                        format!("Service was not ready: {}", e.into()),
9736                    )
9737                })?;
9738            let codec = tonic_prost::ProstCodec::default();
9739            let path = http::uri::PathAndQuery::from_static(
9740                "/pidgr.v1.InviteLinkService/CreateInviteLink",
9741            );
9742            let mut req = request.into_request();
9743            req.extensions_mut()
9744                .insert(
9745                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9746                );
9747            self.inner.unary(req, path, codec).await
9748        }
9749        /** List all invite links for the organization.
9750 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9751*/
9752        pub async fn list_invite_links(
9753            &mut self,
9754            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9755        ) -> std::result::Result<
9756            tonic::Response<super::ListInviteLinksResponse>,
9757            tonic::Status,
9758        > {
9759            self.inner
9760                .ready()
9761                .await
9762                .map_err(|e| {
9763                    tonic::Status::unknown(
9764                        format!("Service was not ready: {}", e.into()),
9765                    )
9766                })?;
9767            let codec = tonic_prost::ProstCodec::default();
9768            let path = http::uri::PathAndQuery::from_static(
9769                "/pidgr.v1.InviteLinkService/ListInviteLinks",
9770            );
9771            let mut req = request.into_request();
9772            req.extensions_mut()
9773                .insert(
9774                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9775                );
9776            self.inner.unary(req, path, codec).await
9777        }
9778        /** Revoke an invite link, making it immediately unusable. Idempotent.
9779 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9780*/
9781        pub async fn revoke_invite_link(
9782            &mut self,
9783            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9784        ) -> std::result::Result<
9785            tonic::Response<super::RevokeInviteLinkResponse>,
9786            tonic::Status,
9787        > {
9788            self.inner
9789                .ready()
9790                .await
9791                .map_err(|e| {
9792                    tonic::Status::unknown(
9793                        format!("Service was not ready: {}", e.into()),
9794                    )
9795                })?;
9796            let codec = tonic_prost::ProstCodec::default();
9797            let path = http::uri::PathAndQuery::from_static(
9798                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9799            );
9800            let mut req = request.into_request();
9801            req.extensions_mut()
9802                .insert(
9803                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9804                );
9805            self.inner.unary(req, path, codec).await
9806        }
9807        /** Validate an invite link and provision a user account if needed.
9808 This is a pre-authentication endpoint — no JWT required.
9809 Rate limited to 10 requests per minute per IP.
9810 Authorization: None (token-based).
9811*/
9812        pub async fn validate_invite_link(
9813            &mut self,
9814            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9815        ) -> std::result::Result<
9816            tonic::Response<super::ValidateInviteLinkResponse>,
9817            tonic::Status,
9818        > {
9819            self.inner
9820                .ready()
9821                .await
9822                .map_err(|e| {
9823                    tonic::Status::unknown(
9824                        format!("Service was not ready: {}", e.into()),
9825                    )
9826                })?;
9827            let codec = tonic_prost::ProstCodec::default();
9828            let path = http::uri::PathAndQuery::from_static(
9829                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9830            );
9831            let mut req = request.into_request();
9832            req.extensions_mut()
9833                .insert(
9834                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9835                );
9836            self.inner.unary(req, path, codec).await
9837        }
9838        /** Redeem an invite link to join an organization.
9839 Requires a valid JWT — the email is extracted from the token.
9840 Authorization: JWT required.
9841*/
9842        pub async fn redeem_invite_link(
9843            &mut self,
9844            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9845        ) -> std::result::Result<
9846            tonic::Response<super::RedeemInviteLinkResponse>,
9847            tonic::Status,
9848        > {
9849            self.inner
9850                .ready()
9851                .await
9852                .map_err(|e| {
9853                    tonic::Status::unknown(
9854                        format!("Service was not ready: {}", e.into()),
9855                    )
9856                })?;
9857            let codec = tonic_prost::ProstCodec::default();
9858            let path = http::uri::PathAndQuery::from_static(
9859                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9860            );
9861            let mut req = request.into_request();
9862            req.extensions_mut()
9863                .insert(
9864                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9865                );
9866            self.inner.unary(req, path, codec).await
9867        }
9868    }
9869}
9870/// Generated server implementations.
9871pub mod invite_link_service_server {
9872    #![allow(
9873        unused_variables,
9874        dead_code,
9875        missing_docs,
9876        clippy::wildcard_imports,
9877        clippy::let_unit_value,
9878    )]
9879    use tonic::codegen::*;
9880    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
9881    #[async_trait]
9882    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9883        /** Create a new shareable invite link for the organization.
9884 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9885*/
9886        async fn create_invite_link(
9887            &self,
9888            request: tonic::Request<super::CreateInviteLinkRequest>,
9889        ) -> std::result::Result<
9890            tonic::Response<super::CreateInviteLinkResponse>,
9891            tonic::Status,
9892        >;
9893        /** List all invite links for the organization.
9894 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9895*/
9896        async fn list_invite_links(
9897            &self,
9898            request: tonic::Request<super::ListInviteLinksRequest>,
9899        ) -> std::result::Result<
9900            tonic::Response<super::ListInviteLinksResponse>,
9901            tonic::Status,
9902        >;
9903        /** Revoke an invite link, making it immediately unusable. Idempotent.
9904 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9905*/
9906        async fn revoke_invite_link(
9907            &self,
9908            request: tonic::Request<super::RevokeInviteLinkRequest>,
9909        ) -> std::result::Result<
9910            tonic::Response<super::RevokeInviteLinkResponse>,
9911            tonic::Status,
9912        >;
9913        /** Validate an invite link and provision a user account if needed.
9914 This is a pre-authentication endpoint — no JWT required.
9915 Rate limited to 10 requests per minute per IP.
9916 Authorization: None (token-based).
9917*/
9918        async fn validate_invite_link(
9919            &self,
9920            request: tonic::Request<super::ValidateInviteLinkRequest>,
9921        ) -> std::result::Result<
9922            tonic::Response<super::ValidateInviteLinkResponse>,
9923            tonic::Status,
9924        >;
9925        /** Redeem an invite link to join an organization.
9926 Requires a valid JWT — the email is extracted from the token.
9927 Authorization: JWT required.
9928*/
9929        async fn redeem_invite_link(
9930            &self,
9931            request: tonic::Request<super::RedeemInviteLinkRequest>,
9932        ) -> std::result::Result<
9933            tonic::Response<super::RedeemInviteLinkResponse>,
9934            tonic::Status,
9935        >;
9936    }
9937    /** Manages shareable invite links for organization self-join.
9938 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9939 ValidateInviteLink is unauthenticated — the token IS the authorization.
9940 RedeemInviteLink requires a valid JWT.
9941*/
9942    #[derive(Debug)]
9943    pub struct InviteLinkServiceServer<T> {
9944        inner: Arc<T>,
9945        accept_compression_encodings: EnabledCompressionEncodings,
9946        send_compression_encodings: EnabledCompressionEncodings,
9947        max_decoding_message_size: Option<usize>,
9948        max_encoding_message_size: Option<usize>,
9949    }
9950    impl<T> InviteLinkServiceServer<T> {
9951        pub fn new(inner: T) -> Self {
9952            Self::from_arc(Arc::new(inner))
9953        }
9954        pub fn from_arc(inner: Arc<T>) -> Self {
9955            Self {
9956                inner,
9957                accept_compression_encodings: Default::default(),
9958                send_compression_encodings: Default::default(),
9959                max_decoding_message_size: None,
9960                max_encoding_message_size: None,
9961            }
9962        }
9963        pub fn with_interceptor<F>(
9964            inner: T,
9965            interceptor: F,
9966        ) -> InterceptedService<Self, F>
9967        where
9968            F: tonic::service::Interceptor,
9969        {
9970            InterceptedService::new(Self::new(inner), interceptor)
9971        }
9972        /// Enable decompressing requests with the given encoding.
9973        #[must_use]
9974        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9975            self.accept_compression_encodings.enable(encoding);
9976            self
9977        }
9978        /// Compress responses with the given encoding, if the client supports it.
9979        #[must_use]
9980        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9981            self.send_compression_encodings.enable(encoding);
9982            self
9983        }
9984        /// Limits the maximum size of a decoded message.
9985        ///
9986        /// Default: `4MB`
9987        #[must_use]
9988        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9989            self.max_decoding_message_size = Some(limit);
9990            self
9991        }
9992        /// Limits the maximum size of an encoded message.
9993        ///
9994        /// Default: `usize::MAX`
9995        #[must_use]
9996        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9997            self.max_encoding_message_size = Some(limit);
9998            self
9999        }
10000    }
10001    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
10002    where
10003        T: InviteLinkService,
10004        B: Body + std::marker::Send + 'static,
10005        B::Error: Into<StdError> + std::marker::Send + 'static,
10006    {
10007        type Response = http::Response<tonic::body::Body>;
10008        type Error = std::convert::Infallible;
10009        type Future = BoxFuture<Self::Response, Self::Error>;
10010        fn poll_ready(
10011            &mut self,
10012            _cx: &mut Context<'_>,
10013        ) -> Poll<std::result::Result<(), Self::Error>> {
10014            Poll::Ready(Ok(()))
10015        }
10016        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10017            match req.uri().path() {
10018                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
10019                    #[allow(non_camel_case_types)]
10020                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10021                    impl<
10022                        T: InviteLinkService,
10023                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
10024                    for CreateInviteLinkSvc<T> {
10025                        type Response = super::CreateInviteLinkResponse;
10026                        type Future = BoxFuture<
10027                            tonic::Response<Self::Response>,
10028                            tonic::Status,
10029                        >;
10030                        fn call(
10031                            &mut self,
10032                            request: tonic::Request<super::CreateInviteLinkRequest>,
10033                        ) -> Self::Future {
10034                            let inner = Arc::clone(&self.0);
10035                            let fut = async move {
10036                                <T as InviteLinkService>::create_invite_link(
10037                                        &inner,
10038                                        request,
10039                                    )
10040                                    .await
10041                            };
10042                            Box::pin(fut)
10043                        }
10044                    }
10045                    let accept_compression_encodings = self.accept_compression_encodings;
10046                    let send_compression_encodings = self.send_compression_encodings;
10047                    let max_decoding_message_size = self.max_decoding_message_size;
10048                    let max_encoding_message_size = self.max_encoding_message_size;
10049                    let inner = self.inner.clone();
10050                    let fut = async move {
10051                        let method = CreateInviteLinkSvc(inner);
10052                        let codec = tonic_prost::ProstCodec::default();
10053                        let mut grpc = tonic::server::Grpc::new(codec)
10054                            .apply_compression_config(
10055                                accept_compression_encodings,
10056                                send_compression_encodings,
10057                            )
10058                            .apply_max_message_size_config(
10059                                max_decoding_message_size,
10060                                max_encoding_message_size,
10061                            );
10062                        let res = grpc.unary(method, req).await;
10063                        Ok(res)
10064                    };
10065                    Box::pin(fut)
10066                }
10067                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
10068                    #[allow(non_camel_case_types)]
10069                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
10070                    impl<
10071                        T: InviteLinkService,
10072                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
10073                    for ListInviteLinksSvc<T> {
10074                        type Response = super::ListInviteLinksResponse;
10075                        type Future = BoxFuture<
10076                            tonic::Response<Self::Response>,
10077                            tonic::Status,
10078                        >;
10079                        fn call(
10080                            &mut self,
10081                            request: tonic::Request<super::ListInviteLinksRequest>,
10082                        ) -> Self::Future {
10083                            let inner = Arc::clone(&self.0);
10084                            let fut = async move {
10085                                <T as InviteLinkService>::list_invite_links(&inner, request)
10086                                    .await
10087                            };
10088                            Box::pin(fut)
10089                        }
10090                    }
10091                    let accept_compression_encodings = self.accept_compression_encodings;
10092                    let send_compression_encodings = self.send_compression_encodings;
10093                    let max_decoding_message_size = self.max_decoding_message_size;
10094                    let max_encoding_message_size = self.max_encoding_message_size;
10095                    let inner = self.inner.clone();
10096                    let fut = async move {
10097                        let method = ListInviteLinksSvc(inner);
10098                        let codec = tonic_prost::ProstCodec::default();
10099                        let mut grpc = tonic::server::Grpc::new(codec)
10100                            .apply_compression_config(
10101                                accept_compression_encodings,
10102                                send_compression_encodings,
10103                            )
10104                            .apply_max_message_size_config(
10105                                max_decoding_message_size,
10106                                max_encoding_message_size,
10107                            );
10108                        let res = grpc.unary(method, req).await;
10109                        Ok(res)
10110                    };
10111                    Box::pin(fut)
10112                }
10113                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
10114                    #[allow(non_camel_case_types)]
10115                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10116                    impl<
10117                        T: InviteLinkService,
10118                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
10119                    for RevokeInviteLinkSvc<T> {
10120                        type Response = super::RevokeInviteLinkResponse;
10121                        type Future = BoxFuture<
10122                            tonic::Response<Self::Response>,
10123                            tonic::Status,
10124                        >;
10125                        fn call(
10126                            &mut self,
10127                            request: tonic::Request<super::RevokeInviteLinkRequest>,
10128                        ) -> Self::Future {
10129                            let inner = Arc::clone(&self.0);
10130                            let fut = async move {
10131                                <T as InviteLinkService>::revoke_invite_link(
10132                                        &inner,
10133                                        request,
10134                                    )
10135                                    .await
10136                            };
10137                            Box::pin(fut)
10138                        }
10139                    }
10140                    let accept_compression_encodings = self.accept_compression_encodings;
10141                    let send_compression_encodings = self.send_compression_encodings;
10142                    let max_decoding_message_size = self.max_decoding_message_size;
10143                    let max_encoding_message_size = self.max_encoding_message_size;
10144                    let inner = self.inner.clone();
10145                    let fut = async move {
10146                        let method = RevokeInviteLinkSvc(inner);
10147                        let codec = tonic_prost::ProstCodec::default();
10148                        let mut grpc = tonic::server::Grpc::new(codec)
10149                            .apply_compression_config(
10150                                accept_compression_encodings,
10151                                send_compression_encodings,
10152                            )
10153                            .apply_max_message_size_config(
10154                                max_decoding_message_size,
10155                                max_encoding_message_size,
10156                            );
10157                        let res = grpc.unary(method, req).await;
10158                        Ok(res)
10159                    };
10160                    Box::pin(fut)
10161                }
10162                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
10163                    #[allow(non_camel_case_types)]
10164                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10165                    impl<
10166                        T: InviteLinkService,
10167                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
10168                    for ValidateInviteLinkSvc<T> {
10169                        type Response = super::ValidateInviteLinkResponse;
10170                        type Future = BoxFuture<
10171                            tonic::Response<Self::Response>,
10172                            tonic::Status,
10173                        >;
10174                        fn call(
10175                            &mut self,
10176                            request: tonic::Request<super::ValidateInviteLinkRequest>,
10177                        ) -> Self::Future {
10178                            let inner = Arc::clone(&self.0);
10179                            let fut = async move {
10180                                <T as InviteLinkService>::validate_invite_link(
10181                                        &inner,
10182                                        request,
10183                                    )
10184                                    .await
10185                            };
10186                            Box::pin(fut)
10187                        }
10188                    }
10189                    let accept_compression_encodings = self.accept_compression_encodings;
10190                    let send_compression_encodings = self.send_compression_encodings;
10191                    let max_decoding_message_size = self.max_decoding_message_size;
10192                    let max_encoding_message_size = self.max_encoding_message_size;
10193                    let inner = self.inner.clone();
10194                    let fut = async move {
10195                        let method = ValidateInviteLinkSvc(inner);
10196                        let codec = tonic_prost::ProstCodec::default();
10197                        let mut grpc = tonic::server::Grpc::new(codec)
10198                            .apply_compression_config(
10199                                accept_compression_encodings,
10200                                send_compression_encodings,
10201                            )
10202                            .apply_max_message_size_config(
10203                                max_decoding_message_size,
10204                                max_encoding_message_size,
10205                            );
10206                        let res = grpc.unary(method, req).await;
10207                        Ok(res)
10208                    };
10209                    Box::pin(fut)
10210                }
10211                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
10212                    #[allow(non_camel_case_types)]
10213                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10214                    impl<
10215                        T: InviteLinkService,
10216                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
10217                    for RedeemInviteLinkSvc<T> {
10218                        type Response = super::RedeemInviteLinkResponse;
10219                        type Future = BoxFuture<
10220                            tonic::Response<Self::Response>,
10221                            tonic::Status,
10222                        >;
10223                        fn call(
10224                            &mut self,
10225                            request: tonic::Request<super::RedeemInviteLinkRequest>,
10226                        ) -> Self::Future {
10227                            let inner = Arc::clone(&self.0);
10228                            let fut = async move {
10229                                <T as InviteLinkService>::redeem_invite_link(
10230                                        &inner,
10231                                        request,
10232                                    )
10233                                    .await
10234                            };
10235                            Box::pin(fut)
10236                        }
10237                    }
10238                    let accept_compression_encodings = self.accept_compression_encodings;
10239                    let send_compression_encodings = self.send_compression_encodings;
10240                    let max_decoding_message_size = self.max_decoding_message_size;
10241                    let max_encoding_message_size = self.max_encoding_message_size;
10242                    let inner = self.inner.clone();
10243                    let fut = async move {
10244                        let method = RedeemInviteLinkSvc(inner);
10245                        let codec = tonic_prost::ProstCodec::default();
10246                        let mut grpc = tonic::server::Grpc::new(codec)
10247                            .apply_compression_config(
10248                                accept_compression_encodings,
10249                                send_compression_encodings,
10250                            )
10251                            .apply_max_message_size_config(
10252                                max_decoding_message_size,
10253                                max_encoding_message_size,
10254                            );
10255                        let res = grpc.unary(method, req).await;
10256                        Ok(res)
10257                    };
10258                    Box::pin(fut)
10259                }
10260                _ => {
10261                    Box::pin(async move {
10262                        let mut response = http::Response::new(
10263                            tonic::body::Body::default(),
10264                        );
10265                        let headers = response.headers_mut();
10266                        headers
10267                            .insert(
10268                                tonic::Status::GRPC_STATUS,
10269                                (tonic::Code::Unimplemented as i32).into(),
10270                            );
10271                        headers
10272                            .insert(
10273                                http::header::CONTENT_TYPE,
10274                                tonic::metadata::GRPC_CONTENT_TYPE,
10275                            );
10276                        Ok(response)
10277                    })
10278                }
10279            }
10280        }
10281    }
10282    impl<T> Clone for InviteLinkServiceServer<T> {
10283        fn clone(&self) -> Self {
10284            let inner = self.inner.clone();
10285            Self {
10286                inner,
10287                accept_compression_encodings: self.accept_compression_encodings,
10288                send_compression_encodings: self.send_compression_encodings,
10289                max_decoding_message_size: self.max_decoding_message_size,
10290                max_encoding_message_size: self.max_encoding_message_size,
10291            }
10292        }
10293    }
10294    /// Generated gRPC service name
10295    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
10296    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
10297        const NAME: &'static str = SERVICE_NAME;
10298    }
10299}
10300/// Generated client implementations.
10301pub mod member_service_client {
10302    #![allow(
10303        unused_variables,
10304        dead_code,
10305        missing_docs,
10306        clippy::wildcard_imports,
10307        clippy::let_unit_value,
10308    )]
10309    use tonic::codegen::*;
10310    use tonic::codegen::http::Uri;
10311    /** Manages members (users) within an organization.
10312 All RPCs operate within the caller's org (extracted from JWT).
10313*/
10314    #[derive(Debug, Clone)]
10315    pub struct MemberServiceClient<T> {
10316        inner: tonic::client::Grpc<T>,
10317    }
10318    impl MemberServiceClient<tonic::transport::Channel> {
10319        /// Attempt to create a new client by connecting to a given endpoint.
10320        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10321        where
10322            D: TryInto<tonic::transport::Endpoint>,
10323            D::Error: Into<StdError>,
10324        {
10325            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10326            Ok(Self::new(conn))
10327        }
10328    }
10329    impl<T> MemberServiceClient<T>
10330    where
10331        T: tonic::client::GrpcService<tonic::body::Body>,
10332        T::Error: Into<StdError>,
10333        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10334        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10335    {
10336        pub fn new(inner: T) -> Self {
10337            let inner = tonic::client::Grpc::new(inner);
10338            Self { inner }
10339        }
10340        pub fn with_origin(inner: T, origin: Uri) -> Self {
10341            let inner = tonic::client::Grpc::with_origin(inner, origin);
10342            Self { inner }
10343        }
10344        pub fn with_interceptor<F>(
10345            inner: T,
10346            interceptor: F,
10347        ) -> MemberServiceClient<InterceptedService<T, F>>
10348        where
10349            F: tonic::service::Interceptor,
10350            T::ResponseBody: Default,
10351            T: tonic::codegen::Service<
10352                http::Request<tonic::body::Body>,
10353                Response = http::Response<
10354                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10355                >,
10356            >,
10357            <T as tonic::codegen::Service<
10358                http::Request<tonic::body::Body>,
10359            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10360        {
10361            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
10362        }
10363        /// Compress requests with the given encoding.
10364        ///
10365        /// This requires the server to support it otherwise it might respond with an
10366        /// error.
10367        #[must_use]
10368        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10369            self.inner = self.inner.send_compressed(encoding);
10370            self
10371        }
10372        /// Enable decompressing responses.
10373        #[must_use]
10374        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10375            self.inner = self.inner.accept_compressed(encoding);
10376            self
10377        }
10378        /// Limits the maximum size of a decoded message.
10379        ///
10380        /// Default: `4MB`
10381        #[must_use]
10382        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10383            self.inner = self.inner.max_decoding_message_size(limit);
10384            self
10385        }
10386        /// Limits the maximum size of an encoded message.
10387        ///
10388        /// Default: `usize::MAX`
10389        #[must_use]
10390        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10391            self.inner = self.inner.max_encoding_message_size(limit);
10392            self
10393        }
10394        /** Invite a new user to the organization via email.
10395 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10396*/
10397        pub async fn invite_user(
10398            &mut self,
10399            request: impl tonic::IntoRequest<super::InviteUserRequest>,
10400        ) -> std::result::Result<
10401            tonic::Response<super::InviteUserResponse>,
10402            tonic::Status,
10403        > {
10404            self.inner
10405                .ready()
10406                .await
10407                .map_err(|e| {
10408                    tonic::Status::unknown(
10409                        format!("Service was not ready: {}", e.into()),
10410                    )
10411                })?;
10412            let codec = tonic_prost::ProstCodec::default();
10413            let path = http::uri::PathAndQuery::from_static(
10414                "/pidgr.v1.MemberService/InviteUser",
10415            );
10416            let mut req = request.into_request();
10417            req.extensions_mut()
10418                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10419            self.inner.unary(req, path, codec).await
10420        }
10421        /** Retrieve a user by ID within the organization.
10422 Self-lookup (empty user_id) is allowed for any authenticated user.
10423 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10424*/
10425        pub async fn get_user(
10426            &mut self,
10427            request: impl tonic::IntoRequest<super::GetUserRequest>,
10428        ) -> std::result::Result<
10429            tonic::Response<super::GetUserResponse>,
10430            tonic::Status,
10431        > {
10432            self.inner
10433                .ready()
10434                .await
10435                .map_err(|e| {
10436                    tonic::Status::unknown(
10437                        format!("Service was not ready: {}", e.into()),
10438                    )
10439                })?;
10440            let codec = tonic_prost::ProstCodec::default();
10441            let path = http::uri::PathAndQuery::from_static(
10442                "/pidgr.v1.MemberService/GetUser",
10443            );
10444            let mut req = request.into_request();
10445            req.extensions_mut()
10446                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10447            self.inner.unary(req, path, codec).await
10448        }
10449        /** List all users in the organization with pagination.
10450 Authorization: Requires PERMISSION_MEMBERS_READ.
10451*/
10452        pub async fn list_users(
10453            &mut self,
10454            request: impl tonic::IntoRequest<super::ListUsersRequest>,
10455        ) -> std::result::Result<
10456            tonic::Response<super::ListUsersResponse>,
10457            tonic::Status,
10458        > {
10459            self.inner
10460                .ready()
10461                .await
10462                .map_err(|e| {
10463                    tonic::Status::unknown(
10464                        format!("Service was not ready: {}", e.into()),
10465                    )
10466                })?;
10467            let codec = tonic_prost::ProstCodec::default();
10468            let path = http::uri::PathAndQuery::from_static(
10469                "/pidgr.v1.MemberService/ListUsers",
10470            );
10471            let mut req = request.into_request();
10472            req.extensions_mut()
10473                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10474            self.inner.unary(req, path, codec).await
10475        }
10476        /** Change a user's role within the organization.
10477 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10478*/
10479        pub async fn update_user_role(
10480            &mut self,
10481            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10482        ) -> std::result::Result<
10483            tonic::Response<super::UpdateUserRoleResponse>,
10484            tonic::Status,
10485        > {
10486            self.inner
10487                .ready()
10488                .await
10489                .map_err(|e| {
10490                    tonic::Status::unknown(
10491                        format!("Service was not ready: {}", e.into()),
10492                    )
10493                })?;
10494            let codec = tonic_prost::ProstCodec::default();
10495            let path = http::uri::PathAndQuery::from_static(
10496                "/pidgr.v1.MemberService/UpdateUserRole",
10497            );
10498            let mut req = request.into_request();
10499            req.extensions_mut()
10500                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10501            self.inner.unary(req, path, codec).await
10502        }
10503        /** Deactivate a user within the organization.
10504 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10505*/
10506        pub async fn deactivate_user(
10507            &mut self,
10508            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10509        ) -> std::result::Result<
10510            tonic::Response<super::DeactivateUserResponse>,
10511            tonic::Status,
10512        > {
10513            self.inner
10514                .ready()
10515                .await
10516                .map_err(|e| {
10517                    tonic::Status::unknown(
10518                        format!("Service was not ready: {}", e.into()),
10519                    )
10520                })?;
10521            let codec = tonic_prost::ProstCodec::default();
10522            let path = http::uri::PathAndQuery::from_static(
10523                "/pidgr.v1.MemberService/DeactivateUser",
10524            );
10525            let mut req = request.into_request();
10526            req.extensions_mut()
10527                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10528            self.inner.unary(req, path, codec).await
10529        }
10530        /** Reactivate a deactivated user, restoring their status to INVITED.
10531 The user must complete the invite link flow again to become ACTIVE.
10532 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10533*/
10534        pub async fn reactivate_user(
10535            &mut self,
10536            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10537        ) -> std::result::Result<
10538            tonic::Response<super::ReactivateUserResponse>,
10539            tonic::Status,
10540        > {
10541            self.inner
10542                .ready()
10543                .await
10544                .map_err(|e| {
10545                    tonic::Status::unknown(
10546                        format!("Service was not ready: {}", e.into()),
10547                    )
10548                })?;
10549            let codec = tonic_prost::ProstCodec::default();
10550            let path = http::uri::PathAndQuery::from_static(
10551                "/pidgr.v1.MemberService/ReactivateUser",
10552            );
10553            let mut req = request.into_request();
10554            req.extensions_mut()
10555                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10556            self.inner.unary(req, path, codec).await
10557        }
10558        /** Revoke an invitation for a user who has not yet completed registration.
10559 Hard-deletes the user record (INVITED users have no data to preserve).
10560 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10561*/
10562        pub async fn revoke_invite(
10563            &mut self,
10564            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10565        ) -> std::result::Result<
10566            tonic::Response<super::RevokeInviteResponse>,
10567            tonic::Status,
10568        > {
10569            self.inner
10570                .ready()
10571                .await
10572                .map_err(|e| {
10573                    tonic::Status::unknown(
10574                        format!("Service was not ready: {}", e.into()),
10575                    )
10576                })?;
10577            let codec = tonic_prost::ProstCodec::default();
10578            let path = http::uri::PathAndQuery::from_static(
10579                "/pidgr.v1.MemberService/RevokeInvite",
10580            );
10581            let mut req = request.into_request();
10582            req.extensions_mut()
10583                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10584            self.inner.unary(req, path, codec).await
10585        }
10586        /** Update a user's profile attributes (department, title, etc.).
10587 Self-update (empty user_id or matching JWT sub) requires no special permission.
10588 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10589*/
10590        pub async fn update_user_profile(
10591            &mut self,
10592            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10593        ) -> std::result::Result<
10594            tonic::Response<super::UpdateUserProfileResponse>,
10595            tonic::Status,
10596        > {
10597            self.inner
10598                .ready()
10599                .await
10600                .map_err(|e| {
10601                    tonic::Status::unknown(
10602                        format!("Service was not ready: {}", e.into()),
10603                    )
10604                })?;
10605            let codec = tonic_prost::ProstCodec::default();
10606            let path = http::uri::PathAndQuery::from_static(
10607                "/pidgr.v1.MemberService/UpdateUserProfile",
10608            );
10609            let mut req = request.into_request();
10610            req.extensions_mut()
10611                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10612            self.inner.unary(req, path, codec).await
10613        }
10614        /** Retrieve the caller's platform settings (theme, etc.).
10615 Authorization: Any authenticated user (self-only).
10616*/
10617        pub async fn get_user_settings(
10618            &mut self,
10619            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10620        ) -> std::result::Result<
10621            tonic::Response<super::GetUserSettingsResponse>,
10622            tonic::Status,
10623        > {
10624            self.inner
10625                .ready()
10626                .await
10627                .map_err(|e| {
10628                    tonic::Status::unknown(
10629                        format!("Service was not ready: {}", e.into()),
10630                    )
10631                })?;
10632            let codec = tonic_prost::ProstCodec::default();
10633            let path = http::uri::PathAndQuery::from_static(
10634                "/pidgr.v1.MemberService/GetUserSettings",
10635            );
10636            let mut req = request.into_request();
10637            req.extensions_mut()
10638                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10639            self.inner.unary(req, path, codec).await
10640        }
10641        /** Update the caller's platform settings.
10642 Only fields with non-default values are applied; others are left unchanged.
10643 Authorization: Any authenticated user (self-only).
10644*/
10645        pub async fn update_user_settings(
10646            &mut self,
10647            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10648        ) -> std::result::Result<
10649            tonic::Response<super::UpdateUserSettingsResponse>,
10650            tonic::Status,
10651        > {
10652            self.inner
10653                .ready()
10654                .await
10655                .map_err(|e| {
10656                    tonic::Status::unknown(
10657                        format!("Service was not ready: {}", e.into()),
10658                    )
10659                })?;
10660            let codec = tonic_prost::ProstCodec::default();
10661            let path = http::uri::PathAndQuery::from_static(
10662                "/pidgr.v1.MemberService/UpdateUserSettings",
10663            );
10664            let mut req = request.into_request();
10665            req.extensions_mut()
10666                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10667            self.inner.unary(req, path, codec).await
10668        }
10669        /** Invite multiple users to the organization in a single call.
10670 Emails are deduplicated. Each email is processed independently — individual
10671 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10672 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10673*/
10674        pub async fn bulk_invite_users(
10675            &mut self,
10676            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10677        ) -> std::result::Result<
10678            tonic::Response<super::BulkInviteUsersResponse>,
10679            tonic::Status,
10680        > {
10681            self.inner
10682                .ready()
10683                .await
10684                .map_err(|e| {
10685                    tonic::Status::unknown(
10686                        format!("Service was not ready: {}", e.into()),
10687                    )
10688                })?;
10689            let codec = tonic_prost::ProstCodec::default();
10690            let path = http::uri::PathAndQuery::from_static(
10691                "/pidgr.v1.MemberService/BulkInviteUsers",
10692            );
10693            let mut req = request.into_request();
10694            req.extensions_mut()
10695                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10696            self.inner.unary(req, path, codec).await
10697        }
10698        /** Confirm passkey enrollment after client-side WebAuthn registration.
10699 Verifies the caller has at least one registered credential server-side,
10700 then marks the user as passkey-enrolled in the identity provider.
10701 Authorization: Any authenticated user (self-only, no permission required).
10702*/
10703        pub async fn confirm_passkey_enrollment(
10704            &mut self,
10705            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10706        ) -> std::result::Result<
10707            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10708            tonic::Status,
10709        > {
10710            self.inner
10711                .ready()
10712                .await
10713                .map_err(|e| {
10714                    tonic::Status::unknown(
10715                        format!("Service was not ready: {}", e.into()),
10716                    )
10717                })?;
10718            let codec = tonic_prost::ProstCodec::default();
10719            let path = http::uri::PathAndQuery::from_static(
10720                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10721            );
10722            let mut req = request.into_request();
10723            req.extensions_mut()
10724                .insert(
10725                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10726                );
10727            self.inner.unary(req, path, codec).await
10728        }
10729        /** Update the data governance region for a user. Triggers a data migration
10730 workflow if the region changed. Admin-only operation.
10731 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10732*/
10733        pub async fn update_user_region(
10734            &mut self,
10735            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10736        ) -> std::result::Result<
10737            tonic::Response<super::UpdateUserRegionResponse>,
10738            tonic::Status,
10739        > {
10740            self.inner
10741                .ready()
10742                .await
10743                .map_err(|e| {
10744                    tonic::Status::unknown(
10745                        format!("Service was not ready: {}", e.into()),
10746                    )
10747                })?;
10748            let codec = tonic_prost::ProstCodec::default();
10749            let path = http::uri::PathAndQuery::from_static(
10750                "/pidgr.v1.MemberService/UpdateUserRegion",
10751            );
10752            let mut req = request.into_request();
10753            req.extensions_mut()
10754                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10755            self.inner.unary(req, path, codec).await
10756        }
10757    }
10758}
10759/// Generated server implementations.
10760pub mod member_service_server {
10761    #![allow(
10762        unused_variables,
10763        dead_code,
10764        missing_docs,
10765        clippy::wildcard_imports,
10766        clippy::let_unit_value,
10767    )]
10768    use tonic::codegen::*;
10769    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
10770    #[async_trait]
10771    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10772        /** Invite a new user to the organization via email.
10773 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10774*/
10775        async fn invite_user(
10776            &self,
10777            request: tonic::Request<super::InviteUserRequest>,
10778        ) -> std::result::Result<
10779            tonic::Response<super::InviteUserResponse>,
10780            tonic::Status,
10781        >;
10782        /** Retrieve a user by ID within the organization.
10783 Self-lookup (empty user_id) is allowed for any authenticated user.
10784 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10785*/
10786        async fn get_user(
10787            &self,
10788            request: tonic::Request<super::GetUserRequest>,
10789        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10790        /** List all users in the organization with pagination.
10791 Authorization: Requires PERMISSION_MEMBERS_READ.
10792*/
10793        async fn list_users(
10794            &self,
10795            request: tonic::Request<super::ListUsersRequest>,
10796        ) -> std::result::Result<
10797            tonic::Response<super::ListUsersResponse>,
10798            tonic::Status,
10799        >;
10800        /** Change a user's role within the organization.
10801 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10802*/
10803        async fn update_user_role(
10804            &self,
10805            request: tonic::Request<super::UpdateUserRoleRequest>,
10806        ) -> std::result::Result<
10807            tonic::Response<super::UpdateUserRoleResponse>,
10808            tonic::Status,
10809        >;
10810        /** Deactivate a user within the organization.
10811 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10812*/
10813        async fn deactivate_user(
10814            &self,
10815            request: tonic::Request<super::DeactivateUserRequest>,
10816        ) -> std::result::Result<
10817            tonic::Response<super::DeactivateUserResponse>,
10818            tonic::Status,
10819        >;
10820        /** Reactivate a deactivated user, restoring their status to INVITED.
10821 The user must complete the invite link flow again to become ACTIVE.
10822 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10823*/
10824        async fn reactivate_user(
10825            &self,
10826            request: tonic::Request<super::ReactivateUserRequest>,
10827        ) -> std::result::Result<
10828            tonic::Response<super::ReactivateUserResponse>,
10829            tonic::Status,
10830        >;
10831        /** Revoke an invitation for a user who has not yet completed registration.
10832 Hard-deletes the user record (INVITED users have no data to preserve).
10833 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10834*/
10835        async fn revoke_invite(
10836            &self,
10837            request: tonic::Request<super::RevokeInviteRequest>,
10838        ) -> std::result::Result<
10839            tonic::Response<super::RevokeInviteResponse>,
10840            tonic::Status,
10841        >;
10842        /** Update a user's profile attributes (department, title, etc.).
10843 Self-update (empty user_id or matching JWT sub) requires no special permission.
10844 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10845*/
10846        async fn update_user_profile(
10847            &self,
10848            request: tonic::Request<super::UpdateUserProfileRequest>,
10849        ) -> std::result::Result<
10850            tonic::Response<super::UpdateUserProfileResponse>,
10851            tonic::Status,
10852        >;
10853        /** Retrieve the caller's platform settings (theme, etc.).
10854 Authorization: Any authenticated user (self-only).
10855*/
10856        async fn get_user_settings(
10857            &self,
10858            request: tonic::Request<super::GetUserSettingsRequest>,
10859        ) -> std::result::Result<
10860            tonic::Response<super::GetUserSettingsResponse>,
10861            tonic::Status,
10862        >;
10863        /** Update the caller's platform settings.
10864 Only fields with non-default values are applied; others are left unchanged.
10865 Authorization: Any authenticated user (self-only).
10866*/
10867        async fn update_user_settings(
10868            &self,
10869            request: tonic::Request<super::UpdateUserSettingsRequest>,
10870        ) -> std::result::Result<
10871            tonic::Response<super::UpdateUserSettingsResponse>,
10872            tonic::Status,
10873        >;
10874        /** Invite multiple users to the organization in a single call.
10875 Emails are deduplicated. Each email is processed independently — individual
10876 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10877 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10878*/
10879        async fn bulk_invite_users(
10880            &self,
10881            request: tonic::Request<super::BulkInviteUsersRequest>,
10882        ) -> std::result::Result<
10883            tonic::Response<super::BulkInviteUsersResponse>,
10884            tonic::Status,
10885        >;
10886        /** Confirm passkey enrollment after client-side WebAuthn registration.
10887 Verifies the caller has at least one registered credential server-side,
10888 then marks the user as passkey-enrolled in the identity provider.
10889 Authorization: Any authenticated user (self-only, no permission required).
10890*/
10891        async fn confirm_passkey_enrollment(
10892            &self,
10893            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10894        ) -> std::result::Result<
10895            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10896            tonic::Status,
10897        >;
10898        /** Update the data governance region for a user. Triggers a data migration
10899 workflow if the region changed. Admin-only operation.
10900 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10901*/
10902        async fn update_user_region(
10903            &self,
10904            request: tonic::Request<super::UpdateUserRegionRequest>,
10905        ) -> std::result::Result<
10906            tonic::Response<super::UpdateUserRegionResponse>,
10907            tonic::Status,
10908        >;
10909    }
10910    /** Manages members (users) within an organization.
10911 All RPCs operate within the caller's org (extracted from JWT).
10912*/
10913    #[derive(Debug)]
10914    pub struct MemberServiceServer<T> {
10915        inner: Arc<T>,
10916        accept_compression_encodings: EnabledCompressionEncodings,
10917        send_compression_encodings: EnabledCompressionEncodings,
10918        max_decoding_message_size: Option<usize>,
10919        max_encoding_message_size: Option<usize>,
10920    }
10921    impl<T> MemberServiceServer<T> {
10922        pub fn new(inner: T) -> Self {
10923            Self::from_arc(Arc::new(inner))
10924        }
10925        pub fn from_arc(inner: Arc<T>) -> Self {
10926            Self {
10927                inner,
10928                accept_compression_encodings: Default::default(),
10929                send_compression_encodings: Default::default(),
10930                max_decoding_message_size: None,
10931                max_encoding_message_size: None,
10932            }
10933        }
10934        pub fn with_interceptor<F>(
10935            inner: T,
10936            interceptor: F,
10937        ) -> InterceptedService<Self, F>
10938        where
10939            F: tonic::service::Interceptor,
10940        {
10941            InterceptedService::new(Self::new(inner), interceptor)
10942        }
10943        /// Enable decompressing requests with the given encoding.
10944        #[must_use]
10945        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10946            self.accept_compression_encodings.enable(encoding);
10947            self
10948        }
10949        /// Compress responses with the given encoding, if the client supports it.
10950        #[must_use]
10951        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10952            self.send_compression_encodings.enable(encoding);
10953            self
10954        }
10955        /// Limits the maximum size of a decoded message.
10956        ///
10957        /// Default: `4MB`
10958        #[must_use]
10959        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10960            self.max_decoding_message_size = Some(limit);
10961            self
10962        }
10963        /// Limits the maximum size of an encoded message.
10964        ///
10965        /// Default: `usize::MAX`
10966        #[must_use]
10967        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10968            self.max_encoding_message_size = Some(limit);
10969            self
10970        }
10971    }
10972    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10973    where
10974        T: MemberService,
10975        B: Body + std::marker::Send + 'static,
10976        B::Error: Into<StdError> + std::marker::Send + 'static,
10977    {
10978        type Response = http::Response<tonic::body::Body>;
10979        type Error = std::convert::Infallible;
10980        type Future = BoxFuture<Self::Response, Self::Error>;
10981        fn poll_ready(
10982            &mut self,
10983            _cx: &mut Context<'_>,
10984        ) -> Poll<std::result::Result<(), Self::Error>> {
10985            Poll::Ready(Ok(()))
10986        }
10987        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10988            match req.uri().path() {
10989                "/pidgr.v1.MemberService/InviteUser" => {
10990                    #[allow(non_camel_case_types)]
10991                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10992                    impl<
10993                        T: MemberService,
10994                    > tonic::server::UnaryService<super::InviteUserRequest>
10995                    for InviteUserSvc<T> {
10996                        type Response = super::InviteUserResponse;
10997                        type Future = BoxFuture<
10998                            tonic::Response<Self::Response>,
10999                            tonic::Status,
11000                        >;
11001                        fn call(
11002                            &mut self,
11003                            request: tonic::Request<super::InviteUserRequest>,
11004                        ) -> Self::Future {
11005                            let inner = Arc::clone(&self.0);
11006                            let fut = async move {
11007                                <T as MemberService>::invite_user(&inner, request).await
11008                            };
11009                            Box::pin(fut)
11010                        }
11011                    }
11012                    let accept_compression_encodings = self.accept_compression_encodings;
11013                    let send_compression_encodings = self.send_compression_encodings;
11014                    let max_decoding_message_size = self.max_decoding_message_size;
11015                    let max_encoding_message_size = self.max_encoding_message_size;
11016                    let inner = self.inner.clone();
11017                    let fut = async move {
11018                        let method = InviteUserSvc(inner);
11019                        let codec = tonic_prost::ProstCodec::default();
11020                        let mut grpc = tonic::server::Grpc::new(codec)
11021                            .apply_compression_config(
11022                                accept_compression_encodings,
11023                                send_compression_encodings,
11024                            )
11025                            .apply_max_message_size_config(
11026                                max_decoding_message_size,
11027                                max_encoding_message_size,
11028                            );
11029                        let res = grpc.unary(method, req).await;
11030                        Ok(res)
11031                    };
11032                    Box::pin(fut)
11033                }
11034                "/pidgr.v1.MemberService/GetUser" => {
11035                    #[allow(non_camel_case_types)]
11036                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
11037                    impl<
11038                        T: MemberService,
11039                    > tonic::server::UnaryService<super::GetUserRequest>
11040                    for GetUserSvc<T> {
11041                        type Response = super::GetUserResponse;
11042                        type Future = BoxFuture<
11043                            tonic::Response<Self::Response>,
11044                            tonic::Status,
11045                        >;
11046                        fn call(
11047                            &mut self,
11048                            request: tonic::Request<super::GetUserRequest>,
11049                        ) -> Self::Future {
11050                            let inner = Arc::clone(&self.0);
11051                            let fut = async move {
11052                                <T as MemberService>::get_user(&inner, request).await
11053                            };
11054                            Box::pin(fut)
11055                        }
11056                    }
11057                    let accept_compression_encodings = self.accept_compression_encodings;
11058                    let send_compression_encodings = self.send_compression_encodings;
11059                    let max_decoding_message_size = self.max_decoding_message_size;
11060                    let max_encoding_message_size = self.max_encoding_message_size;
11061                    let inner = self.inner.clone();
11062                    let fut = async move {
11063                        let method = GetUserSvc(inner);
11064                        let codec = tonic_prost::ProstCodec::default();
11065                        let mut grpc = tonic::server::Grpc::new(codec)
11066                            .apply_compression_config(
11067                                accept_compression_encodings,
11068                                send_compression_encodings,
11069                            )
11070                            .apply_max_message_size_config(
11071                                max_decoding_message_size,
11072                                max_encoding_message_size,
11073                            );
11074                        let res = grpc.unary(method, req).await;
11075                        Ok(res)
11076                    };
11077                    Box::pin(fut)
11078                }
11079                "/pidgr.v1.MemberService/ListUsers" => {
11080                    #[allow(non_camel_case_types)]
11081                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
11082                    impl<
11083                        T: MemberService,
11084                    > tonic::server::UnaryService<super::ListUsersRequest>
11085                    for ListUsersSvc<T> {
11086                        type Response = super::ListUsersResponse;
11087                        type Future = BoxFuture<
11088                            tonic::Response<Self::Response>,
11089                            tonic::Status,
11090                        >;
11091                        fn call(
11092                            &mut self,
11093                            request: tonic::Request<super::ListUsersRequest>,
11094                        ) -> Self::Future {
11095                            let inner = Arc::clone(&self.0);
11096                            let fut = async move {
11097                                <T as MemberService>::list_users(&inner, request).await
11098                            };
11099                            Box::pin(fut)
11100                        }
11101                    }
11102                    let accept_compression_encodings = self.accept_compression_encodings;
11103                    let send_compression_encodings = self.send_compression_encodings;
11104                    let max_decoding_message_size = self.max_decoding_message_size;
11105                    let max_encoding_message_size = self.max_encoding_message_size;
11106                    let inner = self.inner.clone();
11107                    let fut = async move {
11108                        let method = ListUsersSvc(inner);
11109                        let codec = tonic_prost::ProstCodec::default();
11110                        let mut grpc = tonic::server::Grpc::new(codec)
11111                            .apply_compression_config(
11112                                accept_compression_encodings,
11113                                send_compression_encodings,
11114                            )
11115                            .apply_max_message_size_config(
11116                                max_decoding_message_size,
11117                                max_encoding_message_size,
11118                            );
11119                        let res = grpc.unary(method, req).await;
11120                        Ok(res)
11121                    };
11122                    Box::pin(fut)
11123                }
11124                "/pidgr.v1.MemberService/UpdateUserRole" => {
11125                    #[allow(non_camel_case_types)]
11126                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
11127                    impl<
11128                        T: MemberService,
11129                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
11130                    for UpdateUserRoleSvc<T> {
11131                        type Response = super::UpdateUserRoleResponse;
11132                        type Future = BoxFuture<
11133                            tonic::Response<Self::Response>,
11134                            tonic::Status,
11135                        >;
11136                        fn call(
11137                            &mut self,
11138                            request: tonic::Request<super::UpdateUserRoleRequest>,
11139                        ) -> Self::Future {
11140                            let inner = Arc::clone(&self.0);
11141                            let fut = async move {
11142                                <T as MemberService>::update_user_role(&inner, request)
11143                                    .await
11144                            };
11145                            Box::pin(fut)
11146                        }
11147                    }
11148                    let accept_compression_encodings = self.accept_compression_encodings;
11149                    let send_compression_encodings = self.send_compression_encodings;
11150                    let max_decoding_message_size = self.max_decoding_message_size;
11151                    let max_encoding_message_size = self.max_encoding_message_size;
11152                    let inner = self.inner.clone();
11153                    let fut = async move {
11154                        let method = UpdateUserRoleSvc(inner);
11155                        let codec = tonic_prost::ProstCodec::default();
11156                        let mut grpc = tonic::server::Grpc::new(codec)
11157                            .apply_compression_config(
11158                                accept_compression_encodings,
11159                                send_compression_encodings,
11160                            )
11161                            .apply_max_message_size_config(
11162                                max_decoding_message_size,
11163                                max_encoding_message_size,
11164                            );
11165                        let res = grpc.unary(method, req).await;
11166                        Ok(res)
11167                    };
11168                    Box::pin(fut)
11169                }
11170                "/pidgr.v1.MemberService/DeactivateUser" => {
11171                    #[allow(non_camel_case_types)]
11172                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
11173                    impl<
11174                        T: MemberService,
11175                    > tonic::server::UnaryService<super::DeactivateUserRequest>
11176                    for DeactivateUserSvc<T> {
11177                        type Response = super::DeactivateUserResponse;
11178                        type Future = BoxFuture<
11179                            tonic::Response<Self::Response>,
11180                            tonic::Status,
11181                        >;
11182                        fn call(
11183                            &mut self,
11184                            request: tonic::Request<super::DeactivateUserRequest>,
11185                        ) -> Self::Future {
11186                            let inner = Arc::clone(&self.0);
11187                            let fut = async move {
11188                                <T as MemberService>::deactivate_user(&inner, request).await
11189                            };
11190                            Box::pin(fut)
11191                        }
11192                    }
11193                    let accept_compression_encodings = self.accept_compression_encodings;
11194                    let send_compression_encodings = self.send_compression_encodings;
11195                    let max_decoding_message_size = self.max_decoding_message_size;
11196                    let max_encoding_message_size = self.max_encoding_message_size;
11197                    let inner = self.inner.clone();
11198                    let fut = async move {
11199                        let method = DeactivateUserSvc(inner);
11200                        let codec = tonic_prost::ProstCodec::default();
11201                        let mut grpc = tonic::server::Grpc::new(codec)
11202                            .apply_compression_config(
11203                                accept_compression_encodings,
11204                                send_compression_encodings,
11205                            )
11206                            .apply_max_message_size_config(
11207                                max_decoding_message_size,
11208                                max_encoding_message_size,
11209                            );
11210                        let res = grpc.unary(method, req).await;
11211                        Ok(res)
11212                    };
11213                    Box::pin(fut)
11214                }
11215                "/pidgr.v1.MemberService/ReactivateUser" => {
11216                    #[allow(non_camel_case_types)]
11217                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
11218                    impl<
11219                        T: MemberService,
11220                    > tonic::server::UnaryService<super::ReactivateUserRequest>
11221                    for ReactivateUserSvc<T> {
11222                        type Response = super::ReactivateUserResponse;
11223                        type Future = BoxFuture<
11224                            tonic::Response<Self::Response>,
11225                            tonic::Status,
11226                        >;
11227                        fn call(
11228                            &mut self,
11229                            request: tonic::Request<super::ReactivateUserRequest>,
11230                        ) -> Self::Future {
11231                            let inner = Arc::clone(&self.0);
11232                            let fut = async move {
11233                                <T as MemberService>::reactivate_user(&inner, request).await
11234                            };
11235                            Box::pin(fut)
11236                        }
11237                    }
11238                    let accept_compression_encodings = self.accept_compression_encodings;
11239                    let send_compression_encodings = self.send_compression_encodings;
11240                    let max_decoding_message_size = self.max_decoding_message_size;
11241                    let max_encoding_message_size = self.max_encoding_message_size;
11242                    let inner = self.inner.clone();
11243                    let fut = async move {
11244                        let method = ReactivateUserSvc(inner);
11245                        let codec = tonic_prost::ProstCodec::default();
11246                        let mut grpc = tonic::server::Grpc::new(codec)
11247                            .apply_compression_config(
11248                                accept_compression_encodings,
11249                                send_compression_encodings,
11250                            )
11251                            .apply_max_message_size_config(
11252                                max_decoding_message_size,
11253                                max_encoding_message_size,
11254                            );
11255                        let res = grpc.unary(method, req).await;
11256                        Ok(res)
11257                    };
11258                    Box::pin(fut)
11259                }
11260                "/pidgr.v1.MemberService/RevokeInvite" => {
11261                    #[allow(non_camel_case_types)]
11262                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
11263                    impl<
11264                        T: MemberService,
11265                    > tonic::server::UnaryService<super::RevokeInviteRequest>
11266                    for RevokeInviteSvc<T> {
11267                        type Response = super::RevokeInviteResponse;
11268                        type Future = BoxFuture<
11269                            tonic::Response<Self::Response>,
11270                            tonic::Status,
11271                        >;
11272                        fn call(
11273                            &mut self,
11274                            request: tonic::Request<super::RevokeInviteRequest>,
11275                        ) -> Self::Future {
11276                            let inner = Arc::clone(&self.0);
11277                            let fut = async move {
11278                                <T as MemberService>::revoke_invite(&inner, request).await
11279                            };
11280                            Box::pin(fut)
11281                        }
11282                    }
11283                    let accept_compression_encodings = self.accept_compression_encodings;
11284                    let send_compression_encodings = self.send_compression_encodings;
11285                    let max_decoding_message_size = self.max_decoding_message_size;
11286                    let max_encoding_message_size = self.max_encoding_message_size;
11287                    let inner = self.inner.clone();
11288                    let fut = async move {
11289                        let method = RevokeInviteSvc(inner);
11290                        let codec = tonic_prost::ProstCodec::default();
11291                        let mut grpc = tonic::server::Grpc::new(codec)
11292                            .apply_compression_config(
11293                                accept_compression_encodings,
11294                                send_compression_encodings,
11295                            )
11296                            .apply_max_message_size_config(
11297                                max_decoding_message_size,
11298                                max_encoding_message_size,
11299                            );
11300                        let res = grpc.unary(method, req).await;
11301                        Ok(res)
11302                    };
11303                    Box::pin(fut)
11304                }
11305                "/pidgr.v1.MemberService/UpdateUserProfile" => {
11306                    #[allow(non_camel_case_types)]
11307                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
11308                    impl<
11309                        T: MemberService,
11310                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
11311                    for UpdateUserProfileSvc<T> {
11312                        type Response = super::UpdateUserProfileResponse;
11313                        type Future = BoxFuture<
11314                            tonic::Response<Self::Response>,
11315                            tonic::Status,
11316                        >;
11317                        fn call(
11318                            &mut self,
11319                            request: tonic::Request<super::UpdateUserProfileRequest>,
11320                        ) -> Self::Future {
11321                            let inner = Arc::clone(&self.0);
11322                            let fut = async move {
11323                                <T as MemberService>::update_user_profile(&inner, request)
11324                                    .await
11325                            };
11326                            Box::pin(fut)
11327                        }
11328                    }
11329                    let accept_compression_encodings = self.accept_compression_encodings;
11330                    let send_compression_encodings = self.send_compression_encodings;
11331                    let max_decoding_message_size = self.max_decoding_message_size;
11332                    let max_encoding_message_size = self.max_encoding_message_size;
11333                    let inner = self.inner.clone();
11334                    let fut = async move {
11335                        let method = UpdateUserProfileSvc(inner);
11336                        let codec = tonic_prost::ProstCodec::default();
11337                        let mut grpc = tonic::server::Grpc::new(codec)
11338                            .apply_compression_config(
11339                                accept_compression_encodings,
11340                                send_compression_encodings,
11341                            )
11342                            .apply_max_message_size_config(
11343                                max_decoding_message_size,
11344                                max_encoding_message_size,
11345                            );
11346                        let res = grpc.unary(method, req).await;
11347                        Ok(res)
11348                    };
11349                    Box::pin(fut)
11350                }
11351                "/pidgr.v1.MemberService/GetUserSettings" => {
11352                    #[allow(non_camel_case_types)]
11353                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
11354                    impl<
11355                        T: MemberService,
11356                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
11357                    for GetUserSettingsSvc<T> {
11358                        type Response = super::GetUserSettingsResponse;
11359                        type Future = BoxFuture<
11360                            tonic::Response<Self::Response>,
11361                            tonic::Status,
11362                        >;
11363                        fn call(
11364                            &mut self,
11365                            request: tonic::Request<super::GetUserSettingsRequest>,
11366                        ) -> Self::Future {
11367                            let inner = Arc::clone(&self.0);
11368                            let fut = async move {
11369                                <T as MemberService>::get_user_settings(&inner, request)
11370                                    .await
11371                            };
11372                            Box::pin(fut)
11373                        }
11374                    }
11375                    let accept_compression_encodings = self.accept_compression_encodings;
11376                    let send_compression_encodings = self.send_compression_encodings;
11377                    let max_decoding_message_size = self.max_decoding_message_size;
11378                    let max_encoding_message_size = self.max_encoding_message_size;
11379                    let inner = self.inner.clone();
11380                    let fut = async move {
11381                        let method = GetUserSettingsSvc(inner);
11382                        let codec = tonic_prost::ProstCodec::default();
11383                        let mut grpc = tonic::server::Grpc::new(codec)
11384                            .apply_compression_config(
11385                                accept_compression_encodings,
11386                                send_compression_encodings,
11387                            )
11388                            .apply_max_message_size_config(
11389                                max_decoding_message_size,
11390                                max_encoding_message_size,
11391                            );
11392                        let res = grpc.unary(method, req).await;
11393                        Ok(res)
11394                    };
11395                    Box::pin(fut)
11396                }
11397                "/pidgr.v1.MemberService/UpdateUserSettings" => {
11398                    #[allow(non_camel_case_types)]
11399                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11400                    impl<
11401                        T: MemberService,
11402                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11403                    for UpdateUserSettingsSvc<T> {
11404                        type Response = super::UpdateUserSettingsResponse;
11405                        type Future = BoxFuture<
11406                            tonic::Response<Self::Response>,
11407                            tonic::Status,
11408                        >;
11409                        fn call(
11410                            &mut self,
11411                            request: tonic::Request<super::UpdateUserSettingsRequest>,
11412                        ) -> Self::Future {
11413                            let inner = Arc::clone(&self.0);
11414                            let fut = async move {
11415                                <T as MemberService>::update_user_settings(&inner, request)
11416                                    .await
11417                            };
11418                            Box::pin(fut)
11419                        }
11420                    }
11421                    let accept_compression_encodings = self.accept_compression_encodings;
11422                    let send_compression_encodings = self.send_compression_encodings;
11423                    let max_decoding_message_size = self.max_decoding_message_size;
11424                    let max_encoding_message_size = self.max_encoding_message_size;
11425                    let inner = self.inner.clone();
11426                    let fut = async move {
11427                        let method = UpdateUserSettingsSvc(inner);
11428                        let codec = tonic_prost::ProstCodec::default();
11429                        let mut grpc = tonic::server::Grpc::new(codec)
11430                            .apply_compression_config(
11431                                accept_compression_encodings,
11432                                send_compression_encodings,
11433                            )
11434                            .apply_max_message_size_config(
11435                                max_decoding_message_size,
11436                                max_encoding_message_size,
11437                            );
11438                        let res = grpc.unary(method, req).await;
11439                        Ok(res)
11440                    };
11441                    Box::pin(fut)
11442                }
11443                "/pidgr.v1.MemberService/BulkInviteUsers" => {
11444                    #[allow(non_camel_case_types)]
11445                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11446                    impl<
11447                        T: MemberService,
11448                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11449                    for BulkInviteUsersSvc<T> {
11450                        type Response = super::BulkInviteUsersResponse;
11451                        type Future = BoxFuture<
11452                            tonic::Response<Self::Response>,
11453                            tonic::Status,
11454                        >;
11455                        fn call(
11456                            &mut self,
11457                            request: tonic::Request<super::BulkInviteUsersRequest>,
11458                        ) -> Self::Future {
11459                            let inner = Arc::clone(&self.0);
11460                            let fut = async move {
11461                                <T as MemberService>::bulk_invite_users(&inner, request)
11462                                    .await
11463                            };
11464                            Box::pin(fut)
11465                        }
11466                    }
11467                    let accept_compression_encodings = self.accept_compression_encodings;
11468                    let send_compression_encodings = self.send_compression_encodings;
11469                    let max_decoding_message_size = self.max_decoding_message_size;
11470                    let max_encoding_message_size = self.max_encoding_message_size;
11471                    let inner = self.inner.clone();
11472                    let fut = async move {
11473                        let method = BulkInviteUsersSvc(inner);
11474                        let codec = tonic_prost::ProstCodec::default();
11475                        let mut grpc = tonic::server::Grpc::new(codec)
11476                            .apply_compression_config(
11477                                accept_compression_encodings,
11478                                send_compression_encodings,
11479                            )
11480                            .apply_max_message_size_config(
11481                                max_decoding_message_size,
11482                                max_encoding_message_size,
11483                            );
11484                        let res = grpc.unary(method, req).await;
11485                        Ok(res)
11486                    };
11487                    Box::pin(fut)
11488                }
11489                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11490                    #[allow(non_camel_case_types)]
11491                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11492                    impl<
11493                        T: MemberService,
11494                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11495                    for ConfirmPasskeyEnrollmentSvc<T> {
11496                        type Response = super::ConfirmPasskeyEnrollmentResponse;
11497                        type Future = BoxFuture<
11498                            tonic::Response<Self::Response>,
11499                            tonic::Status,
11500                        >;
11501                        fn call(
11502                            &mut self,
11503                            request: tonic::Request<
11504                                super::ConfirmPasskeyEnrollmentRequest,
11505                            >,
11506                        ) -> Self::Future {
11507                            let inner = Arc::clone(&self.0);
11508                            let fut = async move {
11509                                <T as MemberService>::confirm_passkey_enrollment(
11510                                        &inner,
11511                                        request,
11512                                    )
11513                                    .await
11514                            };
11515                            Box::pin(fut)
11516                        }
11517                    }
11518                    let accept_compression_encodings = self.accept_compression_encodings;
11519                    let send_compression_encodings = self.send_compression_encodings;
11520                    let max_decoding_message_size = self.max_decoding_message_size;
11521                    let max_encoding_message_size = self.max_encoding_message_size;
11522                    let inner = self.inner.clone();
11523                    let fut = async move {
11524                        let method = ConfirmPasskeyEnrollmentSvc(inner);
11525                        let codec = tonic_prost::ProstCodec::default();
11526                        let mut grpc = tonic::server::Grpc::new(codec)
11527                            .apply_compression_config(
11528                                accept_compression_encodings,
11529                                send_compression_encodings,
11530                            )
11531                            .apply_max_message_size_config(
11532                                max_decoding_message_size,
11533                                max_encoding_message_size,
11534                            );
11535                        let res = grpc.unary(method, req).await;
11536                        Ok(res)
11537                    };
11538                    Box::pin(fut)
11539                }
11540                "/pidgr.v1.MemberService/UpdateUserRegion" => {
11541                    #[allow(non_camel_case_types)]
11542                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11543                    impl<
11544                        T: MemberService,
11545                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11546                    for UpdateUserRegionSvc<T> {
11547                        type Response = super::UpdateUserRegionResponse;
11548                        type Future = BoxFuture<
11549                            tonic::Response<Self::Response>,
11550                            tonic::Status,
11551                        >;
11552                        fn call(
11553                            &mut self,
11554                            request: tonic::Request<super::UpdateUserRegionRequest>,
11555                        ) -> Self::Future {
11556                            let inner = Arc::clone(&self.0);
11557                            let fut = async move {
11558                                <T as MemberService>::update_user_region(&inner, request)
11559                                    .await
11560                            };
11561                            Box::pin(fut)
11562                        }
11563                    }
11564                    let accept_compression_encodings = self.accept_compression_encodings;
11565                    let send_compression_encodings = self.send_compression_encodings;
11566                    let max_decoding_message_size = self.max_decoding_message_size;
11567                    let max_encoding_message_size = self.max_encoding_message_size;
11568                    let inner = self.inner.clone();
11569                    let fut = async move {
11570                        let method = UpdateUserRegionSvc(inner);
11571                        let codec = tonic_prost::ProstCodec::default();
11572                        let mut grpc = tonic::server::Grpc::new(codec)
11573                            .apply_compression_config(
11574                                accept_compression_encodings,
11575                                send_compression_encodings,
11576                            )
11577                            .apply_max_message_size_config(
11578                                max_decoding_message_size,
11579                                max_encoding_message_size,
11580                            );
11581                        let res = grpc.unary(method, req).await;
11582                        Ok(res)
11583                    };
11584                    Box::pin(fut)
11585                }
11586                _ => {
11587                    Box::pin(async move {
11588                        let mut response = http::Response::new(
11589                            tonic::body::Body::default(),
11590                        );
11591                        let headers = response.headers_mut();
11592                        headers
11593                            .insert(
11594                                tonic::Status::GRPC_STATUS,
11595                                (tonic::Code::Unimplemented as i32).into(),
11596                            );
11597                        headers
11598                            .insert(
11599                                http::header::CONTENT_TYPE,
11600                                tonic::metadata::GRPC_CONTENT_TYPE,
11601                            );
11602                        Ok(response)
11603                    })
11604                }
11605            }
11606        }
11607    }
11608    impl<T> Clone for MemberServiceServer<T> {
11609        fn clone(&self) -> Self {
11610            let inner = self.inner.clone();
11611            Self {
11612                inner,
11613                accept_compression_encodings: self.accept_compression_encodings,
11614                send_compression_encodings: self.send_compression_encodings,
11615                max_decoding_message_size: self.max_decoding_message_size,
11616                max_encoding_message_size: self.max_encoding_message_size,
11617            }
11618        }
11619    }
11620    /// Generated gRPC service name
11621    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11622    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11623        const NAME: &'static str = SERVICE_NAME;
11624    }
11625}
11626/// Generated client implementations.
11627pub mod org_security_keys_service_client {
11628    #![allow(
11629        unused_variables,
11630        dead_code,
11631        missing_docs,
11632        clippy::wildcard_imports,
11633        clippy::let_unit_value,
11634    )]
11635    use tonic::codegen::*;
11636    use tonic::codegen::http::Uri;
11637    /** OrgSecurityKeysService exposes per-org secret key material to internal
11638 services that need it for HMAC computation, signature verification, or
11639 envelope-key derivation.
11640
11641 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11642 material. The server MUST require a client certificate from a known
11643 internal service (allowlisted by subject DN) and MUST reject any request
11644 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11645
11646 Callers (today: pidgr-integrations) cache returned peppers in-process
11647 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11648 keep dispatch hot-path latency bounded.
11649*/
11650    #[derive(Debug, Clone)]
11651    pub struct OrgSecurityKeysServiceClient<T> {
11652        inner: tonic::client::Grpc<T>,
11653    }
11654    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
11655        /// Attempt to create a new client by connecting to a given endpoint.
11656        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11657        where
11658            D: TryInto<tonic::transport::Endpoint>,
11659            D::Error: Into<StdError>,
11660        {
11661            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11662            Ok(Self::new(conn))
11663        }
11664    }
11665    impl<T> OrgSecurityKeysServiceClient<T>
11666    where
11667        T: tonic::client::GrpcService<tonic::body::Body>,
11668        T::Error: Into<StdError>,
11669        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11670        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11671    {
11672        pub fn new(inner: T) -> Self {
11673            let inner = tonic::client::Grpc::new(inner);
11674            Self { inner }
11675        }
11676        pub fn with_origin(inner: T, origin: Uri) -> Self {
11677            let inner = tonic::client::Grpc::with_origin(inner, origin);
11678            Self { inner }
11679        }
11680        pub fn with_interceptor<F>(
11681            inner: T,
11682            interceptor: F,
11683        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
11684        where
11685            F: tonic::service::Interceptor,
11686            T::ResponseBody: Default,
11687            T: tonic::codegen::Service<
11688                http::Request<tonic::body::Body>,
11689                Response = http::Response<
11690                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11691                >,
11692            >,
11693            <T as tonic::codegen::Service<
11694                http::Request<tonic::body::Body>,
11695            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11696        {
11697            OrgSecurityKeysServiceClient::new(
11698                InterceptedService::new(inner, interceptor),
11699            )
11700        }
11701        /// Compress requests with the given encoding.
11702        ///
11703        /// This requires the server to support it otherwise it might respond with an
11704        /// error.
11705        #[must_use]
11706        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11707            self.inner = self.inner.send_compressed(encoding);
11708            self
11709        }
11710        /// Enable decompressing responses.
11711        #[must_use]
11712        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11713            self.inner = self.inner.accept_compressed(encoding);
11714            self
11715        }
11716        /// Limits the maximum size of a decoded message.
11717        ///
11718        /// Default: `4MB`
11719        #[must_use]
11720        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11721            self.inner = self.inner.max_decoding_message_size(limit);
11722            self
11723        }
11724        /// Limits the maximum size of an encoded message.
11725        ///
11726        /// Default: `usize::MAX`
11727        #[must_use]
11728        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11729            self.inner = self.inner.max_encoding_message_size(limit);
11730            self
11731        }
11732        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11733 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11734 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11735*/
11736        pub async fn get_peppers(
11737            &mut self,
11738            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11739        ) -> std::result::Result<
11740            tonic::Response<super::GetPeppersResponse>,
11741            tonic::Status,
11742        > {
11743            self.inner
11744                .ready()
11745                .await
11746                .map_err(|e| {
11747                    tonic::Status::unknown(
11748                        format!("Service was not ready: {}", e.into()),
11749                    )
11750                })?;
11751            let codec = tonic_prost::ProstCodec::default();
11752            let path = http::uri::PathAndQuery::from_static(
11753                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11754            );
11755            let mut req = request.into_request();
11756            req.extensions_mut()
11757                .insert(
11758                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11759                );
11760            self.inner.unary(req, path, codec).await
11761        }
11762    }
11763}
11764/// Generated server implementations.
11765pub mod org_security_keys_service_server {
11766    #![allow(
11767        unused_variables,
11768        dead_code,
11769        missing_docs,
11770        clippy::wildcard_imports,
11771        clippy::let_unit_value,
11772    )]
11773    use tonic::codegen::*;
11774    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
11775    #[async_trait]
11776    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11777        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11778 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11779 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11780*/
11781        async fn get_peppers(
11782            &self,
11783            request: tonic::Request<super::GetPeppersRequest>,
11784        ) -> std::result::Result<
11785            tonic::Response<super::GetPeppersResponse>,
11786            tonic::Status,
11787        >;
11788    }
11789    /** OrgSecurityKeysService exposes per-org secret key material to internal
11790 services that need it for HMAC computation, signature verification, or
11791 envelope-key derivation.
11792
11793 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11794 material. The server MUST require a client certificate from a known
11795 internal service (allowlisted by subject DN) and MUST reject any request
11796 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11797
11798 Callers (today: pidgr-integrations) cache returned peppers in-process
11799 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11800 keep dispatch hot-path latency bounded.
11801*/
11802    #[derive(Debug)]
11803    pub struct OrgSecurityKeysServiceServer<T> {
11804        inner: Arc<T>,
11805        accept_compression_encodings: EnabledCompressionEncodings,
11806        send_compression_encodings: EnabledCompressionEncodings,
11807        max_decoding_message_size: Option<usize>,
11808        max_encoding_message_size: Option<usize>,
11809    }
11810    impl<T> OrgSecurityKeysServiceServer<T> {
11811        pub fn new(inner: T) -> Self {
11812            Self::from_arc(Arc::new(inner))
11813        }
11814        pub fn from_arc(inner: Arc<T>) -> Self {
11815            Self {
11816                inner,
11817                accept_compression_encodings: Default::default(),
11818                send_compression_encodings: Default::default(),
11819                max_decoding_message_size: None,
11820                max_encoding_message_size: None,
11821            }
11822        }
11823        pub fn with_interceptor<F>(
11824            inner: T,
11825            interceptor: F,
11826        ) -> InterceptedService<Self, F>
11827        where
11828            F: tonic::service::Interceptor,
11829        {
11830            InterceptedService::new(Self::new(inner), interceptor)
11831        }
11832        /// Enable decompressing requests with the given encoding.
11833        #[must_use]
11834        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11835            self.accept_compression_encodings.enable(encoding);
11836            self
11837        }
11838        /// Compress responses with the given encoding, if the client supports it.
11839        #[must_use]
11840        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11841            self.send_compression_encodings.enable(encoding);
11842            self
11843        }
11844        /// Limits the maximum size of a decoded message.
11845        ///
11846        /// Default: `4MB`
11847        #[must_use]
11848        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11849            self.max_decoding_message_size = Some(limit);
11850            self
11851        }
11852        /// Limits the maximum size of an encoded message.
11853        ///
11854        /// Default: `usize::MAX`
11855        #[must_use]
11856        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11857            self.max_encoding_message_size = Some(limit);
11858            self
11859        }
11860    }
11861    impl<T, B> tonic::codegen::Service<http::Request<B>>
11862    for OrgSecurityKeysServiceServer<T>
11863    where
11864        T: OrgSecurityKeysService,
11865        B: Body + std::marker::Send + 'static,
11866        B::Error: Into<StdError> + std::marker::Send + 'static,
11867    {
11868        type Response = http::Response<tonic::body::Body>;
11869        type Error = std::convert::Infallible;
11870        type Future = BoxFuture<Self::Response, Self::Error>;
11871        fn poll_ready(
11872            &mut self,
11873            _cx: &mut Context<'_>,
11874        ) -> Poll<std::result::Result<(), Self::Error>> {
11875            Poll::Ready(Ok(()))
11876        }
11877        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11878            match req.uri().path() {
11879                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11880                    #[allow(non_camel_case_types)]
11881                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11882                    impl<
11883                        T: OrgSecurityKeysService,
11884                    > tonic::server::UnaryService<super::GetPeppersRequest>
11885                    for GetPeppersSvc<T> {
11886                        type Response = super::GetPeppersResponse;
11887                        type Future = BoxFuture<
11888                            tonic::Response<Self::Response>,
11889                            tonic::Status,
11890                        >;
11891                        fn call(
11892                            &mut self,
11893                            request: tonic::Request<super::GetPeppersRequest>,
11894                        ) -> Self::Future {
11895                            let inner = Arc::clone(&self.0);
11896                            let fut = async move {
11897                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11898                                    .await
11899                            };
11900                            Box::pin(fut)
11901                        }
11902                    }
11903                    let accept_compression_encodings = self.accept_compression_encodings;
11904                    let send_compression_encodings = self.send_compression_encodings;
11905                    let max_decoding_message_size = self.max_decoding_message_size;
11906                    let max_encoding_message_size = self.max_encoding_message_size;
11907                    let inner = self.inner.clone();
11908                    let fut = async move {
11909                        let method = GetPeppersSvc(inner);
11910                        let codec = tonic_prost::ProstCodec::default();
11911                        let mut grpc = tonic::server::Grpc::new(codec)
11912                            .apply_compression_config(
11913                                accept_compression_encodings,
11914                                send_compression_encodings,
11915                            )
11916                            .apply_max_message_size_config(
11917                                max_decoding_message_size,
11918                                max_encoding_message_size,
11919                            );
11920                        let res = grpc.unary(method, req).await;
11921                        Ok(res)
11922                    };
11923                    Box::pin(fut)
11924                }
11925                _ => {
11926                    Box::pin(async move {
11927                        let mut response = http::Response::new(
11928                            tonic::body::Body::default(),
11929                        );
11930                        let headers = response.headers_mut();
11931                        headers
11932                            .insert(
11933                                tonic::Status::GRPC_STATUS,
11934                                (tonic::Code::Unimplemented as i32).into(),
11935                            );
11936                        headers
11937                            .insert(
11938                                http::header::CONTENT_TYPE,
11939                                tonic::metadata::GRPC_CONTENT_TYPE,
11940                            );
11941                        Ok(response)
11942                    })
11943                }
11944            }
11945        }
11946    }
11947    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11948        fn clone(&self) -> Self {
11949            let inner = self.inner.clone();
11950            Self {
11951                inner,
11952                accept_compression_encodings: self.accept_compression_encodings,
11953                send_compression_encodings: self.send_compression_encodings,
11954                max_decoding_message_size: self.max_decoding_message_size,
11955                max_encoding_message_size: self.max_encoding_message_size,
11956            }
11957        }
11958    }
11959    /// Generated gRPC service name
11960    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11961    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11962        const NAME: &'static str = SERVICE_NAME;
11963    }
11964}
11965/// Generated client implementations.
11966pub mod organization_service_client {
11967    #![allow(
11968        unused_variables,
11969        dead_code,
11970        missing_docs,
11971        clippy::wildcard_imports,
11972        clippy::let_unit_value,
11973    )]
11974    use tonic::codegen::*;
11975    use tonic::codegen::http::Uri;
11976    /** Manages organizations (tenants) in the Pidgr platform.
11977 Most RPCs operate within the caller's org (extracted from JWT).
11978 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11979*/
11980    #[derive(Debug, Clone)]
11981    pub struct OrganizationServiceClient<T> {
11982        inner: tonic::client::Grpc<T>,
11983    }
11984    impl OrganizationServiceClient<tonic::transport::Channel> {
11985        /// Attempt to create a new client by connecting to a given endpoint.
11986        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11987        where
11988            D: TryInto<tonic::transport::Endpoint>,
11989            D::Error: Into<StdError>,
11990        {
11991            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11992            Ok(Self::new(conn))
11993        }
11994    }
11995    impl<T> OrganizationServiceClient<T>
11996    where
11997        T: tonic::client::GrpcService<tonic::body::Body>,
11998        T::Error: Into<StdError>,
11999        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12000        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12001    {
12002        pub fn new(inner: T) -> Self {
12003            let inner = tonic::client::Grpc::new(inner);
12004            Self { inner }
12005        }
12006        pub fn with_origin(inner: T, origin: Uri) -> Self {
12007            let inner = tonic::client::Grpc::with_origin(inner, origin);
12008            Self { inner }
12009        }
12010        pub fn with_interceptor<F>(
12011            inner: T,
12012            interceptor: F,
12013        ) -> OrganizationServiceClient<InterceptedService<T, F>>
12014        where
12015            F: tonic::service::Interceptor,
12016            T::ResponseBody: Default,
12017            T: tonic::codegen::Service<
12018                http::Request<tonic::body::Body>,
12019                Response = http::Response<
12020                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12021                >,
12022            >,
12023            <T as tonic::codegen::Service<
12024                http::Request<tonic::body::Body>,
12025            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12026        {
12027            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
12028        }
12029        /// Compress requests with the given encoding.
12030        ///
12031        /// This requires the server to support it otherwise it might respond with an
12032        /// error.
12033        #[must_use]
12034        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12035            self.inner = self.inner.send_compressed(encoding);
12036            self
12037        }
12038        /// Enable decompressing responses.
12039        #[must_use]
12040        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12041            self.inner = self.inner.accept_compressed(encoding);
12042            self
12043        }
12044        /// Limits the maximum size of a decoded message.
12045        ///
12046        /// Default: `4MB`
12047        #[must_use]
12048        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12049            self.inner = self.inner.max_decoding_message_size(limit);
12050            self
12051        }
12052        /// Limits the maximum size of an encoded message.
12053        ///
12054        /// Default: `usize::MAX`
12055        #[must_use]
12056        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12057            self.inner = self.inner.max_encoding_message_size(limit);
12058            self
12059        }
12060        /** Create a new organization. JWT auth only — the caller becomes the initial
12061 admin. Add further admins via CreateInviteLink.
12062 Authorization: Authenticated user (no specific permission required).
12063*/
12064        pub async fn create_organization(
12065            &mut self,
12066            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
12067        ) -> std::result::Result<
12068            tonic::Response<super::CreateOrganizationResponse>,
12069            tonic::Status,
12070        > {
12071            self.inner
12072                .ready()
12073                .await
12074                .map_err(|e| {
12075                    tonic::Status::unknown(
12076                        format!("Service was not ready: {}", e.into()),
12077                    )
12078                })?;
12079            let codec = tonic_prost::ProstCodec::default();
12080            let path = http::uri::PathAndQuery::from_static(
12081                "/pidgr.v1.OrganizationService/CreateOrganization",
12082            );
12083            let mut req = request.into_request();
12084            req.extensions_mut()
12085                .insert(
12086                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
12087                );
12088            self.inner.unary(req, path, codec).await
12089        }
12090        /** Retrieve the organization for the authenticated user.
12091 Authorization: Requires PERMISSION_ORG_READ.
12092*/
12093        pub async fn get_organization(
12094            &mut self,
12095            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
12096        ) -> std::result::Result<
12097            tonic::Response<super::GetOrganizationResponse>,
12098            tonic::Status,
12099        > {
12100            self.inner
12101                .ready()
12102                .await
12103                .map_err(|e| {
12104                    tonic::Status::unknown(
12105                        format!("Service was not ready: {}", e.into()),
12106                    )
12107                })?;
12108            let codec = tonic_prost::ProstCodec::default();
12109            let path = http::uri::PathAndQuery::from_static(
12110                "/pidgr.v1.OrganizationService/GetOrganization",
12111            );
12112            let mut req = request.into_request();
12113            req.extensions_mut()
12114                .insert(
12115                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
12116                );
12117            self.inner.unary(req, path, codec).await
12118        }
12119        /** Update organization settings (name, default workflow, industry, company size).
12120 Authorization: Requires PERMISSION_ORG_WRITE.
12121*/
12122        pub async fn update_organization(
12123            &mut self,
12124            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
12125        ) -> std::result::Result<
12126            tonic::Response<super::UpdateOrganizationResponse>,
12127            tonic::Status,
12128        > {
12129            self.inner
12130                .ready()
12131                .await
12132                .map_err(|e| {
12133                    tonic::Status::unknown(
12134                        format!("Service was not ready: {}", e.into()),
12135                    )
12136                })?;
12137            let codec = tonic_prost::ProstCodec::default();
12138            let path = http::uri::PathAndQuery::from_static(
12139                "/pidgr.v1.OrganizationService/UpdateOrganization",
12140            );
12141            let mut req = request.into_request();
12142            req.extensions_mut()
12143                .insert(
12144                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
12145                );
12146            self.inner.unary(req, path, codec).await
12147        }
12148        /** Replace all SSO attribute mappings for the organization.
12149 Authorization: Requires PERMISSION_ORG_WRITE.
12150*/
12151        pub async fn update_sso_attribute_mappings(
12152            &mut self,
12153            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
12154        ) -> std::result::Result<
12155            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12156            tonic::Status,
12157        > {
12158            self.inner
12159                .ready()
12160                .await
12161                .map_err(|e| {
12162                    tonic::Status::unknown(
12163                        format!("Service was not ready: {}", e.into()),
12164                    )
12165                })?;
12166            let codec = tonic_prost::ProstCodec::default();
12167            let path = http::uri::PathAndQuery::from_static(
12168                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
12169            );
12170            let mut req = request.into_request();
12171            req.extensions_mut()
12172                .insert(
12173                    GrpcMethod::new(
12174                        "pidgr.v1.OrganizationService",
12175                        "UpdateSsoAttributeMappings",
12176                    ),
12177                );
12178            self.inner.unary(req, path, codec).await
12179        }
12180        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
12181 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12182*/
12183        pub async fn rotate_analytics_salt(
12184            &mut self,
12185            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
12186        ) -> std::result::Result<
12187            tonic::Response<super::RotateAnalyticsSaltResponse>,
12188            tonic::Status,
12189        > {
12190            self.inner
12191                .ready()
12192                .await
12193                .map_err(|e| {
12194                    tonic::Status::unknown(
12195                        format!("Service was not ready: {}", e.into()),
12196                    )
12197                })?;
12198            let codec = tonic_prost::ProstCodec::default();
12199            let path = http::uri::PathAndQuery::from_static(
12200                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
12201            );
12202            let mut req = request.into_request();
12203            req.extensions_mut()
12204                .insert(
12205                    GrpcMethod::new(
12206                        "pidgr.v1.OrganizationService",
12207                        "RotateAnalyticsSalt",
12208                    ),
12209                );
12210            self.inner.unary(req, path, codec).await
12211        }
12212        /** Update the differential privacy epsilon parameter.
12213 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12214*/
12215        pub async fn update_analytics_epsilon(
12216            &mut self,
12217            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
12218        ) -> std::result::Result<
12219            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12220            tonic::Status,
12221        > {
12222            self.inner
12223                .ready()
12224                .await
12225                .map_err(|e| {
12226                    tonic::Status::unknown(
12227                        format!("Service was not ready: {}", e.into()),
12228                    )
12229                })?;
12230            let codec = tonic_prost::ProstCodec::default();
12231            let path = http::uri::PathAndQuery::from_static(
12232                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
12233            );
12234            let mut req = request.into_request();
12235            req.extensions_mut()
12236                .insert(
12237                    GrpcMethod::new(
12238                        "pidgr.v1.OrganizationService",
12239                        "UpdateAnalyticsEpsilon",
12240                    ),
12241                );
12242            self.inner.unary(req, path, codec).await
12243        }
12244        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12245 analytics, third-party channels) with last-changed-by/at metadata for
12246 the consent-trace UI.
12247 Authorization: Requires PERMISSION_PRIVACY_READ.
12248*/
12249        pub async fn get_org_privacy_settings(
12250            &mut self,
12251            request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
12252        ) -> std::result::Result<
12253            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12254            tonic::Status,
12255        > {
12256            self.inner
12257                .ready()
12258                .await
12259                .map_err(|e| {
12260                    tonic::Status::unknown(
12261                        format!("Service was not ready: {}", e.into()),
12262                    )
12263                })?;
12264            let codec = tonic_prost::ProstCodec::default();
12265            let path = http::uri::PathAndQuery::from_static(
12266                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
12267            );
12268            let mut req = request.into_request();
12269            req.extensions_mut()
12270                .insert(
12271                    GrpcMethod::new(
12272                        "pidgr.v1.OrganizationService",
12273                        "GetOrgPrivacySettings",
12274                    ),
12275                );
12276            self.inner.unary(req, path, codec).await
12277        }
12278        /** Update org-level data-processing toggles. Only provided fields change;
12279 each change is recorded with the acting admin and timestamp.
12280 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12281*/
12282        pub async fn update_org_privacy_settings(
12283            &mut self,
12284            request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
12285        ) -> std::result::Result<
12286            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12287            tonic::Status,
12288        > {
12289            self.inner
12290                .ready()
12291                .await
12292                .map_err(|e| {
12293                    tonic::Status::unknown(
12294                        format!("Service was not ready: {}", e.into()),
12295                    )
12296                })?;
12297            let codec = tonic_prost::ProstCodec::default();
12298            let path = http::uri::PathAndQuery::from_static(
12299                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
12300            );
12301            let mut req = request.into_request();
12302            req.extensions_mut()
12303                .insert(
12304                    GrpcMethod::new(
12305                        "pidgr.v1.OrganizationService",
12306                        "UpdateOrgPrivacySettings",
12307                    ),
12308                );
12309            self.inner.unary(req, path, codec).await
12310        }
12311        /** Create a sandbox organization for testing configurations.
12312 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12313 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12314 per user to prevent abuse.
12315*/
12316        pub async fn create_sandbox_organization(
12317            &mut self,
12318            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
12319        ) -> std::result::Result<
12320            tonic::Response<super::CreateSandboxOrganizationResponse>,
12321            tonic::Status,
12322        > {
12323            self.inner
12324                .ready()
12325                .await
12326                .map_err(|e| {
12327                    tonic::Status::unknown(
12328                        format!("Service was not ready: {}", e.into()),
12329                    )
12330                })?;
12331            let codec = tonic_prost::ProstCodec::default();
12332            let path = http::uri::PathAndQuery::from_static(
12333                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
12334            );
12335            let mut req = request.into_request();
12336            req.extensions_mut()
12337                .insert(
12338                    GrpcMethod::new(
12339                        "pidgr.v1.OrganizationService",
12340                        "CreateSandboxOrganization",
12341                    ),
12342                );
12343            self.inner.unary(req, path, codec).await
12344        }
12345        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12346 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12347 content stores.
12348 Authorization: Super admin of the target sandbox OR its creator.
12349*/
12350        pub async fn delete_sandbox_organization(
12351            &mut self,
12352            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
12353        ) -> std::result::Result<
12354            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12355            tonic::Status,
12356        > {
12357            self.inner
12358                .ready()
12359                .await
12360                .map_err(|e| {
12361                    tonic::Status::unknown(
12362                        format!("Service was not ready: {}", e.into()),
12363                    )
12364                })?;
12365            let codec = tonic_prost::ProstCodec::default();
12366            let path = http::uri::PathAndQuery::from_static(
12367                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
12368            );
12369            let mut req = request.into_request();
12370            req.extensions_mut()
12371                .insert(
12372                    GrpcMethod::new(
12373                        "pidgr.v1.OrganizationService",
12374                        "DeleteSandboxOrganization",
12375                    ),
12376                );
12377            self.inner.unary(req, path, codec).await
12378        }
12379        /** List bootstrap fixtures available for seeding new organizations. The
12380 catalog is backend-owned; admin UI populates the "seed initial data"
12381 control or dropdown from this response.
12382 Authorization: Any authenticated user.
12383*/
12384        pub async fn list_sandbox_fixtures(
12385            &mut self,
12386            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
12387        ) -> std::result::Result<
12388            tonic::Response<super::ListSandboxFixturesResponse>,
12389            tonic::Status,
12390        > {
12391            self.inner
12392                .ready()
12393                .await
12394                .map_err(|e| {
12395                    tonic::Status::unknown(
12396                        format!("Service was not ready: {}", e.into()),
12397                    )
12398                })?;
12399            let codec = tonic_prost::ProstCodec::default();
12400            let path = http::uri::PathAndQuery::from_static(
12401                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
12402            );
12403            let mut req = request.into_request();
12404            req.extensions_mut()
12405                .insert(
12406                    GrpcMethod::new(
12407                        "pidgr.v1.OrganizationService",
12408                        "ListSandboxFixtures",
12409                    ),
12410                );
12411            self.inner.unary(req, path, codec).await
12412        }
12413        /** List all organizations the authenticated user belongs to.
12414 Org-exempt: callable without org context (only requires valid JWT).
12415 Used by the admin org switcher to discover available orgs.
12416 Excludes expired sandbox organizations.
12417 Authorization: Authenticated user (no specific permission required).
12418*/
12419        pub async fn list_user_organizations(
12420            &mut self,
12421            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
12422        ) -> std::result::Result<
12423            tonic::Response<super::ListUserOrganizationsResponse>,
12424            tonic::Status,
12425        > {
12426            self.inner
12427                .ready()
12428                .await
12429                .map_err(|e| {
12430                    tonic::Status::unknown(
12431                        format!("Service was not ready: {}", e.into()),
12432                    )
12433                })?;
12434            let codec = tonic_prost::ProstCodec::default();
12435            let path = http::uri::PathAndQuery::from_static(
12436                "/pidgr.v1.OrganizationService/ListUserOrganizations",
12437            );
12438            let mut req = request.into_request();
12439            req.extensions_mut()
12440                .insert(
12441                    GrpcMethod::new(
12442                        "pidgr.v1.OrganizationService",
12443                        "ListUserOrganizations",
12444                    ),
12445                );
12446            self.inner.unary(req, path, codec).await
12447        }
12448        /** List only the sandbox organizations the authenticated user belongs to.
12449 Org-exempt: callable without org context. The admin UI's /sandboxes
12450 management page is the primary consumer — it's a user-level surface
12451 rather than org-scoped, so this RPC is user-scoped too.
12452 Excludes already-expired sandboxes (pending cleanup).
12453 Authorization: Authenticated user (no specific permission required).
12454*/
12455        pub async fn list_user_sandboxes(
12456            &mut self,
12457            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
12458        ) -> std::result::Result<
12459            tonic::Response<super::ListUserSandboxesResponse>,
12460            tonic::Status,
12461        > {
12462            self.inner
12463                .ready()
12464                .await
12465                .map_err(|e| {
12466                    tonic::Status::unknown(
12467                        format!("Service was not ready: {}", e.into()),
12468                    )
12469                })?;
12470            let codec = tonic_prost::ProstCodec::default();
12471            let path = http::uri::PathAndQuery::from_static(
12472                "/pidgr.v1.OrganizationService/ListUserSandboxes",
12473            );
12474            let mut req = request.into_request();
12475            req.extensions_mut()
12476                .insert(
12477                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
12478                );
12479            self.inner.unary(req, path, codec).await
12480        }
12481    }
12482}
12483/// Generated server implementations.
12484pub mod organization_service_server {
12485    #![allow(
12486        unused_variables,
12487        dead_code,
12488        missing_docs,
12489        clippy::wildcard_imports,
12490        clippy::let_unit_value,
12491    )]
12492    use tonic::codegen::*;
12493    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
12494    #[async_trait]
12495    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
12496        /** Create a new organization. JWT auth only — the caller becomes the initial
12497 admin. Add further admins via CreateInviteLink.
12498 Authorization: Authenticated user (no specific permission required).
12499*/
12500        async fn create_organization(
12501            &self,
12502            request: tonic::Request<super::CreateOrganizationRequest>,
12503        ) -> std::result::Result<
12504            tonic::Response<super::CreateOrganizationResponse>,
12505            tonic::Status,
12506        >;
12507        /** Retrieve the organization for the authenticated user.
12508 Authorization: Requires PERMISSION_ORG_READ.
12509*/
12510        async fn get_organization(
12511            &self,
12512            request: tonic::Request<super::GetOrganizationRequest>,
12513        ) -> std::result::Result<
12514            tonic::Response<super::GetOrganizationResponse>,
12515            tonic::Status,
12516        >;
12517        /** Update organization settings (name, default workflow, industry, company size).
12518 Authorization: Requires PERMISSION_ORG_WRITE.
12519*/
12520        async fn update_organization(
12521            &self,
12522            request: tonic::Request<super::UpdateOrganizationRequest>,
12523        ) -> std::result::Result<
12524            tonic::Response<super::UpdateOrganizationResponse>,
12525            tonic::Status,
12526        >;
12527        /** Replace all SSO attribute mappings for the organization.
12528 Authorization: Requires PERMISSION_ORG_WRITE.
12529*/
12530        async fn update_sso_attribute_mappings(
12531            &self,
12532            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
12533        ) -> std::result::Result<
12534            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12535            tonic::Status,
12536        >;
12537        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
12538 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12539*/
12540        async fn rotate_analytics_salt(
12541            &self,
12542            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12543        ) -> std::result::Result<
12544            tonic::Response<super::RotateAnalyticsSaltResponse>,
12545            tonic::Status,
12546        >;
12547        /** Update the differential privacy epsilon parameter.
12548 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12549*/
12550        async fn update_analytics_epsilon(
12551            &self,
12552            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12553        ) -> std::result::Result<
12554            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12555            tonic::Status,
12556        >;
12557        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12558 analytics, third-party channels) with last-changed-by/at metadata for
12559 the consent-trace UI.
12560 Authorization: Requires PERMISSION_PRIVACY_READ.
12561*/
12562        async fn get_org_privacy_settings(
12563            &self,
12564            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12565        ) -> std::result::Result<
12566            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12567            tonic::Status,
12568        >;
12569        /** Update org-level data-processing toggles. Only provided fields change;
12570 each change is recorded with the acting admin and timestamp.
12571 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12572*/
12573        async fn update_org_privacy_settings(
12574            &self,
12575            request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
12576        ) -> std::result::Result<
12577            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12578            tonic::Status,
12579        >;
12580        /** Create a sandbox organization for testing configurations.
12581 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12582 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12583 per user to prevent abuse.
12584*/
12585        async fn create_sandbox_organization(
12586            &self,
12587            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
12588        ) -> std::result::Result<
12589            tonic::Response<super::CreateSandboxOrganizationResponse>,
12590            tonic::Status,
12591        >;
12592        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12593 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12594 content stores.
12595 Authorization: Super admin of the target sandbox OR its creator.
12596*/
12597        async fn delete_sandbox_organization(
12598            &self,
12599            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
12600        ) -> std::result::Result<
12601            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12602            tonic::Status,
12603        >;
12604        /** List bootstrap fixtures available for seeding new organizations. The
12605 catalog is backend-owned; admin UI populates the "seed initial data"
12606 control or dropdown from this response.
12607 Authorization: Any authenticated user.
12608*/
12609        async fn list_sandbox_fixtures(
12610            &self,
12611            request: tonic::Request<super::ListSandboxFixturesRequest>,
12612        ) -> std::result::Result<
12613            tonic::Response<super::ListSandboxFixturesResponse>,
12614            tonic::Status,
12615        >;
12616        /** List all organizations the authenticated user belongs to.
12617 Org-exempt: callable without org context (only requires valid JWT).
12618 Used by the admin org switcher to discover available orgs.
12619 Excludes expired sandbox organizations.
12620 Authorization: Authenticated user (no specific permission required).
12621*/
12622        async fn list_user_organizations(
12623            &self,
12624            request: tonic::Request<super::ListUserOrganizationsRequest>,
12625        ) -> std::result::Result<
12626            tonic::Response<super::ListUserOrganizationsResponse>,
12627            tonic::Status,
12628        >;
12629        /** List only the sandbox organizations the authenticated user belongs to.
12630 Org-exempt: callable without org context. The admin UI's /sandboxes
12631 management page is the primary consumer — it's a user-level surface
12632 rather than org-scoped, so this RPC is user-scoped too.
12633 Excludes already-expired sandboxes (pending cleanup).
12634 Authorization: Authenticated user (no specific permission required).
12635*/
12636        async fn list_user_sandboxes(
12637            &self,
12638            request: tonic::Request<super::ListUserSandboxesRequest>,
12639        ) -> std::result::Result<
12640            tonic::Response<super::ListUserSandboxesResponse>,
12641            tonic::Status,
12642        >;
12643    }
12644    /** Manages organizations (tenants) in the Pidgr platform.
12645 Most RPCs operate within the caller's org (extracted from JWT).
12646 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
12647*/
12648    #[derive(Debug)]
12649    pub struct OrganizationServiceServer<T> {
12650        inner: Arc<T>,
12651        accept_compression_encodings: EnabledCompressionEncodings,
12652        send_compression_encodings: EnabledCompressionEncodings,
12653        max_decoding_message_size: Option<usize>,
12654        max_encoding_message_size: Option<usize>,
12655    }
12656    impl<T> OrganizationServiceServer<T> {
12657        pub fn new(inner: T) -> Self {
12658            Self::from_arc(Arc::new(inner))
12659        }
12660        pub fn from_arc(inner: Arc<T>) -> Self {
12661            Self {
12662                inner,
12663                accept_compression_encodings: Default::default(),
12664                send_compression_encodings: Default::default(),
12665                max_decoding_message_size: None,
12666                max_encoding_message_size: None,
12667            }
12668        }
12669        pub fn with_interceptor<F>(
12670            inner: T,
12671            interceptor: F,
12672        ) -> InterceptedService<Self, F>
12673        where
12674            F: tonic::service::Interceptor,
12675        {
12676            InterceptedService::new(Self::new(inner), interceptor)
12677        }
12678        /// Enable decompressing requests with the given encoding.
12679        #[must_use]
12680        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12681            self.accept_compression_encodings.enable(encoding);
12682            self
12683        }
12684        /// Compress responses with the given encoding, if the client supports it.
12685        #[must_use]
12686        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12687            self.send_compression_encodings.enable(encoding);
12688            self
12689        }
12690        /// Limits the maximum size of a decoded message.
12691        ///
12692        /// Default: `4MB`
12693        #[must_use]
12694        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12695            self.max_decoding_message_size = Some(limit);
12696            self
12697        }
12698        /// Limits the maximum size of an encoded message.
12699        ///
12700        /// Default: `usize::MAX`
12701        #[must_use]
12702        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12703            self.max_encoding_message_size = Some(limit);
12704            self
12705        }
12706    }
12707    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
12708    where
12709        T: OrganizationService,
12710        B: Body + std::marker::Send + 'static,
12711        B::Error: Into<StdError> + std::marker::Send + 'static,
12712    {
12713        type Response = http::Response<tonic::body::Body>;
12714        type Error = std::convert::Infallible;
12715        type Future = BoxFuture<Self::Response, Self::Error>;
12716        fn poll_ready(
12717            &mut self,
12718            _cx: &mut Context<'_>,
12719        ) -> Poll<std::result::Result<(), Self::Error>> {
12720            Poll::Ready(Ok(()))
12721        }
12722        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12723            match req.uri().path() {
12724                "/pidgr.v1.OrganizationService/CreateOrganization" => {
12725                    #[allow(non_camel_case_types)]
12726                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12727                    impl<
12728                        T: OrganizationService,
12729                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
12730                    for CreateOrganizationSvc<T> {
12731                        type Response = super::CreateOrganizationResponse;
12732                        type Future = BoxFuture<
12733                            tonic::Response<Self::Response>,
12734                            tonic::Status,
12735                        >;
12736                        fn call(
12737                            &mut self,
12738                            request: tonic::Request<super::CreateOrganizationRequest>,
12739                        ) -> Self::Future {
12740                            let inner = Arc::clone(&self.0);
12741                            let fut = async move {
12742                                <T as OrganizationService>::create_organization(
12743                                        &inner,
12744                                        request,
12745                                    )
12746                                    .await
12747                            };
12748                            Box::pin(fut)
12749                        }
12750                    }
12751                    let accept_compression_encodings = self.accept_compression_encodings;
12752                    let send_compression_encodings = self.send_compression_encodings;
12753                    let max_decoding_message_size = self.max_decoding_message_size;
12754                    let max_encoding_message_size = self.max_encoding_message_size;
12755                    let inner = self.inner.clone();
12756                    let fut = async move {
12757                        let method = CreateOrganizationSvc(inner);
12758                        let codec = tonic_prost::ProstCodec::default();
12759                        let mut grpc = tonic::server::Grpc::new(codec)
12760                            .apply_compression_config(
12761                                accept_compression_encodings,
12762                                send_compression_encodings,
12763                            )
12764                            .apply_max_message_size_config(
12765                                max_decoding_message_size,
12766                                max_encoding_message_size,
12767                            );
12768                        let res = grpc.unary(method, req).await;
12769                        Ok(res)
12770                    };
12771                    Box::pin(fut)
12772                }
12773                "/pidgr.v1.OrganizationService/GetOrganization" => {
12774                    #[allow(non_camel_case_types)]
12775                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12776                    impl<
12777                        T: OrganizationService,
12778                    > tonic::server::UnaryService<super::GetOrganizationRequest>
12779                    for GetOrganizationSvc<T> {
12780                        type Response = super::GetOrganizationResponse;
12781                        type Future = BoxFuture<
12782                            tonic::Response<Self::Response>,
12783                            tonic::Status,
12784                        >;
12785                        fn call(
12786                            &mut self,
12787                            request: tonic::Request<super::GetOrganizationRequest>,
12788                        ) -> Self::Future {
12789                            let inner = Arc::clone(&self.0);
12790                            let fut = async move {
12791                                <T as OrganizationService>::get_organization(
12792                                        &inner,
12793                                        request,
12794                                    )
12795                                    .await
12796                            };
12797                            Box::pin(fut)
12798                        }
12799                    }
12800                    let accept_compression_encodings = self.accept_compression_encodings;
12801                    let send_compression_encodings = self.send_compression_encodings;
12802                    let max_decoding_message_size = self.max_decoding_message_size;
12803                    let max_encoding_message_size = self.max_encoding_message_size;
12804                    let inner = self.inner.clone();
12805                    let fut = async move {
12806                        let method = GetOrganizationSvc(inner);
12807                        let codec = tonic_prost::ProstCodec::default();
12808                        let mut grpc = tonic::server::Grpc::new(codec)
12809                            .apply_compression_config(
12810                                accept_compression_encodings,
12811                                send_compression_encodings,
12812                            )
12813                            .apply_max_message_size_config(
12814                                max_decoding_message_size,
12815                                max_encoding_message_size,
12816                            );
12817                        let res = grpc.unary(method, req).await;
12818                        Ok(res)
12819                    };
12820                    Box::pin(fut)
12821                }
12822                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12823                    #[allow(non_camel_case_types)]
12824                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12825                    impl<
12826                        T: OrganizationService,
12827                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12828                    for UpdateOrganizationSvc<T> {
12829                        type Response = super::UpdateOrganizationResponse;
12830                        type Future = BoxFuture<
12831                            tonic::Response<Self::Response>,
12832                            tonic::Status,
12833                        >;
12834                        fn call(
12835                            &mut self,
12836                            request: tonic::Request<super::UpdateOrganizationRequest>,
12837                        ) -> Self::Future {
12838                            let inner = Arc::clone(&self.0);
12839                            let fut = async move {
12840                                <T as OrganizationService>::update_organization(
12841                                        &inner,
12842                                        request,
12843                                    )
12844                                    .await
12845                            };
12846                            Box::pin(fut)
12847                        }
12848                    }
12849                    let accept_compression_encodings = self.accept_compression_encodings;
12850                    let send_compression_encodings = self.send_compression_encodings;
12851                    let max_decoding_message_size = self.max_decoding_message_size;
12852                    let max_encoding_message_size = self.max_encoding_message_size;
12853                    let inner = self.inner.clone();
12854                    let fut = async move {
12855                        let method = UpdateOrganizationSvc(inner);
12856                        let codec = tonic_prost::ProstCodec::default();
12857                        let mut grpc = tonic::server::Grpc::new(codec)
12858                            .apply_compression_config(
12859                                accept_compression_encodings,
12860                                send_compression_encodings,
12861                            )
12862                            .apply_max_message_size_config(
12863                                max_decoding_message_size,
12864                                max_encoding_message_size,
12865                            );
12866                        let res = grpc.unary(method, req).await;
12867                        Ok(res)
12868                    };
12869                    Box::pin(fut)
12870                }
12871                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12872                    #[allow(non_camel_case_types)]
12873                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12874                        pub Arc<T>,
12875                    );
12876                    impl<
12877                        T: OrganizationService,
12878                    > tonic::server::UnaryService<
12879                        super::UpdateSsoAttributeMappingsRequest,
12880                    > for UpdateSsoAttributeMappingsSvc<T> {
12881                        type Response = super::UpdateSsoAttributeMappingsResponse;
12882                        type Future = BoxFuture<
12883                            tonic::Response<Self::Response>,
12884                            tonic::Status,
12885                        >;
12886                        fn call(
12887                            &mut self,
12888                            request: tonic::Request<
12889                                super::UpdateSsoAttributeMappingsRequest,
12890                            >,
12891                        ) -> Self::Future {
12892                            let inner = Arc::clone(&self.0);
12893                            let fut = async move {
12894                                <T as OrganizationService>::update_sso_attribute_mappings(
12895                                        &inner,
12896                                        request,
12897                                    )
12898                                    .await
12899                            };
12900                            Box::pin(fut)
12901                        }
12902                    }
12903                    let accept_compression_encodings = self.accept_compression_encodings;
12904                    let send_compression_encodings = self.send_compression_encodings;
12905                    let max_decoding_message_size = self.max_decoding_message_size;
12906                    let max_encoding_message_size = self.max_encoding_message_size;
12907                    let inner = self.inner.clone();
12908                    let fut = async move {
12909                        let method = UpdateSsoAttributeMappingsSvc(inner);
12910                        let codec = tonic_prost::ProstCodec::default();
12911                        let mut grpc = tonic::server::Grpc::new(codec)
12912                            .apply_compression_config(
12913                                accept_compression_encodings,
12914                                send_compression_encodings,
12915                            )
12916                            .apply_max_message_size_config(
12917                                max_decoding_message_size,
12918                                max_encoding_message_size,
12919                            );
12920                        let res = grpc.unary(method, req).await;
12921                        Ok(res)
12922                    };
12923                    Box::pin(fut)
12924                }
12925                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12926                    #[allow(non_camel_case_types)]
12927                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12928                    impl<
12929                        T: OrganizationService,
12930                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12931                    for RotateAnalyticsSaltSvc<T> {
12932                        type Response = super::RotateAnalyticsSaltResponse;
12933                        type Future = BoxFuture<
12934                            tonic::Response<Self::Response>,
12935                            tonic::Status,
12936                        >;
12937                        fn call(
12938                            &mut self,
12939                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12940                        ) -> Self::Future {
12941                            let inner = Arc::clone(&self.0);
12942                            let fut = async move {
12943                                <T as OrganizationService>::rotate_analytics_salt(
12944                                        &inner,
12945                                        request,
12946                                    )
12947                                    .await
12948                            };
12949                            Box::pin(fut)
12950                        }
12951                    }
12952                    let accept_compression_encodings = self.accept_compression_encodings;
12953                    let send_compression_encodings = self.send_compression_encodings;
12954                    let max_decoding_message_size = self.max_decoding_message_size;
12955                    let max_encoding_message_size = self.max_encoding_message_size;
12956                    let inner = self.inner.clone();
12957                    let fut = async move {
12958                        let method = RotateAnalyticsSaltSvc(inner);
12959                        let codec = tonic_prost::ProstCodec::default();
12960                        let mut grpc = tonic::server::Grpc::new(codec)
12961                            .apply_compression_config(
12962                                accept_compression_encodings,
12963                                send_compression_encodings,
12964                            )
12965                            .apply_max_message_size_config(
12966                                max_decoding_message_size,
12967                                max_encoding_message_size,
12968                            );
12969                        let res = grpc.unary(method, req).await;
12970                        Ok(res)
12971                    };
12972                    Box::pin(fut)
12973                }
12974                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12975                    #[allow(non_camel_case_types)]
12976                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12977                    impl<
12978                        T: OrganizationService,
12979                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12980                    for UpdateAnalyticsEpsilonSvc<T> {
12981                        type Response = super::UpdateAnalyticsEpsilonResponse;
12982                        type Future = BoxFuture<
12983                            tonic::Response<Self::Response>,
12984                            tonic::Status,
12985                        >;
12986                        fn call(
12987                            &mut self,
12988                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12989                        ) -> Self::Future {
12990                            let inner = Arc::clone(&self.0);
12991                            let fut = async move {
12992                                <T as OrganizationService>::update_analytics_epsilon(
12993                                        &inner,
12994                                        request,
12995                                    )
12996                                    .await
12997                            };
12998                            Box::pin(fut)
12999                        }
13000                    }
13001                    let accept_compression_encodings = self.accept_compression_encodings;
13002                    let send_compression_encodings = self.send_compression_encodings;
13003                    let max_decoding_message_size = self.max_decoding_message_size;
13004                    let max_encoding_message_size = self.max_encoding_message_size;
13005                    let inner = self.inner.clone();
13006                    let fut = async move {
13007                        let method = UpdateAnalyticsEpsilonSvc(inner);
13008                        let codec = tonic_prost::ProstCodec::default();
13009                        let mut grpc = tonic::server::Grpc::new(codec)
13010                            .apply_compression_config(
13011                                accept_compression_encodings,
13012                                send_compression_encodings,
13013                            )
13014                            .apply_max_message_size_config(
13015                                max_decoding_message_size,
13016                                max_encoding_message_size,
13017                            );
13018                        let res = grpc.unary(method, req).await;
13019                        Ok(res)
13020                    };
13021                    Box::pin(fut)
13022                }
13023                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
13024                    #[allow(non_camel_case_types)]
13025                    struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
13026                    impl<
13027                        T: OrganizationService,
13028                    > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
13029                    for GetOrgPrivacySettingsSvc<T> {
13030                        type Response = super::GetOrgPrivacySettingsResponse;
13031                        type Future = BoxFuture<
13032                            tonic::Response<Self::Response>,
13033                            tonic::Status,
13034                        >;
13035                        fn call(
13036                            &mut self,
13037                            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
13038                        ) -> Self::Future {
13039                            let inner = Arc::clone(&self.0);
13040                            let fut = async move {
13041                                <T as OrganizationService>::get_org_privacy_settings(
13042                                        &inner,
13043                                        request,
13044                                    )
13045                                    .await
13046                            };
13047                            Box::pin(fut)
13048                        }
13049                    }
13050                    let accept_compression_encodings = self.accept_compression_encodings;
13051                    let send_compression_encodings = self.send_compression_encodings;
13052                    let max_decoding_message_size = self.max_decoding_message_size;
13053                    let max_encoding_message_size = self.max_encoding_message_size;
13054                    let inner = self.inner.clone();
13055                    let fut = async move {
13056                        let method = GetOrgPrivacySettingsSvc(inner);
13057                        let codec = tonic_prost::ProstCodec::default();
13058                        let mut grpc = tonic::server::Grpc::new(codec)
13059                            .apply_compression_config(
13060                                accept_compression_encodings,
13061                                send_compression_encodings,
13062                            )
13063                            .apply_max_message_size_config(
13064                                max_decoding_message_size,
13065                                max_encoding_message_size,
13066                            );
13067                        let res = grpc.unary(method, req).await;
13068                        Ok(res)
13069                    };
13070                    Box::pin(fut)
13071                }
13072                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
13073                    #[allow(non_camel_case_types)]
13074                    struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
13075                        pub Arc<T>,
13076                    );
13077                    impl<
13078                        T: OrganizationService,
13079                    > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
13080                    for UpdateOrgPrivacySettingsSvc<T> {
13081                        type Response = super::UpdateOrgPrivacySettingsResponse;
13082                        type Future = BoxFuture<
13083                            tonic::Response<Self::Response>,
13084                            tonic::Status,
13085                        >;
13086                        fn call(
13087                            &mut self,
13088                            request: tonic::Request<
13089                                super::UpdateOrgPrivacySettingsRequest,
13090                            >,
13091                        ) -> Self::Future {
13092                            let inner = Arc::clone(&self.0);
13093                            let fut = async move {
13094                                <T as OrganizationService>::update_org_privacy_settings(
13095                                        &inner,
13096                                        request,
13097                                    )
13098                                    .await
13099                            };
13100                            Box::pin(fut)
13101                        }
13102                    }
13103                    let accept_compression_encodings = self.accept_compression_encodings;
13104                    let send_compression_encodings = self.send_compression_encodings;
13105                    let max_decoding_message_size = self.max_decoding_message_size;
13106                    let max_encoding_message_size = self.max_encoding_message_size;
13107                    let inner = self.inner.clone();
13108                    let fut = async move {
13109                        let method = UpdateOrgPrivacySettingsSvc(inner);
13110                        let codec = tonic_prost::ProstCodec::default();
13111                        let mut grpc = tonic::server::Grpc::new(codec)
13112                            .apply_compression_config(
13113                                accept_compression_encodings,
13114                                send_compression_encodings,
13115                            )
13116                            .apply_max_message_size_config(
13117                                max_decoding_message_size,
13118                                max_encoding_message_size,
13119                            );
13120                        let res = grpc.unary(method, req).await;
13121                        Ok(res)
13122                    };
13123                    Box::pin(fut)
13124                }
13125                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
13126                    #[allow(non_camel_case_types)]
13127                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
13128                        pub Arc<T>,
13129                    );
13130                    impl<
13131                        T: OrganizationService,
13132                    > tonic::server::UnaryService<
13133                        super::CreateSandboxOrganizationRequest,
13134                    > for CreateSandboxOrganizationSvc<T> {
13135                        type Response = super::CreateSandboxOrganizationResponse;
13136                        type Future = BoxFuture<
13137                            tonic::Response<Self::Response>,
13138                            tonic::Status,
13139                        >;
13140                        fn call(
13141                            &mut self,
13142                            request: tonic::Request<
13143                                super::CreateSandboxOrganizationRequest,
13144                            >,
13145                        ) -> Self::Future {
13146                            let inner = Arc::clone(&self.0);
13147                            let fut = async move {
13148                                <T as OrganizationService>::create_sandbox_organization(
13149                                        &inner,
13150                                        request,
13151                                    )
13152                                    .await
13153                            };
13154                            Box::pin(fut)
13155                        }
13156                    }
13157                    let accept_compression_encodings = self.accept_compression_encodings;
13158                    let send_compression_encodings = self.send_compression_encodings;
13159                    let max_decoding_message_size = self.max_decoding_message_size;
13160                    let max_encoding_message_size = self.max_encoding_message_size;
13161                    let inner = self.inner.clone();
13162                    let fut = async move {
13163                        let method = CreateSandboxOrganizationSvc(inner);
13164                        let codec = tonic_prost::ProstCodec::default();
13165                        let mut grpc = tonic::server::Grpc::new(codec)
13166                            .apply_compression_config(
13167                                accept_compression_encodings,
13168                                send_compression_encodings,
13169                            )
13170                            .apply_max_message_size_config(
13171                                max_decoding_message_size,
13172                                max_encoding_message_size,
13173                            );
13174                        let res = grpc.unary(method, req).await;
13175                        Ok(res)
13176                    };
13177                    Box::pin(fut)
13178                }
13179                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
13180                    #[allow(non_camel_case_types)]
13181                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
13182                        pub Arc<T>,
13183                    );
13184                    impl<
13185                        T: OrganizationService,
13186                    > tonic::server::UnaryService<
13187                        super::DeleteSandboxOrganizationRequest,
13188                    > for DeleteSandboxOrganizationSvc<T> {
13189                        type Response = super::DeleteSandboxOrganizationResponse;
13190                        type Future = BoxFuture<
13191                            tonic::Response<Self::Response>,
13192                            tonic::Status,
13193                        >;
13194                        fn call(
13195                            &mut self,
13196                            request: tonic::Request<
13197                                super::DeleteSandboxOrganizationRequest,
13198                            >,
13199                        ) -> Self::Future {
13200                            let inner = Arc::clone(&self.0);
13201                            let fut = async move {
13202                                <T as OrganizationService>::delete_sandbox_organization(
13203                                        &inner,
13204                                        request,
13205                                    )
13206                                    .await
13207                            };
13208                            Box::pin(fut)
13209                        }
13210                    }
13211                    let accept_compression_encodings = self.accept_compression_encodings;
13212                    let send_compression_encodings = self.send_compression_encodings;
13213                    let max_decoding_message_size = self.max_decoding_message_size;
13214                    let max_encoding_message_size = self.max_encoding_message_size;
13215                    let inner = self.inner.clone();
13216                    let fut = async move {
13217                        let method = DeleteSandboxOrganizationSvc(inner);
13218                        let codec = tonic_prost::ProstCodec::default();
13219                        let mut grpc = tonic::server::Grpc::new(codec)
13220                            .apply_compression_config(
13221                                accept_compression_encodings,
13222                                send_compression_encodings,
13223                            )
13224                            .apply_max_message_size_config(
13225                                max_decoding_message_size,
13226                                max_encoding_message_size,
13227                            );
13228                        let res = grpc.unary(method, req).await;
13229                        Ok(res)
13230                    };
13231                    Box::pin(fut)
13232                }
13233                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
13234                    #[allow(non_camel_case_types)]
13235                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
13236                    impl<
13237                        T: OrganizationService,
13238                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
13239                    for ListSandboxFixturesSvc<T> {
13240                        type Response = super::ListSandboxFixturesResponse;
13241                        type Future = BoxFuture<
13242                            tonic::Response<Self::Response>,
13243                            tonic::Status,
13244                        >;
13245                        fn call(
13246                            &mut self,
13247                            request: tonic::Request<super::ListSandboxFixturesRequest>,
13248                        ) -> Self::Future {
13249                            let inner = Arc::clone(&self.0);
13250                            let fut = async move {
13251                                <T as OrganizationService>::list_sandbox_fixtures(
13252                                        &inner,
13253                                        request,
13254                                    )
13255                                    .await
13256                            };
13257                            Box::pin(fut)
13258                        }
13259                    }
13260                    let accept_compression_encodings = self.accept_compression_encodings;
13261                    let send_compression_encodings = self.send_compression_encodings;
13262                    let max_decoding_message_size = self.max_decoding_message_size;
13263                    let max_encoding_message_size = self.max_encoding_message_size;
13264                    let inner = self.inner.clone();
13265                    let fut = async move {
13266                        let method = ListSandboxFixturesSvc(inner);
13267                        let codec = tonic_prost::ProstCodec::default();
13268                        let mut grpc = tonic::server::Grpc::new(codec)
13269                            .apply_compression_config(
13270                                accept_compression_encodings,
13271                                send_compression_encodings,
13272                            )
13273                            .apply_max_message_size_config(
13274                                max_decoding_message_size,
13275                                max_encoding_message_size,
13276                            );
13277                        let res = grpc.unary(method, req).await;
13278                        Ok(res)
13279                    };
13280                    Box::pin(fut)
13281                }
13282                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
13283                    #[allow(non_camel_case_types)]
13284                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
13285                    impl<
13286                        T: OrganizationService,
13287                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
13288                    for ListUserOrganizationsSvc<T> {
13289                        type Response = super::ListUserOrganizationsResponse;
13290                        type Future = BoxFuture<
13291                            tonic::Response<Self::Response>,
13292                            tonic::Status,
13293                        >;
13294                        fn call(
13295                            &mut self,
13296                            request: tonic::Request<super::ListUserOrganizationsRequest>,
13297                        ) -> Self::Future {
13298                            let inner = Arc::clone(&self.0);
13299                            let fut = async move {
13300                                <T as OrganizationService>::list_user_organizations(
13301                                        &inner,
13302                                        request,
13303                                    )
13304                                    .await
13305                            };
13306                            Box::pin(fut)
13307                        }
13308                    }
13309                    let accept_compression_encodings = self.accept_compression_encodings;
13310                    let send_compression_encodings = self.send_compression_encodings;
13311                    let max_decoding_message_size = self.max_decoding_message_size;
13312                    let max_encoding_message_size = self.max_encoding_message_size;
13313                    let inner = self.inner.clone();
13314                    let fut = async move {
13315                        let method = ListUserOrganizationsSvc(inner);
13316                        let codec = tonic_prost::ProstCodec::default();
13317                        let mut grpc = tonic::server::Grpc::new(codec)
13318                            .apply_compression_config(
13319                                accept_compression_encodings,
13320                                send_compression_encodings,
13321                            )
13322                            .apply_max_message_size_config(
13323                                max_decoding_message_size,
13324                                max_encoding_message_size,
13325                            );
13326                        let res = grpc.unary(method, req).await;
13327                        Ok(res)
13328                    };
13329                    Box::pin(fut)
13330                }
13331                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
13332                    #[allow(non_camel_case_types)]
13333                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
13334                    impl<
13335                        T: OrganizationService,
13336                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
13337                    for ListUserSandboxesSvc<T> {
13338                        type Response = super::ListUserSandboxesResponse;
13339                        type Future = BoxFuture<
13340                            tonic::Response<Self::Response>,
13341                            tonic::Status,
13342                        >;
13343                        fn call(
13344                            &mut self,
13345                            request: tonic::Request<super::ListUserSandboxesRequest>,
13346                        ) -> Self::Future {
13347                            let inner = Arc::clone(&self.0);
13348                            let fut = async move {
13349                                <T as OrganizationService>::list_user_sandboxes(
13350                                        &inner,
13351                                        request,
13352                                    )
13353                                    .await
13354                            };
13355                            Box::pin(fut)
13356                        }
13357                    }
13358                    let accept_compression_encodings = self.accept_compression_encodings;
13359                    let send_compression_encodings = self.send_compression_encodings;
13360                    let max_decoding_message_size = self.max_decoding_message_size;
13361                    let max_encoding_message_size = self.max_encoding_message_size;
13362                    let inner = self.inner.clone();
13363                    let fut = async move {
13364                        let method = ListUserSandboxesSvc(inner);
13365                        let codec = tonic_prost::ProstCodec::default();
13366                        let mut grpc = tonic::server::Grpc::new(codec)
13367                            .apply_compression_config(
13368                                accept_compression_encodings,
13369                                send_compression_encodings,
13370                            )
13371                            .apply_max_message_size_config(
13372                                max_decoding_message_size,
13373                                max_encoding_message_size,
13374                            );
13375                        let res = grpc.unary(method, req).await;
13376                        Ok(res)
13377                    };
13378                    Box::pin(fut)
13379                }
13380                _ => {
13381                    Box::pin(async move {
13382                        let mut response = http::Response::new(
13383                            tonic::body::Body::default(),
13384                        );
13385                        let headers = response.headers_mut();
13386                        headers
13387                            .insert(
13388                                tonic::Status::GRPC_STATUS,
13389                                (tonic::Code::Unimplemented as i32).into(),
13390                            );
13391                        headers
13392                            .insert(
13393                                http::header::CONTENT_TYPE,
13394                                tonic::metadata::GRPC_CONTENT_TYPE,
13395                            );
13396                        Ok(response)
13397                    })
13398                }
13399            }
13400        }
13401    }
13402    impl<T> Clone for OrganizationServiceServer<T> {
13403        fn clone(&self) -> Self {
13404            let inner = self.inner.clone();
13405            Self {
13406                inner,
13407                accept_compression_encodings: self.accept_compression_encodings,
13408                send_compression_encodings: self.send_compression_encodings,
13409                max_decoding_message_size: self.max_decoding_message_size,
13410                max_encoding_message_size: self.max_encoding_message_size,
13411            }
13412        }
13413    }
13414    /// Generated gRPC service name
13415    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
13416    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
13417        const NAME: &'static str = SERVICE_NAME;
13418    }
13419}
13420/// Generated client implementations.
13421pub mod render_service_client {
13422    #![allow(
13423        unused_variables,
13424        dead_code,
13425        missing_docs,
13426        clippy::wildcard_imports,
13427        clippy::let_unit_value,
13428    )]
13429    use tonic::codegen::*;
13430    use tonic::codegen::http::Uri;
13431    /** Internal service for batch template rendering.
13432*/
13433    #[derive(Debug, Clone)]
13434    pub struct RenderServiceClient<T> {
13435        inner: tonic::client::Grpc<T>,
13436    }
13437    impl RenderServiceClient<tonic::transport::Channel> {
13438        /// Attempt to create a new client by connecting to a given endpoint.
13439        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13440        where
13441            D: TryInto<tonic::transport::Endpoint>,
13442            D::Error: Into<StdError>,
13443        {
13444            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13445            Ok(Self::new(conn))
13446        }
13447    }
13448    impl<T> RenderServiceClient<T>
13449    where
13450        T: tonic::client::GrpcService<tonic::body::Body>,
13451        T::Error: Into<StdError>,
13452        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13453        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13454    {
13455        pub fn new(inner: T) -> Self {
13456            let inner = tonic::client::Grpc::new(inner);
13457            Self { inner }
13458        }
13459        pub fn with_origin(inner: T, origin: Uri) -> Self {
13460            let inner = tonic::client::Grpc::with_origin(inner, origin);
13461            Self { inner }
13462        }
13463        pub fn with_interceptor<F>(
13464            inner: T,
13465            interceptor: F,
13466        ) -> RenderServiceClient<InterceptedService<T, F>>
13467        where
13468            F: tonic::service::Interceptor,
13469            T::ResponseBody: Default,
13470            T: tonic::codegen::Service<
13471                http::Request<tonic::body::Body>,
13472                Response = http::Response<
13473                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13474                >,
13475            >,
13476            <T as tonic::codegen::Service<
13477                http::Request<tonic::body::Body>,
13478            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13479        {
13480            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
13481        }
13482        /// Compress requests with the given encoding.
13483        ///
13484        /// This requires the server to support it otherwise it might respond with an
13485        /// error.
13486        #[must_use]
13487        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13488            self.inner = self.inner.send_compressed(encoding);
13489            self
13490        }
13491        /// Enable decompressing responses.
13492        #[must_use]
13493        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13494            self.inner = self.inner.accept_compressed(encoding);
13495            self
13496        }
13497        /// Limits the maximum size of a decoded message.
13498        ///
13499        /// Default: `4MB`
13500        #[must_use]
13501        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13502            self.inner = self.inner.max_decoding_message_size(limit);
13503            self
13504        }
13505        /// Limits the maximum size of an encoded message.
13506        ///
13507        /// Default: `usize::MAX`
13508        #[must_use]
13509        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13510            self.inner = self.inner.max_encoding_message_size(limit);
13511            self
13512        }
13513        /** Render a template for multiple users, streaming results as each completes.
13514 Authorization: Internal server-to-server only. Not exposed to external clients.
13515*/
13516        pub async fn render_batch(
13517            &mut self,
13518            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
13519        ) -> std::result::Result<
13520            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
13521            tonic::Status,
13522        > {
13523            self.inner
13524                .ready()
13525                .await
13526                .map_err(|e| {
13527                    tonic::Status::unknown(
13528                        format!("Service was not ready: {}", e.into()),
13529                    )
13530                })?;
13531            let codec = tonic_prost::ProstCodec::default();
13532            let path = http::uri::PathAndQuery::from_static(
13533                "/pidgr.v1.RenderService/RenderBatch",
13534            );
13535            let mut req = request.into_request();
13536            req.extensions_mut()
13537                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
13538            self.inner.server_streaming(req, path, codec).await
13539        }
13540    }
13541}
13542/// Generated server implementations.
13543pub mod render_service_server {
13544    #![allow(
13545        unused_variables,
13546        dead_code,
13547        missing_docs,
13548        clippy::wildcard_imports,
13549        clippy::let_unit_value,
13550    )]
13551    use tonic::codegen::*;
13552    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
13553    #[async_trait]
13554    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
13555        /// Server streaming response type for the RenderBatch method.
13556        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
13557                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
13558            >
13559            + std::marker::Send
13560            + 'static;
13561        /** Render a template for multiple users, streaming results as each completes.
13562 Authorization: Internal server-to-server only. Not exposed to external clients.
13563*/
13564        async fn render_batch(
13565            &self,
13566            request: tonic::Request<super::RenderBatchRequest>,
13567        ) -> std::result::Result<
13568            tonic::Response<Self::RenderBatchStream>,
13569            tonic::Status,
13570        >;
13571    }
13572    /** Internal service for batch template rendering.
13573*/
13574    #[derive(Debug)]
13575    pub struct RenderServiceServer<T> {
13576        inner: Arc<T>,
13577        accept_compression_encodings: EnabledCompressionEncodings,
13578        send_compression_encodings: EnabledCompressionEncodings,
13579        max_decoding_message_size: Option<usize>,
13580        max_encoding_message_size: Option<usize>,
13581    }
13582    impl<T> RenderServiceServer<T> {
13583        pub fn new(inner: T) -> Self {
13584            Self::from_arc(Arc::new(inner))
13585        }
13586        pub fn from_arc(inner: Arc<T>) -> Self {
13587            Self {
13588                inner,
13589                accept_compression_encodings: Default::default(),
13590                send_compression_encodings: Default::default(),
13591                max_decoding_message_size: None,
13592                max_encoding_message_size: None,
13593            }
13594        }
13595        pub fn with_interceptor<F>(
13596            inner: T,
13597            interceptor: F,
13598        ) -> InterceptedService<Self, F>
13599        where
13600            F: tonic::service::Interceptor,
13601        {
13602            InterceptedService::new(Self::new(inner), interceptor)
13603        }
13604        /// Enable decompressing requests with the given encoding.
13605        #[must_use]
13606        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13607            self.accept_compression_encodings.enable(encoding);
13608            self
13609        }
13610        /// Compress responses with the given encoding, if the client supports it.
13611        #[must_use]
13612        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13613            self.send_compression_encodings.enable(encoding);
13614            self
13615        }
13616        /// Limits the maximum size of a decoded message.
13617        ///
13618        /// Default: `4MB`
13619        #[must_use]
13620        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13621            self.max_decoding_message_size = Some(limit);
13622            self
13623        }
13624        /// Limits the maximum size of an encoded message.
13625        ///
13626        /// Default: `usize::MAX`
13627        #[must_use]
13628        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13629            self.max_encoding_message_size = Some(limit);
13630            self
13631        }
13632    }
13633    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
13634    where
13635        T: RenderService,
13636        B: Body + std::marker::Send + 'static,
13637        B::Error: Into<StdError> + std::marker::Send + 'static,
13638    {
13639        type Response = http::Response<tonic::body::Body>;
13640        type Error = std::convert::Infallible;
13641        type Future = BoxFuture<Self::Response, Self::Error>;
13642        fn poll_ready(
13643            &mut self,
13644            _cx: &mut Context<'_>,
13645        ) -> Poll<std::result::Result<(), Self::Error>> {
13646            Poll::Ready(Ok(()))
13647        }
13648        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13649            match req.uri().path() {
13650                "/pidgr.v1.RenderService/RenderBatch" => {
13651                    #[allow(non_camel_case_types)]
13652                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
13653                    impl<
13654                        T: RenderService,
13655                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
13656                    for RenderBatchSvc<T> {
13657                        type Response = super::RenderBatchResponse;
13658                        type ResponseStream = T::RenderBatchStream;
13659                        type Future = BoxFuture<
13660                            tonic::Response<Self::ResponseStream>,
13661                            tonic::Status,
13662                        >;
13663                        fn call(
13664                            &mut self,
13665                            request: tonic::Request<super::RenderBatchRequest>,
13666                        ) -> Self::Future {
13667                            let inner = Arc::clone(&self.0);
13668                            let fut = async move {
13669                                <T as RenderService>::render_batch(&inner, request).await
13670                            };
13671                            Box::pin(fut)
13672                        }
13673                    }
13674                    let accept_compression_encodings = self.accept_compression_encodings;
13675                    let send_compression_encodings = self.send_compression_encodings;
13676                    let max_decoding_message_size = self.max_decoding_message_size;
13677                    let max_encoding_message_size = self.max_encoding_message_size;
13678                    let inner = self.inner.clone();
13679                    let fut = async move {
13680                        let method = RenderBatchSvc(inner);
13681                        let codec = tonic_prost::ProstCodec::default();
13682                        let mut grpc = tonic::server::Grpc::new(codec)
13683                            .apply_compression_config(
13684                                accept_compression_encodings,
13685                                send_compression_encodings,
13686                            )
13687                            .apply_max_message_size_config(
13688                                max_decoding_message_size,
13689                                max_encoding_message_size,
13690                            );
13691                        let res = grpc.server_streaming(method, req).await;
13692                        Ok(res)
13693                    };
13694                    Box::pin(fut)
13695                }
13696                _ => {
13697                    Box::pin(async move {
13698                        let mut response = http::Response::new(
13699                            tonic::body::Body::default(),
13700                        );
13701                        let headers = response.headers_mut();
13702                        headers
13703                            .insert(
13704                                tonic::Status::GRPC_STATUS,
13705                                (tonic::Code::Unimplemented as i32).into(),
13706                            );
13707                        headers
13708                            .insert(
13709                                http::header::CONTENT_TYPE,
13710                                tonic::metadata::GRPC_CONTENT_TYPE,
13711                            );
13712                        Ok(response)
13713                    })
13714                }
13715            }
13716        }
13717    }
13718    impl<T> Clone for RenderServiceServer<T> {
13719        fn clone(&self) -> Self {
13720            let inner = self.inner.clone();
13721            Self {
13722                inner,
13723                accept_compression_encodings: self.accept_compression_encodings,
13724                send_compression_encodings: self.send_compression_encodings,
13725                max_decoding_message_size: self.max_decoding_message_size,
13726                max_encoding_message_size: self.max_encoding_message_size,
13727            }
13728        }
13729    }
13730    /// Generated gRPC service name
13731    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13732    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13733        const NAME: &'static str = SERVICE_NAME;
13734    }
13735}
13736/// Generated client implementations.
13737pub mod replay_service_client {
13738    #![allow(
13739        unused_variables,
13740        dead_code,
13741        missing_docs,
13742        clippy::wildcard_imports,
13743        clippy::let_unit_value,
13744    )]
13745    use tonic::codegen::*;
13746    use tonic::codegen::http::Uri;
13747    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13748 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13749*/
13750    #[derive(Debug, Clone)]
13751    pub struct ReplayServiceClient<T> {
13752        inner: tonic::client::Grpc<T>,
13753    }
13754    impl ReplayServiceClient<tonic::transport::Channel> {
13755        /// Attempt to create a new client by connecting to a given endpoint.
13756        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13757        where
13758            D: TryInto<tonic::transport::Endpoint>,
13759            D::Error: Into<StdError>,
13760        {
13761            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13762            Ok(Self::new(conn))
13763        }
13764    }
13765    impl<T> ReplayServiceClient<T>
13766    where
13767        T: tonic::client::GrpcService<tonic::body::Body>,
13768        T::Error: Into<StdError>,
13769        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13770        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13771    {
13772        pub fn new(inner: T) -> Self {
13773            let inner = tonic::client::Grpc::new(inner);
13774            Self { inner }
13775        }
13776        pub fn with_origin(inner: T, origin: Uri) -> Self {
13777            let inner = tonic::client::Grpc::with_origin(inner, origin);
13778            Self { inner }
13779        }
13780        pub fn with_interceptor<F>(
13781            inner: T,
13782            interceptor: F,
13783        ) -> ReplayServiceClient<InterceptedService<T, F>>
13784        where
13785            F: tonic::service::Interceptor,
13786            T::ResponseBody: Default,
13787            T: tonic::codegen::Service<
13788                http::Request<tonic::body::Body>,
13789                Response = http::Response<
13790                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13791                >,
13792            >,
13793            <T as tonic::codegen::Service<
13794                http::Request<tonic::body::Body>,
13795            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13796        {
13797            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13798        }
13799        /// Compress requests with the given encoding.
13800        ///
13801        /// This requires the server to support it otherwise it might respond with an
13802        /// error.
13803        #[must_use]
13804        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13805            self.inner = self.inner.send_compressed(encoding);
13806            self
13807        }
13808        /// Enable decompressing responses.
13809        #[must_use]
13810        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13811            self.inner = self.inner.accept_compressed(encoding);
13812            self
13813        }
13814        /// Limits the maximum size of a decoded message.
13815        ///
13816        /// Default: `4MB`
13817        #[must_use]
13818        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13819            self.inner = self.inner.max_decoding_message_size(limit);
13820            self
13821        }
13822        /// Limits the maximum size of an encoded message.
13823        ///
13824        /// Default: `usize::MAX`
13825        #[must_use]
13826        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13827            self.inner = self.inner.max_encoding_message_size(limit);
13828            self
13829        }
13830        /** List recent session recordings with optional campaign and time range filters.
13831 Authorization: Requires CAMPAIGNS_READ permission.
13832*/
13833        pub async fn list_session_recordings(
13834            &mut self,
13835            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13836        ) -> std::result::Result<
13837            tonic::Response<super::ListSessionRecordingsResponse>,
13838            tonic::Status,
13839        > {
13840            self.inner
13841                .ready()
13842                .await
13843                .map_err(|e| {
13844                    tonic::Status::unknown(
13845                        format!("Service was not ready: {}", e.into()),
13846                    )
13847                })?;
13848            let codec = tonic_prost::ProstCodec::default();
13849            let path = http::uri::PathAndQuery::from_static(
13850                "/pidgr.v1.ReplayService/ListSessionRecordings",
13851            );
13852            let mut req = request.into_request();
13853            req.extensions_mut()
13854                .insert(
13855                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13856                );
13857            self.inner.unary(req, path, codec).await
13858        }
13859        /** Fetch the full rrweb snapshot data for a single recording.
13860 Authorization: Requires CAMPAIGNS_READ permission.
13861*/
13862        pub async fn get_session_snapshots(
13863            &mut self,
13864            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13865        ) -> std::result::Result<
13866            tonic::Response<super::GetSessionSnapshotsResponse>,
13867            tonic::Status,
13868        > {
13869            self.inner
13870                .ready()
13871                .await
13872                .map_err(|e| {
13873                    tonic::Status::unknown(
13874                        format!("Service was not ready: {}", e.into()),
13875                    )
13876                })?;
13877            let codec = tonic_prost::ProstCodec::default();
13878            let path = http::uri::PathAndQuery::from_static(
13879                "/pidgr.v1.ReplayService/GetSessionSnapshots",
13880            );
13881            let mut req = request.into_request();
13882            req.extensions_mut()
13883                .insert(
13884                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13885                );
13886            self.inner.unary(req, path, codec).await
13887        }
13888    }
13889}
13890/// Generated server implementations.
13891pub mod replay_service_server {
13892    #![allow(
13893        unused_variables,
13894        dead_code,
13895        missing_docs,
13896        clippy::wildcard_imports,
13897        clippy::let_unit_value,
13898    )]
13899    use tonic::codegen::*;
13900    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
13901    #[async_trait]
13902    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13903        /** List recent session recordings with optional campaign and time range filters.
13904 Authorization: Requires CAMPAIGNS_READ permission.
13905*/
13906        async fn list_session_recordings(
13907            &self,
13908            request: tonic::Request<super::ListSessionRecordingsRequest>,
13909        ) -> std::result::Result<
13910            tonic::Response<super::ListSessionRecordingsResponse>,
13911            tonic::Status,
13912        >;
13913        /** Fetch the full rrweb snapshot data for a single recording.
13914 Authorization: Requires CAMPAIGNS_READ permission.
13915*/
13916        async fn get_session_snapshots(
13917            &self,
13918            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13919        ) -> std::result::Result<
13920            tonic::Response<super::GetSessionSnapshotsResponse>,
13921            tonic::Status,
13922        >;
13923    }
13924    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13925 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13926*/
13927    #[derive(Debug)]
13928    pub struct ReplayServiceServer<T> {
13929        inner: Arc<T>,
13930        accept_compression_encodings: EnabledCompressionEncodings,
13931        send_compression_encodings: EnabledCompressionEncodings,
13932        max_decoding_message_size: Option<usize>,
13933        max_encoding_message_size: Option<usize>,
13934    }
13935    impl<T> ReplayServiceServer<T> {
13936        pub fn new(inner: T) -> Self {
13937            Self::from_arc(Arc::new(inner))
13938        }
13939        pub fn from_arc(inner: Arc<T>) -> Self {
13940            Self {
13941                inner,
13942                accept_compression_encodings: Default::default(),
13943                send_compression_encodings: Default::default(),
13944                max_decoding_message_size: None,
13945                max_encoding_message_size: None,
13946            }
13947        }
13948        pub fn with_interceptor<F>(
13949            inner: T,
13950            interceptor: F,
13951        ) -> InterceptedService<Self, F>
13952        where
13953            F: tonic::service::Interceptor,
13954        {
13955            InterceptedService::new(Self::new(inner), interceptor)
13956        }
13957        /// Enable decompressing requests with the given encoding.
13958        #[must_use]
13959        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13960            self.accept_compression_encodings.enable(encoding);
13961            self
13962        }
13963        /// Compress responses with the given encoding, if the client supports it.
13964        #[must_use]
13965        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13966            self.send_compression_encodings.enable(encoding);
13967            self
13968        }
13969        /// Limits the maximum size of a decoded message.
13970        ///
13971        /// Default: `4MB`
13972        #[must_use]
13973        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13974            self.max_decoding_message_size = Some(limit);
13975            self
13976        }
13977        /// Limits the maximum size of an encoded message.
13978        ///
13979        /// Default: `usize::MAX`
13980        #[must_use]
13981        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13982            self.max_encoding_message_size = Some(limit);
13983            self
13984        }
13985    }
13986    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13987    where
13988        T: ReplayService,
13989        B: Body + std::marker::Send + 'static,
13990        B::Error: Into<StdError> + std::marker::Send + 'static,
13991    {
13992        type Response = http::Response<tonic::body::Body>;
13993        type Error = std::convert::Infallible;
13994        type Future = BoxFuture<Self::Response, Self::Error>;
13995        fn poll_ready(
13996            &mut self,
13997            _cx: &mut Context<'_>,
13998        ) -> Poll<std::result::Result<(), Self::Error>> {
13999            Poll::Ready(Ok(()))
14000        }
14001        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14002            match req.uri().path() {
14003                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
14004                    #[allow(non_camel_case_types)]
14005                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
14006                    impl<
14007                        T: ReplayService,
14008                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
14009                    for ListSessionRecordingsSvc<T> {
14010                        type Response = super::ListSessionRecordingsResponse;
14011                        type Future = BoxFuture<
14012                            tonic::Response<Self::Response>,
14013                            tonic::Status,
14014                        >;
14015                        fn call(
14016                            &mut self,
14017                            request: tonic::Request<super::ListSessionRecordingsRequest>,
14018                        ) -> Self::Future {
14019                            let inner = Arc::clone(&self.0);
14020                            let fut = async move {
14021                                <T as ReplayService>::list_session_recordings(
14022                                        &inner,
14023                                        request,
14024                                    )
14025                                    .await
14026                            };
14027                            Box::pin(fut)
14028                        }
14029                    }
14030                    let accept_compression_encodings = self.accept_compression_encodings;
14031                    let send_compression_encodings = self.send_compression_encodings;
14032                    let max_decoding_message_size = self.max_decoding_message_size;
14033                    let max_encoding_message_size = self.max_encoding_message_size;
14034                    let inner = self.inner.clone();
14035                    let fut = async move {
14036                        let method = ListSessionRecordingsSvc(inner);
14037                        let codec = tonic_prost::ProstCodec::default();
14038                        let mut grpc = tonic::server::Grpc::new(codec)
14039                            .apply_compression_config(
14040                                accept_compression_encodings,
14041                                send_compression_encodings,
14042                            )
14043                            .apply_max_message_size_config(
14044                                max_decoding_message_size,
14045                                max_encoding_message_size,
14046                            );
14047                        let res = grpc.unary(method, req).await;
14048                        Ok(res)
14049                    };
14050                    Box::pin(fut)
14051                }
14052                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
14053                    #[allow(non_camel_case_types)]
14054                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
14055                    impl<
14056                        T: ReplayService,
14057                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
14058                    for GetSessionSnapshotsSvc<T> {
14059                        type Response = super::GetSessionSnapshotsResponse;
14060                        type Future = BoxFuture<
14061                            tonic::Response<Self::Response>,
14062                            tonic::Status,
14063                        >;
14064                        fn call(
14065                            &mut self,
14066                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
14067                        ) -> Self::Future {
14068                            let inner = Arc::clone(&self.0);
14069                            let fut = async move {
14070                                <T as ReplayService>::get_session_snapshots(&inner, request)
14071                                    .await
14072                            };
14073                            Box::pin(fut)
14074                        }
14075                    }
14076                    let accept_compression_encodings = self.accept_compression_encodings;
14077                    let send_compression_encodings = self.send_compression_encodings;
14078                    let max_decoding_message_size = self.max_decoding_message_size;
14079                    let max_encoding_message_size = self.max_encoding_message_size;
14080                    let inner = self.inner.clone();
14081                    let fut = async move {
14082                        let method = GetSessionSnapshotsSvc(inner);
14083                        let codec = tonic_prost::ProstCodec::default();
14084                        let mut grpc = tonic::server::Grpc::new(codec)
14085                            .apply_compression_config(
14086                                accept_compression_encodings,
14087                                send_compression_encodings,
14088                            )
14089                            .apply_max_message_size_config(
14090                                max_decoding_message_size,
14091                                max_encoding_message_size,
14092                            );
14093                        let res = grpc.unary(method, req).await;
14094                        Ok(res)
14095                    };
14096                    Box::pin(fut)
14097                }
14098                _ => {
14099                    Box::pin(async move {
14100                        let mut response = http::Response::new(
14101                            tonic::body::Body::default(),
14102                        );
14103                        let headers = response.headers_mut();
14104                        headers
14105                            .insert(
14106                                tonic::Status::GRPC_STATUS,
14107                                (tonic::Code::Unimplemented as i32).into(),
14108                            );
14109                        headers
14110                            .insert(
14111                                http::header::CONTENT_TYPE,
14112                                tonic::metadata::GRPC_CONTENT_TYPE,
14113                            );
14114                        Ok(response)
14115                    })
14116                }
14117            }
14118        }
14119    }
14120    impl<T> Clone for ReplayServiceServer<T> {
14121        fn clone(&self) -> Self {
14122            let inner = self.inner.clone();
14123            Self {
14124                inner,
14125                accept_compression_encodings: self.accept_compression_encodings,
14126                send_compression_encodings: self.send_compression_encodings,
14127                max_decoding_message_size: self.max_decoding_message_size,
14128                max_encoding_message_size: self.max_encoding_message_size,
14129            }
14130        }
14131    }
14132    /// Generated gRPC service name
14133    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
14134    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
14135        const NAME: &'static str = SERVICE_NAME;
14136    }
14137}
14138/// Generated client implementations.
14139pub mod role_service_client {
14140    #![allow(
14141        unused_variables,
14142        dead_code,
14143        missing_docs,
14144        clippy::wildcard_imports,
14145        clippy::let_unit_value,
14146    )]
14147    use tonic::codegen::*;
14148    use tonic::codegen::http::Uri;
14149    /** Manages roles and their permissions within an organization.
14150 All RPCs operate within the caller's org (extracted from JWT).
14151*/
14152    #[derive(Debug, Clone)]
14153    pub struct RoleServiceClient<T> {
14154        inner: tonic::client::Grpc<T>,
14155    }
14156    impl RoleServiceClient<tonic::transport::Channel> {
14157        /// Attempt to create a new client by connecting to a given endpoint.
14158        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14159        where
14160            D: TryInto<tonic::transport::Endpoint>,
14161            D::Error: Into<StdError>,
14162        {
14163            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14164            Ok(Self::new(conn))
14165        }
14166    }
14167    impl<T> RoleServiceClient<T>
14168    where
14169        T: tonic::client::GrpcService<tonic::body::Body>,
14170        T::Error: Into<StdError>,
14171        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14172        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14173    {
14174        pub fn new(inner: T) -> Self {
14175            let inner = tonic::client::Grpc::new(inner);
14176            Self { inner }
14177        }
14178        pub fn with_origin(inner: T, origin: Uri) -> Self {
14179            let inner = tonic::client::Grpc::with_origin(inner, origin);
14180            Self { inner }
14181        }
14182        pub fn with_interceptor<F>(
14183            inner: T,
14184            interceptor: F,
14185        ) -> RoleServiceClient<InterceptedService<T, F>>
14186        where
14187            F: tonic::service::Interceptor,
14188            T::ResponseBody: Default,
14189            T: tonic::codegen::Service<
14190                http::Request<tonic::body::Body>,
14191                Response = http::Response<
14192                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14193                >,
14194            >,
14195            <T as tonic::codegen::Service<
14196                http::Request<tonic::body::Body>,
14197            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14198        {
14199            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
14200        }
14201        /// Compress requests with the given encoding.
14202        ///
14203        /// This requires the server to support it otherwise it might respond with an
14204        /// error.
14205        #[must_use]
14206        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14207            self.inner = self.inner.send_compressed(encoding);
14208            self
14209        }
14210        /// Enable decompressing responses.
14211        #[must_use]
14212        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14213            self.inner = self.inner.accept_compressed(encoding);
14214            self
14215        }
14216        /// Limits the maximum size of a decoded message.
14217        ///
14218        /// Default: `4MB`
14219        #[must_use]
14220        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14221            self.inner = self.inner.max_decoding_message_size(limit);
14222            self
14223        }
14224        /// Limits the maximum size of an encoded message.
14225        ///
14226        /// Default: `usize::MAX`
14227        #[must_use]
14228        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14229            self.inner = self.inner.max_encoding_message_size(limit);
14230            self
14231        }
14232        /** List all roles in the organization with their permission sets.
14233 Authorization: Requires PERMISSION_ORG_READ.
14234*/
14235        pub async fn list_roles(
14236            &mut self,
14237            request: impl tonic::IntoRequest<super::ListRolesRequest>,
14238        ) -> std::result::Result<
14239            tonic::Response<super::ListRolesResponse>,
14240            tonic::Status,
14241        > {
14242            self.inner
14243                .ready()
14244                .await
14245                .map_err(|e| {
14246                    tonic::Status::unknown(
14247                        format!("Service was not ready: {}", e.into()),
14248                    )
14249                })?;
14250            let codec = tonic_prost::ProstCodec::default();
14251            let path = http::uri::PathAndQuery::from_static(
14252                "/pidgr.v1.RoleService/ListRoles",
14253            );
14254            let mut req = request.into_request();
14255            req.extensions_mut()
14256                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
14257            self.inner.unary(req, path, codec).await
14258        }
14259        /** Create a new custom role with a name and initial permissions.
14260 Slug is auto-generated from the name and immutable after creation.
14261 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14262*/
14263        pub async fn create_role(
14264            &mut self,
14265            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
14266        ) -> std::result::Result<
14267            tonic::Response<super::CreateRoleResponse>,
14268            tonic::Status,
14269        > {
14270            self.inner
14271                .ready()
14272                .await
14273                .map_err(|e| {
14274                    tonic::Status::unknown(
14275                        format!("Service was not ready: {}", e.into()),
14276                    )
14277                })?;
14278            let codec = tonic_prost::ProstCodec::default();
14279            let path = http::uri::PathAndQuery::from_static(
14280                "/pidgr.v1.RoleService/CreateRole",
14281            );
14282            let mut req = request.into_request();
14283            req.extensions_mut()
14284                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
14285            self.inner.unary(req, path, codec).await
14286        }
14287        /** Update a role's name and/or permissions.
14288 System roles (is_system=true) cannot be updated.
14289 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14290*/
14291        pub async fn update_role(
14292            &mut self,
14293            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
14294        ) -> std::result::Result<
14295            tonic::Response<super::UpdateRoleResponse>,
14296            tonic::Status,
14297        > {
14298            self.inner
14299                .ready()
14300                .await
14301                .map_err(|e| {
14302                    tonic::Status::unknown(
14303                        format!("Service was not ready: {}", e.into()),
14304                    )
14305                })?;
14306            let codec = tonic_prost::ProstCodec::default();
14307            let path = http::uri::PathAndQuery::from_static(
14308                "/pidgr.v1.RoleService/UpdateRole",
14309            );
14310            let mut req = request.into_request();
14311            req.extensions_mut()
14312                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
14313            self.inner.unary(req, path, codec).await
14314        }
14315        /** Delete a role. Fails if any users are assigned to it.
14316 System roles (is_system=true) cannot be deleted.
14317 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14318*/
14319        pub async fn delete_role(
14320            &mut self,
14321            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
14322        ) -> std::result::Result<
14323            tonic::Response<super::DeleteRoleResponse>,
14324            tonic::Status,
14325        > {
14326            self.inner
14327                .ready()
14328                .await
14329                .map_err(|e| {
14330                    tonic::Status::unknown(
14331                        format!("Service was not ready: {}", e.into()),
14332                    )
14333                })?;
14334            let codec = tonic_prost::ProstCodec::default();
14335            let path = http::uri::PathAndQuery::from_static(
14336                "/pidgr.v1.RoleService/DeleteRole",
14337            );
14338            let mut req = request.into_request();
14339            req.extensions_mut()
14340                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
14341            self.inner.unary(req, path, codec).await
14342        }
14343    }
14344}
14345/// Generated server implementations.
14346pub mod role_service_server {
14347    #![allow(
14348        unused_variables,
14349        dead_code,
14350        missing_docs,
14351        clippy::wildcard_imports,
14352        clippy::let_unit_value,
14353    )]
14354    use tonic::codegen::*;
14355    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
14356    #[async_trait]
14357    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
14358        /** List all roles in the organization with their permission sets.
14359 Authorization: Requires PERMISSION_ORG_READ.
14360*/
14361        async fn list_roles(
14362            &self,
14363            request: tonic::Request<super::ListRolesRequest>,
14364        ) -> std::result::Result<
14365            tonic::Response<super::ListRolesResponse>,
14366            tonic::Status,
14367        >;
14368        /** Create a new custom role with a name and initial permissions.
14369 Slug is auto-generated from the name and immutable after creation.
14370 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14371*/
14372        async fn create_role(
14373            &self,
14374            request: tonic::Request<super::CreateRoleRequest>,
14375        ) -> std::result::Result<
14376            tonic::Response<super::CreateRoleResponse>,
14377            tonic::Status,
14378        >;
14379        /** Update a role's name and/or permissions.
14380 System roles (is_system=true) cannot be updated.
14381 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14382*/
14383        async fn update_role(
14384            &self,
14385            request: tonic::Request<super::UpdateRoleRequest>,
14386        ) -> std::result::Result<
14387            tonic::Response<super::UpdateRoleResponse>,
14388            tonic::Status,
14389        >;
14390        /** Delete a role. Fails if any users are assigned to it.
14391 System roles (is_system=true) cannot be deleted.
14392 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14393*/
14394        async fn delete_role(
14395            &self,
14396            request: tonic::Request<super::DeleteRoleRequest>,
14397        ) -> std::result::Result<
14398            tonic::Response<super::DeleteRoleResponse>,
14399            tonic::Status,
14400        >;
14401    }
14402    /** Manages roles and their permissions within an organization.
14403 All RPCs operate within the caller's org (extracted from JWT).
14404*/
14405    #[derive(Debug)]
14406    pub struct RoleServiceServer<T> {
14407        inner: Arc<T>,
14408        accept_compression_encodings: EnabledCompressionEncodings,
14409        send_compression_encodings: EnabledCompressionEncodings,
14410        max_decoding_message_size: Option<usize>,
14411        max_encoding_message_size: Option<usize>,
14412    }
14413    impl<T> RoleServiceServer<T> {
14414        pub fn new(inner: T) -> Self {
14415            Self::from_arc(Arc::new(inner))
14416        }
14417        pub fn from_arc(inner: Arc<T>) -> Self {
14418            Self {
14419                inner,
14420                accept_compression_encodings: Default::default(),
14421                send_compression_encodings: Default::default(),
14422                max_decoding_message_size: None,
14423                max_encoding_message_size: None,
14424            }
14425        }
14426        pub fn with_interceptor<F>(
14427            inner: T,
14428            interceptor: F,
14429        ) -> InterceptedService<Self, F>
14430        where
14431            F: tonic::service::Interceptor,
14432        {
14433            InterceptedService::new(Self::new(inner), interceptor)
14434        }
14435        /// Enable decompressing requests with the given encoding.
14436        #[must_use]
14437        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14438            self.accept_compression_encodings.enable(encoding);
14439            self
14440        }
14441        /// Compress responses with the given encoding, if the client supports it.
14442        #[must_use]
14443        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14444            self.send_compression_encodings.enable(encoding);
14445            self
14446        }
14447        /// Limits the maximum size of a decoded message.
14448        ///
14449        /// Default: `4MB`
14450        #[must_use]
14451        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14452            self.max_decoding_message_size = Some(limit);
14453            self
14454        }
14455        /// Limits the maximum size of an encoded message.
14456        ///
14457        /// Default: `usize::MAX`
14458        #[must_use]
14459        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14460            self.max_encoding_message_size = Some(limit);
14461            self
14462        }
14463    }
14464    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
14465    where
14466        T: RoleService,
14467        B: Body + std::marker::Send + 'static,
14468        B::Error: Into<StdError> + std::marker::Send + 'static,
14469    {
14470        type Response = http::Response<tonic::body::Body>;
14471        type Error = std::convert::Infallible;
14472        type Future = BoxFuture<Self::Response, Self::Error>;
14473        fn poll_ready(
14474            &mut self,
14475            _cx: &mut Context<'_>,
14476        ) -> Poll<std::result::Result<(), Self::Error>> {
14477            Poll::Ready(Ok(()))
14478        }
14479        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14480            match req.uri().path() {
14481                "/pidgr.v1.RoleService/ListRoles" => {
14482                    #[allow(non_camel_case_types)]
14483                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
14484                    impl<
14485                        T: RoleService,
14486                    > tonic::server::UnaryService<super::ListRolesRequest>
14487                    for ListRolesSvc<T> {
14488                        type Response = super::ListRolesResponse;
14489                        type Future = BoxFuture<
14490                            tonic::Response<Self::Response>,
14491                            tonic::Status,
14492                        >;
14493                        fn call(
14494                            &mut self,
14495                            request: tonic::Request<super::ListRolesRequest>,
14496                        ) -> Self::Future {
14497                            let inner = Arc::clone(&self.0);
14498                            let fut = async move {
14499                                <T as RoleService>::list_roles(&inner, request).await
14500                            };
14501                            Box::pin(fut)
14502                        }
14503                    }
14504                    let accept_compression_encodings = self.accept_compression_encodings;
14505                    let send_compression_encodings = self.send_compression_encodings;
14506                    let max_decoding_message_size = self.max_decoding_message_size;
14507                    let max_encoding_message_size = self.max_encoding_message_size;
14508                    let inner = self.inner.clone();
14509                    let fut = async move {
14510                        let method = ListRolesSvc(inner);
14511                        let codec = tonic_prost::ProstCodec::default();
14512                        let mut grpc = tonic::server::Grpc::new(codec)
14513                            .apply_compression_config(
14514                                accept_compression_encodings,
14515                                send_compression_encodings,
14516                            )
14517                            .apply_max_message_size_config(
14518                                max_decoding_message_size,
14519                                max_encoding_message_size,
14520                            );
14521                        let res = grpc.unary(method, req).await;
14522                        Ok(res)
14523                    };
14524                    Box::pin(fut)
14525                }
14526                "/pidgr.v1.RoleService/CreateRole" => {
14527                    #[allow(non_camel_case_types)]
14528                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
14529                    impl<
14530                        T: RoleService,
14531                    > tonic::server::UnaryService<super::CreateRoleRequest>
14532                    for CreateRoleSvc<T> {
14533                        type Response = super::CreateRoleResponse;
14534                        type Future = BoxFuture<
14535                            tonic::Response<Self::Response>,
14536                            tonic::Status,
14537                        >;
14538                        fn call(
14539                            &mut self,
14540                            request: tonic::Request<super::CreateRoleRequest>,
14541                        ) -> Self::Future {
14542                            let inner = Arc::clone(&self.0);
14543                            let fut = async move {
14544                                <T as RoleService>::create_role(&inner, request).await
14545                            };
14546                            Box::pin(fut)
14547                        }
14548                    }
14549                    let accept_compression_encodings = self.accept_compression_encodings;
14550                    let send_compression_encodings = self.send_compression_encodings;
14551                    let max_decoding_message_size = self.max_decoding_message_size;
14552                    let max_encoding_message_size = self.max_encoding_message_size;
14553                    let inner = self.inner.clone();
14554                    let fut = async move {
14555                        let method = CreateRoleSvc(inner);
14556                        let codec = tonic_prost::ProstCodec::default();
14557                        let mut grpc = tonic::server::Grpc::new(codec)
14558                            .apply_compression_config(
14559                                accept_compression_encodings,
14560                                send_compression_encodings,
14561                            )
14562                            .apply_max_message_size_config(
14563                                max_decoding_message_size,
14564                                max_encoding_message_size,
14565                            );
14566                        let res = grpc.unary(method, req).await;
14567                        Ok(res)
14568                    };
14569                    Box::pin(fut)
14570                }
14571                "/pidgr.v1.RoleService/UpdateRole" => {
14572                    #[allow(non_camel_case_types)]
14573                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
14574                    impl<
14575                        T: RoleService,
14576                    > tonic::server::UnaryService<super::UpdateRoleRequest>
14577                    for UpdateRoleSvc<T> {
14578                        type Response = super::UpdateRoleResponse;
14579                        type Future = BoxFuture<
14580                            tonic::Response<Self::Response>,
14581                            tonic::Status,
14582                        >;
14583                        fn call(
14584                            &mut self,
14585                            request: tonic::Request<super::UpdateRoleRequest>,
14586                        ) -> Self::Future {
14587                            let inner = Arc::clone(&self.0);
14588                            let fut = async move {
14589                                <T as RoleService>::update_role(&inner, request).await
14590                            };
14591                            Box::pin(fut)
14592                        }
14593                    }
14594                    let accept_compression_encodings = self.accept_compression_encodings;
14595                    let send_compression_encodings = self.send_compression_encodings;
14596                    let max_decoding_message_size = self.max_decoding_message_size;
14597                    let max_encoding_message_size = self.max_encoding_message_size;
14598                    let inner = self.inner.clone();
14599                    let fut = async move {
14600                        let method = UpdateRoleSvc(inner);
14601                        let codec = tonic_prost::ProstCodec::default();
14602                        let mut grpc = tonic::server::Grpc::new(codec)
14603                            .apply_compression_config(
14604                                accept_compression_encodings,
14605                                send_compression_encodings,
14606                            )
14607                            .apply_max_message_size_config(
14608                                max_decoding_message_size,
14609                                max_encoding_message_size,
14610                            );
14611                        let res = grpc.unary(method, req).await;
14612                        Ok(res)
14613                    };
14614                    Box::pin(fut)
14615                }
14616                "/pidgr.v1.RoleService/DeleteRole" => {
14617                    #[allow(non_camel_case_types)]
14618                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
14619                    impl<
14620                        T: RoleService,
14621                    > tonic::server::UnaryService<super::DeleteRoleRequest>
14622                    for DeleteRoleSvc<T> {
14623                        type Response = super::DeleteRoleResponse;
14624                        type Future = BoxFuture<
14625                            tonic::Response<Self::Response>,
14626                            tonic::Status,
14627                        >;
14628                        fn call(
14629                            &mut self,
14630                            request: tonic::Request<super::DeleteRoleRequest>,
14631                        ) -> Self::Future {
14632                            let inner = Arc::clone(&self.0);
14633                            let fut = async move {
14634                                <T as RoleService>::delete_role(&inner, request).await
14635                            };
14636                            Box::pin(fut)
14637                        }
14638                    }
14639                    let accept_compression_encodings = self.accept_compression_encodings;
14640                    let send_compression_encodings = self.send_compression_encodings;
14641                    let max_decoding_message_size = self.max_decoding_message_size;
14642                    let max_encoding_message_size = self.max_encoding_message_size;
14643                    let inner = self.inner.clone();
14644                    let fut = async move {
14645                        let method = DeleteRoleSvc(inner);
14646                        let codec = tonic_prost::ProstCodec::default();
14647                        let mut grpc = tonic::server::Grpc::new(codec)
14648                            .apply_compression_config(
14649                                accept_compression_encodings,
14650                                send_compression_encodings,
14651                            )
14652                            .apply_max_message_size_config(
14653                                max_decoding_message_size,
14654                                max_encoding_message_size,
14655                            );
14656                        let res = grpc.unary(method, req).await;
14657                        Ok(res)
14658                    };
14659                    Box::pin(fut)
14660                }
14661                _ => {
14662                    Box::pin(async move {
14663                        let mut response = http::Response::new(
14664                            tonic::body::Body::default(),
14665                        );
14666                        let headers = response.headers_mut();
14667                        headers
14668                            .insert(
14669                                tonic::Status::GRPC_STATUS,
14670                                (tonic::Code::Unimplemented as i32).into(),
14671                            );
14672                        headers
14673                            .insert(
14674                                http::header::CONTENT_TYPE,
14675                                tonic::metadata::GRPC_CONTENT_TYPE,
14676                            );
14677                        Ok(response)
14678                    })
14679                }
14680            }
14681        }
14682    }
14683    impl<T> Clone for RoleServiceServer<T> {
14684        fn clone(&self) -> Self {
14685            let inner = self.inner.clone();
14686            Self {
14687                inner,
14688                accept_compression_encodings: self.accept_compression_encodings,
14689                send_compression_encodings: self.send_compression_encodings,
14690                max_decoding_message_size: self.max_decoding_message_size,
14691                max_encoding_message_size: self.max_encoding_message_size,
14692            }
14693        }
14694    }
14695    /// Generated gRPC service name
14696    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
14697    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
14698        const NAME: &'static str = SERVICE_NAME;
14699    }
14700}
14701/// Generated client implementations.
14702pub mod sso_service_client {
14703    #![allow(
14704        unused_variables,
14705        dead_code,
14706        missing_docs,
14707        clippy::wildcard_imports,
14708        clippy::let_unit_value,
14709    )]
14710    use tonic::codegen::*;
14711    use tonic::codegen::http::Uri;
14712    /** Manages SSO identity provider configuration for organizations.
14713*/
14714    #[derive(Debug, Clone)]
14715    pub struct SsoServiceClient<T> {
14716        inner: tonic::client::Grpc<T>,
14717    }
14718    impl SsoServiceClient<tonic::transport::Channel> {
14719        /// Attempt to create a new client by connecting to a given endpoint.
14720        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14721        where
14722            D: TryInto<tonic::transport::Endpoint>,
14723            D::Error: Into<StdError>,
14724        {
14725            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14726            Ok(Self::new(conn))
14727        }
14728    }
14729    impl<T> SsoServiceClient<T>
14730    where
14731        T: tonic::client::GrpcService<tonic::body::Body>,
14732        T::Error: Into<StdError>,
14733        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14734        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14735    {
14736        pub fn new(inner: T) -> Self {
14737            let inner = tonic::client::Grpc::new(inner);
14738            Self { inner }
14739        }
14740        pub fn with_origin(inner: T, origin: Uri) -> Self {
14741            let inner = tonic::client::Grpc::with_origin(inner, origin);
14742            Self { inner }
14743        }
14744        pub fn with_interceptor<F>(
14745            inner: T,
14746            interceptor: F,
14747        ) -> SsoServiceClient<InterceptedService<T, F>>
14748        where
14749            F: tonic::service::Interceptor,
14750            T::ResponseBody: Default,
14751            T: tonic::codegen::Service<
14752                http::Request<tonic::body::Body>,
14753                Response = http::Response<
14754                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14755                >,
14756            >,
14757            <T as tonic::codegen::Service<
14758                http::Request<tonic::body::Body>,
14759            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14760        {
14761            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14762        }
14763        /// Compress requests with the given encoding.
14764        ///
14765        /// This requires the server to support it otherwise it might respond with an
14766        /// error.
14767        #[must_use]
14768        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14769            self.inner = self.inner.send_compressed(encoding);
14770            self
14771        }
14772        /// Enable decompressing responses.
14773        #[must_use]
14774        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14775            self.inner = self.inner.accept_compressed(encoding);
14776            self
14777        }
14778        /// Limits the maximum size of a decoded message.
14779        ///
14780        /// Default: `4MB`
14781        #[must_use]
14782        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14783            self.inner = self.inner.max_decoding_message_size(limit);
14784            self
14785        }
14786        /// Limits the maximum size of an encoded message.
14787        ///
14788        /// Default: `usize::MAX`
14789        #[must_use]
14790        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14791            self.inner = self.inner.max_encoding_message_size(limit);
14792            self
14793        }
14794        /** Check if an email domain has SSO configured.
14795 This is a pre-authentication endpoint — no JWT required.
14796 Authorization: None (public).
14797*/
14798        pub async fn check_sso_by_domain(
14799            &mut self,
14800            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14801        ) -> std::result::Result<
14802            tonic::Response<super::CheckSsoByDomainResponse>,
14803            tonic::Status,
14804        > {
14805            self.inner
14806                .ready()
14807                .await
14808                .map_err(|e| {
14809                    tonic::Status::unknown(
14810                        format!("Service was not ready: {}", e.into()),
14811                    )
14812                })?;
14813            let codec = tonic_prost::ProstCodec::default();
14814            let path = http::uri::PathAndQuery::from_static(
14815                "/pidgr.v1.SSOService/CheckSSOByDomain",
14816            );
14817            let mut req = request.into_request();
14818            req.extensions_mut()
14819                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14820            self.inner.unary(req, path, codec).await
14821        }
14822        /** Create an SSO provider for the organization.
14823 Validates the metadata URL before saving.
14824 Creates the corresponding identity provider in the auth service.
14825 Authorization: Requires PERMISSION_ORG_WRITE.
14826*/
14827        pub async fn create_sso_provider(
14828            &mut self,
14829            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14830        ) -> std::result::Result<
14831            tonic::Response<super::CreateSsoProviderResponse>,
14832            tonic::Status,
14833        > {
14834            self.inner
14835                .ready()
14836                .await
14837                .map_err(|e| {
14838                    tonic::Status::unknown(
14839                        format!("Service was not ready: {}", e.into()),
14840                    )
14841                })?;
14842            let codec = tonic_prost::ProstCodec::default();
14843            let path = http::uri::PathAndQuery::from_static(
14844                "/pidgr.v1.SSOService/CreateSSOProvider",
14845            );
14846            let mut req = request.into_request();
14847            req.extensions_mut()
14848                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14849            self.inner.unary(req, path, codec).await
14850        }
14851        /** Get the organization's SSO provider configuration.
14852 Authorization: Requires PERMISSION_ORG_READ.
14853*/
14854        pub async fn get_sso_provider(
14855            &mut self,
14856            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14857        ) -> std::result::Result<
14858            tonic::Response<super::GetSsoProviderResponse>,
14859            tonic::Status,
14860        > {
14861            self.inner
14862                .ready()
14863                .await
14864                .map_err(|e| {
14865                    tonic::Status::unknown(
14866                        format!("Service was not ready: {}", e.into()),
14867                    )
14868                })?;
14869            let codec = tonic_prost::ProstCodec::default();
14870            let path = http::uri::PathAndQuery::from_static(
14871                "/pidgr.v1.SSOService/GetSSOProvider",
14872            );
14873            let mut req = request.into_request();
14874            req.extensions_mut()
14875                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14876            self.inner.unary(req, path, codec).await
14877        }
14878        /** Delete the organization's SSO provider.
14879 Deletes the corresponding identity provider from the auth service.
14880 Users with that domain fall back to passkey/OTP.
14881 Authorization: Requires PERMISSION_ORG_WRITE.
14882*/
14883        pub async fn delete_sso_provider(
14884            &mut self,
14885            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14886        ) -> std::result::Result<
14887            tonic::Response<super::DeleteSsoProviderResponse>,
14888            tonic::Status,
14889        > {
14890            self.inner
14891                .ready()
14892                .await
14893                .map_err(|e| {
14894                    tonic::Status::unknown(
14895                        format!("Service was not ready: {}", e.into()),
14896                    )
14897                })?;
14898            let codec = tonic_prost::ProstCodec::default();
14899            let path = http::uri::PathAndQuery::from_static(
14900                "/pidgr.v1.SSOService/DeleteSSOProvider",
14901            );
14902            let mut req = request.into_request();
14903            req.extensions_mut()
14904                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14905            self.inner.unary(req, path, codec).await
14906        }
14907    }
14908}
14909/// Generated server implementations.
14910pub mod sso_service_server {
14911    #![allow(
14912        unused_variables,
14913        dead_code,
14914        missing_docs,
14915        clippy::wildcard_imports,
14916        clippy::let_unit_value,
14917    )]
14918    use tonic::codegen::*;
14919    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
14920    #[async_trait]
14921    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14922        /** Check if an email domain has SSO configured.
14923 This is a pre-authentication endpoint — no JWT required.
14924 Authorization: None (public).
14925*/
14926        async fn check_sso_by_domain(
14927            &self,
14928            request: tonic::Request<super::CheckSsoByDomainRequest>,
14929        ) -> std::result::Result<
14930            tonic::Response<super::CheckSsoByDomainResponse>,
14931            tonic::Status,
14932        >;
14933        /** Create an SSO provider for the organization.
14934 Validates the metadata URL before saving.
14935 Creates the corresponding identity provider in the auth service.
14936 Authorization: Requires PERMISSION_ORG_WRITE.
14937*/
14938        async fn create_sso_provider(
14939            &self,
14940            request: tonic::Request<super::CreateSsoProviderRequest>,
14941        ) -> std::result::Result<
14942            tonic::Response<super::CreateSsoProviderResponse>,
14943            tonic::Status,
14944        >;
14945        /** Get the organization's SSO provider configuration.
14946 Authorization: Requires PERMISSION_ORG_READ.
14947*/
14948        async fn get_sso_provider(
14949            &self,
14950            request: tonic::Request<super::GetSsoProviderRequest>,
14951        ) -> std::result::Result<
14952            tonic::Response<super::GetSsoProviderResponse>,
14953            tonic::Status,
14954        >;
14955        /** Delete the organization's SSO provider.
14956 Deletes the corresponding identity provider from the auth service.
14957 Users with that domain fall back to passkey/OTP.
14958 Authorization: Requires PERMISSION_ORG_WRITE.
14959*/
14960        async fn delete_sso_provider(
14961            &self,
14962            request: tonic::Request<super::DeleteSsoProviderRequest>,
14963        ) -> std::result::Result<
14964            tonic::Response<super::DeleteSsoProviderResponse>,
14965            tonic::Status,
14966        >;
14967    }
14968    /** Manages SSO identity provider configuration for organizations.
14969*/
14970    #[derive(Debug)]
14971    pub struct SsoServiceServer<T> {
14972        inner: Arc<T>,
14973        accept_compression_encodings: EnabledCompressionEncodings,
14974        send_compression_encodings: EnabledCompressionEncodings,
14975        max_decoding_message_size: Option<usize>,
14976        max_encoding_message_size: Option<usize>,
14977    }
14978    impl<T> SsoServiceServer<T> {
14979        pub fn new(inner: T) -> Self {
14980            Self::from_arc(Arc::new(inner))
14981        }
14982        pub fn from_arc(inner: Arc<T>) -> Self {
14983            Self {
14984                inner,
14985                accept_compression_encodings: Default::default(),
14986                send_compression_encodings: Default::default(),
14987                max_decoding_message_size: None,
14988                max_encoding_message_size: None,
14989            }
14990        }
14991        pub fn with_interceptor<F>(
14992            inner: T,
14993            interceptor: F,
14994        ) -> InterceptedService<Self, F>
14995        where
14996            F: tonic::service::Interceptor,
14997        {
14998            InterceptedService::new(Self::new(inner), interceptor)
14999        }
15000        /// Enable decompressing requests with the given encoding.
15001        #[must_use]
15002        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15003            self.accept_compression_encodings.enable(encoding);
15004            self
15005        }
15006        /// Compress responses with the given encoding, if the client supports it.
15007        #[must_use]
15008        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15009            self.send_compression_encodings.enable(encoding);
15010            self
15011        }
15012        /// Limits the maximum size of a decoded message.
15013        ///
15014        /// Default: `4MB`
15015        #[must_use]
15016        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15017            self.max_decoding_message_size = Some(limit);
15018            self
15019        }
15020        /// Limits the maximum size of an encoded message.
15021        ///
15022        /// Default: `usize::MAX`
15023        #[must_use]
15024        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15025            self.max_encoding_message_size = Some(limit);
15026            self
15027        }
15028    }
15029    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
15030    where
15031        T: SsoService,
15032        B: Body + std::marker::Send + 'static,
15033        B::Error: Into<StdError> + std::marker::Send + 'static,
15034    {
15035        type Response = http::Response<tonic::body::Body>;
15036        type Error = std::convert::Infallible;
15037        type Future = BoxFuture<Self::Response, Self::Error>;
15038        fn poll_ready(
15039            &mut self,
15040            _cx: &mut Context<'_>,
15041        ) -> Poll<std::result::Result<(), Self::Error>> {
15042            Poll::Ready(Ok(()))
15043        }
15044        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15045            match req.uri().path() {
15046                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
15047                    #[allow(non_camel_case_types)]
15048                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
15049                    impl<
15050                        T: SsoService,
15051                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
15052                    for CheckSSOByDomainSvc<T> {
15053                        type Response = super::CheckSsoByDomainResponse;
15054                        type Future = BoxFuture<
15055                            tonic::Response<Self::Response>,
15056                            tonic::Status,
15057                        >;
15058                        fn call(
15059                            &mut self,
15060                            request: tonic::Request<super::CheckSsoByDomainRequest>,
15061                        ) -> Self::Future {
15062                            let inner = Arc::clone(&self.0);
15063                            let fut = async move {
15064                                <T as SsoService>::check_sso_by_domain(&inner, request)
15065                                    .await
15066                            };
15067                            Box::pin(fut)
15068                        }
15069                    }
15070                    let accept_compression_encodings = self.accept_compression_encodings;
15071                    let send_compression_encodings = self.send_compression_encodings;
15072                    let max_decoding_message_size = self.max_decoding_message_size;
15073                    let max_encoding_message_size = self.max_encoding_message_size;
15074                    let inner = self.inner.clone();
15075                    let fut = async move {
15076                        let method = CheckSSOByDomainSvc(inner);
15077                        let codec = tonic_prost::ProstCodec::default();
15078                        let mut grpc = tonic::server::Grpc::new(codec)
15079                            .apply_compression_config(
15080                                accept_compression_encodings,
15081                                send_compression_encodings,
15082                            )
15083                            .apply_max_message_size_config(
15084                                max_decoding_message_size,
15085                                max_encoding_message_size,
15086                            );
15087                        let res = grpc.unary(method, req).await;
15088                        Ok(res)
15089                    };
15090                    Box::pin(fut)
15091                }
15092                "/pidgr.v1.SSOService/CreateSSOProvider" => {
15093                    #[allow(non_camel_case_types)]
15094                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
15095                    impl<
15096                        T: SsoService,
15097                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
15098                    for CreateSSOProviderSvc<T> {
15099                        type Response = super::CreateSsoProviderResponse;
15100                        type Future = BoxFuture<
15101                            tonic::Response<Self::Response>,
15102                            tonic::Status,
15103                        >;
15104                        fn call(
15105                            &mut self,
15106                            request: tonic::Request<super::CreateSsoProviderRequest>,
15107                        ) -> Self::Future {
15108                            let inner = Arc::clone(&self.0);
15109                            let fut = async move {
15110                                <T as SsoService>::create_sso_provider(&inner, request)
15111                                    .await
15112                            };
15113                            Box::pin(fut)
15114                        }
15115                    }
15116                    let accept_compression_encodings = self.accept_compression_encodings;
15117                    let send_compression_encodings = self.send_compression_encodings;
15118                    let max_decoding_message_size = self.max_decoding_message_size;
15119                    let max_encoding_message_size = self.max_encoding_message_size;
15120                    let inner = self.inner.clone();
15121                    let fut = async move {
15122                        let method = CreateSSOProviderSvc(inner);
15123                        let codec = tonic_prost::ProstCodec::default();
15124                        let mut grpc = tonic::server::Grpc::new(codec)
15125                            .apply_compression_config(
15126                                accept_compression_encodings,
15127                                send_compression_encodings,
15128                            )
15129                            .apply_max_message_size_config(
15130                                max_decoding_message_size,
15131                                max_encoding_message_size,
15132                            );
15133                        let res = grpc.unary(method, req).await;
15134                        Ok(res)
15135                    };
15136                    Box::pin(fut)
15137                }
15138                "/pidgr.v1.SSOService/GetSSOProvider" => {
15139                    #[allow(non_camel_case_types)]
15140                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
15141                    impl<
15142                        T: SsoService,
15143                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
15144                    for GetSSOProviderSvc<T> {
15145                        type Response = super::GetSsoProviderResponse;
15146                        type Future = BoxFuture<
15147                            tonic::Response<Self::Response>,
15148                            tonic::Status,
15149                        >;
15150                        fn call(
15151                            &mut self,
15152                            request: tonic::Request<super::GetSsoProviderRequest>,
15153                        ) -> Self::Future {
15154                            let inner = Arc::clone(&self.0);
15155                            let fut = async move {
15156                                <T as SsoService>::get_sso_provider(&inner, request).await
15157                            };
15158                            Box::pin(fut)
15159                        }
15160                    }
15161                    let accept_compression_encodings = self.accept_compression_encodings;
15162                    let send_compression_encodings = self.send_compression_encodings;
15163                    let max_decoding_message_size = self.max_decoding_message_size;
15164                    let max_encoding_message_size = self.max_encoding_message_size;
15165                    let inner = self.inner.clone();
15166                    let fut = async move {
15167                        let method = GetSSOProviderSvc(inner);
15168                        let codec = tonic_prost::ProstCodec::default();
15169                        let mut grpc = tonic::server::Grpc::new(codec)
15170                            .apply_compression_config(
15171                                accept_compression_encodings,
15172                                send_compression_encodings,
15173                            )
15174                            .apply_max_message_size_config(
15175                                max_decoding_message_size,
15176                                max_encoding_message_size,
15177                            );
15178                        let res = grpc.unary(method, req).await;
15179                        Ok(res)
15180                    };
15181                    Box::pin(fut)
15182                }
15183                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
15184                    #[allow(non_camel_case_types)]
15185                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
15186                    impl<
15187                        T: SsoService,
15188                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
15189                    for DeleteSSOProviderSvc<T> {
15190                        type Response = super::DeleteSsoProviderResponse;
15191                        type Future = BoxFuture<
15192                            tonic::Response<Self::Response>,
15193                            tonic::Status,
15194                        >;
15195                        fn call(
15196                            &mut self,
15197                            request: tonic::Request<super::DeleteSsoProviderRequest>,
15198                        ) -> Self::Future {
15199                            let inner = Arc::clone(&self.0);
15200                            let fut = async move {
15201                                <T as SsoService>::delete_sso_provider(&inner, request)
15202                                    .await
15203                            };
15204                            Box::pin(fut)
15205                        }
15206                    }
15207                    let accept_compression_encodings = self.accept_compression_encodings;
15208                    let send_compression_encodings = self.send_compression_encodings;
15209                    let max_decoding_message_size = self.max_decoding_message_size;
15210                    let max_encoding_message_size = self.max_encoding_message_size;
15211                    let inner = self.inner.clone();
15212                    let fut = async move {
15213                        let method = DeleteSSOProviderSvc(inner);
15214                        let codec = tonic_prost::ProstCodec::default();
15215                        let mut grpc = tonic::server::Grpc::new(codec)
15216                            .apply_compression_config(
15217                                accept_compression_encodings,
15218                                send_compression_encodings,
15219                            )
15220                            .apply_max_message_size_config(
15221                                max_decoding_message_size,
15222                                max_encoding_message_size,
15223                            );
15224                        let res = grpc.unary(method, req).await;
15225                        Ok(res)
15226                    };
15227                    Box::pin(fut)
15228                }
15229                _ => {
15230                    Box::pin(async move {
15231                        let mut response = http::Response::new(
15232                            tonic::body::Body::default(),
15233                        );
15234                        let headers = response.headers_mut();
15235                        headers
15236                            .insert(
15237                                tonic::Status::GRPC_STATUS,
15238                                (tonic::Code::Unimplemented as i32).into(),
15239                            );
15240                        headers
15241                            .insert(
15242                                http::header::CONTENT_TYPE,
15243                                tonic::metadata::GRPC_CONTENT_TYPE,
15244                            );
15245                        Ok(response)
15246                    })
15247                }
15248            }
15249        }
15250    }
15251    impl<T> Clone for SsoServiceServer<T> {
15252        fn clone(&self) -> Self {
15253            let inner = self.inner.clone();
15254            Self {
15255                inner,
15256                accept_compression_encodings: self.accept_compression_encodings,
15257                send_compression_encodings: self.send_compression_encodings,
15258                max_decoding_message_size: self.max_decoding_message_size,
15259                max_encoding_message_size: self.max_encoding_message_size,
15260            }
15261        }
15262    }
15263    /// Generated gRPC service name
15264    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
15265    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
15266        const NAME: &'static str = SERVICE_NAME;
15267    }
15268}
15269/// Generated client implementations.
15270pub mod team_service_client {
15271    #![allow(
15272        unused_variables,
15273        dead_code,
15274        missing_docs,
15275        clippy::wildcard_imports,
15276        clippy::let_unit_value,
15277    )]
15278    use tonic::codegen::*;
15279    use tonic::codegen::http::Uri;
15280    /** Manages organizational teams (departments, divisions) within an organization.
15281 Teams represent the organizational structure and can serve as sender identity.
15282 All RPCs operate within the caller's org (extracted from JWT).
15283*/
15284    #[derive(Debug, Clone)]
15285    pub struct TeamServiceClient<T> {
15286        inner: tonic::client::Grpc<T>,
15287    }
15288    impl TeamServiceClient<tonic::transport::Channel> {
15289        /// Attempt to create a new client by connecting to a given endpoint.
15290        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15291        where
15292            D: TryInto<tonic::transport::Endpoint>,
15293            D::Error: Into<StdError>,
15294        {
15295            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15296            Ok(Self::new(conn))
15297        }
15298    }
15299    impl<T> TeamServiceClient<T>
15300    where
15301        T: tonic::client::GrpcService<tonic::body::Body>,
15302        T::Error: Into<StdError>,
15303        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15304        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15305    {
15306        pub fn new(inner: T) -> Self {
15307            let inner = tonic::client::Grpc::new(inner);
15308            Self { inner }
15309        }
15310        pub fn with_origin(inner: T, origin: Uri) -> Self {
15311            let inner = tonic::client::Grpc::with_origin(inner, origin);
15312            Self { inner }
15313        }
15314        pub fn with_interceptor<F>(
15315            inner: T,
15316            interceptor: F,
15317        ) -> TeamServiceClient<InterceptedService<T, F>>
15318        where
15319            F: tonic::service::Interceptor,
15320            T::ResponseBody: Default,
15321            T: tonic::codegen::Service<
15322                http::Request<tonic::body::Body>,
15323                Response = http::Response<
15324                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15325                >,
15326            >,
15327            <T as tonic::codegen::Service<
15328                http::Request<tonic::body::Body>,
15329            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15330        {
15331            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
15332        }
15333        /// Compress requests with the given encoding.
15334        ///
15335        /// This requires the server to support it otherwise it might respond with an
15336        /// error.
15337        #[must_use]
15338        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15339            self.inner = self.inner.send_compressed(encoding);
15340            self
15341        }
15342        /// Enable decompressing responses.
15343        #[must_use]
15344        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15345            self.inner = self.inner.accept_compressed(encoding);
15346            self
15347        }
15348        /// Limits the maximum size of a decoded message.
15349        ///
15350        /// Default: `4MB`
15351        #[must_use]
15352        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15353            self.inner = self.inner.max_decoding_message_size(limit);
15354            self
15355        }
15356        /// Limits the maximum size of an encoded message.
15357        ///
15358        /// Default: `usize::MAX`
15359        #[must_use]
15360        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15361            self.inner = self.inner.max_encoding_message_size(limit);
15362            self
15363        }
15364        /** Create a new team in the organization.
15365 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15366*/
15367        pub async fn create_team(
15368            &mut self,
15369            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
15370        ) -> std::result::Result<
15371            tonic::Response<super::CreateTeamResponse>,
15372            tonic::Status,
15373        > {
15374            self.inner
15375                .ready()
15376                .await
15377                .map_err(|e| {
15378                    tonic::Status::unknown(
15379                        format!("Service was not ready: {}", e.into()),
15380                    )
15381                })?;
15382            let codec = tonic_prost::ProstCodec::default();
15383            let path = http::uri::PathAndQuery::from_static(
15384                "/pidgr.v1.TeamService/CreateTeam",
15385            );
15386            let mut req = request.into_request();
15387            req.extensions_mut()
15388                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
15389            self.inner.unary(req, path, codec).await
15390        }
15391        /** Retrieve a team by ID.
15392 Authorization: Caller must be a member of the team, or have
15393 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15394*/
15395        pub async fn get_team(
15396            &mut self,
15397            request: impl tonic::IntoRequest<super::GetTeamRequest>,
15398        ) -> std::result::Result<
15399            tonic::Response<super::GetTeamResponse>,
15400            tonic::Status,
15401        > {
15402            self.inner
15403                .ready()
15404                .await
15405                .map_err(|e| {
15406                    tonic::Status::unknown(
15407                        format!("Service was not ready: {}", e.into()),
15408                    )
15409                })?;
15410            let codec = tonic_prost::ProstCodec::default();
15411            let path = http::uri::PathAndQuery::from_static(
15412                "/pidgr.v1.TeamService/GetTeam",
15413            );
15414            let mut req = request.into_request();
15415            req.extensions_mut()
15416                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
15417            self.inner.unary(req, path, codec).await
15418        }
15419        /** List teams in the organization with pagination.
15420 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15421*/
15422        pub async fn list_teams(
15423            &mut self,
15424            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
15425        ) -> std::result::Result<
15426            tonic::Response<super::ListTeamsResponse>,
15427            tonic::Status,
15428        > {
15429            self.inner
15430                .ready()
15431                .await
15432                .map_err(|e| {
15433                    tonic::Status::unknown(
15434                        format!("Service was not ready: {}", e.into()),
15435                    )
15436                })?;
15437            let codec = tonic_prost::ProstCodec::default();
15438            let path = http::uri::PathAndQuery::from_static(
15439                "/pidgr.v1.TeamService/ListTeams",
15440            );
15441            let mut req = request.into_request();
15442            req.extensions_mut()
15443                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
15444            self.inner.unary(req, path, codec).await
15445        }
15446        /** Update a team's name and/or description.
15447 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15448*/
15449        pub async fn update_team(
15450            &mut self,
15451            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
15452        ) -> std::result::Result<
15453            tonic::Response<super::UpdateTeamResponse>,
15454            tonic::Status,
15455        > {
15456            self.inner
15457                .ready()
15458                .await
15459                .map_err(|e| {
15460                    tonic::Status::unknown(
15461                        format!("Service was not ready: {}", e.into()),
15462                    )
15463                })?;
15464            let codec = tonic_prost::ProstCodec::default();
15465            let path = http::uri::PathAndQuery::from_static(
15466                "/pidgr.v1.TeamService/UpdateTeam",
15467            );
15468            let mut req = request.into_request();
15469            req.extensions_mut()
15470                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
15471            self.inner.unary(req, path, codec).await
15472        }
15473        /** Delete a team and all its membership records. Default teams cannot be deleted.
15474 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15475*/
15476        pub async fn delete_team(
15477            &mut self,
15478            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
15479        ) -> std::result::Result<
15480            tonic::Response<super::DeleteTeamResponse>,
15481            tonic::Status,
15482        > {
15483            self.inner
15484                .ready()
15485                .await
15486                .map_err(|e| {
15487                    tonic::Status::unknown(
15488                        format!("Service was not ready: {}", e.into()),
15489                    )
15490                })?;
15491            let codec = tonic_prost::ProstCodec::default();
15492            let path = http::uri::PathAndQuery::from_static(
15493                "/pidgr.v1.TeamService/DeleteTeam",
15494            );
15495            let mut req = request.into_request();
15496            req.extensions_mut()
15497                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
15498            self.inner.unary(req, path, codec).await
15499        }
15500        /** Add one or more users to a team (idempotent).
15501 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15502*/
15503        pub async fn add_team_members(
15504            &mut self,
15505            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
15506        ) -> std::result::Result<
15507            tonic::Response<super::AddTeamMembersResponse>,
15508            tonic::Status,
15509        > {
15510            self.inner
15511                .ready()
15512                .await
15513                .map_err(|e| {
15514                    tonic::Status::unknown(
15515                        format!("Service was not ready: {}", e.into()),
15516                    )
15517                })?;
15518            let codec = tonic_prost::ProstCodec::default();
15519            let path = http::uri::PathAndQuery::from_static(
15520                "/pidgr.v1.TeamService/AddTeamMembers",
15521            );
15522            let mut req = request.into_request();
15523            req.extensions_mut()
15524                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
15525            self.inner.unary(req, path, codec).await
15526        }
15527        /** Remove one or more users from a team (idempotent).
15528 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15529*/
15530        pub async fn remove_team_members(
15531            &mut self,
15532            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
15533        ) -> std::result::Result<
15534            tonic::Response<super::RemoveTeamMembersResponse>,
15535            tonic::Status,
15536        > {
15537            self.inner
15538                .ready()
15539                .await
15540                .map_err(|e| {
15541                    tonic::Status::unknown(
15542                        format!("Service was not ready: {}", e.into()),
15543                    )
15544                })?;
15545            let codec = tonic_prost::ProstCodec::default();
15546            let path = http::uri::PathAndQuery::from_static(
15547                "/pidgr.v1.TeamService/RemoveTeamMembers",
15548            );
15549            let mut req = request.into_request();
15550            req.extensions_mut()
15551                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
15552            self.inner.unary(req, path, codec).await
15553        }
15554        /** List members of a team with pagination.
15555 Authorization: Caller must be a member of the team, or have
15556 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15557*/
15558        pub async fn list_team_members(
15559            &mut self,
15560            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
15561        ) -> std::result::Result<
15562            tonic::Response<super::ListTeamMembersResponse>,
15563            tonic::Status,
15564        > {
15565            self.inner
15566                .ready()
15567                .await
15568                .map_err(|e| {
15569                    tonic::Status::unknown(
15570                        format!("Service was not ready: {}", e.into()),
15571                    )
15572                })?;
15573            let codec = tonic_prost::ProstCodec::default();
15574            let path = http::uri::PathAndQuery::from_static(
15575                "/pidgr.v1.TeamService/ListTeamMembers",
15576            );
15577            let mut req = request.into_request();
15578            req.extensions_mut()
15579                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
15580            self.inner.unary(req, path, codec).await
15581        }
15582    }
15583}
15584/// Generated server implementations.
15585pub mod team_service_server {
15586    #![allow(
15587        unused_variables,
15588        dead_code,
15589        missing_docs,
15590        clippy::wildcard_imports,
15591        clippy::let_unit_value,
15592    )]
15593    use tonic::codegen::*;
15594    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
15595    #[async_trait]
15596    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
15597        /** Create a new team in the organization.
15598 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15599*/
15600        async fn create_team(
15601            &self,
15602            request: tonic::Request<super::CreateTeamRequest>,
15603        ) -> std::result::Result<
15604            tonic::Response<super::CreateTeamResponse>,
15605            tonic::Status,
15606        >;
15607        /** Retrieve a team by ID.
15608 Authorization: Caller must be a member of the team, or have
15609 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15610*/
15611        async fn get_team(
15612            &self,
15613            request: tonic::Request<super::GetTeamRequest>,
15614        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
15615        /** List teams in the organization with pagination.
15616 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15617*/
15618        async fn list_teams(
15619            &self,
15620            request: tonic::Request<super::ListTeamsRequest>,
15621        ) -> std::result::Result<
15622            tonic::Response<super::ListTeamsResponse>,
15623            tonic::Status,
15624        >;
15625        /** Update a team's name and/or description.
15626 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15627*/
15628        async fn update_team(
15629            &self,
15630            request: tonic::Request<super::UpdateTeamRequest>,
15631        ) -> std::result::Result<
15632            tonic::Response<super::UpdateTeamResponse>,
15633            tonic::Status,
15634        >;
15635        /** Delete a team and all its membership records. Default teams cannot be deleted.
15636 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15637*/
15638        async fn delete_team(
15639            &self,
15640            request: tonic::Request<super::DeleteTeamRequest>,
15641        ) -> std::result::Result<
15642            tonic::Response<super::DeleteTeamResponse>,
15643            tonic::Status,
15644        >;
15645        /** Add one or more users to a team (idempotent).
15646 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15647*/
15648        async fn add_team_members(
15649            &self,
15650            request: tonic::Request<super::AddTeamMembersRequest>,
15651        ) -> std::result::Result<
15652            tonic::Response<super::AddTeamMembersResponse>,
15653            tonic::Status,
15654        >;
15655        /** Remove one or more users from a team (idempotent).
15656 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15657*/
15658        async fn remove_team_members(
15659            &self,
15660            request: tonic::Request<super::RemoveTeamMembersRequest>,
15661        ) -> std::result::Result<
15662            tonic::Response<super::RemoveTeamMembersResponse>,
15663            tonic::Status,
15664        >;
15665        /** List members of a team with pagination.
15666 Authorization: Caller must be a member of the team, or have
15667 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15668*/
15669        async fn list_team_members(
15670            &self,
15671            request: tonic::Request<super::ListTeamMembersRequest>,
15672        ) -> std::result::Result<
15673            tonic::Response<super::ListTeamMembersResponse>,
15674            tonic::Status,
15675        >;
15676    }
15677    /** Manages organizational teams (departments, divisions) within an organization.
15678 Teams represent the organizational structure and can serve as sender identity.
15679 All RPCs operate within the caller's org (extracted from JWT).
15680*/
15681    #[derive(Debug)]
15682    pub struct TeamServiceServer<T> {
15683        inner: Arc<T>,
15684        accept_compression_encodings: EnabledCompressionEncodings,
15685        send_compression_encodings: EnabledCompressionEncodings,
15686        max_decoding_message_size: Option<usize>,
15687        max_encoding_message_size: Option<usize>,
15688    }
15689    impl<T> TeamServiceServer<T> {
15690        pub fn new(inner: T) -> Self {
15691            Self::from_arc(Arc::new(inner))
15692        }
15693        pub fn from_arc(inner: Arc<T>) -> Self {
15694            Self {
15695                inner,
15696                accept_compression_encodings: Default::default(),
15697                send_compression_encodings: Default::default(),
15698                max_decoding_message_size: None,
15699                max_encoding_message_size: None,
15700            }
15701        }
15702        pub fn with_interceptor<F>(
15703            inner: T,
15704            interceptor: F,
15705        ) -> InterceptedService<Self, F>
15706        where
15707            F: tonic::service::Interceptor,
15708        {
15709            InterceptedService::new(Self::new(inner), interceptor)
15710        }
15711        /// Enable decompressing requests with the given encoding.
15712        #[must_use]
15713        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15714            self.accept_compression_encodings.enable(encoding);
15715            self
15716        }
15717        /// Compress responses with the given encoding, if the client supports it.
15718        #[must_use]
15719        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15720            self.send_compression_encodings.enable(encoding);
15721            self
15722        }
15723        /// Limits the maximum size of a decoded message.
15724        ///
15725        /// Default: `4MB`
15726        #[must_use]
15727        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15728            self.max_decoding_message_size = Some(limit);
15729            self
15730        }
15731        /// Limits the maximum size of an encoded message.
15732        ///
15733        /// Default: `usize::MAX`
15734        #[must_use]
15735        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15736            self.max_encoding_message_size = Some(limit);
15737            self
15738        }
15739    }
15740    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15741    where
15742        T: TeamService,
15743        B: Body + std::marker::Send + 'static,
15744        B::Error: Into<StdError> + std::marker::Send + 'static,
15745    {
15746        type Response = http::Response<tonic::body::Body>;
15747        type Error = std::convert::Infallible;
15748        type Future = BoxFuture<Self::Response, Self::Error>;
15749        fn poll_ready(
15750            &mut self,
15751            _cx: &mut Context<'_>,
15752        ) -> Poll<std::result::Result<(), Self::Error>> {
15753            Poll::Ready(Ok(()))
15754        }
15755        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15756            match req.uri().path() {
15757                "/pidgr.v1.TeamService/CreateTeam" => {
15758                    #[allow(non_camel_case_types)]
15759                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15760                    impl<
15761                        T: TeamService,
15762                    > tonic::server::UnaryService<super::CreateTeamRequest>
15763                    for CreateTeamSvc<T> {
15764                        type Response = super::CreateTeamResponse;
15765                        type Future = BoxFuture<
15766                            tonic::Response<Self::Response>,
15767                            tonic::Status,
15768                        >;
15769                        fn call(
15770                            &mut self,
15771                            request: tonic::Request<super::CreateTeamRequest>,
15772                        ) -> Self::Future {
15773                            let inner = Arc::clone(&self.0);
15774                            let fut = async move {
15775                                <T as TeamService>::create_team(&inner, request).await
15776                            };
15777                            Box::pin(fut)
15778                        }
15779                    }
15780                    let accept_compression_encodings = self.accept_compression_encodings;
15781                    let send_compression_encodings = self.send_compression_encodings;
15782                    let max_decoding_message_size = self.max_decoding_message_size;
15783                    let max_encoding_message_size = self.max_encoding_message_size;
15784                    let inner = self.inner.clone();
15785                    let fut = async move {
15786                        let method = CreateTeamSvc(inner);
15787                        let codec = tonic_prost::ProstCodec::default();
15788                        let mut grpc = tonic::server::Grpc::new(codec)
15789                            .apply_compression_config(
15790                                accept_compression_encodings,
15791                                send_compression_encodings,
15792                            )
15793                            .apply_max_message_size_config(
15794                                max_decoding_message_size,
15795                                max_encoding_message_size,
15796                            );
15797                        let res = grpc.unary(method, req).await;
15798                        Ok(res)
15799                    };
15800                    Box::pin(fut)
15801                }
15802                "/pidgr.v1.TeamService/GetTeam" => {
15803                    #[allow(non_camel_case_types)]
15804                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15805                    impl<
15806                        T: TeamService,
15807                    > tonic::server::UnaryService<super::GetTeamRequest>
15808                    for GetTeamSvc<T> {
15809                        type Response = super::GetTeamResponse;
15810                        type Future = BoxFuture<
15811                            tonic::Response<Self::Response>,
15812                            tonic::Status,
15813                        >;
15814                        fn call(
15815                            &mut self,
15816                            request: tonic::Request<super::GetTeamRequest>,
15817                        ) -> Self::Future {
15818                            let inner = Arc::clone(&self.0);
15819                            let fut = async move {
15820                                <T as TeamService>::get_team(&inner, request).await
15821                            };
15822                            Box::pin(fut)
15823                        }
15824                    }
15825                    let accept_compression_encodings = self.accept_compression_encodings;
15826                    let send_compression_encodings = self.send_compression_encodings;
15827                    let max_decoding_message_size = self.max_decoding_message_size;
15828                    let max_encoding_message_size = self.max_encoding_message_size;
15829                    let inner = self.inner.clone();
15830                    let fut = async move {
15831                        let method = GetTeamSvc(inner);
15832                        let codec = tonic_prost::ProstCodec::default();
15833                        let mut grpc = tonic::server::Grpc::new(codec)
15834                            .apply_compression_config(
15835                                accept_compression_encodings,
15836                                send_compression_encodings,
15837                            )
15838                            .apply_max_message_size_config(
15839                                max_decoding_message_size,
15840                                max_encoding_message_size,
15841                            );
15842                        let res = grpc.unary(method, req).await;
15843                        Ok(res)
15844                    };
15845                    Box::pin(fut)
15846                }
15847                "/pidgr.v1.TeamService/ListTeams" => {
15848                    #[allow(non_camel_case_types)]
15849                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15850                    impl<
15851                        T: TeamService,
15852                    > tonic::server::UnaryService<super::ListTeamsRequest>
15853                    for ListTeamsSvc<T> {
15854                        type Response = super::ListTeamsResponse;
15855                        type Future = BoxFuture<
15856                            tonic::Response<Self::Response>,
15857                            tonic::Status,
15858                        >;
15859                        fn call(
15860                            &mut self,
15861                            request: tonic::Request<super::ListTeamsRequest>,
15862                        ) -> Self::Future {
15863                            let inner = Arc::clone(&self.0);
15864                            let fut = async move {
15865                                <T as TeamService>::list_teams(&inner, request).await
15866                            };
15867                            Box::pin(fut)
15868                        }
15869                    }
15870                    let accept_compression_encodings = self.accept_compression_encodings;
15871                    let send_compression_encodings = self.send_compression_encodings;
15872                    let max_decoding_message_size = self.max_decoding_message_size;
15873                    let max_encoding_message_size = self.max_encoding_message_size;
15874                    let inner = self.inner.clone();
15875                    let fut = async move {
15876                        let method = ListTeamsSvc(inner);
15877                        let codec = tonic_prost::ProstCodec::default();
15878                        let mut grpc = tonic::server::Grpc::new(codec)
15879                            .apply_compression_config(
15880                                accept_compression_encodings,
15881                                send_compression_encodings,
15882                            )
15883                            .apply_max_message_size_config(
15884                                max_decoding_message_size,
15885                                max_encoding_message_size,
15886                            );
15887                        let res = grpc.unary(method, req).await;
15888                        Ok(res)
15889                    };
15890                    Box::pin(fut)
15891                }
15892                "/pidgr.v1.TeamService/UpdateTeam" => {
15893                    #[allow(non_camel_case_types)]
15894                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15895                    impl<
15896                        T: TeamService,
15897                    > tonic::server::UnaryService<super::UpdateTeamRequest>
15898                    for UpdateTeamSvc<T> {
15899                        type Response = super::UpdateTeamResponse;
15900                        type Future = BoxFuture<
15901                            tonic::Response<Self::Response>,
15902                            tonic::Status,
15903                        >;
15904                        fn call(
15905                            &mut self,
15906                            request: tonic::Request<super::UpdateTeamRequest>,
15907                        ) -> Self::Future {
15908                            let inner = Arc::clone(&self.0);
15909                            let fut = async move {
15910                                <T as TeamService>::update_team(&inner, request).await
15911                            };
15912                            Box::pin(fut)
15913                        }
15914                    }
15915                    let accept_compression_encodings = self.accept_compression_encodings;
15916                    let send_compression_encodings = self.send_compression_encodings;
15917                    let max_decoding_message_size = self.max_decoding_message_size;
15918                    let max_encoding_message_size = self.max_encoding_message_size;
15919                    let inner = self.inner.clone();
15920                    let fut = async move {
15921                        let method = UpdateTeamSvc(inner);
15922                        let codec = tonic_prost::ProstCodec::default();
15923                        let mut grpc = tonic::server::Grpc::new(codec)
15924                            .apply_compression_config(
15925                                accept_compression_encodings,
15926                                send_compression_encodings,
15927                            )
15928                            .apply_max_message_size_config(
15929                                max_decoding_message_size,
15930                                max_encoding_message_size,
15931                            );
15932                        let res = grpc.unary(method, req).await;
15933                        Ok(res)
15934                    };
15935                    Box::pin(fut)
15936                }
15937                "/pidgr.v1.TeamService/DeleteTeam" => {
15938                    #[allow(non_camel_case_types)]
15939                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15940                    impl<
15941                        T: TeamService,
15942                    > tonic::server::UnaryService<super::DeleteTeamRequest>
15943                    for DeleteTeamSvc<T> {
15944                        type Response = super::DeleteTeamResponse;
15945                        type Future = BoxFuture<
15946                            tonic::Response<Self::Response>,
15947                            tonic::Status,
15948                        >;
15949                        fn call(
15950                            &mut self,
15951                            request: tonic::Request<super::DeleteTeamRequest>,
15952                        ) -> Self::Future {
15953                            let inner = Arc::clone(&self.0);
15954                            let fut = async move {
15955                                <T as TeamService>::delete_team(&inner, request).await
15956                            };
15957                            Box::pin(fut)
15958                        }
15959                    }
15960                    let accept_compression_encodings = self.accept_compression_encodings;
15961                    let send_compression_encodings = self.send_compression_encodings;
15962                    let max_decoding_message_size = self.max_decoding_message_size;
15963                    let max_encoding_message_size = self.max_encoding_message_size;
15964                    let inner = self.inner.clone();
15965                    let fut = async move {
15966                        let method = DeleteTeamSvc(inner);
15967                        let codec = tonic_prost::ProstCodec::default();
15968                        let mut grpc = tonic::server::Grpc::new(codec)
15969                            .apply_compression_config(
15970                                accept_compression_encodings,
15971                                send_compression_encodings,
15972                            )
15973                            .apply_max_message_size_config(
15974                                max_decoding_message_size,
15975                                max_encoding_message_size,
15976                            );
15977                        let res = grpc.unary(method, req).await;
15978                        Ok(res)
15979                    };
15980                    Box::pin(fut)
15981                }
15982                "/pidgr.v1.TeamService/AddTeamMembers" => {
15983                    #[allow(non_camel_case_types)]
15984                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15985                    impl<
15986                        T: TeamService,
15987                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
15988                    for AddTeamMembersSvc<T> {
15989                        type Response = super::AddTeamMembersResponse;
15990                        type Future = BoxFuture<
15991                            tonic::Response<Self::Response>,
15992                            tonic::Status,
15993                        >;
15994                        fn call(
15995                            &mut self,
15996                            request: tonic::Request<super::AddTeamMembersRequest>,
15997                        ) -> Self::Future {
15998                            let inner = Arc::clone(&self.0);
15999                            let fut = async move {
16000                                <T as TeamService>::add_team_members(&inner, request).await
16001                            };
16002                            Box::pin(fut)
16003                        }
16004                    }
16005                    let accept_compression_encodings = self.accept_compression_encodings;
16006                    let send_compression_encodings = self.send_compression_encodings;
16007                    let max_decoding_message_size = self.max_decoding_message_size;
16008                    let max_encoding_message_size = self.max_encoding_message_size;
16009                    let inner = self.inner.clone();
16010                    let fut = async move {
16011                        let method = AddTeamMembersSvc(inner);
16012                        let codec = tonic_prost::ProstCodec::default();
16013                        let mut grpc = tonic::server::Grpc::new(codec)
16014                            .apply_compression_config(
16015                                accept_compression_encodings,
16016                                send_compression_encodings,
16017                            )
16018                            .apply_max_message_size_config(
16019                                max_decoding_message_size,
16020                                max_encoding_message_size,
16021                            );
16022                        let res = grpc.unary(method, req).await;
16023                        Ok(res)
16024                    };
16025                    Box::pin(fut)
16026                }
16027                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
16028                    #[allow(non_camel_case_types)]
16029                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
16030                    impl<
16031                        T: TeamService,
16032                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
16033                    for RemoveTeamMembersSvc<T> {
16034                        type Response = super::RemoveTeamMembersResponse;
16035                        type Future = BoxFuture<
16036                            tonic::Response<Self::Response>,
16037                            tonic::Status,
16038                        >;
16039                        fn call(
16040                            &mut self,
16041                            request: tonic::Request<super::RemoveTeamMembersRequest>,
16042                        ) -> Self::Future {
16043                            let inner = Arc::clone(&self.0);
16044                            let fut = async move {
16045                                <T as TeamService>::remove_team_members(&inner, request)
16046                                    .await
16047                            };
16048                            Box::pin(fut)
16049                        }
16050                    }
16051                    let accept_compression_encodings = self.accept_compression_encodings;
16052                    let send_compression_encodings = self.send_compression_encodings;
16053                    let max_decoding_message_size = self.max_decoding_message_size;
16054                    let max_encoding_message_size = self.max_encoding_message_size;
16055                    let inner = self.inner.clone();
16056                    let fut = async move {
16057                        let method = RemoveTeamMembersSvc(inner);
16058                        let codec = tonic_prost::ProstCodec::default();
16059                        let mut grpc = tonic::server::Grpc::new(codec)
16060                            .apply_compression_config(
16061                                accept_compression_encodings,
16062                                send_compression_encodings,
16063                            )
16064                            .apply_max_message_size_config(
16065                                max_decoding_message_size,
16066                                max_encoding_message_size,
16067                            );
16068                        let res = grpc.unary(method, req).await;
16069                        Ok(res)
16070                    };
16071                    Box::pin(fut)
16072                }
16073                "/pidgr.v1.TeamService/ListTeamMembers" => {
16074                    #[allow(non_camel_case_types)]
16075                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
16076                    impl<
16077                        T: TeamService,
16078                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
16079                    for ListTeamMembersSvc<T> {
16080                        type Response = super::ListTeamMembersResponse;
16081                        type Future = BoxFuture<
16082                            tonic::Response<Self::Response>,
16083                            tonic::Status,
16084                        >;
16085                        fn call(
16086                            &mut self,
16087                            request: tonic::Request<super::ListTeamMembersRequest>,
16088                        ) -> Self::Future {
16089                            let inner = Arc::clone(&self.0);
16090                            let fut = async move {
16091                                <T as TeamService>::list_team_members(&inner, request).await
16092                            };
16093                            Box::pin(fut)
16094                        }
16095                    }
16096                    let accept_compression_encodings = self.accept_compression_encodings;
16097                    let send_compression_encodings = self.send_compression_encodings;
16098                    let max_decoding_message_size = self.max_decoding_message_size;
16099                    let max_encoding_message_size = self.max_encoding_message_size;
16100                    let inner = self.inner.clone();
16101                    let fut = async move {
16102                        let method = ListTeamMembersSvc(inner);
16103                        let codec = tonic_prost::ProstCodec::default();
16104                        let mut grpc = tonic::server::Grpc::new(codec)
16105                            .apply_compression_config(
16106                                accept_compression_encodings,
16107                                send_compression_encodings,
16108                            )
16109                            .apply_max_message_size_config(
16110                                max_decoding_message_size,
16111                                max_encoding_message_size,
16112                            );
16113                        let res = grpc.unary(method, req).await;
16114                        Ok(res)
16115                    };
16116                    Box::pin(fut)
16117                }
16118                _ => {
16119                    Box::pin(async move {
16120                        let mut response = http::Response::new(
16121                            tonic::body::Body::default(),
16122                        );
16123                        let headers = response.headers_mut();
16124                        headers
16125                            .insert(
16126                                tonic::Status::GRPC_STATUS,
16127                                (tonic::Code::Unimplemented as i32).into(),
16128                            );
16129                        headers
16130                            .insert(
16131                                http::header::CONTENT_TYPE,
16132                                tonic::metadata::GRPC_CONTENT_TYPE,
16133                            );
16134                        Ok(response)
16135                    })
16136                }
16137            }
16138        }
16139    }
16140    impl<T> Clone for TeamServiceServer<T> {
16141        fn clone(&self) -> Self {
16142            let inner = self.inner.clone();
16143            Self {
16144                inner,
16145                accept_compression_encodings: self.accept_compression_encodings,
16146                send_compression_encodings: self.send_compression_encodings,
16147                max_decoding_message_size: self.max_decoding_message_size,
16148                max_encoding_message_size: self.max_encoding_message_size,
16149            }
16150        }
16151    }
16152    /// Generated gRPC service name
16153    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
16154    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
16155        const NAME: &'static str = SERVICE_NAME;
16156    }
16157}
16158/// Generated client implementations.
16159pub mod template_service_client {
16160    #![allow(
16161        unused_variables,
16162        dead_code,
16163        missing_docs,
16164        clippy::wildcard_imports,
16165        clippy::let_unit_value,
16166    )]
16167    use tonic::codegen::*;
16168    use tonic::codegen::http::Uri;
16169    /** Manages versioned message templates used by campaigns.
16170 Templates are append-only — updates create new versions while preserving history.
16171*/
16172    #[derive(Debug, Clone)]
16173    pub struct TemplateServiceClient<T> {
16174        inner: tonic::client::Grpc<T>,
16175    }
16176    impl TemplateServiceClient<tonic::transport::Channel> {
16177        /// Attempt to create a new client by connecting to a given endpoint.
16178        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16179        where
16180            D: TryInto<tonic::transport::Endpoint>,
16181            D::Error: Into<StdError>,
16182        {
16183            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16184            Ok(Self::new(conn))
16185        }
16186    }
16187    impl<T> TemplateServiceClient<T>
16188    where
16189        T: tonic::client::GrpcService<tonic::body::Body>,
16190        T::Error: Into<StdError>,
16191        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16192        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16193    {
16194        pub fn new(inner: T) -> Self {
16195            let inner = tonic::client::Grpc::new(inner);
16196            Self { inner }
16197        }
16198        pub fn with_origin(inner: T, origin: Uri) -> Self {
16199            let inner = tonic::client::Grpc::with_origin(inner, origin);
16200            Self { inner }
16201        }
16202        pub fn with_interceptor<F>(
16203            inner: T,
16204            interceptor: F,
16205        ) -> TemplateServiceClient<InterceptedService<T, F>>
16206        where
16207            F: tonic::service::Interceptor,
16208            T::ResponseBody: Default,
16209            T: tonic::codegen::Service<
16210                http::Request<tonic::body::Body>,
16211                Response = http::Response<
16212                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16213                >,
16214            >,
16215            <T as tonic::codegen::Service<
16216                http::Request<tonic::body::Body>,
16217            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16218        {
16219            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
16220        }
16221        /// Compress requests with the given encoding.
16222        ///
16223        /// This requires the server to support it otherwise it might respond with an
16224        /// error.
16225        #[must_use]
16226        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16227            self.inner = self.inner.send_compressed(encoding);
16228            self
16229        }
16230        /// Enable decompressing responses.
16231        #[must_use]
16232        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16233            self.inner = self.inner.accept_compressed(encoding);
16234            self
16235        }
16236        /// Limits the maximum size of a decoded message.
16237        ///
16238        /// Default: `4MB`
16239        #[must_use]
16240        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16241            self.inner = self.inner.max_decoding_message_size(limit);
16242            self
16243        }
16244        /// Limits the maximum size of an encoded message.
16245        ///
16246        /// Default: `usize::MAX`
16247        #[must_use]
16248        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16249            self.inner = self.inner.max_encoding_message_size(limit);
16250            self
16251        }
16252        /** Create a new template with a body and variable definitions.
16253 Authorization: Requires MANAGER+ role.
16254*/
16255        pub async fn create_template(
16256            &mut self,
16257            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
16258        ) -> std::result::Result<
16259            tonic::Response<super::CreateTemplateResponse>,
16260            tonic::Status,
16261        > {
16262            self.inner
16263                .ready()
16264                .await
16265                .map_err(|e| {
16266                    tonic::Status::unknown(
16267                        format!("Service was not ready: {}", e.into()),
16268                    )
16269                })?;
16270            let codec = tonic_prost::ProstCodec::default();
16271            let path = http::uri::PathAndQuery::from_static(
16272                "/pidgr.v1.TemplateService/CreateTemplate",
16273            );
16274            let mut req = request.into_request();
16275            req.extensions_mut()
16276                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
16277            self.inner.unary(req, path, codec).await
16278        }
16279        /** Update an existing template, creating a new version.
16280 Authorization: Requires MANAGER+ role.
16281*/
16282        pub async fn update_template(
16283            &mut self,
16284            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
16285        ) -> std::result::Result<
16286            tonic::Response<super::UpdateTemplateResponse>,
16287            tonic::Status,
16288        > {
16289            self.inner
16290                .ready()
16291                .await
16292                .map_err(|e| {
16293                    tonic::Status::unknown(
16294                        format!("Service was not ready: {}", e.into()),
16295                    )
16296                })?;
16297            let codec = tonic_prost::ProstCodec::default();
16298            let path = http::uri::PathAndQuery::from_static(
16299                "/pidgr.v1.TemplateService/UpdateTemplate",
16300            );
16301            let mut req = request.into_request();
16302            req.extensions_mut()
16303                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
16304            self.inner.unary(req, path, codec).await
16305        }
16306        /** Retrieve a specific template by ID and optional version.
16307 Authorization: Authenticated user within the organization.
16308*/
16309        pub async fn get_template(
16310            &mut self,
16311            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
16312        ) -> std::result::Result<
16313            tonic::Response<super::GetTemplateResponse>,
16314            tonic::Status,
16315        > {
16316            self.inner
16317                .ready()
16318                .await
16319                .map_err(|e| {
16320                    tonic::Status::unknown(
16321                        format!("Service was not ready: {}", e.into()),
16322                    )
16323                })?;
16324            let codec = tonic_prost::ProstCodec::default();
16325            let path = http::uri::PathAndQuery::from_static(
16326                "/pidgr.v1.TemplateService/GetTemplate",
16327            );
16328            let mut req = request.into_request();
16329            req.extensions_mut()
16330                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
16331            self.inner.unary(req, path, codec).await
16332        }
16333        /** List all templates for the organization with pagination.
16334 Authorization: Authenticated user within the organization.
16335*/
16336        pub async fn list_templates(
16337            &mut self,
16338            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
16339        ) -> std::result::Result<
16340            tonic::Response<super::ListTemplatesResponse>,
16341            tonic::Status,
16342        > {
16343            self.inner
16344                .ready()
16345                .await
16346                .map_err(|e| {
16347                    tonic::Status::unknown(
16348                        format!("Service was not ready: {}", e.into()),
16349                    )
16350                })?;
16351            let codec = tonic_prost::ProstCodec::default();
16352            let path = http::uri::PathAndQuery::from_static(
16353                "/pidgr.v1.TemplateService/ListTemplates",
16354            );
16355            let mut req = request.into_request();
16356            req.extensions_mut()
16357                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
16358            self.inner.unary(req, path, codec).await
16359        }
16360        /** Create a locale-specific translation of a template.
16361 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16362*/
16363        pub async fn create_template_translation(
16364            &mut self,
16365            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
16366        ) -> std::result::Result<
16367            tonic::Response<super::CreateTemplateTranslationResponse>,
16368            tonic::Status,
16369        > {
16370            self.inner
16371                .ready()
16372                .await
16373                .map_err(|e| {
16374                    tonic::Status::unknown(
16375                        format!("Service was not ready: {}", e.into()),
16376                    )
16377                })?;
16378            let codec = tonic_prost::ProstCodec::default();
16379            let path = http::uri::PathAndQuery::from_static(
16380                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
16381            );
16382            let mut req = request.into_request();
16383            req.extensions_mut()
16384                .insert(
16385                    GrpcMethod::new(
16386                        "pidgr.v1.TemplateService",
16387                        "CreateTemplateTranslation",
16388                    ),
16389                );
16390            self.inner.unary(req, path, codec).await
16391        }
16392        /** Update an existing template translation.
16393 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16394*/
16395        pub async fn update_template_translation(
16396            &mut self,
16397            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
16398        ) -> std::result::Result<
16399            tonic::Response<super::UpdateTemplateTranslationResponse>,
16400            tonic::Status,
16401        > {
16402            self.inner
16403                .ready()
16404                .await
16405                .map_err(|e| {
16406                    tonic::Status::unknown(
16407                        format!("Service was not ready: {}", e.into()),
16408                    )
16409                })?;
16410            let codec = tonic_prost::ProstCodec::default();
16411            let path = http::uri::PathAndQuery::from_static(
16412                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
16413            );
16414            let mut req = request.into_request();
16415            req.extensions_mut()
16416                .insert(
16417                    GrpcMethod::new(
16418                        "pidgr.v1.TemplateService",
16419                        "UpdateTemplateTranslation",
16420                    ),
16421                );
16422            self.inner.unary(req, path, codec).await
16423        }
16424        /** List all translations for a template version.
16425 Authorization: Requires PERMISSION_TEMPLATES_READ.
16426*/
16427        pub async fn list_template_translations(
16428            &mut self,
16429            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
16430        ) -> std::result::Result<
16431            tonic::Response<super::ListTemplateTranslationsResponse>,
16432            tonic::Status,
16433        > {
16434            self.inner
16435                .ready()
16436                .await
16437                .map_err(|e| {
16438                    tonic::Status::unknown(
16439                        format!("Service was not ready: {}", e.into()),
16440                    )
16441                })?;
16442            let codec = tonic_prost::ProstCodec::default();
16443            let path = http::uri::PathAndQuery::from_static(
16444                "/pidgr.v1.TemplateService/ListTemplateTranslations",
16445            );
16446            let mut req = request.into_request();
16447            req.extensions_mut()
16448                .insert(
16449                    GrpcMethod::new(
16450                        "pidgr.v1.TemplateService",
16451                        "ListTemplateTranslations",
16452                    ),
16453                );
16454            self.inner.unary(req, path, codec).await
16455        }
16456        /** Approve a template translation for use in campaigns.
16457 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16458*/
16459        pub async fn approve_template_translation(
16460            &mut self,
16461            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
16462        ) -> std::result::Result<
16463            tonic::Response<super::ApproveTemplateTranslationResponse>,
16464            tonic::Status,
16465        > {
16466            self.inner
16467                .ready()
16468                .await
16469                .map_err(|e| {
16470                    tonic::Status::unknown(
16471                        format!("Service was not ready: {}", e.into()),
16472                    )
16473                })?;
16474            let codec = tonic_prost::ProstCodec::default();
16475            let path = http::uri::PathAndQuery::from_static(
16476                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
16477            );
16478            let mut req = request.into_request();
16479            req.extensions_mut()
16480                .insert(
16481                    GrpcMethod::new(
16482                        "pidgr.v1.TemplateService",
16483                        "ApproveTemplateTranslation",
16484                    ),
16485                );
16486            self.inner.unary(req, path, codec).await
16487        }
16488    }
16489}
16490/// Generated server implementations.
16491pub mod template_service_server {
16492    #![allow(
16493        unused_variables,
16494        dead_code,
16495        missing_docs,
16496        clippy::wildcard_imports,
16497        clippy::let_unit_value,
16498    )]
16499    use tonic::codegen::*;
16500    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
16501    #[async_trait]
16502    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
16503        /** Create a new template with a body and variable definitions.
16504 Authorization: Requires MANAGER+ role.
16505*/
16506        async fn create_template(
16507            &self,
16508            request: tonic::Request<super::CreateTemplateRequest>,
16509        ) -> std::result::Result<
16510            tonic::Response<super::CreateTemplateResponse>,
16511            tonic::Status,
16512        >;
16513        /** Update an existing template, creating a new version.
16514 Authorization: Requires MANAGER+ role.
16515*/
16516        async fn update_template(
16517            &self,
16518            request: tonic::Request<super::UpdateTemplateRequest>,
16519        ) -> std::result::Result<
16520            tonic::Response<super::UpdateTemplateResponse>,
16521            tonic::Status,
16522        >;
16523        /** Retrieve a specific template by ID and optional version.
16524 Authorization: Authenticated user within the organization.
16525*/
16526        async fn get_template(
16527            &self,
16528            request: tonic::Request<super::GetTemplateRequest>,
16529        ) -> std::result::Result<
16530            tonic::Response<super::GetTemplateResponse>,
16531            tonic::Status,
16532        >;
16533        /** List all templates for the organization with pagination.
16534 Authorization: Authenticated user within the organization.
16535*/
16536        async fn list_templates(
16537            &self,
16538            request: tonic::Request<super::ListTemplatesRequest>,
16539        ) -> std::result::Result<
16540            tonic::Response<super::ListTemplatesResponse>,
16541            tonic::Status,
16542        >;
16543        /** Create a locale-specific translation of a template.
16544 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16545*/
16546        async fn create_template_translation(
16547            &self,
16548            request: tonic::Request<super::CreateTemplateTranslationRequest>,
16549        ) -> std::result::Result<
16550            tonic::Response<super::CreateTemplateTranslationResponse>,
16551            tonic::Status,
16552        >;
16553        /** Update an existing template translation.
16554 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16555*/
16556        async fn update_template_translation(
16557            &self,
16558            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
16559        ) -> std::result::Result<
16560            tonic::Response<super::UpdateTemplateTranslationResponse>,
16561            tonic::Status,
16562        >;
16563        /** List all translations for a template version.
16564 Authorization: Requires PERMISSION_TEMPLATES_READ.
16565*/
16566        async fn list_template_translations(
16567            &self,
16568            request: tonic::Request<super::ListTemplateTranslationsRequest>,
16569        ) -> std::result::Result<
16570            tonic::Response<super::ListTemplateTranslationsResponse>,
16571            tonic::Status,
16572        >;
16573        /** Approve a template translation for use in campaigns.
16574 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16575*/
16576        async fn approve_template_translation(
16577            &self,
16578            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
16579        ) -> std::result::Result<
16580            tonic::Response<super::ApproveTemplateTranslationResponse>,
16581            tonic::Status,
16582        >;
16583    }
16584    /** Manages versioned message templates used by campaigns.
16585 Templates are append-only — updates create new versions while preserving history.
16586*/
16587    #[derive(Debug)]
16588    pub struct TemplateServiceServer<T> {
16589        inner: Arc<T>,
16590        accept_compression_encodings: EnabledCompressionEncodings,
16591        send_compression_encodings: EnabledCompressionEncodings,
16592        max_decoding_message_size: Option<usize>,
16593        max_encoding_message_size: Option<usize>,
16594    }
16595    impl<T> TemplateServiceServer<T> {
16596        pub fn new(inner: T) -> Self {
16597            Self::from_arc(Arc::new(inner))
16598        }
16599        pub fn from_arc(inner: Arc<T>) -> Self {
16600            Self {
16601                inner,
16602                accept_compression_encodings: Default::default(),
16603                send_compression_encodings: Default::default(),
16604                max_decoding_message_size: None,
16605                max_encoding_message_size: None,
16606            }
16607        }
16608        pub fn with_interceptor<F>(
16609            inner: T,
16610            interceptor: F,
16611        ) -> InterceptedService<Self, F>
16612        where
16613            F: tonic::service::Interceptor,
16614        {
16615            InterceptedService::new(Self::new(inner), interceptor)
16616        }
16617        /// Enable decompressing requests with the given encoding.
16618        #[must_use]
16619        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16620            self.accept_compression_encodings.enable(encoding);
16621            self
16622        }
16623        /// Compress responses with the given encoding, if the client supports it.
16624        #[must_use]
16625        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16626            self.send_compression_encodings.enable(encoding);
16627            self
16628        }
16629        /// Limits the maximum size of a decoded message.
16630        ///
16631        /// Default: `4MB`
16632        #[must_use]
16633        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16634            self.max_decoding_message_size = Some(limit);
16635            self
16636        }
16637        /// Limits the maximum size of an encoded message.
16638        ///
16639        /// Default: `usize::MAX`
16640        #[must_use]
16641        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16642            self.max_encoding_message_size = Some(limit);
16643            self
16644        }
16645    }
16646    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
16647    where
16648        T: TemplateService,
16649        B: Body + std::marker::Send + 'static,
16650        B::Error: Into<StdError> + std::marker::Send + 'static,
16651    {
16652        type Response = http::Response<tonic::body::Body>;
16653        type Error = std::convert::Infallible;
16654        type Future = BoxFuture<Self::Response, Self::Error>;
16655        fn poll_ready(
16656            &mut self,
16657            _cx: &mut Context<'_>,
16658        ) -> Poll<std::result::Result<(), Self::Error>> {
16659            Poll::Ready(Ok(()))
16660        }
16661        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16662            match req.uri().path() {
16663                "/pidgr.v1.TemplateService/CreateTemplate" => {
16664                    #[allow(non_camel_case_types)]
16665                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
16666                    impl<
16667                        T: TemplateService,
16668                    > tonic::server::UnaryService<super::CreateTemplateRequest>
16669                    for CreateTemplateSvc<T> {
16670                        type Response = super::CreateTemplateResponse;
16671                        type Future = BoxFuture<
16672                            tonic::Response<Self::Response>,
16673                            tonic::Status,
16674                        >;
16675                        fn call(
16676                            &mut self,
16677                            request: tonic::Request<super::CreateTemplateRequest>,
16678                        ) -> Self::Future {
16679                            let inner = Arc::clone(&self.0);
16680                            let fut = async move {
16681                                <T as TemplateService>::create_template(&inner, request)
16682                                    .await
16683                            };
16684                            Box::pin(fut)
16685                        }
16686                    }
16687                    let accept_compression_encodings = self.accept_compression_encodings;
16688                    let send_compression_encodings = self.send_compression_encodings;
16689                    let max_decoding_message_size = self.max_decoding_message_size;
16690                    let max_encoding_message_size = self.max_encoding_message_size;
16691                    let inner = self.inner.clone();
16692                    let fut = async move {
16693                        let method = CreateTemplateSvc(inner);
16694                        let codec = tonic_prost::ProstCodec::default();
16695                        let mut grpc = tonic::server::Grpc::new(codec)
16696                            .apply_compression_config(
16697                                accept_compression_encodings,
16698                                send_compression_encodings,
16699                            )
16700                            .apply_max_message_size_config(
16701                                max_decoding_message_size,
16702                                max_encoding_message_size,
16703                            );
16704                        let res = grpc.unary(method, req).await;
16705                        Ok(res)
16706                    };
16707                    Box::pin(fut)
16708                }
16709                "/pidgr.v1.TemplateService/UpdateTemplate" => {
16710                    #[allow(non_camel_case_types)]
16711                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
16712                    impl<
16713                        T: TemplateService,
16714                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
16715                    for UpdateTemplateSvc<T> {
16716                        type Response = super::UpdateTemplateResponse;
16717                        type Future = BoxFuture<
16718                            tonic::Response<Self::Response>,
16719                            tonic::Status,
16720                        >;
16721                        fn call(
16722                            &mut self,
16723                            request: tonic::Request<super::UpdateTemplateRequest>,
16724                        ) -> Self::Future {
16725                            let inner = Arc::clone(&self.0);
16726                            let fut = async move {
16727                                <T as TemplateService>::update_template(&inner, request)
16728                                    .await
16729                            };
16730                            Box::pin(fut)
16731                        }
16732                    }
16733                    let accept_compression_encodings = self.accept_compression_encodings;
16734                    let send_compression_encodings = self.send_compression_encodings;
16735                    let max_decoding_message_size = self.max_decoding_message_size;
16736                    let max_encoding_message_size = self.max_encoding_message_size;
16737                    let inner = self.inner.clone();
16738                    let fut = async move {
16739                        let method = UpdateTemplateSvc(inner);
16740                        let codec = tonic_prost::ProstCodec::default();
16741                        let mut grpc = tonic::server::Grpc::new(codec)
16742                            .apply_compression_config(
16743                                accept_compression_encodings,
16744                                send_compression_encodings,
16745                            )
16746                            .apply_max_message_size_config(
16747                                max_decoding_message_size,
16748                                max_encoding_message_size,
16749                            );
16750                        let res = grpc.unary(method, req).await;
16751                        Ok(res)
16752                    };
16753                    Box::pin(fut)
16754                }
16755                "/pidgr.v1.TemplateService/GetTemplate" => {
16756                    #[allow(non_camel_case_types)]
16757                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16758                    impl<
16759                        T: TemplateService,
16760                    > tonic::server::UnaryService<super::GetTemplateRequest>
16761                    for GetTemplateSvc<T> {
16762                        type Response = super::GetTemplateResponse;
16763                        type Future = BoxFuture<
16764                            tonic::Response<Self::Response>,
16765                            tonic::Status,
16766                        >;
16767                        fn call(
16768                            &mut self,
16769                            request: tonic::Request<super::GetTemplateRequest>,
16770                        ) -> Self::Future {
16771                            let inner = Arc::clone(&self.0);
16772                            let fut = async move {
16773                                <T as TemplateService>::get_template(&inner, request).await
16774                            };
16775                            Box::pin(fut)
16776                        }
16777                    }
16778                    let accept_compression_encodings = self.accept_compression_encodings;
16779                    let send_compression_encodings = self.send_compression_encodings;
16780                    let max_decoding_message_size = self.max_decoding_message_size;
16781                    let max_encoding_message_size = self.max_encoding_message_size;
16782                    let inner = self.inner.clone();
16783                    let fut = async move {
16784                        let method = GetTemplateSvc(inner);
16785                        let codec = tonic_prost::ProstCodec::default();
16786                        let mut grpc = tonic::server::Grpc::new(codec)
16787                            .apply_compression_config(
16788                                accept_compression_encodings,
16789                                send_compression_encodings,
16790                            )
16791                            .apply_max_message_size_config(
16792                                max_decoding_message_size,
16793                                max_encoding_message_size,
16794                            );
16795                        let res = grpc.unary(method, req).await;
16796                        Ok(res)
16797                    };
16798                    Box::pin(fut)
16799                }
16800                "/pidgr.v1.TemplateService/ListTemplates" => {
16801                    #[allow(non_camel_case_types)]
16802                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16803                    impl<
16804                        T: TemplateService,
16805                    > tonic::server::UnaryService<super::ListTemplatesRequest>
16806                    for ListTemplatesSvc<T> {
16807                        type Response = super::ListTemplatesResponse;
16808                        type Future = BoxFuture<
16809                            tonic::Response<Self::Response>,
16810                            tonic::Status,
16811                        >;
16812                        fn call(
16813                            &mut self,
16814                            request: tonic::Request<super::ListTemplatesRequest>,
16815                        ) -> Self::Future {
16816                            let inner = Arc::clone(&self.0);
16817                            let fut = async move {
16818                                <T as TemplateService>::list_templates(&inner, request)
16819                                    .await
16820                            };
16821                            Box::pin(fut)
16822                        }
16823                    }
16824                    let accept_compression_encodings = self.accept_compression_encodings;
16825                    let send_compression_encodings = self.send_compression_encodings;
16826                    let max_decoding_message_size = self.max_decoding_message_size;
16827                    let max_encoding_message_size = self.max_encoding_message_size;
16828                    let inner = self.inner.clone();
16829                    let fut = async move {
16830                        let method = ListTemplatesSvc(inner);
16831                        let codec = tonic_prost::ProstCodec::default();
16832                        let mut grpc = tonic::server::Grpc::new(codec)
16833                            .apply_compression_config(
16834                                accept_compression_encodings,
16835                                send_compression_encodings,
16836                            )
16837                            .apply_max_message_size_config(
16838                                max_decoding_message_size,
16839                                max_encoding_message_size,
16840                            );
16841                        let res = grpc.unary(method, req).await;
16842                        Ok(res)
16843                    };
16844                    Box::pin(fut)
16845                }
16846                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16847                    #[allow(non_camel_case_types)]
16848                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16849                    impl<
16850                        T: TemplateService,
16851                    > tonic::server::UnaryService<
16852                        super::CreateTemplateTranslationRequest,
16853                    > for CreateTemplateTranslationSvc<T> {
16854                        type Response = super::CreateTemplateTranslationResponse;
16855                        type Future = BoxFuture<
16856                            tonic::Response<Self::Response>,
16857                            tonic::Status,
16858                        >;
16859                        fn call(
16860                            &mut self,
16861                            request: tonic::Request<
16862                                super::CreateTemplateTranslationRequest,
16863                            >,
16864                        ) -> Self::Future {
16865                            let inner = Arc::clone(&self.0);
16866                            let fut = async move {
16867                                <T as TemplateService>::create_template_translation(
16868                                        &inner,
16869                                        request,
16870                                    )
16871                                    .await
16872                            };
16873                            Box::pin(fut)
16874                        }
16875                    }
16876                    let accept_compression_encodings = self.accept_compression_encodings;
16877                    let send_compression_encodings = self.send_compression_encodings;
16878                    let max_decoding_message_size = self.max_decoding_message_size;
16879                    let max_encoding_message_size = self.max_encoding_message_size;
16880                    let inner = self.inner.clone();
16881                    let fut = async move {
16882                        let method = CreateTemplateTranslationSvc(inner);
16883                        let codec = tonic_prost::ProstCodec::default();
16884                        let mut grpc = tonic::server::Grpc::new(codec)
16885                            .apply_compression_config(
16886                                accept_compression_encodings,
16887                                send_compression_encodings,
16888                            )
16889                            .apply_max_message_size_config(
16890                                max_decoding_message_size,
16891                                max_encoding_message_size,
16892                            );
16893                        let res = grpc.unary(method, req).await;
16894                        Ok(res)
16895                    };
16896                    Box::pin(fut)
16897                }
16898                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16899                    #[allow(non_camel_case_types)]
16900                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16901                    impl<
16902                        T: TemplateService,
16903                    > tonic::server::UnaryService<
16904                        super::UpdateTemplateTranslationRequest,
16905                    > for UpdateTemplateTranslationSvc<T> {
16906                        type Response = super::UpdateTemplateTranslationResponse;
16907                        type Future = BoxFuture<
16908                            tonic::Response<Self::Response>,
16909                            tonic::Status,
16910                        >;
16911                        fn call(
16912                            &mut self,
16913                            request: tonic::Request<
16914                                super::UpdateTemplateTranslationRequest,
16915                            >,
16916                        ) -> Self::Future {
16917                            let inner = Arc::clone(&self.0);
16918                            let fut = async move {
16919                                <T as TemplateService>::update_template_translation(
16920                                        &inner,
16921                                        request,
16922                                    )
16923                                    .await
16924                            };
16925                            Box::pin(fut)
16926                        }
16927                    }
16928                    let accept_compression_encodings = self.accept_compression_encodings;
16929                    let send_compression_encodings = self.send_compression_encodings;
16930                    let max_decoding_message_size = self.max_decoding_message_size;
16931                    let max_encoding_message_size = self.max_encoding_message_size;
16932                    let inner = self.inner.clone();
16933                    let fut = async move {
16934                        let method = UpdateTemplateTranslationSvc(inner);
16935                        let codec = tonic_prost::ProstCodec::default();
16936                        let mut grpc = tonic::server::Grpc::new(codec)
16937                            .apply_compression_config(
16938                                accept_compression_encodings,
16939                                send_compression_encodings,
16940                            )
16941                            .apply_max_message_size_config(
16942                                max_decoding_message_size,
16943                                max_encoding_message_size,
16944                            );
16945                        let res = grpc.unary(method, req).await;
16946                        Ok(res)
16947                    };
16948                    Box::pin(fut)
16949                }
16950                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16951                    #[allow(non_camel_case_types)]
16952                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16953                    impl<
16954                        T: TemplateService,
16955                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16956                    for ListTemplateTranslationsSvc<T> {
16957                        type Response = super::ListTemplateTranslationsResponse;
16958                        type Future = BoxFuture<
16959                            tonic::Response<Self::Response>,
16960                            tonic::Status,
16961                        >;
16962                        fn call(
16963                            &mut self,
16964                            request: tonic::Request<
16965                                super::ListTemplateTranslationsRequest,
16966                            >,
16967                        ) -> Self::Future {
16968                            let inner = Arc::clone(&self.0);
16969                            let fut = async move {
16970                                <T as TemplateService>::list_template_translations(
16971                                        &inner,
16972                                        request,
16973                                    )
16974                                    .await
16975                            };
16976                            Box::pin(fut)
16977                        }
16978                    }
16979                    let accept_compression_encodings = self.accept_compression_encodings;
16980                    let send_compression_encodings = self.send_compression_encodings;
16981                    let max_decoding_message_size = self.max_decoding_message_size;
16982                    let max_encoding_message_size = self.max_encoding_message_size;
16983                    let inner = self.inner.clone();
16984                    let fut = async move {
16985                        let method = ListTemplateTranslationsSvc(inner);
16986                        let codec = tonic_prost::ProstCodec::default();
16987                        let mut grpc = tonic::server::Grpc::new(codec)
16988                            .apply_compression_config(
16989                                accept_compression_encodings,
16990                                send_compression_encodings,
16991                            )
16992                            .apply_max_message_size_config(
16993                                max_decoding_message_size,
16994                                max_encoding_message_size,
16995                            );
16996                        let res = grpc.unary(method, req).await;
16997                        Ok(res)
16998                    };
16999                    Box::pin(fut)
17000                }
17001                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
17002                    #[allow(non_camel_case_types)]
17003                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
17004                    impl<
17005                        T: TemplateService,
17006                    > tonic::server::UnaryService<
17007                        super::ApproveTemplateTranslationRequest,
17008                    > for ApproveTemplateTranslationSvc<T> {
17009                        type Response = super::ApproveTemplateTranslationResponse;
17010                        type Future = BoxFuture<
17011                            tonic::Response<Self::Response>,
17012                            tonic::Status,
17013                        >;
17014                        fn call(
17015                            &mut self,
17016                            request: tonic::Request<
17017                                super::ApproveTemplateTranslationRequest,
17018                            >,
17019                        ) -> Self::Future {
17020                            let inner = Arc::clone(&self.0);
17021                            let fut = async move {
17022                                <T as TemplateService>::approve_template_translation(
17023                                        &inner,
17024                                        request,
17025                                    )
17026                                    .await
17027                            };
17028                            Box::pin(fut)
17029                        }
17030                    }
17031                    let accept_compression_encodings = self.accept_compression_encodings;
17032                    let send_compression_encodings = self.send_compression_encodings;
17033                    let max_decoding_message_size = self.max_decoding_message_size;
17034                    let max_encoding_message_size = self.max_encoding_message_size;
17035                    let inner = self.inner.clone();
17036                    let fut = async move {
17037                        let method = ApproveTemplateTranslationSvc(inner);
17038                        let codec = tonic_prost::ProstCodec::default();
17039                        let mut grpc = tonic::server::Grpc::new(codec)
17040                            .apply_compression_config(
17041                                accept_compression_encodings,
17042                                send_compression_encodings,
17043                            )
17044                            .apply_max_message_size_config(
17045                                max_decoding_message_size,
17046                                max_encoding_message_size,
17047                            );
17048                        let res = grpc.unary(method, req).await;
17049                        Ok(res)
17050                    };
17051                    Box::pin(fut)
17052                }
17053                _ => {
17054                    Box::pin(async move {
17055                        let mut response = http::Response::new(
17056                            tonic::body::Body::default(),
17057                        );
17058                        let headers = response.headers_mut();
17059                        headers
17060                            .insert(
17061                                tonic::Status::GRPC_STATUS,
17062                                (tonic::Code::Unimplemented as i32).into(),
17063                            );
17064                        headers
17065                            .insert(
17066                                http::header::CONTENT_TYPE,
17067                                tonic::metadata::GRPC_CONTENT_TYPE,
17068                            );
17069                        Ok(response)
17070                    })
17071                }
17072            }
17073        }
17074    }
17075    impl<T> Clone for TemplateServiceServer<T> {
17076        fn clone(&self) -> Self {
17077            let inner = self.inner.clone();
17078            Self {
17079                inner,
17080                accept_compression_encodings: self.accept_compression_encodings,
17081                send_compression_encodings: self.send_compression_encodings,
17082                max_decoding_message_size: self.max_decoding_message_size,
17083                max_encoding_message_size: self.max_encoding_message_size,
17084            }
17085        }
17086    }
17087    /// Generated gRPC service name
17088    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
17089    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
17090        const NAME: &'static str = SERVICE_NAME;
17091    }
17092}
17093/// Generated client implementations.
17094pub mod token_service_client {
17095    #![allow(
17096        unused_variables,
17097        dead_code,
17098        missing_docs,
17099        clippy::wildcard_imports,
17100        clippy::let_unit_value,
17101    )]
17102    use tonic::codegen::*;
17103    use tonic::codegen::http::Uri;
17104    /** HMAC-signed deeplink-token signing and validation.
17105
17106 Deeplink tokens carry the (campaign, recipient, step) tuple that
17107 authorizes a third-party-channel deeplink
17108 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
17109 pidgr-api with a per-org HMAC key managed by the platform's key store;
17110 rotation is automatic with a 7-day overlap window so callers do not
17111 have to coordinate.
17112*/
17113    #[derive(Debug, Clone)]
17114    pub struct TokenServiceClient<T> {
17115        inner: tonic::client::Grpc<T>,
17116    }
17117    impl TokenServiceClient<tonic::transport::Channel> {
17118        /// Attempt to create a new client by connecting to a given endpoint.
17119        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
17120        where
17121            D: TryInto<tonic::transport::Endpoint>,
17122            D::Error: Into<StdError>,
17123        {
17124            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
17125            Ok(Self::new(conn))
17126        }
17127    }
17128    impl<T> TokenServiceClient<T>
17129    where
17130        T: tonic::client::GrpcService<tonic::body::Body>,
17131        T::Error: Into<StdError>,
17132        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
17133        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
17134    {
17135        pub fn new(inner: T) -> Self {
17136            let inner = tonic::client::Grpc::new(inner);
17137            Self { inner }
17138        }
17139        pub fn with_origin(inner: T, origin: Uri) -> Self {
17140            let inner = tonic::client::Grpc::with_origin(inner, origin);
17141            Self { inner }
17142        }
17143        pub fn with_interceptor<F>(
17144            inner: T,
17145            interceptor: F,
17146        ) -> TokenServiceClient<InterceptedService<T, F>>
17147        where
17148            F: tonic::service::Interceptor,
17149            T::ResponseBody: Default,
17150            T: tonic::codegen::Service<
17151                http::Request<tonic::body::Body>,
17152                Response = http::Response<
17153                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
17154                >,
17155            >,
17156            <T as tonic::codegen::Service<
17157                http::Request<tonic::body::Body>,
17158            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
17159        {
17160            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
17161        }
17162        /// Compress requests with the given encoding.
17163        ///
17164        /// This requires the server to support it otherwise it might respond with an
17165        /// error.
17166        #[must_use]
17167        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17168            self.inner = self.inner.send_compressed(encoding);
17169            self
17170        }
17171        /// Enable decompressing responses.
17172        #[must_use]
17173        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17174            self.inner = self.inner.accept_compressed(encoding);
17175            self
17176        }
17177        /// Limits the maximum size of a decoded message.
17178        ///
17179        /// Default: `4MB`
17180        #[must_use]
17181        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17182            self.inner = self.inner.max_decoding_message_size(limit);
17183            self
17184        }
17185        /// Limits the maximum size of an encoded message.
17186        ///
17187        /// Default: `usize::MAX`
17188        #[must_use]
17189        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17190            self.inner = self.inner.max_encoding_message_size(limit);
17191            self
17192        }
17193        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
17194 the dispatch layer assembling a deeplink during message
17195 composition).
17196*/
17197        pub async fn sign_deeplink_token(
17198            &mut self,
17199            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
17200        ) -> std::result::Result<
17201            tonic::Response<super::SignDeeplinkTokenResponse>,
17202            tonic::Status,
17203        > {
17204            self.inner
17205                .ready()
17206                .await
17207                .map_err(|e| {
17208                    tonic::Status::unknown(
17209                        format!("Service was not ready: {}", e.into()),
17210                    )
17211                })?;
17212            let codec = tonic_prost::ProstCodec::default();
17213            let path = http::uri::PathAndQuery::from_static(
17214                "/pidgr.v1.TokenService/SignDeeplinkToken",
17215            );
17216            let mut req = request.into_request();
17217            req.extensions_mut()
17218                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
17219            self.inner.unary(req, path, codec).await
17220        }
17221        /** Validate a deeplink token. Authorization: unauthenticated (caller
17222 is the native app validating before showing the auth gate). The
17223 token IS the lookup key; valid responses carry the decoded payload.
17224*/
17225        pub async fn validate_deeplink_token(
17226            &mut self,
17227            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
17228        ) -> std::result::Result<
17229            tonic::Response<super::ValidateDeeplinkTokenResponse>,
17230            tonic::Status,
17231        > {
17232            self.inner
17233                .ready()
17234                .await
17235                .map_err(|e| {
17236                    tonic::Status::unknown(
17237                        format!("Service was not ready: {}", e.into()),
17238                    )
17239                })?;
17240            let codec = tonic_prost::ProstCodec::default();
17241            let path = http::uri::PathAndQuery::from_static(
17242                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
17243            );
17244            let mut req = request.into_request();
17245            req.extensions_mut()
17246                .insert(
17247                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
17248                );
17249            self.inner.unary(req, path, codec).await
17250        }
17251    }
17252}
17253/// Generated server implementations.
17254pub mod token_service_server {
17255    #![allow(
17256        unused_variables,
17257        dead_code,
17258        missing_docs,
17259        clippy::wildcard_imports,
17260        clippy::let_unit_value,
17261    )]
17262    use tonic::codegen::*;
17263    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
17264    #[async_trait]
17265    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
17266        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
17267 the dispatch layer assembling a deeplink during message
17268 composition).
17269*/
17270        async fn sign_deeplink_token(
17271            &self,
17272            request: tonic::Request<super::SignDeeplinkTokenRequest>,
17273        ) -> std::result::Result<
17274            tonic::Response<super::SignDeeplinkTokenResponse>,
17275            tonic::Status,
17276        >;
17277        /** Validate a deeplink token. Authorization: unauthenticated (caller
17278 is the native app validating before showing the auth gate). The
17279 token IS the lookup key; valid responses carry the decoded payload.
17280*/
17281        async fn validate_deeplink_token(
17282            &self,
17283            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17284        ) -> std::result::Result<
17285            tonic::Response<super::ValidateDeeplinkTokenResponse>,
17286            tonic::Status,
17287        >;
17288    }
17289    /** HMAC-signed deeplink-token signing and validation.
17290
17291 Deeplink tokens carry the (campaign, recipient, step) tuple that
17292 authorizes a third-party-channel deeplink
17293 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
17294 pidgr-api with a per-org HMAC key managed by the platform's key store;
17295 rotation is automatic with a 7-day overlap window so callers do not
17296 have to coordinate.
17297*/
17298    #[derive(Debug)]
17299    pub struct TokenServiceServer<T> {
17300        inner: Arc<T>,
17301        accept_compression_encodings: EnabledCompressionEncodings,
17302        send_compression_encodings: EnabledCompressionEncodings,
17303        max_decoding_message_size: Option<usize>,
17304        max_encoding_message_size: Option<usize>,
17305    }
17306    impl<T> TokenServiceServer<T> {
17307        pub fn new(inner: T) -> Self {
17308            Self::from_arc(Arc::new(inner))
17309        }
17310        pub fn from_arc(inner: Arc<T>) -> Self {
17311            Self {
17312                inner,
17313                accept_compression_encodings: Default::default(),
17314                send_compression_encodings: Default::default(),
17315                max_decoding_message_size: None,
17316                max_encoding_message_size: None,
17317            }
17318        }
17319        pub fn with_interceptor<F>(
17320            inner: T,
17321            interceptor: F,
17322        ) -> InterceptedService<Self, F>
17323        where
17324            F: tonic::service::Interceptor,
17325        {
17326            InterceptedService::new(Self::new(inner), interceptor)
17327        }
17328        /// Enable decompressing requests with the given encoding.
17329        #[must_use]
17330        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17331            self.accept_compression_encodings.enable(encoding);
17332            self
17333        }
17334        /// Compress responses with the given encoding, if the client supports it.
17335        #[must_use]
17336        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17337            self.send_compression_encodings.enable(encoding);
17338            self
17339        }
17340        /// Limits the maximum size of a decoded message.
17341        ///
17342        /// Default: `4MB`
17343        #[must_use]
17344        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17345            self.max_decoding_message_size = Some(limit);
17346            self
17347        }
17348        /// Limits the maximum size of an encoded message.
17349        ///
17350        /// Default: `usize::MAX`
17351        #[must_use]
17352        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17353            self.max_encoding_message_size = Some(limit);
17354            self
17355        }
17356    }
17357    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
17358    where
17359        T: TokenService,
17360        B: Body + std::marker::Send + 'static,
17361        B::Error: Into<StdError> + std::marker::Send + 'static,
17362    {
17363        type Response = http::Response<tonic::body::Body>;
17364        type Error = std::convert::Infallible;
17365        type Future = BoxFuture<Self::Response, Self::Error>;
17366        fn poll_ready(
17367            &mut self,
17368            _cx: &mut Context<'_>,
17369        ) -> Poll<std::result::Result<(), Self::Error>> {
17370            Poll::Ready(Ok(()))
17371        }
17372        fn call(&mut self, req: http::Request<B>) -> Self::Future {
17373            match req.uri().path() {
17374                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
17375                    #[allow(non_camel_case_types)]
17376                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17377                    impl<
17378                        T: TokenService,
17379                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
17380                    for SignDeeplinkTokenSvc<T> {
17381                        type Response = super::SignDeeplinkTokenResponse;
17382                        type Future = BoxFuture<
17383                            tonic::Response<Self::Response>,
17384                            tonic::Status,
17385                        >;
17386                        fn call(
17387                            &mut self,
17388                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
17389                        ) -> Self::Future {
17390                            let inner = Arc::clone(&self.0);
17391                            let fut = async move {
17392                                <T as TokenService>::sign_deeplink_token(&inner, request)
17393                                    .await
17394                            };
17395                            Box::pin(fut)
17396                        }
17397                    }
17398                    let accept_compression_encodings = self.accept_compression_encodings;
17399                    let send_compression_encodings = self.send_compression_encodings;
17400                    let max_decoding_message_size = self.max_decoding_message_size;
17401                    let max_encoding_message_size = self.max_encoding_message_size;
17402                    let inner = self.inner.clone();
17403                    let fut = async move {
17404                        let method = SignDeeplinkTokenSvc(inner);
17405                        let codec = tonic_prost::ProstCodec::default();
17406                        let mut grpc = tonic::server::Grpc::new(codec)
17407                            .apply_compression_config(
17408                                accept_compression_encodings,
17409                                send_compression_encodings,
17410                            )
17411                            .apply_max_message_size_config(
17412                                max_decoding_message_size,
17413                                max_encoding_message_size,
17414                            );
17415                        let res = grpc.unary(method, req).await;
17416                        Ok(res)
17417                    };
17418                    Box::pin(fut)
17419                }
17420                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
17421                    #[allow(non_camel_case_types)]
17422                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17423                    impl<
17424                        T: TokenService,
17425                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
17426                    for ValidateDeeplinkTokenSvc<T> {
17427                        type Response = super::ValidateDeeplinkTokenResponse;
17428                        type Future = BoxFuture<
17429                            tonic::Response<Self::Response>,
17430                            tonic::Status,
17431                        >;
17432                        fn call(
17433                            &mut self,
17434                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17435                        ) -> Self::Future {
17436                            let inner = Arc::clone(&self.0);
17437                            let fut = async move {
17438                                <T as TokenService>::validate_deeplink_token(
17439                                        &inner,
17440                                        request,
17441                                    )
17442                                    .await
17443                            };
17444                            Box::pin(fut)
17445                        }
17446                    }
17447                    let accept_compression_encodings = self.accept_compression_encodings;
17448                    let send_compression_encodings = self.send_compression_encodings;
17449                    let max_decoding_message_size = self.max_decoding_message_size;
17450                    let max_encoding_message_size = self.max_encoding_message_size;
17451                    let inner = self.inner.clone();
17452                    let fut = async move {
17453                        let method = ValidateDeeplinkTokenSvc(inner);
17454                        let codec = tonic_prost::ProstCodec::default();
17455                        let mut grpc = tonic::server::Grpc::new(codec)
17456                            .apply_compression_config(
17457                                accept_compression_encodings,
17458                                send_compression_encodings,
17459                            )
17460                            .apply_max_message_size_config(
17461                                max_decoding_message_size,
17462                                max_encoding_message_size,
17463                            );
17464                        let res = grpc.unary(method, req).await;
17465                        Ok(res)
17466                    };
17467                    Box::pin(fut)
17468                }
17469                _ => {
17470                    Box::pin(async move {
17471                        let mut response = http::Response::new(
17472                            tonic::body::Body::default(),
17473                        );
17474                        let headers = response.headers_mut();
17475                        headers
17476                            .insert(
17477                                tonic::Status::GRPC_STATUS,
17478                                (tonic::Code::Unimplemented as i32).into(),
17479                            );
17480                        headers
17481                            .insert(
17482                                http::header::CONTENT_TYPE,
17483                                tonic::metadata::GRPC_CONTENT_TYPE,
17484                            );
17485                        Ok(response)
17486                    })
17487                }
17488            }
17489        }
17490    }
17491    impl<T> Clone for TokenServiceServer<T> {
17492        fn clone(&self) -> Self {
17493            let inner = self.inner.clone();
17494            Self {
17495                inner,
17496                accept_compression_encodings: self.accept_compression_encodings,
17497                send_compression_encodings: self.send_compression_encodings,
17498                max_decoding_message_size: self.max_decoding_message_size,
17499                max_encoding_message_size: self.max_encoding_message_size,
17500            }
17501        }
17502    }
17503    /// Generated gRPC service name
17504    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
17505    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
17506        const NAME: &'static str = SERVICE_NAME;
17507    }
17508}