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    }
7516}
7517/// Generated server implementations.
7518pub mod insights_service_server {
7519    #![allow(
7520        unused_variables,
7521        dead_code,
7522        missing_docs,
7523        clippy::wildcard_imports,
7524        clippy::let_unit_value,
7525    )]
7526    use tonic::codegen::*;
7527    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7528    #[async_trait]
7529    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7530        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7531 Returns empty archetypes if insufficient data (cold start).
7532 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7533*/
7534        async fn get_group_archetypes(
7535            &self,
7536            request: tonic::Request<super::GetGroupArchetypesRequest>,
7537        ) -> std::result::Result<
7538            tonic::Response<super::GetGroupArchetypesResponse>,
7539            tonic::Status,
7540        >;
7541        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7542 Returns a confidence interval that narrows as more campaign data accumulates.
7543 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7544*/
7545        async fn predict_campaign_ack(
7546            &self,
7547            request: tonic::Request<super::PredictCampaignAckRequest>,
7548        ) -> std::result::Result<
7549            tonic::Response<super::PredictCampaignAckResponse>,
7550            tonic::Status,
7551        >;
7552        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7553 Advisory is informational only — never drives automated decisions.
7554 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7555*/
7556        async fn get_campaign_advisory(
7557            &self,
7558            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7559        ) -> std::result::Result<
7560            tonic::Response<super::GetCampaignAdvisoryResponse>,
7561            tonic::Status,
7562        >;
7563        /** Generate an AI-powered narrative summary of a group's insights.
7564 Combines archetype, prediction, and campaign data into human-readable analysis.
7565 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7566*/
7567        async fn get_insight_narrative(
7568            &self,
7569            request: tonic::Request<super::GetInsightNarrativeRequest>,
7570        ) -> std::result::Result<
7571            tonic::Response<super::GetInsightNarrativeResponse>,
7572            tonic::Status,
7573        >;
7574        /** Manually trigger the ML training pipeline for the caller's organization.
7575 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7576 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7577*/
7578        async fn trigger_ml_pipeline(
7579            &self,
7580            request: tonic::Request<super::TriggerMlPipelineRequest>,
7581        ) -> std::result::Result<
7582            tonic::Response<super::TriggerMlPipelineResponse>,
7583            tonic::Status,
7584        >;
7585        /** Manually retrigger archetype clustering for a single group, reusing
7586 the already-deployed SageMaker clustering model. Cheaper than a
7587 full TriggerMLPipeline run because no training happens. Shares the
7588 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7589 get N manual retrains per month across both RPCs.
7590 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7591*/
7592        async fn trigger_archetype_clustering(
7593            &self,
7594            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7595        ) -> std::result::Result<
7596            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7597            tonic::Status,
7598        >;
7599        /** Draft a campaign body for the given archetype using Bedrock with the
7600 campaign-for-archetype prompt template. Used by the Compass
7601 "Target this archetype" CTA to pre-fill the wizard's body field.
7602 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7603 returns NOT_FOUND.
7604 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7605*/
7606        async fn generate_campaign_body_draft(
7607            &self,
7608            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7609        ) -> std::result::Result<
7610            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7611            tonic::Status,
7612        >;
7613    }
7614    /** Provides cohort-level AI insights for campaign planning and optimization.
7615 All predictions are aggregate — no individual-level profiling.
7616 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7617 All RPCs operate within the caller's org (extracted from JWT).
7618*/
7619    #[derive(Debug)]
7620    pub struct InsightsServiceServer<T> {
7621        inner: Arc<T>,
7622        accept_compression_encodings: EnabledCompressionEncodings,
7623        send_compression_encodings: EnabledCompressionEncodings,
7624        max_decoding_message_size: Option<usize>,
7625        max_encoding_message_size: Option<usize>,
7626    }
7627    impl<T> InsightsServiceServer<T> {
7628        pub fn new(inner: T) -> Self {
7629            Self::from_arc(Arc::new(inner))
7630        }
7631        pub fn from_arc(inner: Arc<T>) -> Self {
7632            Self {
7633                inner,
7634                accept_compression_encodings: Default::default(),
7635                send_compression_encodings: Default::default(),
7636                max_decoding_message_size: None,
7637                max_encoding_message_size: None,
7638            }
7639        }
7640        pub fn with_interceptor<F>(
7641            inner: T,
7642            interceptor: F,
7643        ) -> InterceptedService<Self, F>
7644        where
7645            F: tonic::service::Interceptor,
7646        {
7647            InterceptedService::new(Self::new(inner), interceptor)
7648        }
7649        /// Enable decompressing requests with the given encoding.
7650        #[must_use]
7651        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7652            self.accept_compression_encodings.enable(encoding);
7653            self
7654        }
7655        /// Compress responses with the given encoding, if the client supports it.
7656        #[must_use]
7657        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7658            self.send_compression_encodings.enable(encoding);
7659            self
7660        }
7661        /// Limits the maximum size of a decoded message.
7662        ///
7663        /// Default: `4MB`
7664        #[must_use]
7665        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7666            self.max_decoding_message_size = Some(limit);
7667            self
7668        }
7669        /// Limits the maximum size of an encoded message.
7670        ///
7671        /// Default: `usize::MAX`
7672        #[must_use]
7673        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7674            self.max_encoding_message_size = Some(limit);
7675            self
7676        }
7677    }
7678    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7679    where
7680        T: InsightsService,
7681        B: Body + std::marker::Send + 'static,
7682        B::Error: Into<StdError> + std::marker::Send + 'static,
7683    {
7684        type Response = http::Response<tonic::body::Body>;
7685        type Error = std::convert::Infallible;
7686        type Future = BoxFuture<Self::Response, Self::Error>;
7687        fn poll_ready(
7688            &mut self,
7689            _cx: &mut Context<'_>,
7690        ) -> Poll<std::result::Result<(), Self::Error>> {
7691            Poll::Ready(Ok(()))
7692        }
7693        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7694            match req.uri().path() {
7695                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7696                    #[allow(non_camel_case_types)]
7697                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7698                    impl<
7699                        T: InsightsService,
7700                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7701                    for GetGroupArchetypesSvc<T> {
7702                        type Response = super::GetGroupArchetypesResponse;
7703                        type Future = BoxFuture<
7704                            tonic::Response<Self::Response>,
7705                            tonic::Status,
7706                        >;
7707                        fn call(
7708                            &mut self,
7709                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7710                        ) -> Self::Future {
7711                            let inner = Arc::clone(&self.0);
7712                            let fut = async move {
7713                                <T as InsightsService>::get_group_archetypes(
7714                                        &inner,
7715                                        request,
7716                                    )
7717                                    .await
7718                            };
7719                            Box::pin(fut)
7720                        }
7721                    }
7722                    let accept_compression_encodings = self.accept_compression_encodings;
7723                    let send_compression_encodings = self.send_compression_encodings;
7724                    let max_decoding_message_size = self.max_decoding_message_size;
7725                    let max_encoding_message_size = self.max_encoding_message_size;
7726                    let inner = self.inner.clone();
7727                    let fut = async move {
7728                        let method = GetGroupArchetypesSvc(inner);
7729                        let codec = tonic_prost::ProstCodec::default();
7730                        let mut grpc = tonic::server::Grpc::new(codec)
7731                            .apply_compression_config(
7732                                accept_compression_encodings,
7733                                send_compression_encodings,
7734                            )
7735                            .apply_max_message_size_config(
7736                                max_decoding_message_size,
7737                                max_encoding_message_size,
7738                            );
7739                        let res = grpc.unary(method, req).await;
7740                        Ok(res)
7741                    };
7742                    Box::pin(fut)
7743                }
7744                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7745                    #[allow(non_camel_case_types)]
7746                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7747                    impl<
7748                        T: InsightsService,
7749                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7750                    for PredictCampaignACKSvc<T> {
7751                        type Response = super::PredictCampaignAckResponse;
7752                        type Future = BoxFuture<
7753                            tonic::Response<Self::Response>,
7754                            tonic::Status,
7755                        >;
7756                        fn call(
7757                            &mut self,
7758                            request: tonic::Request<super::PredictCampaignAckRequest>,
7759                        ) -> Self::Future {
7760                            let inner = Arc::clone(&self.0);
7761                            let fut = async move {
7762                                <T as InsightsService>::predict_campaign_ack(
7763                                        &inner,
7764                                        request,
7765                                    )
7766                                    .await
7767                            };
7768                            Box::pin(fut)
7769                        }
7770                    }
7771                    let accept_compression_encodings = self.accept_compression_encodings;
7772                    let send_compression_encodings = self.send_compression_encodings;
7773                    let max_decoding_message_size = self.max_decoding_message_size;
7774                    let max_encoding_message_size = self.max_encoding_message_size;
7775                    let inner = self.inner.clone();
7776                    let fut = async move {
7777                        let method = PredictCampaignACKSvc(inner);
7778                        let codec = tonic_prost::ProstCodec::default();
7779                        let mut grpc = tonic::server::Grpc::new(codec)
7780                            .apply_compression_config(
7781                                accept_compression_encodings,
7782                                send_compression_encodings,
7783                            )
7784                            .apply_max_message_size_config(
7785                                max_decoding_message_size,
7786                                max_encoding_message_size,
7787                            );
7788                        let res = grpc.unary(method, req).await;
7789                        Ok(res)
7790                    };
7791                    Box::pin(fut)
7792                }
7793                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7794                    #[allow(non_camel_case_types)]
7795                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7796                    impl<
7797                        T: InsightsService,
7798                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7799                    for GetCampaignAdvisorySvc<T> {
7800                        type Response = super::GetCampaignAdvisoryResponse;
7801                        type Future = BoxFuture<
7802                            tonic::Response<Self::Response>,
7803                            tonic::Status,
7804                        >;
7805                        fn call(
7806                            &mut self,
7807                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7808                        ) -> Self::Future {
7809                            let inner = Arc::clone(&self.0);
7810                            let fut = async move {
7811                                <T as InsightsService>::get_campaign_advisory(
7812                                        &inner,
7813                                        request,
7814                                    )
7815                                    .await
7816                            };
7817                            Box::pin(fut)
7818                        }
7819                    }
7820                    let accept_compression_encodings = self.accept_compression_encodings;
7821                    let send_compression_encodings = self.send_compression_encodings;
7822                    let max_decoding_message_size = self.max_decoding_message_size;
7823                    let max_encoding_message_size = self.max_encoding_message_size;
7824                    let inner = self.inner.clone();
7825                    let fut = async move {
7826                        let method = GetCampaignAdvisorySvc(inner);
7827                        let codec = tonic_prost::ProstCodec::default();
7828                        let mut grpc = tonic::server::Grpc::new(codec)
7829                            .apply_compression_config(
7830                                accept_compression_encodings,
7831                                send_compression_encodings,
7832                            )
7833                            .apply_max_message_size_config(
7834                                max_decoding_message_size,
7835                                max_encoding_message_size,
7836                            );
7837                        let res = grpc.unary(method, req).await;
7838                        Ok(res)
7839                    };
7840                    Box::pin(fut)
7841                }
7842                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7843                    #[allow(non_camel_case_types)]
7844                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7845                    impl<
7846                        T: InsightsService,
7847                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7848                    for GetInsightNarrativeSvc<T> {
7849                        type Response = super::GetInsightNarrativeResponse;
7850                        type Future = BoxFuture<
7851                            tonic::Response<Self::Response>,
7852                            tonic::Status,
7853                        >;
7854                        fn call(
7855                            &mut self,
7856                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7857                        ) -> Self::Future {
7858                            let inner = Arc::clone(&self.0);
7859                            let fut = async move {
7860                                <T as InsightsService>::get_insight_narrative(
7861                                        &inner,
7862                                        request,
7863                                    )
7864                                    .await
7865                            };
7866                            Box::pin(fut)
7867                        }
7868                    }
7869                    let accept_compression_encodings = self.accept_compression_encodings;
7870                    let send_compression_encodings = self.send_compression_encodings;
7871                    let max_decoding_message_size = self.max_decoding_message_size;
7872                    let max_encoding_message_size = self.max_encoding_message_size;
7873                    let inner = self.inner.clone();
7874                    let fut = async move {
7875                        let method = GetInsightNarrativeSvc(inner);
7876                        let codec = tonic_prost::ProstCodec::default();
7877                        let mut grpc = tonic::server::Grpc::new(codec)
7878                            .apply_compression_config(
7879                                accept_compression_encodings,
7880                                send_compression_encodings,
7881                            )
7882                            .apply_max_message_size_config(
7883                                max_decoding_message_size,
7884                                max_encoding_message_size,
7885                            );
7886                        let res = grpc.unary(method, req).await;
7887                        Ok(res)
7888                    };
7889                    Box::pin(fut)
7890                }
7891                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7892                    #[allow(non_camel_case_types)]
7893                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7894                    impl<
7895                        T: InsightsService,
7896                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7897                    for TriggerMLPipelineSvc<T> {
7898                        type Response = super::TriggerMlPipelineResponse;
7899                        type Future = BoxFuture<
7900                            tonic::Response<Self::Response>,
7901                            tonic::Status,
7902                        >;
7903                        fn call(
7904                            &mut self,
7905                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7906                        ) -> Self::Future {
7907                            let inner = Arc::clone(&self.0);
7908                            let fut = async move {
7909                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
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 = TriggerMLPipelineSvc(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/TriggerArchetypeClustering" => {
7938                    #[allow(non_camel_case_types)]
7939                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7940                    impl<
7941                        T: InsightsService,
7942                    > tonic::server::UnaryService<
7943                        super::TriggerArchetypeClusteringRequest,
7944                    > for TriggerArchetypeClusteringSvc<T> {
7945                        type Response = super::TriggerArchetypeClusteringResponse;
7946                        type Future = BoxFuture<
7947                            tonic::Response<Self::Response>,
7948                            tonic::Status,
7949                        >;
7950                        fn call(
7951                            &mut self,
7952                            request: tonic::Request<
7953                                super::TriggerArchetypeClusteringRequest,
7954                            >,
7955                        ) -> Self::Future {
7956                            let inner = Arc::clone(&self.0);
7957                            let fut = async move {
7958                                <T as InsightsService>::trigger_archetype_clustering(
7959                                        &inner,
7960                                        request,
7961                                    )
7962                                    .await
7963                            };
7964                            Box::pin(fut)
7965                        }
7966                    }
7967                    let accept_compression_encodings = self.accept_compression_encodings;
7968                    let send_compression_encodings = self.send_compression_encodings;
7969                    let max_decoding_message_size = self.max_decoding_message_size;
7970                    let max_encoding_message_size = self.max_encoding_message_size;
7971                    let inner = self.inner.clone();
7972                    let fut = async move {
7973                        let method = TriggerArchetypeClusteringSvc(inner);
7974                        let codec = tonic_prost::ProstCodec::default();
7975                        let mut grpc = tonic::server::Grpc::new(codec)
7976                            .apply_compression_config(
7977                                accept_compression_encodings,
7978                                send_compression_encodings,
7979                            )
7980                            .apply_max_message_size_config(
7981                                max_decoding_message_size,
7982                                max_encoding_message_size,
7983                            );
7984                        let res = grpc.unary(method, req).await;
7985                        Ok(res)
7986                    };
7987                    Box::pin(fut)
7988                }
7989                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7990                    #[allow(non_camel_case_types)]
7991                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7992                    impl<
7993                        T: InsightsService,
7994                    > tonic::server::UnaryService<
7995                        super::GenerateCampaignBodyDraftRequest,
7996                    > for GenerateCampaignBodyDraftSvc<T> {
7997                        type Response = super::GenerateCampaignBodyDraftResponse;
7998                        type Future = BoxFuture<
7999                            tonic::Response<Self::Response>,
8000                            tonic::Status,
8001                        >;
8002                        fn call(
8003                            &mut self,
8004                            request: tonic::Request<
8005                                super::GenerateCampaignBodyDraftRequest,
8006                            >,
8007                        ) -> Self::Future {
8008                            let inner = Arc::clone(&self.0);
8009                            let fut = async move {
8010                                <T as InsightsService>::generate_campaign_body_draft(
8011                                        &inner,
8012                                        request,
8013                                    )
8014                                    .await
8015                            };
8016                            Box::pin(fut)
8017                        }
8018                    }
8019                    let accept_compression_encodings = self.accept_compression_encodings;
8020                    let send_compression_encodings = self.send_compression_encodings;
8021                    let max_decoding_message_size = self.max_decoding_message_size;
8022                    let max_encoding_message_size = self.max_encoding_message_size;
8023                    let inner = self.inner.clone();
8024                    let fut = async move {
8025                        let method = GenerateCampaignBodyDraftSvc(inner);
8026                        let codec = tonic_prost::ProstCodec::default();
8027                        let mut grpc = tonic::server::Grpc::new(codec)
8028                            .apply_compression_config(
8029                                accept_compression_encodings,
8030                                send_compression_encodings,
8031                            )
8032                            .apply_max_message_size_config(
8033                                max_decoding_message_size,
8034                                max_encoding_message_size,
8035                            );
8036                        let res = grpc.unary(method, req).await;
8037                        Ok(res)
8038                    };
8039                    Box::pin(fut)
8040                }
8041                _ => {
8042                    Box::pin(async move {
8043                        let mut response = http::Response::new(
8044                            tonic::body::Body::default(),
8045                        );
8046                        let headers = response.headers_mut();
8047                        headers
8048                            .insert(
8049                                tonic::Status::GRPC_STATUS,
8050                                (tonic::Code::Unimplemented as i32).into(),
8051                            );
8052                        headers
8053                            .insert(
8054                                http::header::CONTENT_TYPE,
8055                                tonic::metadata::GRPC_CONTENT_TYPE,
8056                            );
8057                        Ok(response)
8058                    })
8059                }
8060            }
8061        }
8062    }
8063    impl<T> Clone for InsightsServiceServer<T> {
8064        fn clone(&self) -> Self {
8065            let inner = self.inner.clone();
8066            Self {
8067                inner,
8068                accept_compression_encodings: self.accept_compression_encodings,
8069                send_compression_encodings: self.send_compression_encodings,
8070                max_decoding_message_size: self.max_decoding_message_size,
8071                max_encoding_message_size: self.max_encoding_message_size,
8072            }
8073        }
8074    }
8075    /// Generated gRPC service name
8076    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
8077    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
8078        const NAME: &'static str = SERVICE_NAME;
8079    }
8080}
8081/// Generated client implementations.
8082pub mod integrations_service_client {
8083    #![allow(
8084        unused_variables,
8085        dead_code,
8086        missing_docs,
8087        clippy::wildcard_imports,
8088        clippy::let_unit_value,
8089    )]
8090    use tonic::codegen::*;
8091    use tonic::codegen::http::Uri;
8092    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8093
8094 Auth model:
8095   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8096     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8097   - UpsertReachability / RemoveReachability / GetReachability /
8098     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8099     caller's `custom:org_id` claim).
8100   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8101     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8102     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8103
8104 Cross-org access is denied with `permission_denied`.
8105*/
8106    #[derive(Debug, Clone)]
8107    pub struct IntegrationsServiceClient<T> {
8108        inner: tonic::client::Grpc<T>,
8109    }
8110    impl IntegrationsServiceClient<tonic::transport::Channel> {
8111        /// Attempt to create a new client by connecting to a given endpoint.
8112        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8113        where
8114            D: TryInto<tonic::transport::Endpoint>,
8115            D::Error: Into<StdError>,
8116        {
8117            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8118            Ok(Self::new(conn))
8119        }
8120    }
8121    impl<T> IntegrationsServiceClient<T>
8122    where
8123        T: tonic::client::GrpcService<tonic::body::Body>,
8124        T::Error: Into<StdError>,
8125        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8126        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8127    {
8128        pub fn new(inner: T) -> Self {
8129            let inner = tonic::client::Grpc::new(inner);
8130            Self { inner }
8131        }
8132        pub fn with_origin(inner: T, origin: Uri) -> Self {
8133            let inner = tonic::client::Grpc::with_origin(inner, origin);
8134            Self { inner }
8135        }
8136        pub fn with_interceptor<F>(
8137            inner: T,
8138            interceptor: F,
8139        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
8140        where
8141            F: tonic::service::Interceptor,
8142            T::ResponseBody: Default,
8143            T: tonic::codegen::Service<
8144                http::Request<tonic::body::Body>,
8145                Response = http::Response<
8146                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8147                >,
8148            >,
8149            <T as tonic::codegen::Service<
8150                http::Request<tonic::body::Body>,
8151            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8152        {
8153            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
8154        }
8155        /// Compress requests with the given encoding.
8156        ///
8157        /// This requires the server to support it otherwise it might respond with an
8158        /// error.
8159        #[must_use]
8160        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8161            self.inner = self.inner.send_compressed(encoding);
8162            self
8163        }
8164        /// Enable decompressing responses.
8165        #[must_use]
8166        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8167            self.inner = self.inner.accept_compressed(encoding);
8168            self
8169        }
8170        /// Limits the maximum size of a decoded message.
8171        ///
8172        /// Default: `4MB`
8173        #[must_use]
8174        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8175            self.inner = self.inner.max_decoding_message_size(limit);
8176            self
8177        }
8178        /// Limits the maximum size of an encoded message.
8179        ///
8180        /// Default: `usize::MAX`
8181        #[must_use]
8182        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8183            self.inner = self.inner.max_encoding_message_size(limit);
8184            self
8185        }
8186        /** Dispatch a single rendered message to one channel. Idempotent on
8187 `dispatch_id`. Internal-mTLS only.
8188*/
8189        pub async fn dispatch_to_channel(
8190            &mut self,
8191            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8192        ) -> std::result::Result<
8193            tonic::Response<super::DispatchToChannelResponse>,
8194            tonic::Status,
8195        > {
8196            self.inner
8197                .ready()
8198                .await
8199                .map_err(|e| {
8200                    tonic::Status::unknown(
8201                        format!("Service was not ready: {}", e.into()),
8202                    )
8203                })?;
8204            let codec = tonic_prost::ProstCodec::default();
8205            let path = http::uri::PathAndQuery::from_static(
8206                "/pidgr.v1.IntegrationsService/DispatchToChannel",
8207            );
8208            let mut req = request.into_request();
8209            req.extensions_mut()
8210                .insert(
8211                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8212                );
8213            self.inner.unary(req, path, codec).await
8214        }
8215        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8216 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8217 audit row BEFORE the registry commit.
8218*/
8219        pub async fn upsert_reachability(
8220            &mut self,
8221            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8222        ) -> std::result::Result<
8223            tonic::Response<super::UpsertReachabilityResponse>,
8224            tonic::Status,
8225        > {
8226            self.inner
8227                .ready()
8228                .await
8229                .map_err(|e| {
8230                    tonic::Status::unknown(
8231                        format!("Service was not ready: {}", e.into()),
8232                    )
8233                })?;
8234            let codec = tonic_prost::ProstCodec::default();
8235            let path = http::uri::PathAndQuery::from_static(
8236                "/pidgr.v1.IntegrationsService/UpsertReachability",
8237            );
8238            let mut req = request.into_request();
8239            req.extensions_mut()
8240                .insert(
8241                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8242                );
8243            self.inner.unary(req, path, codec).await
8244        }
8245        /** Remove a reachability identifier. Idempotent. Emits a
8246 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8247*/
8248        pub async fn remove_reachability(
8249            &mut self,
8250            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8251        ) -> std::result::Result<
8252            tonic::Response<super::RemoveReachabilityResponse>,
8253            tonic::Status,
8254        > {
8255            self.inner
8256                .ready()
8257                .await
8258                .map_err(|e| {
8259                    tonic::Status::unknown(
8260                        format!("Service was not ready: {}", e.into()),
8261                    )
8262                })?;
8263            let codec = tonic_prost::ProstCodec::default();
8264            let path = http::uri::PathAndQuery::from_static(
8265                "/pidgr.v1.IntegrationsService/RemoveReachability",
8266            );
8267            let mut req = request.into_request();
8268            req.extensions_mut()
8269                .insert(
8270                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8271                );
8272            self.inner.unary(req, path, codec).await
8273        }
8274        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8275 Does not return plaintext or envelope ciphertext.
8276*/
8277        pub async fn get_reachability(
8278            &mut self,
8279            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8280        ) -> std::result::Result<
8281            tonic::Response<super::GetReachabilityResponse>,
8282            tonic::Status,
8283        > {
8284            self.inner
8285                .ready()
8286                .await
8287                .map_err(|e| {
8288                    tonic::Status::unknown(
8289                        format!("Service was not ready: {}", e.into()),
8290                    )
8291                })?;
8292            let codec = tonic_prost::ProstCodec::default();
8293            let path = http::uri::PathAndQuery::from_static(
8294                "/pidgr.v1.IntegrationsService/GetReachability",
8295            );
8296            let mut req = request.into_request();
8297            req.extensions_mut()
8298                .insert(
8299                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8300                );
8301            self.inner.unary(req, path, codec).await
8302        }
8303        /** List per-channel reachability metadata for a single user. Used by the
8304 admin per-user matrix view. Does not return plaintext or ciphertext.
8305*/
8306        pub async fn list_reachability_for_user(
8307            &mut self,
8308            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8309        ) -> std::result::Result<
8310            tonic::Response<super::ListReachabilityForUserResponse>,
8311            tonic::Status,
8312        > {
8313            self.inner
8314                .ready()
8315                .await
8316                .map_err(|e| {
8317                    tonic::Status::unknown(
8318                        format!("Service was not ready: {}", e.into()),
8319                    )
8320                })?;
8321            let codec = tonic_prost::ProstCodec::default();
8322            let path = http::uri::PathAndQuery::from_static(
8323                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8324            );
8325            let mut req = request.into_request();
8326            req.extensions_mut()
8327                .insert(
8328                    GrpcMethod::new(
8329                        "pidgr.v1.IntegrationsService",
8330                        "ListReachabilityForUser",
8331                    ),
8332                );
8333            self.inner.unary(req, path, codec).await
8334        }
8335        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8336 no policy is configured — NOT a NOT_FOUND.
8337*/
8338        pub async fn get_region_policy(
8339            &mut self,
8340            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8341        ) -> std::result::Result<
8342            tonic::Response<super::GetRegionPolicyResponse>,
8343            tonic::Status,
8344        > {
8345            self.inner
8346                .ready()
8347                .await
8348                .map_err(|e| {
8349                    tonic::Status::unknown(
8350                        format!("Service was not ready: {}", e.into()),
8351                    )
8352                })?;
8353            let codec = tonic_prost::ProstCodec::default();
8354            let path = http::uri::PathAndQuery::from_static(
8355                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8356            );
8357            let mut req = request.into_request();
8358            req.extensions_mut()
8359                .insert(
8360                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8361                );
8362            self.inner.unary(req, path, codec).await
8363        }
8364        /** Admin-only upsert of the per-(org, channel) region allowlist.
8365*/
8366        pub async fn set_region_policy(
8367            &mut self,
8368            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8369        ) -> std::result::Result<
8370            tonic::Response<super::SetRegionPolicyResponse>,
8371            tonic::Status,
8372        > {
8373            self.inner
8374                .ready()
8375                .await
8376                .map_err(|e| {
8377                    tonic::Status::unknown(
8378                        format!("Service was not ready: {}", e.into()),
8379                    )
8380                })?;
8381            let codec = tonic_prost::ProstCodec::default();
8382            let path = http::uri::PathAndQuery::from_static(
8383                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8384            );
8385            let mut req = request.into_request();
8386            req.extensions_mut()
8387                .insert(
8388                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8389                );
8390            self.inner.unary(req, path, codec).await
8391        }
8392        /** Read the current calendar-month cost-cap state. Returns the channel
8393 default cap when no row exists; never NOT_FOUND.
8394*/
8395        pub async fn get_cost_cap_policy(
8396            &mut self,
8397            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8398        ) -> std::result::Result<
8399            tonic::Response<super::GetCostCapPolicyResponse>,
8400            tonic::Status,
8401        > {
8402            self.inner
8403                .ready()
8404                .await
8405                .map_err(|e| {
8406                    tonic::Status::unknown(
8407                        format!("Service was not ready: {}", e.into()),
8408                    )
8409                })?;
8410            let codec = tonic_prost::ProstCodec::default();
8411            let path = http::uri::PathAndQuery::from_static(
8412                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8413            );
8414            let mut req = request.into_request();
8415            req.extensions_mut()
8416                .insert(
8417                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8418                );
8419            self.inner.unary(req, path, codec).await
8420        }
8421        /** Admin-only upsert of the current calendar-month cost cap.
8422*/
8423        pub async fn set_cost_cap_policy(
8424            &mut self,
8425            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8426        ) -> std::result::Result<
8427            tonic::Response<super::SetCostCapPolicyResponse>,
8428            tonic::Status,
8429        > {
8430            self.inner
8431                .ready()
8432                .await
8433                .map_err(|e| {
8434                    tonic::Status::unknown(
8435                        format!("Service was not ready: {}", e.into()),
8436                    )
8437                })?;
8438            let codec = tonic_prost::ProstCodec::default();
8439            let path = http::uri::PathAndQuery::from_static(
8440                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8441            );
8442            let mut req = request.into_request();
8443            req.extensions_mut()
8444                .insert(
8445                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8446                );
8447            self.inner.unary(req, path, codec).await
8448        }
8449        /** Read the org's generic-webhook channel configuration. The signing secret
8450 is never returned. Returns an empty-url config when none exists — NOT a
8451 NOT_FOUND.
8452*/
8453        pub async fn get_org_webhook_config(
8454            &mut self,
8455            request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8456        ) -> std::result::Result<
8457            tonic::Response<super::GetOrgWebhookConfigResponse>,
8458            tonic::Status,
8459        > {
8460            self.inner
8461                .ready()
8462                .await
8463                .map_err(|e| {
8464                    tonic::Status::unknown(
8465                        format!("Service was not ready: {}", e.into()),
8466                    )
8467                })?;
8468            let codec = tonic_prost::ProstCodec::default();
8469            let path = http::uri::PathAndQuery::from_static(
8470                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8471            );
8472            let mut req = request.into_request();
8473            req.extensions_mut()
8474                .insert(
8475                    GrpcMethod::new(
8476                        "pidgr.v1.IntegrationsService",
8477                        "GetOrgWebhookConfig",
8478                    ),
8479                );
8480            self.inner.unary(req, path, codec).await
8481        }
8482        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8483 the destination URL (https-only, public hosts) and envelope-encrypts the
8484 secret at rest.
8485*/
8486        pub async fn set_org_webhook_config(
8487            &mut self,
8488            request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8489        ) -> std::result::Result<
8490            tonic::Response<super::SetOrgWebhookConfigResponse>,
8491            tonic::Status,
8492        > {
8493            self.inner
8494                .ready()
8495                .await
8496                .map_err(|e| {
8497                    tonic::Status::unknown(
8498                        format!("Service was not ready: {}", e.into()),
8499                    )
8500                })?;
8501            let codec = tonic_prost::ProstCodec::default();
8502            let path = http::uri::PathAndQuery::from_static(
8503                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8504            );
8505            let mut req = request.into_request();
8506            req.extensions_mut()
8507                .insert(
8508                    GrpcMethod::new(
8509                        "pidgr.v1.IntegrationsService",
8510                        "SetOrgWebhookConfig",
8511                    ),
8512                );
8513            self.inner.unary(req, path, codec).await
8514        }
8515        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8516 user follows to bind a third-party channel (Telegram bot-follow, Slack
8517 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8518 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8519 are rejected with `invalid_argument`.
8520*/
8521        pub async fn create_channel_connect_link(
8522            &mut self,
8523            request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8524        ) -> std::result::Result<
8525            tonic::Response<super::CreateChannelConnectLinkResponse>,
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/CreateChannelConnectLink",
8539            );
8540            let mut req = request.into_request();
8541            req.extensions_mut()
8542                .insert(
8543                    GrpcMethod::new(
8544                        "pidgr.v1.IntegrationsService",
8545                        "CreateChannelConnectLink",
8546                    ),
8547                );
8548            self.inner.unary(req, path, codec).await
8549        }
8550    }
8551}
8552/// Generated server implementations.
8553pub mod integrations_service_server {
8554    #![allow(
8555        unused_variables,
8556        dead_code,
8557        missing_docs,
8558        clippy::wildcard_imports,
8559        clippy::let_unit_value,
8560    )]
8561    use tonic::codegen::*;
8562    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8563    #[async_trait]
8564    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8565        /** Dispatch a single rendered message to one channel. Idempotent on
8566 `dispatch_id`. Internal-mTLS only.
8567*/
8568        async fn dispatch_to_channel(
8569            &self,
8570            request: tonic::Request<super::DispatchToChannelRequest>,
8571        ) -> std::result::Result<
8572            tonic::Response<super::DispatchToChannelResponse>,
8573            tonic::Status,
8574        >;
8575        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8576 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8577 audit row BEFORE the registry commit.
8578*/
8579        async fn upsert_reachability(
8580            &self,
8581            request: tonic::Request<super::UpsertReachabilityRequest>,
8582        ) -> std::result::Result<
8583            tonic::Response<super::UpsertReachabilityResponse>,
8584            tonic::Status,
8585        >;
8586        /** Remove a reachability identifier. Idempotent. Emits a
8587 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8588*/
8589        async fn remove_reachability(
8590            &self,
8591            request: tonic::Request<super::RemoveReachabilityRequest>,
8592        ) -> std::result::Result<
8593            tonic::Response<super::RemoveReachabilityResponse>,
8594            tonic::Status,
8595        >;
8596        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8597 Does not return plaintext or envelope ciphertext.
8598*/
8599        async fn get_reachability(
8600            &self,
8601            request: tonic::Request<super::GetReachabilityRequest>,
8602        ) -> std::result::Result<
8603            tonic::Response<super::GetReachabilityResponse>,
8604            tonic::Status,
8605        >;
8606        /** List per-channel reachability metadata for a single user. Used by the
8607 admin per-user matrix view. Does not return plaintext or ciphertext.
8608*/
8609        async fn list_reachability_for_user(
8610            &self,
8611            request: tonic::Request<super::ListReachabilityForUserRequest>,
8612        ) -> std::result::Result<
8613            tonic::Response<super::ListReachabilityForUserResponse>,
8614            tonic::Status,
8615        >;
8616        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8617 no policy is configured — NOT a NOT_FOUND.
8618*/
8619        async fn get_region_policy(
8620            &self,
8621            request: tonic::Request<super::GetRegionPolicyRequest>,
8622        ) -> std::result::Result<
8623            tonic::Response<super::GetRegionPolicyResponse>,
8624            tonic::Status,
8625        >;
8626        /** Admin-only upsert of the per-(org, channel) region allowlist.
8627*/
8628        async fn set_region_policy(
8629            &self,
8630            request: tonic::Request<super::SetRegionPolicyRequest>,
8631        ) -> std::result::Result<
8632            tonic::Response<super::SetRegionPolicyResponse>,
8633            tonic::Status,
8634        >;
8635        /** Read the current calendar-month cost-cap state. Returns the channel
8636 default cap when no row exists; never NOT_FOUND.
8637*/
8638        async fn get_cost_cap_policy(
8639            &self,
8640            request: tonic::Request<super::GetCostCapPolicyRequest>,
8641        ) -> std::result::Result<
8642            tonic::Response<super::GetCostCapPolicyResponse>,
8643            tonic::Status,
8644        >;
8645        /** Admin-only upsert of the current calendar-month cost cap.
8646*/
8647        async fn set_cost_cap_policy(
8648            &self,
8649            request: tonic::Request<super::SetCostCapPolicyRequest>,
8650        ) -> std::result::Result<
8651            tonic::Response<super::SetCostCapPolicyResponse>,
8652            tonic::Status,
8653        >;
8654        /** Read the org's generic-webhook channel configuration. The signing secret
8655 is never returned. Returns an empty-url config when none exists — NOT a
8656 NOT_FOUND.
8657*/
8658        async fn get_org_webhook_config(
8659            &self,
8660            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8661        ) -> std::result::Result<
8662            tonic::Response<super::GetOrgWebhookConfigResponse>,
8663            tonic::Status,
8664        >;
8665        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8666 the destination URL (https-only, public hosts) and envelope-encrypts the
8667 secret at rest.
8668*/
8669        async fn set_org_webhook_config(
8670            &self,
8671            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8672        ) -> std::result::Result<
8673            tonic::Response<super::SetOrgWebhookConfigResponse>,
8674            tonic::Status,
8675        >;
8676        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8677 user follows to bind a third-party channel (Telegram bot-follow, Slack
8678 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8679 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8680 are rejected with `invalid_argument`.
8681*/
8682        async fn create_channel_connect_link(
8683            &self,
8684            request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8685        ) -> std::result::Result<
8686            tonic::Response<super::CreateChannelConnectLinkResponse>,
8687            tonic::Status,
8688        >;
8689    }
8690    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8691
8692 Auth model:
8693   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8694     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8695   - UpsertReachability / RemoveReachability / GetReachability /
8696     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8697     caller's `custom:org_id` claim).
8698   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8699     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8700     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8701
8702 Cross-org access is denied with `permission_denied`.
8703*/
8704    #[derive(Debug)]
8705    pub struct IntegrationsServiceServer<T> {
8706        inner: Arc<T>,
8707        accept_compression_encodings: EnabledCompressionEncodings,
8708        send_compression_encodings: EnabledCompressionEncodings,
8709        max_decoding_message_size: Option<usize>,
8710        max_encoding_message_size: Option<usize>,
8711    }
8712    impl<T> IntegrationsServiceServer<T> {
8713        pub fn new(inner: T) -> Self {
8714            Self::from_arc(Arc::new(inner))
8715        }
8716        pub fn from_arc(inner: Arc<T>) -> Self {
8717            Self {
8718                inner,
8719                accept_compression_encodings: Default::default(),
8720                send_compression_encodings: Default::default(),
8721                max_decoding_message_size: None,
8722                max_encoding_message_size: None,
8723            }
8724        }
8725        pub fn with_interceptor<F>(
8726            inner: T,
8727            interceptor: F,
8728        ) -> InterceptedService<Self, F>
8729        where
8730            F: tonic::service::Interceptor,
8731        {
8732            InterceptedService::new(Self::new(inner), interceptor)
8733        }
8734        /// Enable decompressing requests with the given encoding.
8735        #[must_use]
8736        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8737            self.accept_compression_encodings.enable(encoding);
8738            self
8739        }
8740        /// Compress responses with the given encoding, if the client supports it.
8741        #[must_use]
8742        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8743            self.send_compression_encodings.enable(encoding);
8744            self
8745        }
8746        /// Limits the maximum size of a decoded message.
8747        ///
8748        /// Default: `4MB`
8749        #[must_use]
8750        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8751            self.max_decoding_message_size = Some(limit);
8752            self
8753        }
8754        /// Limits the maximum size of an encoded message.
8755        ///
8756        /// Default: `usize::MAX`
8757        #[must_use]
8758        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8759            self.max_encoding_message_size = Some(limit);
8760            self
8761        }
8762    }
8763    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8764    where
8765        T: IntegrationsService,
8766        B: Body + std::marker::Send + 'static,
8767        B::Error: Into<StdError> + std::marker::Send + 'static,
8768    {
8769        type Response = http::Response<tonic::body::Body>;
8770        type Error = std::convert::Infallible;
8771        type Future = BoxFuture<Self::Response, Self::Error>;
8772        fn poll_ready(
8773            &mut self,
8774            _cx: &mut Context<'_>,
8775        ) -> Poll<std::result::Result<(), Self::Error>> {
8776            Poll::Ready(Ok(()))
8777        }
8778        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8779            match req.uri().path() {
8780                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8781                    #[allow(non_camel_case_types)]
8782                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8783                    impl<
8784                        T: IntegrationsService,
8785                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
8786                    for DispatchToChannelSvc<T> {
8787                        type Response = super::DispatchToChannelResponse;
8788                        type Future = BoxFuture<
8789                            tonic::Response<Self::Response>,
8790                            tonic::Status,
8791                        >;
8792                        fn call(
8793                            &mut self,
8794                            request: tonic::Request<super::DispatchToChannelRequest>,
8795                        ) -> Self::Future {
8796                            let inner = Arc::clone(&self.0);
8797                            let fut = async move {
8798                                <T as IntegrationsService>::dispatch_to_channel(
8799                                        &inner,
8800                                        request,
8801                                    )
8802                                    .await
8803                            };
8804                            Box::pin(fut)
8805                        }
8806                    }
8807                    let accept_compression_encodings = self.accept_compression_encodings;
8808                    let send_compression_encodings = self.send_compression_encodings;
8809                    let max_decoding_message_size = self.max_decoding_message_size;
8810                    let max_encoding_message_size = self.max_encoding_message_size;
8811                    let inner = self.inner.clone();
8812                    let fut = async move {
8813                        let method = DispatchToChannelSvc(inner);
8814                        let codec = tonic_prost::ProstCodec::default();
8815                        let mut grpc = tonic::server::Grpc::new(codec)
8816                            .apply_compression_config(
8817                                accept_compression_encodings,
8818                                send_compression_encodings,
8819                            )
8820                            .apply_max_message_size_config(
8821                                max_decoding_message_size,
8822                                max_encoding_message_size,
8823                            );
8824                        let res = grpc.unary(method, req).await;
8825                        Ok(res)
8826                    };
8827                    Box::pin(fut)
8828                }
8829                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8830                    #[allow(non_camel_case_types)]
8831                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8832                    impl<
8833                        T: IntegrationsService,
8834                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8835                    for UpsertReachabilitySvc<T> {
8836                        type Response = super::UpsertReachabilityResponse;
8837                        type Future = BoxFuture<
8838                            tonic::Response<Self::Response>,
8839                            tonic::Status,
8840                        >;
8841                        fn call(
8842                            &mut self,
8843                            request: tonic::Request<super::UpsertReachabilityRequest>,
8844                        ) -> Self::Future {
8845                            let inner = Arc::clone(&self.0);
8846                            let fut = async move {
8847                                <T as IntegrationsService>::upsert_reachability(
8848                                        &inner,
8849                                        request,
8850                                    )
8851                                    .await
8852                            };
8853                            Box::pin(fut)
8854                        }
8855                    }
8856                    let accept_compression_encodings = self.accept_compression_encodings;
8857                    let send_compression_encodings = self.send_compression_encodings;
8858                    let max_decoding_message_size = self.max_decoding_message_size;
8859                    let max_encoding_message_size = self.max_encoding_message_size;
8860                    let inner = self.inner.clone();
8861                    let fut = async move {
8862                        let method = UpsertReachabilitySvc(inner);
8863                        let codec = tonic_prost::ProstCodec::default();
8864                        let mut grpc = tonic::server::Grpc::new(codec)
8865                            .apply_compression_config(
8866                                accept_compression_encodings,
8867                                send_compression_encodings,
8868                            )
8869                            .apply_max_message_size_config(
8870                                max_decoding_message_size,
8871                                max_encoding_message_size,
8872                            );
8873                        let res = grpc.unary(method, req).await;
8874                        Ok(res)
8875                    };
8876                    Box::pin(fut)
8877                }
8878                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8879                    #[allow(non_camel_case_types)]
8880                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8881                    impl<
8882                        T: IntegrationsService,
8883                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8884                    for RemoveReachabilitySvc<T> {
8885                        type Response = super::RemoveReachabilityResponse;
8886                        type Future = BoxFuture<
8887                            tonic::Response<Self::Response>,
8888                            tonic::Status,
8889                        >;
8890                        fn call(
8891                            &mut self,
8892                            request: tonic::Request<super::RemoveReachabilityRequest>,
8893                        ) -> Self::Future {
8894                            let inner = Arc::clone(&self.0);
8895                            let fut = async move {
8896                                <T as IntegrationsService>::remove_reachability(
8897                                        &inner,
8898                                        request,
8899                                    )
8900                                    .await
8901                            };
8902                            Box::pin(fut)
8903                        }
8904                    }
8905                    let accept_compression_encodings = self.accept_compression_encodings;
8906                    let send_compression_encodings = self.send_compression_encodings;
8907                    let max_decoding_message_size = self.max_decoding_message_size;
8908                    let max_encoding_message_size = self.max_encoding_message_size;
8909                    let inner = self.inner.clone();
8910                    let fut = async move {
8911                        let method = RemoveReachabilitySvc(inner);
8912                        let codec = tonic_prost::ProstCodec::default();
8913                        let mut grpc = tonic::server::Grpc::new(codec)
8914                            .apply_compression_config(
8915                                accept_compression_encodings,
8916                                send_compression_encodings,
8917                            )
8918                            .apply_max_message_size_config(
8919                                max_decoding_message_size,
8920                                max_encoding_message_size,
8921                            );
8922                        let res = grpc.unary(method, req).await;
8923                        Ok(res)
8924                    };
8925                    Box::pin(fut)
8926                }
8927                "/pidgr.v1.IntegrationsService/GetReachability" => {
8928                    #[allow(non_camel_case_types)]
8929                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8930                    impl<
8931                        T: IntegrationsService,
8932                    > tonic::server::UnaryService<super::GetReachabilityRequest>
8933                    for GetReachabilitySvc<T> {
8934                        type Response = super::GetReachabilityResponse;
8935                        type Future = BoxFuture<
8936                            tonic::Response<Self::Response>,
8937                            tonic::Status,
8938                        >;
8939                        fn call(
8940                            &mut self,
8941                            request: tonic::Request<super::GetReachabilityRequest>,
8942                        ) -> Self::Future {
8943                            let inner = Arc::clone(&self.0);
8944                            let fut = async move {
8945                                <T as IntegrationsService>::get_reachability(
8946                                        &inner,
8947                                        request,
8948                                    )
8949                                    .await
8950                            };
8951                            Box::pin(fut)
8952                        }
8953                    }
8954                    let accept_compression_encodings = self.accept_compression_encodings;
8955                    let send_compression_encodings = self.send_compression_encodings;
8956                    let max_decoding_message_size = self.max_decoding_message_size;
8957                    let max_encoding_message_size = self.max_encoding_message_size;
8958                    let inner = self.inner.clone();
8959                    let fut = async move {
8960                        let method = GetReachabilitySvc(inner);
8961                        let codec = tonic_prost::ProstCodec::default();
8962                        let mut grpc = tonic::server::Grpc::new(codec)
8963                            .apply_compression_config(
8964                                accept_compression_encodings,
8965                                send_compression_encodings,
8966                            )
8967                            .apply_max_message_size_config(
8968                                max_decoding_message_size,
8969                                max_encoding_message_size,
8970                            );
8971                        let res = grpc.unary(method, req).await;
8972                        Ok(res)
8973                    };
8974                    Box::pin(fut)
8975                }
8976                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8977                    #[allow(non_camel_case_types)]
8978                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
8979                        pub Arc<T>,
8980                    );
8981                    impl<
8982                        T: IntegrationsService,
8983                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8984                    for ListReachabilityForUserSvc<T> {
8985                        type Response = super::ListReachabilityForUserResponse;
8986                        type Future = BoxFuture<
8987                            tonic::Response<Self::Response>,
8988                            tonic::Status,
8989                        >;
8990                        fn call(
8991                            &mut self,
8992                            request: tonic::Request<
8993                                super::ListReachabilityForUserRequest,
8994                            >,
8995                        ) -> Self::Future {
8996                            let inner = Arc::clone(&self.0);
8997                            let fut = async move {
8998                                <T as IntegrationsService>::list_reachability_for_user(
8999                                        &inner,
9000                                        request,
9001                                    )
9002                                    .await
9003                            };
9004                            Box::pin(fut)
9005                        }
9006                    }
9007                    let accept_compression_encodings = self.accept_compression_encodings;
9008                    let send_compression_encodings = self.send_compression_encodings;
9009                    let max_decoding_message_size = self.max_decoding_message_size;
9010                    let max_encoding_message_size = self.max_encoding_message_size;
9011                    let inner = self.inner.clone();
9012                    let fut = async move {
9013                        let method = ListReachabilityForUserSvc(inner);
9014                        let codec = tonic_prost::ProstCodec::default();
9015                        let mut grpc = tonic::server::Grpc::new(codec)
9016                            .apply_compression_config(
9017                                accept_compression_encodings,
9018                                send_compression_encodings,
9019                            )
9020                            .apply_max_message_size_config(
9021                                max_decoding_message_size,
9022                                max_encoding_message_size,
9023                            );
9024                        let res = grpc.unary(method, req).await;
9025                        Ok(res)
9026                    };
9027                    Box::pin(fut)
9028                }
9029                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
9030                    #[allow(non_camel_case_types)]
9031                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9032                    impl<
9033                        T: IntegrationsService,
9034                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
9035                    for GetRegionPolicySvc<T> {
9036                        type Response = super::GetRegionPolicyResponse;
9037                        type Future = BoxFuture<
9038                            tonic::Response<Self::Response>,
9039                            tonic::Status,
9040                        >;
9041                        fn call(
9042                            &mut self,
9043                            request: tonic::Request<super::GetRegionPolicyRequest>,
9044                        ) -> Self::Future {
9045                            let inner = Arc::clone(&self.0);
9046                            let fut = async move {
9047                                <T as IntegrationsService>::get_region_policy(
9048                                        &inner,
9049                                        request,
9050                                    )
9051                                    .await
9052                            };
9053                            Box::pin(fut)
9054                        }
9055                    }
9056                    let accept_compression_encodings = self.accept_compression_encodings;
9057                    let send_compression_encodings = self.send_compression_encodings;
9058                    let max_decoding_message_size = self.max_decoding_message_size;
9059                    let max_encoding_message_size = self.max_encoding_message_size;
9060                    let inner = self.inner.clone();
9061                    let fut = async move {
9062                        let method = GetRegionPolicySvc(inner);
9063                        let codec = tonic_prost::ProstCodec::default();
9064                        let mut grpc = tonic::server::Grpc::new(codec)
9065                            .apply_compression_config(
9066                                accept_compression_encodings,
9067                                send_compression_encodings,
9068                            )
9069                            .apply_max_message_size_config(
9070                                max_decoding_message_size,
9071                                max_encoding_message_size,
9072                            );
9073                        let res = grpc.unary(method, req).await;
9074                        Ok(res)
9075                    };
9076                    Box::pin(fut)
9077                }
9078                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
9079                    #[allow(non_camel_case_types)]
9080                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9081                    impl<
9082                        T: IntegrationsService,
9083                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
9084                    for SetRegionPolicySvc<T> {
9085                        type Response = super::SetRegionPolicyResponse;
9086                        type Future = BoxFuture<
9087                            tonic::Response<Self::Response>,
9088                            tonic::Status,
9089                        >;
9090                        fn call(
9091                            &mut self,
9092                            request: tonic::Request<super::SetRegionPolicyRequest>,
9093                        ) -> Self::Future {
9094                            let inner = Arc::clone(&self.0);
9095                            let fut = async move {
9096                                <T as IntegrationsService>::set_region_policy(
9097                                        &inner,
9098                                        request,
9099                                    )
9100                                    .await
9101                            };
9102                            Box::pin(fut)
9103                        }
9104                    }
9105                    let accept_compression_encodings = self.accept_compression_encodings;
9106                    let send_compression_encodings = self.send_compression_encodings;
9107                    let max_decoding_message_size = self.max_decoding_message_size;
9108                    let max_encoding_message_size = self.max_encoding_message_size;
9109                    let inner = self.inner.clone();
9110                    let fut = async move {
9111                        let method = SetRegionPolicySvc(inner);
9112                        let codec = tonic_prost::ProstCodec::default();
9113                        let mut grpc = tonic::server::Grpc::new(codec)
9114                            .apply_compression_config(
9115                                accept_compression_encodings,
9116                                send_compression_encodings,
9117                            )
9118                            .apply_max_message_size_config(
9119                                max_decoding_message_size,
9120                                max_encoding_message_size,
9121                            );
9122                        let res = grpc.unary(method, req).await;
9123                        Ok(res)
9124                    };
9125                    Box::pin(fut)
9126                }
9127                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
9128                    #[allow(non_camel_case_types)]
9129                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9130                    impl<
9131                        T: IntegrationsService,
9132                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
9133                    for GetCostCapPolicySvc<T> {
9134                        type Response = super::GetCostCapPolicyResponse;
9135                        type Future = BoxFuture<
9136                            tonic::Response<Self::Response>,
9137                            tonic::Status,
9138                        >;
9139                        fn call(
9140                            &mut self,
9141                            request: tonic::Request<super::GetCostCapPolicyRequest>,
9142                        ) -> Self::Future {
9143                            let inner = Arc::clone(&self.0);
9144                            let fut = async move {
9145                                <T as IntegrationsService>::get_cost_cap_policy(
9146                                        &inner,
9147                                        request,
9148                                    )
9149                                    .await
9150                            };
9151                            Box::pin(fut)
9152                        }
9153                    }
9154                    let accept_compression_encodings = self.accept_compression_encodings;
9155                    let send_compression_encodings = self.send_compression_encodings;
9156                    let max_decoding_message_size = self.max_decoding_message_size;
9157                    let max_encoding_message_size = self.max_encoding_message_size;
9158                    let inner = self.inner.clone();
9159                    let fut = async move {
9160                        let method = GetCostCapPolicySvc(inner);
9161                        let codec = tonic_prost::ProstCodec::default();
9162                        let mut grpc = tonic::server::Grpc::new(codec)
9163                            .apply_compression_config(
9164                                accept_compression_encodings,
9165                                send_compression_encodings,
9166                            )
9167                            .apply_max_message_size_config(
9168                                max_decoding_message_size,
9169                                max_encoding_message_size,
9170                            );
9171                        let res = grpc.unary(method, req).await;
9172                        Ok(res)
9173                    };
9174                    Box::pin(fut)
9175                }
9176                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
9177                    #[allow(non_camel_case_types)]
9178                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9179                    impl<
9180                        T: IntegrationsService,
9181                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9182                    for SetCostCapPolicySvc<T> {
9183                        type Response = super::SetCostCapPolicyResponse;
9184                        type Future = BoxFuture<
9185                            tonic::Response<Self::Response>,
9186                            tonic::Status,
9187                        >;
9188                        fn call(
9189                            &mut self,
9190                            request: tonic::Request<super::SetCostCapPolicyRequest>,
9191                        ) -> Self::Future {
9192                            let inner = Arc::clone(&self.0);
9193                            let fut = async move {
9194                                <T as IntegrationsService>::set_cost_cap_policy(
9195                                        &inner,
9196                                        request,
9197                                    )
9198                                    .await
9199                            };
9200                            Box::pin(fut)
9201                        }
9202                    }
9203                    let accept_compression_encodings = self.accept_compression_encodings;
9204                    let send_compression_encodings = self.send_compression_encodings;
9205                    let max_decoding_message_size = self.max_decoding_message_size;
9206                    let max_encoding_message_size = self.max_encoding_message_size;
9207                    let inner = self.inner.clone();
9208                    let fut = async move {
9209                        let method = SetCostCapPolicySvc(inner);
9210                        let codec = tonic_prost::ProstCodec::default();
9211                        let mut grpc = tonic::server::Grpc::new(codec)
9212                            .apply_compression_config(
9213                                accept_compression_encodings,
9214                                send_compression_encodings,
9215                            )
9216                            .apply_max_message_size_config(
9217                                max_decoding_message_size,
9218                                max_encoding_message_size,
9219                            );
9220                        let res = grpc.unary(method, req).await;
9221                        Ok(res)
9222                    };
9223                    Box::pin(fut)
9224                }
9225                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9226                    #[allow(non_camel_case_types)]
9227                    struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9228                    impl<
9229                        T: IntegrationsService,
9230                    > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9231                    for GetOrgWebhookConfigSvc<T> {
9232                        type Response = super::GetOrgWebhookConfigResponse;
9233                        type Future = BoxFuture<
9234                            tonic::Response<Self::Response>,
9235                            tonic::Status,
9236                        >;
9237                        fn call(
9238                            &mut self,
9239                            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9240                        ) -> Self::Future {
9241                            let inner = Arc::clone(&self.0);
9242                            let fut = async move {
9243                                <T as IntegrationsService>::get_org_webhook_config(
9244                                        &inner,
9245                                        request,
9246                                    )
9247                                    .await
9248                            };
9249                            Box::pin(fut)
9250                        }
9251                    }
9252                    let accept_compression_encodings = self.accept_compression_encodings;
9253                    let send_compression_encodings = self.send_compression_encodings;
9254                    let max_decoding_message_size = self.max_decoding_message_size;
9255                    let max_encoding_message_size = self.max_encoding_message_size;
9256                    let inner = self.inner.clone();
9257                    let fut = async move {
9258                        let method = GetOrgWebhookConfigSvc(inner);
9259                        let codec = tonic_prost::ProstCodec::default();
9260                        let mut grpc = tonic::server::Grpc::new(codec)
9261                            .apply_compression_config(
9262                                accept_compression_encodings,
9263                                send_compression_encodings,
9264                            )
9265                            .apply_max_message_size_config(
9266                                max_decoding_message_size,
9267                                max_encoding_message_size,
9268                            );
9269                        let res = grpc.unary(method, req).await;
9270                        Ok(res)
9271                    };
9272                    Box::pin(fut)
9273                }
9274                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9275                    #[allow(non_camel_case_types)]
9276                    struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9277                    impl<
9278                        T: IntegrationsService,
9279                    > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9280                    for SetOrgWebhookConfigSvc<T> {
9281                        type Response = super::SetOrgWebhookConfigResponse;
9282                        type Future = BoxFuture<
9283                            tonic::Response<Self::Response>,
9284                            tonic::Status,
9285                        >;
9286                        fn call(
9287                            &mut self,
9288                            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9289                        ) -> Self::Future {
9290                            let inner = Arc::clone(&self.0);
9291                            let fut = async move {
9292                                <T as IntegrationsService>::set_org_webhook_config(
9293                                        &inner,
9294                                        request,
9295                                    )
9296                                    .await
9297                            };
9298                            Box::pin(fut)
9299                        }
9300                    }
9301                    let accept_compression_encodings = self.accept_compression_encodings;
9302                    let send_compression_encodings = self.send_compression_encodings;
9303                    let max_decoding_message_size = self.max_decoding_message_size;
9304                    let max_encoding_message_size = self.max_encoding_message_size;
9305                    let inner = self.inner.clone();
9306                    let fut = async move {
9307                        let method = SetOrgWebhookConfigSvc(inner);
9308                        let codec = tonic_prost::ProstCodec::default();
9309                        let mut grpc = tonic::server::Grpc::new(codec)
9310                            .apply_compression_config(
9311                                accept_compression_encodings,
9312                                send_compression_encodings,
9313                            )
9314                            .apply_max_message_size_config(
9315                                max_decoding_message_size,
9316                                max_encoding_message_size,
9317                            );
9318                        let res = grpc.unary(method, req).await;
9319                        Ok(res)
9320                    };
9321                    Box::pin(fut)
9322                }
9323                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9324                    #[allow(non_camel_case_types)]
9325                    struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9326                        pub Arc<T>,
9327                    );
9328                    impl<
9329                        T: IntegrationsService,
9330                    > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9331                    for CreateChannelConnectLinkSvc<T> {
9332                        type Response = super::CreateChannelConnectLinkResponse;
9333                        type Future = BoxFuture<
9334                            tonic::Response<Self::Response>,
9335                            tonic::Status,
9336                        >;
9337                        fn call(
9338                            &mut self,
9339                            request: tonic::Request<
9340                                super::CreateChannelConnectLinkRequest,
9341                            >,
9342                        ) -> Self::Future {
9343                            let inner = Arc::clone(&self.0);
9344                            let fut = async move {
9345                                <T as IntegrationsService>::create_channel_connect_link(
9346                                        &inner,
9347                                        request,
9348                                    )
9349                                    .await
9350                            };
9351                            Box::pin(fut)
9352                        }
9353                    }
9354                    let accept_compression_encodings = self.accept_compression_encodings;
9355                    let send_compression_encodings = self.send_compression_encodings;
9356                    let max_decoding_message_size = self.max_decoding_message_size;
9357                    let max_encoding_message_size = self.max_encoding_message_size;
9358                    let inner = self.inner.clone();
9359                    let fut = async move {
9360                        let method = CreateChannelConnectLinkSvc(inner);
9361                        let codec = tonic_prost::ProstCodec::default();
9362                        let mut grpc = tonic::server::Grpc::new(codec)
9363                            .apply_compression_config(
9364                                accept_compression_encodings,
9365                                send_compression_encodings,
9366                            )
9367                            .apply_max_message_size_config(
9368                                max_decoding_message_size,
9369                                max_encoding_message_size,
9370                            );
9371                        let res = grpc.unary(method, req).await;
9372                        Ok(res)
9373                    };
9374                    Box::pin(fut)
9375                }
9376                _ => {
9377                    Box::pin(async move {
9378                        let mut response = http::Response::new(
9379                            tonic::body::Body::default(),
9380                        );
9381                        let headers = response.headers_mut();
9382                        headers
9383                            .insert(
9384                                tonic::Status::GRPC_STATUS,
9385                                (tonic::Code::Unimplemented as i32).into(),
9386                            );
9387                        headers
9388                            .insert(
9389                                http::header::CONTENT_TYPE,
9390                                tonic::metadata::GRPC_CONTENT_TYPE,
9391                            );
9392                        Ok(response)
9393                    })
9394                }
9395            }
9396        }
9397    }
9398    impl<T> Clone for IntegrationsServiceServer<T> {
9399        fn clone(&self) -> Self {
9400            let inner = self.inner.clone();
9401            Self {
9402                inner,
9403                accept_compression_encodings: self.accept_compression_encodings,
9404                send_compression_encodings: self.send_compression_encodings,
9405                max_decoding_message_size: self.max_decoding_message_size,
9406                max_encoding_message_size: self.max_encoding_message_size,
9407            }
9408        }
9409    }
9410    /// Generated gRPC service name
9411    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9412    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9413        const NAME: &'static str = SERVICE_NAME;
9414    }
9415}
9416/// Generated client implementations.
9417pub mod invite_link_service_client {
9418    #![allow(
9419        unused_variables,
9420        dead_code,
9421        missing_docs,
9422        clippy::wildcard_imports,
9423        clippy::let_unit_value,
9424    )]
9425    use tonic::codegen::*;
9426    use tonic::codegen::http::Uri;
9427    /** Manages shareable invite links for organization self-join.
9428 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9429 ValidateInviteLink is unauthenticated — the token IS the authorization.
9430 RedeemInviteLink requires a valid JWT.
9431*/
9432    #[derive(Debug, Clone)]
9433    pub struct InviteLinkServiceClient<T> {
9434        inner: tonic::client::Grpc<T>,
9435    }
9436    impl InviteLinkServiceClient<tonic::transport::Channel> {
9437        /// Attempt to create a new client by connecting to a given endpoint.
9438        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9439        where
9440            D: TryInto<tonic::transport::Endpoint>,
9441            D::Error: Into<StdError>,
9442        {
9443            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9444            Ok(Self::new(conn))
9445        }
9446    }
9447    impl<T> InviteLinkServiceClient<T>
9448    where
9449        T: tonic::client::GrpcService<tonic::body::Body>,
9450        T::Error: Into<StdError>,
9451        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9452        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9453    {
9454        pub fn new(inner: T) -> Self {
9455            let inner = tonic::client::Grpc::new(inner);
9456            Self { inner }
9457        }
9458        pub fn with_origin(inner: T, origin: Uri) -> Self {
9459            let inner = tonic::client::Grpc::with_origin(inner, origin);
9460            Self { inner }
9461        }
9462        pub fn with_interceptor<F>(
9463            inner: T,
9464            interceptor: F,
9465        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9466        where
9467            F: tonic::service::Interceptor,
9468            T::ResponseBody: Default,
9469            T: tonic::codegen::Service<
9470                http::Request<tonic::body::Body>,
9471                Response = http::Response<
9472                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9473                >,
9474            >,
9475            <T as tonic::codegen::Service<
9476                http::Request<tonic::body::Body>,
9477            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9478        {
9479            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9480        }
9481        /// Compress requests with the given encoding.
9482        ///
9483        /// This requires the server to support it otherwise it might respond with an
9484        /// error.
9485        #[must_use]
9486        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9487            self.inner = self.inner.send_compressed(encoding);
9488            self
9489        }
9490        /// Enable decompressing responses.
9491        #[must_use]
9492        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9493            self.inner = self.inner.accept_compressed(encoding);
9494            self
9495        }
9496        /// Limits the maximum size of a decoded message.
9497        ///
9498        /// Default: `4MB`
9499        #[must_use]
9500        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9501            self.inner = self.inner.max_decoding_message_size(limit);
9502            self
9503        }
9504        /// Limits the maximum size of an encoded message.
9505        ///
9506        /// Default: `usize::MAX`
9507        #[must_use]
9508        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9509            self.inner = self.inner.max_encoding_message_size(limit);
9510            self
9511        }
9512        /** Create a new shareable invite link for the organization.
9513 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9514*/
9515        pub async fn create_invite_link(
9516            &mut self,
9517            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9518        ) -> std::result::Result<
9519            tonic::Response<super::CreateInviteLinkResponse>,
9520            tonic::Status,
9521        > {
9522            self.inner
9523                .ready()
9524                .await
9525                .map_err(|e| {
9526                    tonic::Status::unknown(
9527                        format!("Service was not ready: {}", e.into()),
9528                    )
9529                })?;
9530            let codec = tonic_prost::ProstCodec::default();
9531            let path = http::uri::PathAndQuery::from_static(
9532                "/pidgr.v1.InviteLinkService/CreateInviteLink",
9533            );
9534            let mut req = request.into_request();
9535            req.extensions_mut()
9536                .insert(
9537                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9538                );
9539            self.inner.unary(req, path, codec).await
9540        }
9541        /** List all invite links for the organization.
9542 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9543*/
9544        pub async fn list_invite_links(
9545            &mut self,
9546            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9547        ) -> std::result::Result<
9548            tonic::Response<super::ListInviteLinksResponse>,
9549            tonic::Status,
9550        > {
9551            self.inner
9552                .ready()
9553                .await
9554                .map_err(|e| {
9555                    tonic::Status::unknown(
9556                        format!("Service was not ready: {}", e.into()),
9557                    )
9558                })?;
9559            let codec = tonic_prost::ProstCodec::default();
9560            let path = http::uri::PathAndQuery::from_static(
9561                "/pidgr.v1.InviteLinkService/ListInviteLinks",
9562            );
9563            let mut req = request.into_request();
9564            req.extensions_mut()
9565                .insert(
9566                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9567                );
9568            self.inner.unary(req, path, codec).await
9569        }
9570        /** Revoke an invite link, making it immediately unusable. Idempotent.
9571 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9572*/
9573        pub async fn revoke_invite_link(
9574            &mut self,
9575            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9576        ) -> std::result::Result<
9577            tonic::Response<super::RevokeInviteLinkResponse>,
9578            tonic::Status,
9579        > {
9580            self.inner
9581                .ready()
9582                .await
9583                .map_err(|e| {
9584                    tonic::Status::unknown(
9585                        format!("Service was not ready: {}", e.into()),
9586                    )
9587                })?;
9588            let codec = tonic_prost::ProstCodec::default();
9589            let path = http::uri::PathAndQuery::from_static(
9590                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9591            );
9592            let mut req = request.into_request();
9593            req.extensions_mut()
9594                .insert(
9595                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9596                );
9597            self.inner.unary(req, path, codec).await
9598        }
9599        /** Validate an invite link and provision a user account if needed.
9600 This is a pre-authentication endpoint — no JWT required.
9601 Rate limited to 10 requests per minute per IP.
9602 Authorization: None (token-based).
9603*/
9604        pub async fn validate_invite_link(
9605            &mut self,
9606            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9607        ) -> std::result::Result<
9608            tonic::Response<super::ValidateInviteLinkResponse>,
9609            tonic::Status,
9610        > {
9611            self.inner
9612                .ready()
9613                .await
9614                .map_err(|e| {
9615                    tonic::Status::unknown(
9616                        format!("Service was not ready: {}", e.into()),
9617                    )
9618                })?;
9619            let codec = tonic_prost::ProstCodec::default();
9620            let path = http::uri::PathAndQuery::from_static(
9621                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9622            );
9623            let mut req = request.into_request();
9624            req.extensions_mut()
9625                .insert(
9626                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9627                );
9628            self.inner.unary(req, path, codec).await
9629        }
9630        /** Redeem an invite link to join an organization.
9631 Requires a valid JWT — the email is extracted from the token.
9632 Authorization: JWT required.
9633*/
9634        pub async fn redeem_invite_link(
9635            &mut self,
9636            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9637        ) -> std::result::Result<
9638            tonic::Response<super::RedeemInviteLinkResponse>,
9639            tonic::Status,
9640        > {
9641            self.inner
9642                .ready()
9643                .await
9644                .map_err(|e| {
9645                    tonic::Status::unknown(
9646                        format!("Service was not ready: {}", e.into()),
9647                    )
9648                })?;
9649            let codec = tonic_prost::ProstCodec::default();
9650            let path = http::uri::PathAndQuery::from_static(
9651                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9652            );
9653            let mut req = request.into_request();
9654            req.extensions_mut()
9655                .insert(
9656                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9657                );
9658            self.inner.unary(req, path, codec).await
9659        }
9660    }
9661}
9662/// Generated server implementations.
9663pub mod invite_link_service_server {
9664    #![allow(
9665        unused_variables,
9666        dead_code,
9667        missing_docs,
9668        clippy::wildcard_imports,
9669        clippy::let_unit_value,
9670    )]
9671    use tonic::codegen::*;
9672    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
9673    #[async_trait]
9674    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9675        /** Create a new shareable invite link for the organization.
9676 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9677*/
9678        async fn create_invite_link(
9679            &self,
9680            request: tonic::Request<super::CreateInviteLinkRequest>,
9681        ) -> std::result::Result<
9682            tonic::Response<super::CreateInviteLinkResponse>,
9683            tonic::Status,
9684        >;
9685        /** List all invite links for the organization.
9686 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9687*/
9688        async fn list_invite_links(
9689            &self,
9690            request: tonic::Request<super::ListInviteLinksRequest>,
9691        ) -> std::result::Result<
9692            tonic::Response<super::ListInviteLinksResponse>,
9693            tonic::Status,
9694        >;
9695        /** Revoke an invite link, making it immediately unusable. Idempotent.
9696 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9697*/
9698        async fn revoke_invite_link(
9699            &self,
9700            request: tonic::Request<super::RevokeInviteLinkRequest>,
9701        ) -> std::result::Result<
9702            tonic::Response<super::RevokeInviteLinkResponse>,
9703            tonic::Status,
9704        >;
9705        /** Validate an invite link and provision a user account if needed.
9706 This is a pre-authentication endpoint — no JWT required.
9707 Rate limited to 10 requests per minute per IP.
9708 Authorization: None (token-based).
9709*/
9710        async fn validate_invite_link(
9711            &self,
9712            request: tonic::Request<super::ValidateInviteLinkRequest>,
9713        ) -> std::result::Result<
9714            tonic::Response<super::ValidateInviteLinkResponse>,
9715            tonic::Status,
9716        >;
9717        /** Redeem an invite link to join an organization.
9718 Requires a valid JWT — the email is extracted from the token.
9719 Authorization: JWT required.
9720*/
9721        async fn redeem_invite_link(
9722            &self,
9723            request: tonic::Request<super::RedeemInviteLinkRequest>,
9724        ) -> std::result::Result<
9725            tonic::Response<super::RedeemInviteLinkResponse>,
9726            tonic::Status,
9727        >;
9728    }
9729    /** Manages shareable invite links for organization self-join.
9730 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9731 ValidateInviteLink is unauthenticated — the token IS the authorization.
9732 RedeemInviteLink requires a valid JWT.
9733*/
9734    #[derive(Debug)]
9735    pub struct InviteLinkServiceServer<T> {
9736        inner: Arc<T>,
9737        accept_compression_encodings: EnabledCompressionEncodings,
9738        send_compression_encodings: EnabledCompressionEncodings,
9739        max_decoding_message_size: Option<usize>,
9740        max_encoding_message_size: Option<usize>,
9741    }
9742    impl<T> InviteLinkServiceServer<T> {
9743        pub fn new(inner: T) -> Self {
9744            Self::from_arc(Arc::new(inner))
9745        }
9746        pub fn from_arc(inner: Arc<T>) -> Self {
9747            Self {
9748                inner,
9749                accept_compression_encodings: Default::default(),
9750                send_compression_encodings: Default::default(),
9751                max_decoding_message_size: None,
9752                max_encoding_message_size: None,
9753            }
9754        }
9755        pub fn with_interceptor<F>(
9756            inner: T,
9757            interceptor: F,
9758        ) -> InterceptedService<Self, F>
9759        where
9760            F: tonic::service::Interceptor,
9761        {
9762            InterceptedService::new(Self::new(inner), interceptor)
9763        }
9764        /// Enable decompressing requests with the given encoding.
9765        #[must_use]
9766        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9767            self.accept_compression_encodings.enable(encoding);
9768            self
9769        }
9770        /// Compress responses with the given encoding, if the client supports it.
9771        #[must_use]
9772        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9773            self.send_compression_encodings.enable(encoding);
9774            self
9775        }
9776        /// Limits the maximum size of a decoded message.
9777        ///
9778        /// Default: `4MB`
9779        #[must_use]
9780        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9781            self.max_decoding_message_size = Some(limit);
9782            self
9783        }
9784        /// Limits the maximum size of an encoded message.
9785        ///
9786        /// Default: `usize::MAX`
9787        #[must_use]
9788        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9789            self.max_encoding_message_size = Some(limit);
9790            self
9791        }
9792    }
9793    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9794    where
9795        T: InviteLinkService,
9796        B: Body + std::marker::Send + 'static,
9797        B::Error: Into<StdError> + std::marker::Send + 'static,
9798    {
9799        type Response = http::Response<tonic::body::Body>;
9800        type Error = std::convert::Infallible;
9801        type Future = BoxFuture<Self::Response, Self::Error>;
9802        fn poll_ready(
9803            &mut self,
9804            _cx: &mut Context<'_>,
9805        ) -> Poll<std::result::Result<(), Self::Error>> {
9806            Poll::Ready(Ok(()))
9807        }
9808        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9809            match req.uri().path() {
9810                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9811                    #[allow(non_camel_case_types)]
9812                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9813                    impl<
9814                        T: InviteLinkService,
9815                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9816                    for CreateInviteLinkSvc<T> {
9817                        type Response = super::CreateInviteLinkResponse;
9818                        type Future = BoxFuture<
9819                            tonic::Response<Self::Response>,
9820                            tonic::Status,
9821                        >;
9822                        fn call(
9823                            &mut self,
9824                            request: tonic::Request<super::CreateInviteLinkRequest>,
9825                        ) -> Self::Future {
9826                            let inner = Arc::clone(&self.0);
9827                            let fut = async move {
9828                                <T as InviteLinkService>::create_invite_link(
9829                                        &inner,
9830                                        request,
9831                                    )
9832                                    .await
9833                            };
9834                            Box::pin(fut)
9835                        }
9836                    }
9837                    let accept_compression_encodings = self.accept_compression_encodings;
9838                    let send_compression_encodings = self.send_compression_encodings;
9839                    let max_decoding_message_size = self.max_decoding_message_size;
9840                    let max_encoding_message_size = self.max_encoding_message_size;
9841                    let inner = self.inner.clone();
9842                    let fut = async move {
9843                        let method = CreateInviteLinkSvc(inner);
9844                        let codec = tonic_prost::ProstCodec::default();
9845                        let mut grpc = tonic::server::Grpc::new(codec)
9846                            .apply_compression_config(
9847                                accept_compression_encodings,
9848                                send_compression_encodings,
9849                            )
9850                            .apply_max_message_size_config(
9851                                max_decoding_message_size,
9852                                max_encoding_message_size,
9853                            );
9854                        let res = grpc.unary(method, req).await;
9855                        Ok(res)
9856                    };
9857                    Box::pin(fut)
9858                }
9859                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9860                    #[allow(non_camel_case_types)]
9861                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9862                    impl<
9863                        T: InviteLinkService,
9864                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
9865                    for ListInviteLinksSvc<T> {
9866                        type Response = super::ListInviteLinksResponse;
9867                        type Future = BoxFuture<
9868                            tonic::Response<Self::Response>,
9869                            tonic::Status,
9870                        >;
9871                        fn call(
9872                            &mut self,
9873                            request: tonic::Request<super::ListInviteLinksRequest>,
9874                        ) -> Self::Future {
9875                            let inner = Arc::clone(&self.0);
9876                            let fut = async move {
9877                                <T as InviteLinkService>::list_invite_links(&inner, request)
9878                                    .await
9879                            };
9880                            Box::pin(fut)
9881                        }
9882                    }
9883                    let accept_compression_encodings = self.accept_compression_encodings;
9884                    let send_compression_encodings = self.send_compression_encodings;
9885                    let max_decoding_message_size = self.max_decoding_message_size;
9886                    let max_encoding_message_size = self.max_encoding_message_size;
9887                    let inner = self.inner.clone();
9888                    let fut = async move {
9889                        let method = ListInviteLinksSvc(inner);
9890                        let codec = tonic_prost::ProstCodec::default();
9891                        let mut grpc = tonic::server::Grpc::new(codec)
9892                            .apply_compression_config(
9893                                accept_compression_encodings,
9894                                send_compression_encodings,
9895                            )
9896                            .apply_max_message_size_config(
9897                                max_decoding_message_size,
9898                                max_encoding_message_size,
9899                            );
9900                        let res = grpc.unary(method, req).await;
9901                        Ok(res)
9902                    };
9903                    Box::pin(fut)
9904                }
9905                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
9906                    #[allow(non_camel_case_types)]
9907                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9908                    impl<
9909                        T: InviteLinkService,
9910                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
9911                    for RevokeInviteLinkSvc<T> {
9912                        type Response = super::RevokeInviteLinkResponse;
9913                        type Future = BoxFuture<
9914                            tonic::Response<Self::Response>,
9915                            tonic::Status,
9916                        >;
9917                        fn call(
9918                            &mut self,
9919                            request: tonic::Request<super::RevokeInviteLinkRequest>,
9920                        ) -> Self::Future {
9921                            let inner = Arc::clone(&self.0);
9922                            let fut = async move {
9923                                <T as InviteLinkService>::revoke_invite_link(
9924                                        &inner,
9925                                        request,
9926                                    )
9927                                    .await
9928                            };
9929                            Box::pin(fut)
9930                        }
9931                    }
9932                    let accept_compression_encodings = self.accept_compression_encodings;
9933                    let send_compression_encodings = self.send_compression_encodings;
9934                    let max_decoding_message_size = self.max_decoding_message_size;
9935                    let max_encoding_message_size = self.max_encoding_message_size;
9936                    let inner = self.inner.clone();
9937                    let fut = async move {
9938                        let method = RevokeInviteLinkSvc(inner);
9939                        let codec = tonic_prost::ProstCodec::default();
9940                        let mut grpc = tonic::server::Grpc::new(codec)
9941                            .apply_compression_config(
9942                                accept_compression_encodings,
9943                                send_compression_encodings,
9944                            )
9945                            .apply_max_message_size_config(
9946                                max_decoding_message_size,
9947                                max_encoding_message_size,
9948                            );
9949                        let res = grpc.unary(method, req).await;
9950                        Ok(res)
9951                    };
9952                    Box::pin(fut)
9953                }
9954                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
9955                    #[allow(non_camel_case_types)]
9956                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9957                    impl<
9958                        T: InviteLinkService,
9959                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
9960                    for ValidateInviteLinkSvc<T> {
9961                        type Response = super::ValidateInviteLinkResponse;
9962                        type Future = BoxFuture<
9963                            tonic::Response<Self::Response>,
9964                            tonic::Status,
9965                        >;
9966                        fn call(
9967                            &mut self,
9968                            request: tonic::Request<super::ValidateInviteLinkRequest>,
9969                        ) -> Self::Future {
9970                            let inner = Arc::clone(&self.0);
9971                            let fut = async move {
9972                                <T as InviteLinkService>::validate_invite_link(
9973                                        &inner,
9974                                        request,
9975                                    )
9976                                    .await
9977                            };
9978                            Box::pin(fut)
9979                        }
9980                    }
9981                    let accept_compression_encodings = self.accept_compression_encodings;
9982                    let send_compression_encodings = self.send_compression_encodings;
9983                    let max_decoding_message_size = self.max_decoding_message_size;
9984                    let max_encoding_message_size = self.max_encoding_message_size;
9985                    let inner = self.inner.clone();
9986                    let fut = async move {
9987                        let method = ValidateInviteLinkSvc(inner);
9988                        let codec = tonic_prost::ProstCodec::default();
9989                        let mut grpc = tonic::server::Grpc::new(codec)
9990                            .apply_compression_config(
9991                                accept_compression_encodings,
9992                                send_compression_encodings,
9993                            )
9994                            .apply_max_message_size_config(
9995                                max_decoding_message_size,
9996                                max_encoding_message_size,
9997                            );
9998                        let res = grpc.unary(method, req).await;
9999                        Ok(res)
10000                    };
10001                    Box::pin(fut)
10002                }
10003                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
10004                    #[allow(non_camel_case_types)]
10005                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10006                    impl<
10007                        T: InviteLinkService,
10008                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
10009                    for RedeemInviteLinkSvc<T> {
10010                        type Response = super::RedeemInviteLinkResponse;
10011                        type Future = BoxFuture<
10012                            tonic::Response<Self::Response>,
10013                            tonic::Status,
10014                        >;
10015                        fn call(
10016                            &mut self,
10017                            request: tonic::Request<super::RedeemInviteLinkRequest>,
10018                        ) -> Self::Future {
10019                            let inner = Arc::clone(&self.0);
10020                            let fut = async move {
10021                                <T as InviteLinkService>::redeem_invite_link(
10022                                        &inner,
10023                                        request,
10024                                    )
10025                                    .await
10026                            };
10027                            Box::pin(fut)
10028                        }
10029                    }
10030                    let accept_compression_encodings = self.accept_compression_encodings;
10031                    let send_compression_encodings = self.send_compression_encodings;
10032                    let max_decoding_message_size = self.max_decoding_message_size;
10033                    let max_encoding_message_size = self.max_encoding_message_size;
10034                    let inner = self.inner.clone();
10035                    let fut = async move {
10036                        let method = RedeemInviteLinkSvc(inner);
10037                        let codec = tonic_prost::ProstCodec::default();
10038                        let mut grpc = tonic::server::Grpc::new(codec)
10039                            .apply_compression_config(
10040                                accept_compression_encodings,
10041                                send_compression_encodings,
10042                            )
10043                            .apply_max_message_size_config(
10044                                max_decoding_message_size,
10045                                max_encoding_message_size,
10046                            );
10047                        let res = grpc.unary(method, req).await;
10048                        Ok(res)
10049                    };
10050                    Box::pin(fut)
10051                }
10052                _ => {
10053                    Box::pin(async move {
10054                        let mut response = http::Response::new(
10055                            tonic::body::Body::default(),
10056                        );
10057                        let headers = response.headers_mut();
10058                        headers
10059                            .insert(
10060                                tonic::Status::GRPC_STATUS,
10061                                (tonic::Code::Unimplemented as i32).into(),
10062                            );
10063                        headers
10064                            .insert(
10065                                http::header::CONTENT_TYPE,
10066                                tonic::metadata::GRPC_CONTENT_TYPE,
10067                            );
10068                        Ok(response)
10069                    })
10070                }
10071            }
10072        }
10073    }
10074    impl<T> Clone for InviteLinkServiceServer<T> {
10075        fn clone(&self) -> Self {
10076            let inner = self.inner.clone();
10077            Self {
10078                inner,
10079                accept_compression_encodings: self.accept_compression_encodings,
10080                send_compression_encodings: self.send_compression_encodings,
10081                max_decoding_message_size: self.max_decoding_message_size,
10082                max_encoding_message_size: self.max_encoding_message_size,
10083            }
10084        }
10085    }
10086    /// Generated gRPC service name
10087    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
10088    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
10089        const NAME: &'static str = SERVICE_NAME;
10090    }
10091}
10092/// Generated client implementations.
10093pub mod member_service_client {
10094    #![allow(
10095        unused_variables,
10096        dead_code,
10097        missing_docs,
10098        clippy::wildcard_imports,
10099        clippy::let_unit_value,
10100    )]
10101    use tonic::codegen::*;
10102    use tonic::codegen::http::Uri;
10103    /** Manages members (users) within an organization.
10104 All RPCs operate within the caller's org (extracted from JWT).
10105*/
10106    #[derive(Debug, Clone)]
10107    pub struct MemberServiceClient<T> {
10108        inner: tonic::client::Grpc<T>,
10109    }
10110    impl MemberServiceClient<tonic::transport::Channel> {
10111        /// Attempt to create a new client by connecting to a given endpoint.
10112        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10113        where
10114            D: TryInto<tonic::transport::Endpoint>,
10115            D::Error: Into<StdError>,
10116        {
10117            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10118            Ok(Self::new(conn))
10119        }
10120    }
10121    impl<T> MemberServiceClient<T>
10122    where
10123        T: tonic::client::GrpcService<tonic::body::Body>,
10124        T::Error: Into<StdError>,
10125        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10126        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10127    {
10128        pub fn new(inner: T) -> Self {
10129            let inner = tonic::client::Grpc::new(inner);
10130            Self { inner }
10131        }
10132        pub fn with_origin(inner: T, origin: Uri) -> Self {
10133            let inner = tonic::client::Grpc::with_origin(inner, origin);
10134            Self { inner }
10135        }
10136        pub fn with_interceptor<F>(
10137            inner: T,
10138            interceptor: F,
10139        ) -> MemberServiceClient<InterceptedService<T, F>>
10140        where
10141            F: tonic::service::Interceptor,
10142            T::ResponseBody: Default,
10143            T: tonic::codegen::Service<
10144                http::Request<tonic::body::Body>,
10145                Response = http::Response<
10146                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10147                >,
10148            >,
10149            <T as tonic::codegen::Service<
10150                http::Request<tonic::body::Body>,
10151            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10152        {
10153            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
10154        }
10155        /// Compress requests with the given encoding.
10156        ///
10157        /// This requires the server to support it otherwise it might respond with an
10158        /// error.
10159        #[must_use]
10160        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10161            self.inner = self.inner.send_compressed(encoding);
10162            self
10163        }
10164        /// Enable decompressing responses.
10165        #[must_use]
10166        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10167            self.inner = self.inner.accept_compressed(encoding);
10168            self
10169        }
10170        /// Limits the maximum size of a decoded message.
10171        ///
10172        /// Default: `4MB`
10173        #[must_use]
10174        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10175            self.inner = self.inner.max_decoding_message_size(limit);
10176            self
10177        }
10178        /// Limits the maximum size of an encoded message.
10179        ///
10180        /// Default: `usize::MAX`
10181        #[must_use]
10182        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10183            self.inner = self.inner.max_encoding_message_size(limit);
10184            self
10185        }
10186        /** Invite a new user to the organization via email.
10187 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10188*/
10189        pub async fn invite_user(
10190            &mut self,
10191            request: impl tonic::IntoRequest<super::InviteUserRequest>,
10192        ) -> std::result::Result<
10193            tonic::Response<super::InviteUserResponse>,
10194            tonic::Status,
10195        > {
10196            self.inner
10197                .ready()
10198                .await
10199                .map_err(|e| {
10200                    tonic::Status::unknown(
10201                        format!("Service was not ready: {}", e.into()),
10202                    )
10203                })?;
10204            let codec = tonic_prost::ProstCodec::default();
10205            let path = http::uri::PathAndQuery::from_static(
10206                "/pidgr.v1.MemberService/InviteUser",
10207            );
10208            let mut req = request.into_request();
10209            req.extensions_mut()
10210                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10211            self.inner.unary(req, path, codec).await
10212        }
10213        /** Retrieve a user by ID within the organization.
10214 Self-lookup (empty user_id) is allowed for any authenticated user.
10215 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10216*/
10217        pub async fn get_user(
10218            &mut self,
10219            request: impl tonic::IntoRequest<super::GetUserRequest>,
10220        ) -> std::result::Result<
10221            tonic::Response<super::GetUserResponse>,
10222            tonic::Status,
10223        > {
10224            self.inner
10225                .ready()
10226                .await
10227                .map_err(|e| {
10228                    tonic::Status::unknown(
10229                        format!("Service was not ready: {}", e.into()),
10230                    )
10231                })?;
10232            let codec = tonic_prost::ProstCodec::default();
10233            let path = http::uri::PathAndQuery::from_static(
10234                "/pidgr.v1.MemberService/GetUser",
10235            );
10236            let mut req = request.into_request();
10237            req.extensions_mut()
10238                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10239            self.inner.unary(req, path, codec).await
10240        }
10241        /** List all users in the organization with pagination.
10242 Authorization: Requires PERMISSION_MEMBERS_READ.
10243*/
10244        pub async fn list_users(
10245            &mut self,
10246            request: impl tonic::IntoRequest<super::ListUsersRequest>,
10247        ) -> std::result::Result<
10248            tonic::Response<super::ListUsersResponse>,
10249            tonic::Status,
10250        > {
10251            self.inner
10252                .ready()
10253                .await
10254                .map_err(|e| {
10255                    tonic::Status::unknown(
10256                        format!("Service was not ready: {}", e.into()),
10257                    )
10258                })?;
10259            let codec = tonic_prost::ProstCodec::default();
10260            let path = http::uri::PathAndQuery::from_static(
10261                "/pidgr.v1.MemberService/ListUsers",
10262            );
10263            let mut req = request.into_request();
10264            req.extensions_mut()
10265                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10266            self.inner.unary(req, path, codec).await
10267        }
10268        /** Change a user's role within the organization.
10269 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10270*/
10271        pub async fn update_user_role(
10272            &mut self,
10273            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10274        ) -> std::result::Result<
10275            tonic::Response<super::UpdateUserRoleResponse>,
10276            tonic::Status,
10277        > {
10278            self.inner
10279                .ready()
10280                .await
10281                .map_err(|e| {
10282                    tonic::Status::unknown(
10283                        format!("Service was not ready: {}", e.into()),
10284                    )
10285                })?;
10286            let codec = tonic_prost::ProstCodec::default();
10287            let path = http::uri::PathAndQuery::from_static(
10288                "/pidgr.v1.MemberService/UpdateUserRole",
10289            );
10290            let mut req = request.into_request();
10291            req.extensions_mut()
10292                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10293            self.inner.unary(req, path, codec).await
10294        }
10295        /** Deactivate a user within the organization.
10296 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10297*/
10298        pub async fn deactivate_user(
10299            &mut self,
10300            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10301        ) -> std::result::Result<
10302            tonic::Response<super::DeactivateUserResponse>,
10303            tonic::Status,
10304        > {
10305            self.inner
10306                .ready()
10307                .await
10308                .map_err(|e| {
10309                    tonic::Status::unknown(
10310                        format!("Service was not ready: {}", e.into()),
10311                    )
10312                })?;
10313            let codec = tonic_prost::ProstCodec::default();
10314            let path = http::uri::PathAndQuery::from_static(
10315                "/pidgr.v1.MemberService/DeactivateUser",
10316            );
10317            let mut req = request.into_request();
10318            req.extensions_mut()
10319                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10320            self.inner.unary(req, path, codec).await
10321        }
10322        /** Reactivate a deactivated user, restoring their status to INVITED.
10323 The user must complete the invite link flow again to become ACTIVE.
10324 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10325*/
10326        pub async fn reactivate_user(
10327            &mut self,
10328            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10329        ) -> std::result::Result<
10330            tonic::Response<super::ReactivateUserResponse>,
10331            tonic::Status,
10332        > {
10333            self.inner
10334                .ready()
10335                .await
10336                .map_err(|e| {
10337                    tonic::Status::unknown(
10338                        format!("Service was not ready: {}", e.into()),
10339                    )
10340                })?;
10341            let codec = tonic_prost::ProstCodec::default();
10342            let path = http::uri::PathAndQuery::from_static(
10343                "/pidgr.v1.MemberService/ReactivateUser",
10344            );
10345            let mut req = request.into_request();
10346            req.extensions_mut()
10347                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10348            self.inner.unary(req, path, codec).await
10349        }
10350        /** Revoke an invitation for a user who has not yet completed registration.
10351 Hard-deletes the user record (INVITED users have no data to preserve).
10352 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10353*/
10354        pub async fn revoke_invite(
10355            &mut self,
10356            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10357        ) -> std::result::Result<
10358            tonic::Response<super::RevokeInviteResponse>,
10359            tonic::Status,
10360        > {
10361            self.inner
10362                .ready()
10363                .await
10364                .map_err(|e| {
10365                    tonic::Status::unknown(
10366                        format!("Service was not ready: {}", e.into()),
10367                    )
10368                })?;
10369            let codec = tonic_prost::ProstCodec::default();
10370            let path = http::uri::PathAndQuery::from_static(
10371                "/pidgr.v1.MemberService/RevokeInvite",
10372            );
10373            let mut req = request.into_request();
10374            req.extensions_mut()
10375                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10376            self.inner.unary(req, path, codec).await
10377        }
10378        /** Update a user's profile attributes (department, title, etc.).
10379 Self-update (empty user_id or matching JWT sub) requires no special permission.
10380 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10381*/
10382        pub async fn update_user_profile(
10383            &mut self,
10384            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10385        ) -> std::result::Result<
10386            tonic::Response<super::UpdateUserProfileResponse>,
10387            tonic::Status,
10388        > {
10389            self.inner
10390                .ready()
10391                .await
10392                .map_err(|e| {
10393                    tonic::Status::unknown(
10394                        format!("Service was not ready: {}", e.into()),
10395                    )
10396                })?;
10397            let codec = tonic_prost::ProstCodec::default();
10398            let path = http::uri::PathAndQuery::from_static(
10399                "/pidgr.v1.MemberService/UpdateUserProfile",
10400            );
10401            let mut req = request.into_request();
10402            req.extensions_mut()
10403                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10404            self.inner.unary(req, path, codec).await
10405        }
10406        /** Retrieve the caller's platform settings (theme, etc.).
10407 Authorization: Any authenticated user (self-only).
10408*/
10409        pub async fn get_user_settings(
10410            &mut self,
10411            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10412        ) -> std::result::Result<
10413            tonic::Response<super::GetUserSettingsResponse>,
10414            tonic::Status,
10415        > {
10416            self.inner
10417                .ready()
10418                .await
10419                .map_err(|e| {
10420                    tonic::Status::unknown(
10421                        format!("Service was not ready: {}", e.into()),
10422                    )
10423                })?;
10424            let codec = tonic_prost::ProstCodec::default();
10425            let path = http::uri::PathAndQuery::from_static(
10426                "/pidgr.v1.MemberService/GetUserSettings",
10427            );
10428            let mut req = request.into_request();
10429            req.extensions_mut()
10430                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10431            self.inner.unary(req, path, codec).await
10432        }
10433        /** Update the caller's platform settings.
10434 Only fields with non-default values are applied; others are left unchanged.
10435 Authorization: Any authenticated user (self-only).
10436*/
10437        pub async fn update_user_settings(
10438            &mut self,
10439            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10440        ) -> std::result::Result<
10441            tonic::Response<super::UpdateUserSettingsResponse>,
10442            tonic::Status,
10443        > {
10444            self.inner
10445                .ready()
10446                .await
10447                .map_err(|e| {
10448                    tonic::Status::unknown(
10449                        format!("Service was not ready: {}", e.into()),
10450                    )
10451                })?;
10452            let codec = tonic_prost::ProstCodec::default();
10453            let path = http::uri::PathAndQuery::from_static(
10454                "/pidgr.v1.MemberService/UpdateUserSettings",
10455            );
10456            let mut req = request.into_request();
10457            req.extensions_mut()
10458                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10459            self.inner.unary(req, path, codec).await
10460        }
10461        /** Invite multiple users to the organization in a single call.
10462 Emails are deduplicated. Each email is processed independently — individual
10463 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10464 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10465*/
10466        pub async fn bulk_invite_users(
10467            &mut self,
10468            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10469        ) -> std::result::Result<
10470            tonic::Response<super::BulkInviteUsersResponse>,
10471            tonic::Status,
10472        > {
10473            self.inner
10474                .ready()
10475                .await
10476                .map_err(|e| {
10477                    tonic::Status::unknown(
10478                        format!("Service was not ready: {}", e.into()),
10479                    )
10480                })?;
10481            let codec = tonic_prost::ProstCodec::default();
10482            let path = http::uri::PathAndQuery::from_static(
10483                "/pidgr.v1.MemberService/BulkInviteUsers",
10484            );
10485            let mut req = request.into_request();
10486            req.extensions_mut()
10487                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10488            self.inner.unary(req, path, codec).await
10489        }
10490        /** Confirm passkey enrollment after client-side WebAuthn registration.
10491 Verifies the caller has at least one registered credential server-side,
10492 then marks the user as passkey-enrolled in the identity provider.
10493 Authorization: Any authenticated user (self-only, no permission required).
10494*/
10495        pub async fn confirm_passkey_enrollment(
10496            &mut self,
10497            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10498        ) -> std::result::Result<
10499            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10500            tonic::Status,
10501        > {
10502            self.inner
10503                .ready()
10504                .await
10505                .map_err(|e| {
10506                    tonic::Status::unknown(
10507                        format!("Service was not ready: {}", e.into()),
10508                    )
10509                })?;
10510            let codec = tonic_prost::ProstCodec::default();
10511            let path = http::uri::PathAndQuery::from_static(
10512                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10513            );
10514            let mut req = request.into_request();
10515            req.extensions_mut()
10516                .insert(
10517                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10518                );
10519            self.inner.unary(req, path, codec).await
10520        }
10521        /** Update the data governance region for a user. Triggers a data migration
10522 workflow if the region changed. Admin-only operation.
10523 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10524*/
10525        pub async fn update_user_region(
10526            &mut self,
10527            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10528        ) -> std::result::Result<
10529            tonic::Response<super::UpdateUserRegionResponse>,
10530            tonic::Status,
10531        > {
10532            self.inner
10533                .ready()
10534                .await
10535                .map_err(|e| {
10536                    tonic::Status::unknown(
10537                        format!("Service was not ready: {}", e.into()),
10538                    )
10539                })?;
10540            let codec = tonic_prost::ProstCodec::default();
10541            let path = http::uri::PathAndQuery::from_static(
10542                "/pidgr.v1.MemberService/UpdateUserRegion",
10543            );
10544            let mut req = request.into_request();
10545            req.extensions_mut()
10546                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10547            self.inner.unary(req, path, codec).await
10548        }
10549    }
10550}
10551/// Generated server implementations.
10552pub mod member_service_server {
10553    #![allow(
10554        unused_variables,
10555        dead_code,
10556        missing_docs,
10557        clippy::wildcard_imports,
10558        clippy::let_unit_value,
10559    )]
10560    use tonic::codegen::*;
10561    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
10562    #[async_trait]
10563    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10564        /** Invite a new user to the organization via email.
10565 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10566*/
10567        async fn invite_user(
10568            &self,
10569            request: tonic::Request<super::InviteUserRequest>,
10570        ) -> std::result::Result<
10571            tonic::Response<super::InviteUserResponse>,
10572            tonic::Status,
10573        >;
10574        /** Retrieve a user by ID within the organization.
10575 Self-lookup (empty user_id) is allowed for any authenticated user.
10576 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10577*/
10578        async fn get_user(
10579            &self,
10580            request: tonic::Request<super::GetUserRequest>,
10581        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10582        /** List all users in the organization with pagination.
10583 Authorization: Requires PERMISSION_MEMBERS_READ.
10584*/
10585        async fn list_users(
10586            &self,
10587            request: tonic::Request<super::ListUsersRequest>,
10588        ) -> std::result::Result<
10589            tonic::Response<super::ListUsersResponse>,
10590            tonic::Status,
10591        >;
10592        /** Change a user's role within the organization.
10593 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10594*/
10595        async fn update_user_role(
10596            &self,
10597            request: tonic::Request<super::UpdateUserRoleRequest>,
10598        ) -> std::result::Result<
10599            tonic::Response<super::UpdateUserRoleResponse>,
10600            tonic::Status,
10601        >;
10602        /** Deactivate a user within the organization.
10603 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10604*/
10605        async fn deactivate_user(
10606            &self,
10607            request: tonic::Request<super::DeactivateUserRequest>,
10608        ) -> std::result::Result<
10609            tonic::Response<super::DeactivateUserResponse>,
10610            tonic::Status,
10611        >;
10612        /** Reactivate a deactivated user, restoring their status to INVITED.
10613 The user must complete the invite link flow again to become ACTIVE.
10614 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10615*/
10616        async fn reactivate_user(
10617            &self,
10618            request: tonic::Request<super::ReactivateUserRequest>,
10619        ) -> std::result::Result<
10620            tonic::Response<super::ReactivateUserResponse>,
10621            tonic::Status,
10622        >;
10623        /** Revoke an invitation for a user who has not yet completed registration.
10624 Hard-deletes the user record (INVITED users have no data to preserve).
10625 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10626*/
10627        async fn revoke_invite(
10628            &self,
10629            request: tonic::Request<super::RevokeInviteRequest>,
10630        ) -> std::result::Result<
10631            tonic::Response<super::RevokeInviteResponse>,
10632            tonic::Status,
10633        >;
10634        /** Update a user's profile attributes (department, title, etc.).
10635 Self-update (empty user_id or matching JWT sub) requires no special permission.
10636 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10637*/
10638        async fn update_user_profile(
10639            &self,
10640            request: tonic::Request<super::UpdateUserProfileRequest>,
10641        ) -> std::result::Result<
10642            tonic::Response<super::UpdateUserProfileResponse>,
10643            tonic::Status,
10644        >;
10645        /** Retrieve the caller's platform settings (theme, etc.).
10646 Authorization: Any authenticated user (self-only).
10647*/
10648        async fn get_user_settings(
10649            &self,
10650            request: tonic::Request<super::GetUserSettingsRequest>,
10651        ) -> std::result::Result<
10652            tonic::Response<super::GetUserSettingsResponse>,
10653            tonic::Status,
10654        >;
10655        /** Update the caller's platform settings.
10656 Only fields with non-default values are applied; others are left unchanged.
10657 Authorization: Any authenticated user (self-only).
10658*/
10659        async fn update_user_settings(
10660            &self,
10661            request: tonic::Request<super::UpdateUserSettingsRequest>,
10662        ) -> std::result::Result<
10663            tonic::Response<super::UpdateUserSettingsResponse>,
10664            tonic::Status,
10665        >;
10666        /** Invite multiple users to the organization in a single call.
10667 Emails are deduplicated. Each email is processed independently — individual
10668 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10669 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10670*/
10671        async fn bulk_invite_users(
10672            &self,
10673            request: tonic::Request<super::BulkInviteUsersRequest>,
10674        ) -> std::result::Result<
10675            tonic::Response<super::BulkInviteUsersResponse>,
10676            tonic::Status,
10677        >;
10678        /** Confirm passkey enrollment after client-side WebAuthn registration.
10679 Verifies the caller has at least one registered credential server-side,
10680 then marks the user as passkey-enrolled in the identity provider.
10681 Authorization: Any authenticated user (self-only, no permission required).
10682*/
10683        async fn confirm_passkey_enrollment(
10684            &self,
10685            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10686        ) -> std::result::Result<
10687            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10688            tonic::Status,
10689        >;
10690        /** Update the data governance region for a user. Triggers a data migration
10691 workflow if the region changed. Admin-only operation.
10692 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10693*/
10694        async fn update_user_region(
10695            &self,
10696            request: tonic::Request<super::UpdateUserRegionRequest>,
10697        ) -> std::result::Result<
10698            tonic::Response<super::UpdateUserRegionResponse>,
10699            tonic::Status,
10700        >;
10701    }
10702    /** Manages members (users) within an organization.
10703 All RPCs operate within the caller's org (extracted from JWT).
10704*/
10705    #[derive(Debug)]
10706    pub struct MemberServiceServer<T> {
10707        inner: Arc<T>,
10708        accept_compression_encodings: EnabledCompressionEncodings,
10709        send_compression_encodings: EnabledCompressionEncodings,
10710        max_decoding_message_size: Option<usize>,
10711        max_encoding_message_size: Option<usize>,
10712    }
10713    impl<T> MemberServiceServer<T> {
10714        pub fn new(inner: T) -> Self {
10715            Self::from_arc(Arc::new(inner))
10716        }
10717        pub fn from_arc(inner: Arc<T>) -> Self {
10718            Self {
10719                inner,
10720                accept_compression_encodings: Default::default(),
10721                send_compression_encodings: Default::default(),
10722                max_decoding_message_size: None,
10723                max_encoding_message_size: None,
10724            }
10725        }
10726        pub fn with_interceptor<F>(
10727            inner: T,
10728            interceptor: F,
10729        ) -> InterceptedService<Self, F>
10730        where
10731            F: tonic::service::Interceptor,
10732        {
10733            InterceptedService::new(Self::new(inner), interceptor)
10734        }
10735        /// Enable decompressing requests with the given encoding.
10736        #[must_use]
10737        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10738            self.accept_compression_encodings.enable(encoding);
10739            self
10740        }
10741        /// Compress responses with the given encoding, if the client supports it.
10742        #[must_use]
10743        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10744            self.send_compression_encodings.enable(encoding);
10745            self
10746        }
10747        /// Limits the maximum size of a decoded message.
10748        ///
10749        /// Default: `4MB`
10750        #[must_use]
10751        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10752            self.max_decoding_message_size = Some(limit);
10753            self
10754        }
10755        /// Limits the maximum size of an encoded message.
10756        ///
10757        /// Default: `usize::MAX`
10758        #[must_use]
10759        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10760            self.max_encoding_message_size = Some(limit);
10761            self
10762        }
10763    }
10764    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10765    where
10766        T: MemberService,
10767        B: Body + std::marker::Send + 'static,
10768        B::Error: Into<StdError> + std::marker::Send + 'static,
10769    {
10770        type Response = http::Response<tonic::body::Body>;
10771        type Error = std::convert::Infallible;
10772        type Future = BoxFuture<Self::Response, Self::Error>;
10773        fn poll_ready(
10774            &mut self,
10775            _cx: &mut Context<'_>,
10776        ) -> Poll<std::result::Result<(), Self::Error>> {
10777            Poll::Ready(Ok(()))
10778        }
10779        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10780            match req.uri().path() {
10781                "/pidgr.v1.MemberService/InviteUser" => {
10782                    #[allow(non_camel_case_types)]
10783                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10784                    impl<
10785                        T: MemberService,
10786                    > tonic::server::UnaryService<super::InviteUserRequest>
10787                    for InviteUserSvc<T> {
10788                        type Response = super::InviteUserResponse;
10789                        type Future = BoxFuture<
10790                            tonic::Response<Self::Response>,
10791                            tonic::Status,
10792                        >;
10793                        fn call(
10794                            &mut self,
10795                            request: tonic::Request<super::InviteUserRequest>,
10796                        ) -> Self::Future {
10797                            let inner = Arc::clone(&self.0);
10798                            let fut = async move {
10799                                <T as MemberService>::invite_user(&inner, request).await
10800                            };
10801                            Box::pin(fut)
10802                        }
10803                    }
10804                    let accept_compression_encodings = self.accept_compression_encodings;
10805                    let send_compression_encodings = self.send_compression_encodings;
10806                    let max_decoding_message_size = self.max_decoding_message_size;
10807                    let max_encoding_message_size = self.max_encoding_message_size;
10808                    let inner = self.inner.clone();
10809                    let fut = async move {
10810                        let method = InviteUserSvc(inner);
10811                        let codec = tonic_prost::ProstCodec::default();
10812                        let mut grpc = tonic::server::Grpc::new(codec)
10813                            .apply_compression_config(
10814                                accept_compression_encodings,
10815                                send_compression_encodings,
10816                            )
10817                            .apply_max_message_size_config(
10818                                max_decoding_message_size,
10819                                max_encoding_message_size,
10820                            );
10821                        let res = grpc.unary(method, req).await;
10822                        Ok(res)
10823                    };
10824                    Box::pin(fut)
10825                }
10826                "/pidgr.v1.MemberService/GetUser" => {
10827                    #[allow(non_camel_case_types)]
10828                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
10829                    impl<
10830                        T: MemberService,
10831                    > tonic::server::UnaryService<super::GetUserRequest>
10832                    for GetUserSvc<T> {
10833                        type Response = super::GetUserResponse;
10834                        type Future = BoxFuture<
10835                            tonic::Response<Self::Response>,
10836                            tonic::Status,
10837                        >;
10838                        fn call(
10839                            &mut self,
10840                            request: tonic::Request<super::GetUserRequest>,
10841                        ) -> Self::Future {
10842                            let inner = Arc::clone(&self.0);
10843                            let fut = async move {
10844                                <T as MemberService>::get_user(&inner, request).await
10845                            };
10846                            Box::pin(fut)
10847                        }
10848                    }
10849                    let accept_compression_encodings = self.accept_compression_encodings;
10850                    let send_compression_encodings = self.send_compression_encodings;
10851                    let max_decoding_message_size = self.max_decoding_message_size;
10852                    let max_encoding_message_size = self.max_encoding_message_size;
10853                    let inner = self.inner.clone();
10854                    let fut = async move {
10855                        let method = GetUserSvc(inner);
10856                        let codec = tonic_prost::ProstCodec::default();
10857                        let mut grpc = tonic::server::Grpc::new(codec)
10858                            .apply_compression_config(
10859                                accept_compression_encodings,
10860                                send_compression_encodings,
10861                            )
10862                            .apply_max_message_size_config(
10863                                max_decoding_message_size,
10864                                max_encoding_message_size,
10865                            );
10866                        let res = grpc.unary(method, req).await;
10867                        Ok(res)
10868                    };
10869                    Box::pin(fut)
10870                }
10871                "/pidgr.v1.MemberService/ListUsers" => {
10872                    #[allow(non_camel_case_types)]
10873                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10874                    impl<
10875                        T: MemberService,
10876                    > tonic::server::UnaryService<super::ListUsersRequest>
10877                    for ListUsersSvc<T> {
10878                        type Response = super::ListUsersResponse;
10879                        type Future = BoxFuture<
10880                            tonic::Response<Self::Response>,
10881                            tonic::Status,
10882                        >;
10883                        fn call(
10884                            &mut self,
10885                            request: tonic::Request<super::ListUsersRequest>,
10886                        ) -> Self::Future {
10887                            let inner = Arc::clone(&self.0);
10888                            let fut = async move {
10889                                <T as MemberService>::list_users(&inner, request).await
10890                            };
10891                            Box::pin(fut)
10892                        }
10893                    }
10894                    let accept_compression_encodings = self.accept_compression_encodings;
10895                    let send_compression_encodings = self.send_compression_encodings;
10896                    let max_decoding_message_size = self.max_decoding_message_size;
10897                    let max_encoding_message_size = self.max_encoding_message_size;
10898                    let inner = self.inner.clone();
10899                    let fut = async move {
10900                        let method = ListUsersSvc(inner);
10901                        let codec = tonic_prost::ProstCodec::default();
10902                        let mut grpc = tonic::server::Grpc::new(codec)
10903                            .apply_compression_config(
10904                                accept_compression_encodings,
10905                                send_compression_encodings,
10906                            )
10907                            .apply_max_message_size_config(
10908                                max_decoding_message_size,
10909                                max_encoding_message_size,
10910                            );
10911                        let res = grpc.unary(method, req).await;
10912                        Ok(res)
10913                    };
10914                    Box::pin(fut)
10915                }
10916                "/pidgr.v1.MemberService/UpdateUserRole" => {
10917                    #[allow(non_camel_case_types)]
10918                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
10919                    impl<
10920                        T: MemberService,
10921                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
10922                    for UpdateUserRoleSvc<T> {
10923                        type Response = super::UpdateUserRoleResponse;
10924                        type Future = BoxFuture<
10925                            tonic::Response<Self::Response>,
10926                            tonic::Status,
10927                        >;
10928                        fn call(
10929                            &mut self,
10930                            request: tonic::Request<super::UpdateUserRoleRequest>,
10931                        ) -> Self::Future {
10932                            let inner = Arc::clone(&self.0);
10933                            let fut = async move {
10934                                <T as MemberService>::update_user_role(&inner, request)
10935                                    .await
10936                            };
10937                            Box::pin(fut)
10938                        }
10939                    }
10940                    let accept_compression_encodings = self.accept_compression_encodings;
10941                    let send_compression_encodings = self.send_compression_encodings;
10942                    let max_decoding_message_size = self.max_decoding_message_size;
10943                    let max_encoding_message_size = self.max_encoding_message_size;
10944                    let inner = self.inner.clone();
10945                    let fut = async move {
10946                        let method = UpdateUserRoleSvc(inner);
10947                        let codec = tonic_prost::ProstCodec::default();
10948                        let mut grpc = tonic::server::Grpc::new(codec)
10949                            .apply_compression_config(
10950                                accept_compression_encodings,
10951                                send_compression_encodings,
10952                            )
10953                            .apply_max_message_size_config(
10954                                max_decoding_message_size,
10955                                max_encoding_message_size,
10956                            );
10957                        let res = grpc.unary(method, req).await;
10958                        Ok(res)
10959                    };
10960                    Box::pin(fut)
10961                }
10962                "/pidgr.v1.MemberService/DeactivateUser" => {
10963                    #[allow(non_camel_case_types)]
10964                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
10965                    impl<
10966                        T: MemberService,
10967                    > tonic::server::UnaryService<super::DeactivateUserRequest>
10968                    for DeactivateUserSvc<T> {
10969                        type Response = super::DeactivateUserResponse;
10970                        type Future = BoxFuture<
10971                            tonic::Response<Self::Response>,
10972                            tonic::Status,
10973                        >;
10974                        fn call(
10975                            &mut self,
10976                            request: tonic::Request<super::DeactivateUserRequest>,
10977                        ) -> Self::Future {
10978                            let inner = Arc::clone(&self.0);
10979                            let fut = async move {
10980                                <T as MemberService>::deactivate_user(&inner, request).await
10981                            };
10982                            Box::pin(fut)
10983                        }
10984                    }
10985                    let accept_compression_encodings = self.accept_compression_encodings;
10986                    let send_compression_encodings = self.send_compression_encodings;
10987                    let max_decoding_message_size = self.max_decoding_message_size;
10988                    let max_encoding_message_size = self.max_encoding_message_size;
10989                    let inner = self.inner.clone();
10990                    let fut = async move {
10991                        let method = DeactivateUserSvc(inner);
10992                        let codec = tonic_prost::ProstCodec::default();
10993                        let mut grpc = tonic::server::Grpc::new(codec)
10994                            .apply_compression_config(
10995                                accept_compression_encodings,
10996                                send_compression_encodings,
10997                            )
10998                            .apply_max_message_size_config(
10999                                max_decoding_message_size,
11000                                max_encoding_message_size,
11001                            );
11002                        let res = grpc.unary(method, req).await;
11003                        Ok(res)
11004                    };
11005                    Box::pin(fut)
11006                }
11007                "/pidgr.v1.MemberService/ReactivateUser" => {
11008                    #[allow(non_camel_case_types)]
11009                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
11010                    impl<
11011                        T: MemberService,
11012                    > tonic::server::UnaryService<super::ReactivateUserRequest>
11013                    for ReactivateUserSvc<T> {
11014                        type Response = super::ReactivateUserResponse;
11015                        type Future = BoxFuture<
11016                            tonic::Response<Self::Response>,
11017                            tonic::Status,
11018                        >;
11019                        fn call(
11020                            &mut self,
11021                            request: tonic::Request<super::ReactivateUserRequest>,
11022                        ) -> Self::Future {
11023                            let inner = Arc::clone(&self.0);
11024                            let fut = async move {
11025                                <T as MemberService>::reactivate_user(&inner, request).await
11026                            };
11027                            Box::pin(fut)
11028                        }
11029                    }
11030                    let accept_compression_encodings = self.accept_compression_encodings;
11031                    let send_compression_encodings = self.send_compression_encodings;
11032                    let max_decoding_message_size = self.max_decoding_message_size;
11033                    let max_encoding_message_size = self.max_encoding_message_size;
11034                    let inner = self.inner.clone();
11035                    let fut = async move {
11036                        let method = ReactivateUserSvc(inner);
11037                        let codec = tonic_prost::ProstCodec::default();
11038                        let mut grpc = tonic::server::Grpc::new(codec)
11039                            .apply_compression_config(
11040                                accept_compression_encodings,
11041                                send_compression_encodings,
11042                            )
11043                            .apply_max_message_size_config(
11044                                max_decoding_message_size,
11045                                max_encoding_message_size,
11046                            );
11047                        let res = grpc.unary(method, req).await;
11048                        Ok(res)
11049                    };
11050                    Box::pin(fut)
11051                }
11052                "/pidgr.v1.MemberService/RevokeInvite" => {
11053                    #[allow(non_camel_case_types)]
11054                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
11055                    impl<
11056                        T: MemberService,
11057                    > tonic::server::UnaryService<super::RevokeInviteRequest>
11058                    for RevokeInviteSvc<T> {
11059                        type Response = super::RevokeInviteResponse;
11060                        type Future = BoxFuture<
11061                            tonic::Response<Self::Response>,
11062                            tonic::Status,
11063                        >;
11064                        fn call(
11065                            &mut self,
11066                            request: tonic::Request<super::RevokeInviteRequest>,
11067                        ) -> Self::Future {
11068                            let inner = Arc::clone(&self.0);
11069                            let fut = async move {
11070                                <T as MemberService>::revoke_invite(&inner, request).await
11071                            };
11072                            Box::pin(fut)
11073                        }
11074                    }
11075                    let accept_compression_encodings = self.accept_compression_encodings;
11076                    let send_compression_encodings = self.send_compression_encodings;
11077                    let max_decoding_message_size = self.max_decoding_message_size;
11078                    let max_encoding_message_size = self.max_encoding_message_size;
11079                    let inner = self.inner.clone();
11080                    let fut = async move {
11081                        let method = RevokeInviteSvc(inner);
11082                        let codec = tonic_prost::ProstCodec::default();
11083                        let mut grpc = tonic::server::Grpc::new(codec)
11084                            .apply_compression_config(
11085                                accept_compression_encodings,
11086                                send_compression_encodings,
11087                            )
11088                            .apply_max_message_size_config(
11089                                max_decoding_message_size,
11090                                max_encoding_message_size,
11091                            );
11092                        let res = grpc.unary(method, req).await;
11093                        Ok(res)
11094                    };
11095                    Box::pin(fut)
11096                }
11097                "/pidgr.v1.MemberService/UpdateUserProfile" => {
11098                    #[allow(non_camel_case_types)]
11099                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
11100                    impl<
11101                        T: MemberService,
11102                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
11103                    for UpdateUserProfileSvc<T> {
11104                        type Response = super::UpdateUserProfileResponse;
11105                        type Future = BoxFuture<
11106                            tonic::Response<Self::Response>,
11107                            tonic::Status,
11108                        >;
11109                        fn call(
11110                            &mut self,
11111                            request: tonic::Request<super::UpdateUserProfileRequest>,
11112                        ) -> Self::Future {
11113                            let inner = Arc::clone(&self.0);
11114                            let fut = async move {
11115                                <T as MemberService>::update_user_profile(&inner, request)
11116                                    .await
11117                            };
11118                            Box::pin(fut)
11119                        }
11120                    }
11121                    let accept_compression_encodings = self.accept_compression_encodings;
11122                    let send_compression_encodings = self.send_compression_encodings;
11123                    let max_decoding_message_size = self.max_decoding_message_size;
11124                    let max_encoding_message_size = self.max_encoding_message_size;
11125                    let inner = self.inner.clone();
11126                    let fut = async move {
11127                        let method = UpdateUserProfileSvc(inner);
11128                        let codec = tonic_prost::ProstCodec::default();
11129                        let mut grpc = tonic::server::Grpc::new(codec)
11130                            .apply_compression_config(
11131                                accept_compression_encodings,
11132                                send_compression_encodings,
11133                            )
11134                            .apply_max_message_size_config(
11135                                max_decoding_message_size,
11136                                max_encoding_message_size,
11137                            );
11138                        let res = grpc.unary(method, req).await;
11139                        Ok(res)
11140                    };
11141                    Box::pin(fut)
11142                }
11143                "/pidgr.v1.MemberService/GetUserSettings" => {
11144                    #[allow(non_camel_case_types)]
11145                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
11146                    impl<
11147                        T: MemberService,
11148                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
11149                    for GetUserSettingsSvc<T> {
11150                        type Response = super::GetUserSettingsResponse;
11151                        type Future = BoxFuture<
11152                            tonic::Response<Self::Response>,
11153                            tonic::Status,
11154                        >;
11155                        fn call(
11156                            &mut self,
11157                            request: tonic::Request<super::GetUserSettingsRequest>,
11158                        ) -> Self::Future {
11159                            let inner = Arc::clone(&self.0);
11160                            let fut = async move {
11161                                <T as MemberService>::get_user_settings(&inner, request)
11162                                    .await
11163                            };
11164                            Box::pin(fut)
11165                        }
11166                    }
11167                    let accept_compression_encodings = self.accept_compression_encodings;
11168                    let send_compression_encodings = self.send_compression_encodings;
11169                    let max_decoding_message_size = self.max_decoding_message_size;
11170                    let max_encoding_message_size = self.max_encoding_message_size;
11171                    let inner = self.inner.clone();
11172                    let fut = async move {
11173                        let method = GetUserSettingsSvc(inner);
11174                        let codec = tonic_prost::ProstCodec::default();
11175                        let mut grpc = tonic::server::Grpc::new(codec)
11176                            .apply_compression_config(
11177                                accept_compression_encodings,
11178                                send_compression_encodings,
11179                            )
11180                            .apply_max_message_size_config(
11181                                max_decoding_message_size,
11182                                max_encoding_message_size,
11183                            );
11184                        let res = grpc.unary(method, req).await;
11185                        Ok(res)
11186                    };
11187                    Box::pin(fut)
11188                }
11189                "/pidgr.v1.MemberService/UpdateUserSettings" => {
11190                    #[allow(non_camel_case_types)]
11191                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11192                    impl<
11193                        T: MemberService,
11194                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11195                    for UpdateUserSettingsSvc<T> {
11196                        type Response = super::UpdateUserSettingsResponse;
11197                        type Future = BoxFuture<
11198                            tonic::Response<Self::Response>,
11199                            tonic::Status,
11200                        >;
11201                        fn call(
11202                            &mut self,
11203                            request: tonic::Request<super::UpdateUserSettingsRequest>,
11204                        ) -> Self::Future {
11205                            let inner = Arc::clone(&self.0);
11206                            let fut = async move {
11207                                <T as MemberService>::update_user_settings(&inner, request)
11208                                    .await
11209                            };
11210                            Box::pin(fut)
11211                        }
11212                    }
11213                    let accept_compression_encodings = self.accept_compression_encodings;
11214                    let send_compression_encodings = self.send_compression_encodings;
11215                    let max_decoding_message_size = self.max_decoding_message_size;
11216                    let max_encoding_message_size = self.max_encoding_message_size;
11217                    let inner = self.inner.clone();
11218                    let fut = async move {
11219                        let method = UpdateUserSettingsSvc(inner);
11220                        let codec = tonic_prost::ProstCodec::default();
11221                        let mut grpc = tonic::server::Grpc::new(codec)
11222                            .apply_compression_config(
11223                                accept_compression_encodings,
11224                                send_compression_encodings,
11225                            )
11226                            .apply_max_message_size_config(
11227                                max_decoding_message_size,
11228                                max_encoding_message_size,
11229                            );
11230                        let res = grpc.unary(method, req).await;
11231                        Ok(res)
11232                    };
11233                    Box::pin(fut)
11234                }
11235                "/pidgr.v1.MemberService/BulkInviteUsers" => {
11236                    #[allow(non_camel_case_types)]
11237                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11238                    impl<
11239                        T: MemberService,
11240                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11241                    for BulkInviteUsersSvc<T> {
11242                        type Response = super::BulkInviteUsersResponse;
11243                        type Future = BoxFuture<
11244                            tonic::Response<Self::Response>,
11245                            tonic::Status,
11246                        >;
11247                        fn call(
11248                            &mut self,
11249                            request: tonic::Request<super::BulkInviteUsersRequest>,
11250                        ) -> Self::Future {
11251                            let inner = Arc::clone(&self.0);
11252                            let fut = async move {
11253                                <T as MemberService>::bulk_invite_users(&inner, request)
11254                                    .await
11255                            };
11256                            Box::pin(fut)
11257                        }
11258                    }
11259                    let accept_compression_encodings = self.accept_compression_encodings;
11260                    let send_compression_encodings = self.send_compression_encodings;
11261                    let max_decoding_message_size = self.max_decoding_message_size;
11262                    let max_encoding_message_size = self.max_encoding_message_size;
11263                    let inner = self.inner.clone();
11264                    let fut = async move {
11265                        let method = BulkInviteUsersSvc(inner);
11266                        let codec = tonic_prost::ProstCodec::default();
11267                        let mut grpc = tonic::server::Grpc::new(codec)
11268                            .apply_compression_config(
11269                                accept_compression_encodings,
11270                                send_compression_encodings,
11271                            )
11272                            .apply_max_message_size_config(
11273                                max_decoding_message_size,
11274                                max_encoding_message_size,
11275                            );
11276                        let res = grpc.unary(method, req).await;
11277                        Ok(res)
11278                    };
11279                    Box::pin(fut)
11280                }
11281                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11282                    #[allow(non_camel_case_types)]
11283                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11284                    impl<
11285                        T: MemberService,
11286                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11287                    for ConfirmPasskeyEnrollmentSvc<T> {
11288                        type Response = super::ConfirmPasskeyEnrollmentResponse;
11289                        type Future = BoxFuture<
11290                            tonic::Response<Self::Response>,
11291                            tonic::Status,
11292                        >;
11293                        fn call(
11294                            &mut self,
11295                            request: tonic::Request<
11296                                super::ConfirmPasskeyEnrollmentRequest,
11297                            >,
11298                        ) -> Self::Future {
11299                            let inner = Arc::clone(&self.0);
11300                            let fut = async move {
11301                                <T as MemberService>::confirm_passkey_enrollment(
11302                                        &inner,
11303                                        request,
11304                                    )
11305                                    .await
11306                            };
11307                            Box::pin(fut)
11308                        }
11309                    }
11310                    let accept_compression_encodings = self.accept_compression_encodings;
11311                    let send_compression_encodings = self.send_compression_encodings;
11312                    let max_decoding_message_size = self.max_decoding_message_size;
11313                    let max_encoding_message_size = self.max_encoding_message_size;
11314                    let inner = self.inner.clone();
11315                    let fut = async move {
11316                        let method = ConfirmPasskeyEnrollmentSvc(inner);
11317                        let codec = tonic_prost::ProstCodec::default();
11318                        let mut grpc = tonic::server::Grpc::new(codec)
11319                            .apply_compression_config(
11320                                accept_compression_encodings,
11321                                send_compression_encodings,
11322                            )
11323                            .apply_max_message_size_config(
11324                                max_decoding_message_size,
11325                                max_encoding_message_size,
11326                            );
11327                        let res = grpc.unary(method, req).await;
11328                        Ok(res)
11329                    };
11330                    Box::pin(fut)
11331                }
11332                "/pidgr.v1.MemberService/UpdateUserRegion" => {
11333                    #[allow(non_camel_case_types)]
11334                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11335                    impl<
11336                        T: MemberService,
11337                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11338                    for UpdateUserRegionSvc<T> {
11339                        type Response = super::UpdateUserRegionResponse;
11340                        type Future = BoxFuture<
11341                            tonic::Response<Self::Response>,
11342                            tonic::Status,
11343                        >;
11344                        fn call(
11345                            &mut self,
11346                            request: tonic::Request<super::UpdateUserRegionRequest>,
11347                        ) -> Self::Future {
11348                            let inner = Arc::clone(&self.0);
11349                            let fut = async move {
11350                                <T as MemberService>::update_user_region(&inner, request)
11351                                    .await
11352                            };
11353                            Box::pin(fut)
11354                        }
11355                    }
11356                    let accept_compression_encodings = self.accept_compression_encodings;
11357                    let send_compression_encodings = self.send_compression_encodings;
11358                    let max_decoding_message_size = self.max_decoding_message_size;
11359                    let max_encoding_message_size = self.max_encoding_message_size;
11360                    let inner = self.inner.clone();
11361                    let fut = async move {
11362                        let method = UpdateUserRegionSvc(inner);
11363                        let codec = tonic_prost::ProstCodec::default();
11364                        let mut grpc = tonic::server::Grpc::new(codec)
11365                            .apply_compression_config(
11366                                accept_compression_encodings,
11367                                send_compression_encodings,
11368                            )
11369                            .apply_max_message_size_config(
11370                                max_decoding_message_size,
11371                                max_encoding_message_size,
11372                            );
11373                        let res = grpc.unary(method, req).await;
11374                        Ok(res)
11375                    };
11376                    Box::pin(fut)
11377                }
11378                _ => {
11379                    Box::pin(async move {
11380                        let mut response = http::Response::new(
11381                            tonic::body::Body::default(),
11382                        );
11383                        let headers = response.headers_mut();
11384                        headers
11385                            .insert(
11386                                tonic::Status::GRPC_STATUS,
11387                                (tonic::Code::Unimplemented as i32).into(),
11388                            );
11389                        headers
11390                            .insert(
11391                                http::header::CONTENT_TYPE,
11392                                tonic::metadata::GRPC_CONTENT_TYPE,
11393                            );
11394                        Ok(response)
11395                    })
11396                }
11397            }
11398        }
11399    }
11400    impl<T> Clone for MemberServiceServer<T> {
11401        fn clone(&self) -> Self {
11402            let inner = self.inner.clone();
11403            Self {
11404                inner,
11405                accept_compression_encodings: self.accept_compression_encodings,
11406                send_compression_encodings: self.send_compression_encodings,
11407                max_decoding_message_size: self.max_decoding_message_size,
11408                max_encoding_message_size: self.max_encoding_message_size,
11409            }
11410        }
11411    }
11412    /// Generated gRPC service name
11413    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11414    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11415        const NAME: &'static str = SERVICE_NAME;
11416    }
11417}
11418/// Generated client implementations.
11419pub mod org_security_keys_service_client {
11420    #![allow(
11421        unused_variables,
11422        dead_code,
11423        missing_docs,
11424        clippy::wildcard_imports,
11425        clippy::let_unit_value,
11426    )]
11427    use tonic::codegen::*;
11428    use tonic::codegen::http::Uri;
11429    /** OrgSecurityKeysService exposes per-org secret key material to internal
11430 services that need it for HMAC computation, signature verification, or
11431 envelope-key derivation.
11432
11433 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11434 material. The server MUST require a client certificate from a known
11435 internal service (allowlisted by subject DN) and MUST reject any request
11436 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11437
11438 Callers (today: pidgr-integrations) cache returned peppers in-process
11439 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11440 keep dispatch hot-path latency bounded.
11441*/
11442    #[derive(Debug, Clone)]
11443    pub struct OrgSecurityKeysServiceClient<T> {
11444        inner: tonic::client::Grpc<T>,
11445    }
11446    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
11447        /// Attempt to create a new client by connecting to a given endpoint.
11448        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11449        where
11450            D: TryInto<tonic::transport::Endpoint>,
11451            D::Error: Into<StdError>,
11452        {
11453            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11454            Ok(Self::new(conn))
11455        }
11456    }
11457    impl<T> OrgSecurityKeysServiceClient<T>
11458    where
11459        T: tonic::client::GrpcService<tonic::body::Body>,
11460        T::Error: Into<StdError>,
11461        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11462        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11463    {
11464        pub fn new(inner: T) -> Self {
11465            let inner = tonic::client::Grpc::new(inner);
11466            Self { inner }
11467        }
11468        pub fn with_origin(inner: T, origin: Uri) -> Self {
11469            let inner = tonic::client::Grpc::with_origin(inner, origin);
11470            Self { inner }
11471        }
11472        pub fn with_interceptor<F>(
11473            inner: T,
11474            interceptor: F,
11475        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
11476        where
11477            F: tonic::service::Interceptor,
11478            T::ResponseBody: Default,
11479            T: tonic::codegen::Service<
11480                http::Request<tonic::body::Body>,
11481                Response = http::Response<
11482                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11483                >,
11484            >,
11485            <T as tonic::codegen::Service<
11486                http::Request<tonic::body::Body>,
11487            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11488        {
11489            OrgSecurityKeysServiceClient::new(
11490                InterceptedService::new(inner, interceptor),
11491            )
11492        }
11493        /// Compress requests with the given encoding.
11494        ///
11495        /// This requires the server to support it otherwise it might respond with an
11496        /// error.
11497        #[must_use]
11498        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11499            self.inner = self.inner.send_compressed(encoding);
11500            self
11501        }
11502        /// Enable decompressing responses.
11503        #[must_use]
11504        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11505            self.inner = self.inner.accept_compressed(encoding);
11506            self
11507        }
11508        /// Limits the maximum size of a decoded message.
11509        ///
11510        /// Default: `4MB`
11511        #[must_use]
11512        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11513            self.inner = self.inner.max_decoding_message_size(limit);
11514            self
11515        }
11516        /// Limits the maximum size of an encoded message.
11517        ///
11518        /// Default: `usize::MAX`
11519        #[must_use]
11520        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11521            self.inner = self.inner.max_encoding_message_size(limit);
11522            self
11523        }
11524        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11525 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11526 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11527*/
11528        pub async fn get_peppers(
11529            &mut self,
11530            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11531        ) -> std::result::Result<
11532            tonic::Response<super::GetPeppersResponse>,
11533            tonic::Status,
11534        > {
11535            self.inner
11536                .ready()
11537                .await
11538                .map_err(|e| {
11539                    tonic::Status::unknown(
11540                        format!("Service was not ready: {}", e.into()),
11541                    )
11542                })?;
11543            let codec = tonic_prost::ProstCodec::default();
11544            let path = http::uri::PathAndQuery::from_static(
11545                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11546            );
11547            let mut req = request.into_request();
11548            req.extensions_mut()
11549                .insert(
11550                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11551                );
11552            self.inner.unary(req, path, codec).await
11553        }
11554    }
11555}
11556/// Generated server implementations.
11557pub mod org_security_keys_service_server {
11558    #![allow(
11559        unused_variables,
11560        dead_code,
11561        missing_docs,
11562        clippy::wildcard_imports,
11563        clippy::let_unit_value,
11564    )]
11565    use tonic::codegen::*;
11566    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
11567    #[async_trait]
11568    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11569        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11570 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11571 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11572*/
11573        async fn get_peppers(
11574            &self,
11575            request: tonic::Request<super::GetPeppersRequest>,
11576        ) -> std::result::Result<
11577            tonic::Response<super::GetPeppersResponse>,
11578            tonic::Status,
11579        >;
11580    }
11581    /** OrgSecurityKeysService exposes per-org secret key material to internal
11582 services that need it for HMAC computation, signature verification, or
11583 envelope-key derivation.
11584
11585 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11586 material. The server MUST require a client certificate from a known
11587 internal service (allowlisted by subject DN) and MUST reject any request
11588 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11589
11590 Callers (today: pidgr-integrations) cache returned peppers in-process
11591 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11592 keep dispatch hot-path latency bounded.
11593*/
11594    #[derive(Debug)]
11595    pub struct OrgSecurityKeysServiceServer<T> {
11596        inner: Arc<T>,
11597        accept_compression_encodings: EnabledCompressionEncodings,
11598        send_compression_encodings: EnabledCompressionEncodings,
11599        max_decoding_message_size: Option<usize>,
11600        max_encoding_message_size: Option<usize>,
11601    }
11602    impl<T> OrgSecurityKeysServiceServer<T> {
11603        pub fn new(inner: T) -> Self {
11604            Self::from_arc(Arc::new(inner))
11605        }
11606        pub fn from_arc(inner: Arc<T>) -> Self {
11607            Self {
11608                inner,
11609                accept_compression_encodings: Default::default(),
11610                send_compression_encodings: Default::default(),
11611                max_decoding_message_size: None,
11612                max_encoding_message_size: None,
11613            }
11614        }
11615        pub fn with_interceptor<F>(
11616            inner: T,
11617            interceptor: F,
11618        ) -> InterceptedService<Self, F>
11619        where
11620            F: tonic::service::Interceptor,
11621        {
11622            InterceptedService::new(Self::new(inner), interceptor)
11623        }
11624        /// Enable decompressing requests with the given encoding.
11625        #[must_use]
11626        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11627            self.accept_compression_encodings.enable(encoding);
11628            self
11629        }
11630        /// Compress responses with the given encoding, if the client supports it.
11631        #[must_use]
11632        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11633            self.send_compression_encodings.enable(encoding);
11634            self
11635        }
11636        /// Limits the maximum size of a decoded message.
11637        ///
11638        /// Default: `4MB`
11639        #[must_use]
11640        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11641            self.max_decoding_message_size = Some(limit);
11642            self
11643        }
11644        /// Limits the maximum size of an encoded message.
11645        ///
11646        /// Default: `usize::MAX`
11647        #[must_use]
11648        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11649            self.max_encoding_message_size = Some(limit);
11650            self
11651        }
11652    }
11653    impl<T, B> tonic::codegen::Service<http::Request<B>>
11654    for OrgSecurityKeysServiceServer<T>
11655    where
11656        T: OrgSecurityKeysService,
11657        B: Body + std::marker::Send + 'static,
11658        B::Error: Into<StdError> + std::marker::Send + 'static,
11659    {
11660        type Response = http::Response<tonic::body::Body>;
11661        type Error = std::convert::Infallible;
11662        type Future = BoxFuture<Self::Response, Self::Error>;
11663        fn poll_ready(
11664            &mut self,
11665            _cx: &mut Context<'_>,
11666        ) -> Poll<std::result::Result<(), Self::Error>> {
11667            Poll::Ready(Ok(()))
11668        }
11669        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11670            match req.uri().path() {
11671                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11672                    #[allow(non_camel_case_types)]
11673                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11674                    impl<
11675                        T: OrgSecurityKeysService,
11676                    > tonic::server::UnaryService<super::GetPeppersRequest>
11677                    for GetPeppersSvc<T> {
11678                        type Response = super::GetPeppersResponse;
11679                        type Future = BoxFuture<
11680                            tonic::Response<Self::Response>,
11681                            tonic::Status,
11682                        >;
11683                        fn call(
11684                            &mut self,
11685                            request: tonic::Request<super::GetPeppersRequest>,
11686                        ) -> Self::Future {
11687                            let inner = Arc::clone(&self.0);
11688                            let fut = async move {
11689                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11690                                    .await
11691                            };
11692                            Box::pin(fut)
11693                        }
11694                    }
11695                    let accept_compression_encodings = self.accept_compression_encodings;
11696                    let send_compression_encodings = self.send_compression_encodings;
11697                    let max_decoding_message_size = self.max_decoding_message_size;
11698                    let max_encoding_message_size = self.max_encoding_message_size;
11699                    let inner = self.inner.clone();
11700                    let fut = async move {
11701                        let method = GetPeppersSvc(inner);
11702                        let codec = tonic_prost::ProstCodec::default();
11703                        let mut grpc = tonic::server::Grpc::new(codec)
11704                            .apply_compression_config(
11705                                accept_compression_encodings,
11706                                send_compression_encodings,
11707                            )
11708                            .apply_max_message_size_config(
11709                                max_decoding_message_size,
11710                                max_encoding_message_size,
11711                            );
11712                        let res = grpc.unary(method, req).await;
11713                        Ok(res)
11714                    };
11715                    Box::pin(fut)
11716                }
11717                _ => {
11718                    Box::pin(async move {
11719                        let mut response = http::Response::new(
11720                            tonic::body::Body::default(),
11721                        );
11722                        let headers = response.headers_mut();
11723                        headers
11724                            .insert(
11725                                tonic::Status::GRPC_STATUS,
11726                                (tonic::Code::Unimplemented as i32).into(),
11727                            );
11728                        headers
11729                            .insert(
11730                                http::header::CONTENT_TYPE,
11731                                tonic::metadata::GRPC_CONTENT_TYPE,
11732                            );
11733                        Ok(response)
11734                    })
11735                }
11736            }
11737        }
11738    }
11739    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11740        fn clone(&self) -> Self {
11741            let inner = self.inner.clone();
11742            Self {
11743                inner,
11744                accept_compression_encodings: self.accept_compression_encodings,
11745                send_compression_encodings: self.send_compression_encodings,
11746                max_decoding_message_size: self.max_decoding_message_size,
11747                max_encoding_message_size: self.max_encoding_message_size,
11748            }
11749        }
11750    }
11751    /// Generated gRPC service name
11752    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11753    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11754        const NAME: &'static str = SERVICE_NAME;
11755    }
11756}
11757/// Generated client implementations.
11758pub mod organization_service_client {
11759    #![allow(
11760        unused_variables,
11761        dead_code,
11762        missing_docs,
11763        clippy::wildcard_imports,
11764        clippy::let_unit_value,
11765    )]
11766    use tonic::codegen::*;
11767    use tonic::codegen::http::Uri;
11768    /** Manages organizations (tenants) in the Pidgr platform.
11769 Most RPCs operate within the caller's org (extracted from JWT).
11770 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11771*/
11772    #[derive(Debug, Clone)]
11773    pub struct OrganizationServiceClient<T> {
11774        inner: tonic::client::Grpc<T>,
11775    }
11776    impl OrganizationServiceClient<tonic::transport::Channel> {
11777        /// Attempt to create a new client by connecting to a given endpoint.
11778        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11779        where
11780            D: TryInto<tonic::transport::Endpoint>,
11781            D::Error: Into<StdError>,
11782        {
11783            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11784            Ok(Self::new(conn))
11785        }
11786    }
11787    impl<T> OrganizationServiceClient<T>
11788    where
11789        T: tonic::client::GrpcService<tonic::body::Body>,
11790        T::Error: Into<StdError>,
11791        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11792        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11793    {
11794        pub fn new(inner: T) -> Self {
11795            let inner = tonic::client::Grpc::new(inner);
11796            Self { inner }
11797        }
11798        pub fn with_origin(inner: T, origin: Uri) -> Self {
11799            let inner = tonic::client::Grpc::with_origin(inner, origin);
11800            Self { inner }
11801        }
11802        pub fn with_interceptor<F>(
11803            inner: T,
11804            interceptor: F,
11805        ) -> OrganizationServiceClient<InterceptedService<T, F>>
11806        where
11807            F: tonic::service::Interceptor,
11808            T::ResponseBody: Default,
11809            T: tonic::codegen::Service<
11810                http::Request<tonic::body::Body>,
11811                Response = http::Response<
11812                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11813                >,
11814            >,
11815            <T as tonic::codegen::Service<
11816                http::Request<tonic::body::Body>,
11817            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11818        {
11819            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11820        }
11821        /// Compress requests with the given encoding.
11822        ///
11823        /// This requires the server to support it otherwise it might respond with an
11824        /// error.
11825        #[must_use]
11826        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11827            self.inner = self.inner.send_compressed(encoding);
11828            self
11829        }
11830        /// Enable decompressing responses.
11831        #[must_use]
11832        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11833            self.inner = self.inner.accept_compressed(encoding);
11834            self
11835        }
11836        /// Limits the maximum size of a decoded message.
11837        ///
11838        /// Default: `4MB`
11839        #[must_use]
11840        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11841            self.inner = self.inner.max_decoding_message_size(limit);
11842            self
11843        }
11844        /// Limits the maximum size of an encoded message.
11845        ///
11846        /// Default: `usize::MAX`
11847        #[must_use]
11848        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11849            self.inner = self.inner.max_encoding_message_size(limit);
11850            self
11851        }
11852        /** Create a new organization. JWT auth only — the caller becomes the initial
11853 admin. Add further admins via CreateInviteLink.
11854 Authorization: Authenticated user (no specific permission required).
11855*/
11856        pub async fn create_organization(
11857            &mut self,
11858            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11859        ) -> std::result::Result<
11860            tonic::Response<super::CreateOrganizationResponse>,
11861            tonic::Status,
11862        > {
11863            self.inner
11864                .ready()
11865                .await
11866                .map_err(|e| {
11867                    tonic::Status::unknown(
11868                        format!("Service was not ready: {}", e.into()),
11869                    )
11870                })?;
11871            let codec = tonic_prost::ProstCodec::default();
11872            let path = http::uri::PathAndQuery::from_static(
11873                "/pidgr.v1.OrganizationService/CreateOrganization",
11874            );
11875            let mut req = request.into_request();
11876            req.extensions_mut()
11877                .insert(
11878                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11879                );
11880            self.inner.unary(req, path, codec).await
11881        }
11882        /** Retrieve the organization for the authenticated user.
11883 Authorization: Requires PERMISSION_ORG_READ.
11884*/
11885        pub async fn get_organization(
11886            &mut self,
11887            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11888        ) -> std::result::Result<
11889            tonic::Response<super::GetOrganizationResponse>,
11890            tonic::Status,
11891        > {
11892            self.inner
11893                .ready()
11894                .await
11895                .map_err(|e| {
11896                    tonic::Status::unknown(
11897                        format!("Service was not ready: {}", e.into()),
11898                    )
11899                })?;
11900            let codec = tonic_prost::ProstCodec::default();
11901            let path = http::uri::PathAndQuery::from_static(
11902                "/pidgr.v1.OrganizationService/GetOrganization",
11903            );
11904            let mut req = request.into_request();
11905            req.extensions_mut()
11906                .insert(
11907                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
11908                );
11909            self.inner.unary(req, path, codec).await
11910        }
11911        /** Update organization settings (name, default workflow, industry, company size).
11912 Authorization: Requires PERMISSION_ORG_WRITE.
11913*/
11914        pub async fn update_organization(
11915            &mut self,
11916            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
11917        ) -> std::result::Result<
11918            tonic::Response<super::UpdateOrganizationResponse>,
11919            tonic::Status,
11920        > {
11921            self.inner
11922                .ready()
11923                .await
11924                .map_err(|e| {
11925                    tonic::Status::unknown(
11926                        format!("Service was not ready: {}", e.into()),
11927                    )
11928                })?;
11929            let codec = tonic_prost::ProstCodec::default();
11930            let path = http::uri::PathAndQuery::from_static(
11931                "/pidgr.v1.OrganizationService/UpdateOrganization",
11932            );
11933            let mut req = request.into_request();
11934            req.extensions_mut()
11935                .insert(
11936                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
11937                );
11938            self.inner.unary(req, path, codec).await
11939        }
11940        /** Replace all SSO attribute mappings for the organization.
11941 Authorization: Requires PERMISSION_ORG_WRITE.
11942*/
11943        pub async fn update_sso_attribute_mappings(
11944            &mut self,
11945            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
11946        ) -> std::result::Result<
11947            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11948            tonic::Status,
11949        > {
11950            self.inner
11951                .ready()
11952                .await
11953                .map_err(|e| {
11954                    tonic::Status::unknown(
11955                        format!("Service was not ready: {}", e.into()),
11956                    )
11957                })?;
11958            let codec = tonic_prost::ProstCodec::default();
11959            let path = http::uri::PathAndQuery::from_static(
11960                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
11961            );
11962            let mut req = request.into_request();
11963            req.extensions_mut()
11964                .insert(
11965                    GrpcMethod::new(
11966                        "pidgr.v1.OrganizationService",
11967                        "UpdateSsoAttributeMappings",
11968                    ),
11969                );
11970            self.inner.unary(req, path, codec).await
11971        }
11972        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11973 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11974*/
11975        pub async fn rotate_analytics_salt(
11976            &mut self,
11977            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
11978        ) -> std::result::Result<
11979            tonic::Response<super::RotateAnalyticsSaltResponse>,
11980            tonic::Status,
11981        > {
11982            self.inner
11983                .ready()
11984                .await
11985                .map_err(|e| {
11986                    tonic::Status::unknown(
11987                        format!("Service was not ready: {}", e.into()),
11988                    )
11989                })?;
11990            let codec = tonic_prost::ProstCodec::default();
11991            let path = http::uri::PathAndQuery::from_static(
11992                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11993            );
11994            let mut req = request.into_request();
11995            req.extensions_mut()
11996                .insert(
11997                    GrpcMethod::new(
11998                        "pidgr.v1.OrganizationService",
11999                        "RotateAnalyticsSalt",
12000                    ),
12001                );
12002            self.inner.unary(req, path, codec).await
12003        }
12004        /** Update the differential privacy epsilon parameter.
12005 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12006*/
12007        pub async fn update_analytics_epsilon(
12008            &mut self,
12009            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
12010        ) -> std::result::Result<
12011            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12012            tonic::Status,
12013        > {
12014            self.inner
12015                .ready()
12016                .await
12017                .map_err(|e| {
12018                    tonic::Status::unknown(
12019                        format!("Service was not ready: {}", e.into()),
12020                    )
12021                })?;
12022            let codec = tonic_prost::ProstCodec::default();
12023            let path = http::uri::PathAndQuery::from_static(
12024                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
12025            );
12026            let mut req = request.into_request();
12027            req.extensions_mut()
12028                .insert(
12029                    GrpcMethod::new(
12030                        "pidgr.v1.OrganizationService",
12031                        "UpdateAnalyticsEpsilon",
12032                    ),
12033                );
12034            self.inner.unary(req, path, codec).await
12035        }
12036        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12037 analytics, third-party channels) with last-changed-by/at metadata for
12038 the consent-trace UI.
12039 Authorization: Requires PERMISSION_PRIVACY_READ.
12040*/
12041        pub async fn get_org_privacy_settings(
12042            &mut self,
12043            request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
12044        ) -> std::result::Result<
12045            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12046            tonic::Status,
12047        > {
12048            self.inner
12049                .ready()
12050                .await
12051                .map_err(|e| {
12052                    tonic::Status::unknown(
12053                        format!("Service was not ready: {}", e.into()),
12054                    )
12055                })?;
12056            let codec = tonic_prost::ProstCodec::default();
12057            let path = http::uri::PathAndQuery::from_static(
12058                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
12059            );
12060            let mut req = request.into_request();
12061            req.extensions_mut()
12062                .insert(
12063                    GrpcMethod::new(
12064                        "pidgr.v1.OrganizationService",
12065                        "GetOrgPrivacySettings",
12066                    ),
12067                );
12068            self.inner.unary(req, path, codec).await
12069        }
12070        /** Update org-level data-processing toggles. Only provided fields change;
12071 each change is recorded with the acting admin and timestamp.
12072 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12073*/
12074        pub async fn update_org_privacy_settings(
12075            &mut self,
12076            request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
12077        ) -> std::result::Result<
12078            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12079            tonic::Status,
12080        > {
12081            self.inner
12082                .ready()
12083                .await
12084                .map_err(|e| {
12085                    tonic::Status::unknown(
12086                        format!("Service was not ready: {}", e.into()),
12087                    )
12088                })?;
12089            let codec = tonic_prost::ProstCodec::default();
12090            let path = http::uri::PathAndQuery::from_static(
12091                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
12092            );
12093            let mut req = request.into_request();
12094            req.extensions_mut()
12095                .insert(
12096                    GrpcMethod::new(
12097                        "pidgr.v1.OrganizationService",
12098                        "UpdateOrgPrivacySettings",
12099                    ),
12100                );
12101            self.inner.unary(req, path, codec).await
12102        }
12103        /** Create a sandbox organization for testing configurations.
12104 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12105 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12106 per user to prevent abuse.
12107*/
12108        pub async fn create_sandbox_organization(
12109            &mut self,
12110            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
12111        ) -> std::result::Result<
12112            tonic::Response<super::CreateSandboxOrganizationResponse>,
12113            tonic::Status,
12114        > {
12115            self.inner
12116                .ready()
12117                .await
12118                .map_err(|e| {
12119                    tonic::Status::unknown(
12120                        format!("Service was not ready: {}", e.into()),
12121                    )
12122                })?;
12123            let codec = tonic_prost::ProstCodec::default();
12124            let path = http::uri::PathAndQuery::from_static(
12125                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
12126            );
12127            let mut req = request.into_request();
12128            req.extensions_mut()
12129                .insert(
12130                    GrpcMethod::new(
12131                        "pidgr.v1.OrganizationService",
12132                        "CreateSandboxOrganization",
12133                    ),
12134                );
12135            self.inner.unary(req, path, codec).await
12136        }
12137        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12138 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12139 content stores.
12140 Authorization: Super admin of the target sandbox OR its creator.
12141*/
12142        pub async fn delete_sandbox_organization(
12143            &mut self,
12144            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
12145        ) -> std::result::Result<
12146            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12147            tonic::Status,
12148        > {
12149            self.inner
12150                .ready()
12151                .await
12152                .map_err(|e| {
12153                    tonic::Status::unknown(
12154                        format!("Service was not ready: {}", e.into()),
12155                    )
12156                })?;
12157            let codec = tonic_prost::ProstCodec::default();
12158            let path = http::uri::PathAndQuery::from_static(
12159                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
12160            );
12161            let mut req = request.into_request();
12162            req.extensions_mut()
12163                .insert(
12164                    GrpcMethod::new(
12165                        "pidgr.v1.OrganizationService",
12166                        "DeleteSandboxOrganization",
12167                    ),
12168                );
12169            self.inner.unary(req, path, codec).await
12170        }
12171        /** List bootstrap fixtures available for seeding new organizations. The
12172 catalog is backend-owned; admin UI populates the "seed initial data"
12173 control or dropdown from this response.
12174 Authorization: Any authenticated user.
12175*/
12176        pub async fn list_sandbox_fixtures(
12177            &mut self,
12178            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
12179        ) -> std::result::Result<
12180            tonic::Response<super::ListSandboxFixturesResponse>,
12181            tonic::Status,
12182        > {
12183            self.inner
12184                .ready()
12185                .await
12186                .map_err(|e| {
12187                    tonic::Status::unknown(
12188                        format!("Service was not ready: {}", e.into()),
12189                    )
12190                })?;
12191            let codec = tonic_prost::ProstCodec::default();
12192            let path = http::uri::PathAndQuery::from_static(
12193                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
12194            );
12195            let mut req = request.into_request();
12196            req.extensions_mut()
12197                .insert(
12198                    GrpcMethod::new(
12199                        "pidgr.v1.OrganizationService",
12200                        "ListSandboxFixtures",
12201                    ),
12202                );
12203            self.inner.unary(req, path, codec).await
12204        }
12205        /** List all organizations the authenticated user belongs to.
12206 Org-exempt: callable without org context (only requires valid JWT).
12207 Used by the admin org switcher to discover available orgs.
12208 Excludes expired sandbox organizations.
12209 Authorization: Authenticated user (no specific permission required).
12210*/
12211        pub async fn list_user_organizations(
12212            &mut self,
12213            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
12214        ) -> std::result::Result<
12215            tonic::Response<super::ListUserOrganizationsResponse>,
12216            tonic::Status,
12217        > {
12218            self.inner
12219                .ready()
12220                .await
12221                .map_err(|e| {
12222                    tonic::Status::unknown(
12223                        format!("Service was not ready: {}", e.into()),
12224                    )
12225                })?;
12226            let codec = tonic_prost::ProstCodec::default();
12227            let path = http::uri::PathAndQuery::from_static(
12228                "/pidgr.v1.OrganizationService/ListUserOrganizations",
12229            );
12230            let mut req = request.into_request();
12231            req.extensions_mut()
12232                .insert(
12233                    GrpcMethod::new(
12234                        "pidgr.v1.OrganizationService",
12235                        "ListUserOrganizations",
12236                    ),
12237                );
12238            self.inner.unary(req, path, codec).await
12239        }
12240        /** List only the sandbox organizations the authenticated user belongs to.
12241 Org-exempt: callable without org context. The admin UI's /sandboxes
12242 management page is the primary consumer — it's a user-level surface
12243 rather than org-scoped, so this RPC is user-scoped too.
12244 Excludes already-expired sandboxes (pending cleanup).
12245 Authorization: Authenticated user (no specific permission required).
12246*/
12247        pub async fn list_user_sandboxes(
12248            &mut self,
12249            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
12250        ) -> std::result::Result<
12251            tonic::Response<super::ListUserSandboxesResponse>,
12252            tonic::Status,
12253        > {
12254            self.inner
12255                .ready()
12256                .await
12257                .map_err(|e| {
12258                    tonic::Status::unknown(
12259                        format!("Service was not ready: {}", e.into()),
12260                    )
12261                })?;
12262            let codec = tonic_prost::ProstCodec::default();
12263            let path = http::uri::PathAndQuery::from_static(
12264                "/pidgr.v1.OrganizationService/ListUserSandboxes",
12265            );
12266            let mut req = request.into_request();
12267            req.extensions_mut()
12268                .insert(
12269                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
12270                );
12271            self.inner.unary(req, path, codec).await
12272        }
12273    }
12274}
12275/// Generated server implementations.
12276pub mod organization_service_server {
12277    #![allow(
12278        unused_variables,
12279        dead_code,
12280        missing_docs,
12281        clippy::wildcard_imports,
12282        clippy::let_unit_value,
12283    )]
12284    use tonic::codegen::*;
12285    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
12286    #[async_trait]
12287    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
12288        /** Create a new organization. JWT auth only — the caller becomes the initial
12289 admin. Add further admins via CreateInviteLink.
12290 Authorization: Authenticated user (no specific permission required).
12291*/
12292        async fn create_organization(
12293            &self,
12294            request: tonic::Request<super::CreateOrganizationRequest>,
12295        ) -> std::result::Result<
12296            tonic::Response<super::CreateOrganizationResponse>,
12297            tonic::Status,
12298        >;
12299        /** Retrieve the organization for the authenticated user.
12300 Authorization: Requires PERMISSION_ORG_READ.
12301*/
12302        async fn get_organization(
12303            &self,
12304            request: tonic::Request<super::GetOrganizationRequest>,
12305        ) -> std::result::Result<
12306            tonic::Response<super::GetOrganizationResponse>,
12307            tonic::Status,
12308        >;
12309        /** Update organization settings (name, default workflow, industry, company size).
12310 Authorization: Requires PERMISSION_ORG_WRITE.
12311*/
12312        async fn update_organization(
12313            &self,
12314            request: tonic::Request<super::UpdateOrganizationRequest>,
12315        ) -> std::result::Result<
12316            tonic::Response<super::UpdateOrganizationResponse>,
12317            tonic::Status,
12318        >;
12319        /** Replace all SSO attribute mappings for the organization.
12320 Authorization: Requires PERMISSION_ORG_WRITE.
12321*/
12322        async fn update_sso_attribute_mappings(
12323            &self,
12324            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
12325        ) -> std::result::Result<
12326            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12327            tonic::Status,
12328        >;
12329        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
12330 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12331*/
12332        async fn rotate_analytics_salt(
12333            &self,
12334            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12335        ) -> std::result::Result<
12336            tonic::Response<super::RotateAnalyticsSaltResponse>,
12337            tonic::Status,
12338        >;
12339        /** Update the differential privacy epsilon parameter.
12340 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12341*/
12342        async fn update_analytics_epsilon(
12343            &self,
12344            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12345        ) -> std::result::Result<
12346            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12347            tonic::Status,
12348        >;
12349        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
12350 analytics, third-party channels) with last-changed-by/at metadata for
12351 the consent-trace UI.
12352 Authorization: Requires PERMISSION_PRIVACY_READ.
12353*/
12354        async fn get_org_privacy_settings(
12355            &self,
12356            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12357        ) -> std::result::Result<
12358            tonic::Response<super::GetOrgPrivacySettingsResponse>,
12359            tonic::Status,
12360        >;
12361        /** Update org-level data-processing toggles. Only provided fields change;
12362 each change is recorded with the acting admin and timestamp.
12363 Authorization: Requires PERMISSION_PRIVACY_WRITE.
12364*/
12365        async fn update_org_privacy_settings(
12366            &self,
12367            request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
12368        ) -> std::result::Result<
12369            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12370            tonic::Status,
12371        >;
12372        /** Create a sandbox organization for testing configurations.
12373 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
12374 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
12375 per user to prevent abuse.
12376*/
12377        async fn create_sandbox_organization(
12378            &self,
12379            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
12380        ) -> std::result::Result<
12381            tonic::Response<super::CreateSandboxOrganizationResponse>,
12382            tonic::Status,
12383        >;
12384        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
12385 which handles cleanup across DB, Cognito, S3, Temporal, and regional
12386 content stores.
12387 Authorization: Super admin of the target sandbox OR its creator.
12388*/
12389        async fn delete_sandbox_organization(
12390            &self,
12391            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
12392        ) -> std::result::Result<
12393            tonic::Response<super::DeleteSandboxOrganizationResponse>,
12394            tonic::Status,
12395        >;
12396        /** List bootstrap fixtures available for seeding new organizations. The
12397 catalog is backend-owned; admin UI populates the "seed initial data"
12398 control or dropdown from this response.
12399 Authorization: Any authenticated user.
12400*/
12401        async fn list_sandbox_fixtures(
12402            &self,
12403            request: tonic::Request<super::ListSandboxFixturesRequest>,
12404        ) -> std::result::Result<
12405            tonic::Response<super::ListSandboxFixturesResponse>,
12406            tonic::Status,
12407        >;
12408        /** List all organizations the authenticated user belongs to.
12409 Org-exempt: callable without org context (only requires valid JWT).
12410 Used by the admin org switcher to discover available orgs.
12411 Excludes expired sandbox organizations.
12412 Authorization: Authenticated user (no specific permission required).
12413*/
12414        async fn list_user_organizations(
12415            &self,
12416            request: tonic::Request<super::ListUserOrganizationsRequest>,
12417        ) -> std::result::Result<
12418            tonic::Response<super::ListUserOrganizationsResponse>,
12419            tonic::Status,
12420        >;
12421        /** List only the sandbox organizations the authenticated user belongs to.
12422 Org-exempt: callable without org context. The admin UI's /sandboxes
12423 management page is the primary consumer — it's a user-level surface
12424 rather than org-scoped, so this RPC is user-scoped too.
12425 Excludes already-expired sandboxes (pending cleanup).
12426 Authorization: Authenticated user (no specific permission required).
12427*/
12428        async fn list_user_sandboxes(
12429            &self,
12430            request: tonic::Request<super::ListUserSandboxesRequest>,
12431        ) -> std::result::Result<
12432            tonic::Response<super::ListUserSandboxesResponse>,
12433            tonic::Status,
12434        >;
12435    }
12436    /** Manages organizations (tenants) in the Pidgr platform.
12437 Most RPCs operate within the caller's org (extracted from JWT).
12438 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
12439*/
12440    #[derive(Debug)]
12441    pub struct OrganizationServiceServer<T> {
12442        inner: Arc<T>,
12443        accept_compression_encodings: EnabledCompressionEncodings,
12444        send_compression_encodings: EnabledCompressionEncodings,
12445        max_decoding_message_size: Option<usize>,
12446        max_encoding_message_size: Option<usize>,
12447    }
12448    impl<T> OrganizationServiceServer<T> {
12449        pub fn new(inner: T) -> Self {
12450            Self::from_arc(Arc::new(inner))
12451        }
12452        pub fn from_arc(inner: Arc<T>) -> Self {
12453            Self {
12454                inner,
12455                accept_compression_encodings: Default::default(),
12456                send_compression_encodings: Default::default(),
12457                max_decoding_message_size: None,
12458                max_encoding_message_size: None,
12459            }
12460        }
12461        pub fn with_interceptor<F>(
12462            inner: T,
12463            interceptor: F,
12464        ) -> InterceptedService<Self, F>
12465        where
12466            F: tonic::service::Interceptor,
12467        {
12468            InterceptedService::new(Self::new(inner), interceptor)
12469        }
12470        /// Enable decompressing requests with the given encoding.
12471        #[must_use]
12472        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12473            self.accept_compression_encodings.enable(encoding);
12474            self
12475        }
12476        /// Compress responses with the given encoding, if the client supports it.
12477        #[must_use]
12478        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12479            self.send_compression_encodings.enable(encoding);
12480            self
12481        }
12482        /// Limits the maximum size of a decoded message.
12483        ///
12484        /// Default: `4MB`
12485        #[must_use]
12486        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12487            self.max_decoding_message_size = Some(limit);
12488            self
12489        }
12490        /// Limits the maximum size of an encoded message.
12491        ///
12492        /// Default: `usize::MAX`
12493        #[must_use]
12494        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12495            self.max_encoding_message_size = Some(limit);
12496            self
12497        }
12498    }
12499    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
12500    where
12501        T: OrganizationService,
12502        B: Body + std::marker::Send + 'static,
12503        B::Error: Into<StdError> + std::marker::Send + 'static,
12504    {
12505        type Response = http::Response<tonic::body::Body>;
12506        type Error = std::convert::Infallible;
12507        type Future = BoxFuture<Self::Response, Self::Error>;
12508        fn poll_ready(
12509            &mut self,
12510            _cx: &mut Context<'_>,
12511        ) -> Poll<std::result::Result<(), Self::Error>> {
12512            Poll::Ready(Ok(()))
12513        }
12514        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12515            match req.uri().path() {
12516                "/pidgr.v1.OrganizationService/CreateOrganization" => {
12517                    #[allow(non_camel_case_types)]
12518                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12519                    impl<
12520                        T: OrganizationService,
12521                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
12522                    for CreateOrganizationSvc<T> {
12523                        type Response = super::CreateOrganizationResponse;
12524                        type Future = BoxFuture<
12525                            tonic::Response<Self::Response>,
12526                            tonic::Status,
12527                        >;
12528                        fn call(
12529                            &mut self,
12530                            request: tonic::Request<super::CreateOrganizationRequest>,
12531                        ) -> Self::Future {
12532                            let inner = Arc::clone(&self.0);
12533                            let fut = async move {
12534                                <T as OrganizationService>::create_organization(
12535                                        &inner,
12536                                        request,
12537                                    )
12538                                    .await
12539                            };
12540                            Box::pin(fut)
12541                        }
12542                    }
12543                    let accept_compression_encodings = self.accept_compression_encodings;
12544                    let send_compression_encodings = self.send_compression_encodings;
12545                    let max_decoding_message_size = self.max_decoding_message_size;
12546                    let max_encoding_message_size = self.max_encoding_message_size;
12547                    let inner = self.inner.clone();
12548                    let fut = async move {
12549                        let method = CreateOrganizationSvc(inner);
12550                        let codec = tonic_prost::ProstCodec::default();
12551                        let mut grpc = tonic::server::Grpc::new(codec)
12552                            .apply_compression_config(
12553                                accept_compression_encodings,
12554                                send_compression_encodings,
12555                            )
12556                            .apply_max_message_size_config(
12557                                max_decoding_message_size,
12558                                max_encoding_message_size,
12559                            );
12560                        let res = grpc.unary(method, req).await;
12561                        Ok(res)
12562                    };
12563                    Box::pin(fut)
12564                }
12565                "/pidgr.v1.OrganizationService/GetOrganization" => {
12566                    #[allow(non_camel_case_types)]
12567                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12568                    impl<
12569                        T: OrganizationService,
12570                    > tonic::server::UnaryService<super::GetOrganizationRequest>
12571                    for GetOrganizationSvc<T> {
12572                        type Response = super::GetOrganizationResponse;
12573                        type Future = BoxFuture<
12574                            tonic::Response<Self::Response>,
12575                            tonic::Status,
12576                        >;
12577                        fn call(
12578                            &mut self,
12579                            request: tonic::Request<super::GetOrganizationRequest>,
12580                        ) -> Self::Future {
12581                            let inner = Arc::clone(&self.0);
12582                            let fut = async move {
12583                                <T as OrganizationService>::get_organization(
12584                                        &inner,
12585                                        request,
12586                                    )
12587                                    .await
12588                            };
12589                            Box::pin(fut)
12590                        }
12591                    }
12592                    let accept_compression_encodings = self.accept_compression_encodings;
12593                    let send_compression_encodings = self.send_compression_encodings;
12594                    let max_decoding_message_size = self.max_decoding_message_size;
12595                    let max_encoding_message_size = self.max_encoding_message_size;
12596                    let inner = self.inner.clone();
12597                    let fut = async move {
12598                        let method = GetOrganizationSvc(inner);
12599                        let codec = tonic_prost::ProstCodec::default();
12600                        let mut grpc = tonic::server::Grpc::new(codec)
12601                            .apply_compression_config(
12602                                accept_compression_encodings,
12603                                send_compression_encodings,
12604                            )
12605                            .apply_max_message_size_config(
12606                                max_decoding_message_size,
12607                                max_encoding_message_size,
12608                            );
12609                        let res = grpc.unary(method, req).await;
12610                        Ok(res)
12611                    };
12612                    Box::pin(fut)
12613                }
12614                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12615                    #[allow(non_camel_case_types)]
12616                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12617                    impl<
12618                        T: OrganizationService,
12619                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12620                    for UpdateOrganizationSvc<T> {
12621                        type Response = super::UpdateOrganizationResponse;
12622                        type Future = BoxFuture<
12623                            tonic::Response<Self::Response>,
12624                            tonic::Status,
12625                        >;
12626                        fn call(
12627                            &mut self,
12628                            request: tonic::Request<super::UpdateOrganizationRequest>,
12629                        ) -> Self::Future {
12630                            let inner = Arc::clone(&self.0);
12631                            let fut = async move {
12632                                <T as OrganizationService>::update_organization(
12633                                        &inner,
12634                                        request,
12635                                    )
12636                                    .await
12637                            };
12638                            Box::pin(fut)
12639                        }
12640                    }
12641                    let accept_compression_encodings = self.accept_compression_encodings;
12642                    let send_compression_encodings = self.send_compression_encodings;
12643                    let max_decoding_message_size = self.max_decoding_message_size;
12644                    let max_encoding_message_size = self.max_encoding_message_size;
12645                    let inner = self.inner.clone();
12646                    let fut = async move {
12647                        let method = UpdateOrganizationSvc(inner);
12648                        let codec = tonic_prost::ProstCodec::default();
12649                        let mut grpc = tonic::server::Grpc::new(codec)
12650                            .apply_compression_config(
12651                                accept_compression_encodings,
12652                                send_compression_encodings,
12653                            )
12654                            .apply_max_message_size_config(
12655                                max_decoding_message_size,
12656                                max_encoding_message_size,
12657                            );
12658                        let res = grpc.unary(method, req).await;
12659                        Ok(res)
12660                    };
12661                    Box::pin(fut)
12662                }
12663                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12664                    #[allow(non_camel_case_types)]
12665                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12666                        pub Arc<T>,
12667                    );
12668                    impl<
12669                        T: OrganizationService,
12670                    > tonic::server::UnaryService<
12671                        super::UpdateSsoAttributeMappingsRequest,
12672                    > for UpdateSsoAttributeMappingsSvc<T> {
12673                        type Response = super::UpdateSsoAttributeMappingsResponse;
12674                        type Future = BoxFuture<
12675                            tonic::Response<Self::Response>,
12676                            tonic::Status,
12677                        >;
12678                        fn call(
12679                            &mut self,
12680                            request: tonic::Request<
12681                                super::UpdateSsoAttributeMappingsRequest,
12682                            >,
12683                        ) -> Self::Future {
12684                            let inner = Arc::clone(&self.0);
12685                            let fut = async move {
12686                                <T as OrganizationService>::update_sso_attribute_mappings(
12687                                        &inner,
12688                                        request,
12689                                    )
12690                                    .await
12691                            };
12692                            Box::pin(fut)
12693                        }
12694                    }
12695                    let accept_compression_encodings = self.accept_compression_encodings;
12696                    let send_compression_encodings = self.send_compression_encodings;
12697                    let max_decoding_message_size = self.max_decoding_message_size;
12698                    let max_encoding_message_size = self.max_encoding_message_size;
12699                    let inner = self.inner.clone();
12700                    let fut = async move {
12701                        let method = UpdateSsoAttributeMappingsSvc(inner);
12702                        let codec = tonic_prost::ProstCodec::default();
12703                        let mut grpc = tonic::server::Grpc::new(codec)
12704                            .apply_compression_config(
12705                                accept_compression_encodings,
12706                                send_compression_encodings,
12707                            )
12708                            .apply_max_message_size_config(
12709                                max_decoding_message_size,
12710                                max_encoding_message_size,
12711                            );
12712                        let res = grpc.unary(method, req).await;
12713                        Ok(res)
12714                    };
12715                    Box::pin(fut)
12716                }
12717                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12718                    #[allow(non_camel_case_types)]
12719                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12720                    impl<
12721                        T: OrganizationService,
12722                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12723                    for RotateAnalyticsSaltSvc<T> {
12724                        type Response = super::RotateAnalyticsSaltResponse;
12725                        type Future = BoxFuture<
12726                            tonic::Response<Self::Response>,
12727                            tonic::Status,
12728                        >;
12729                        fn call(
12730                            &mut self,
12731                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12732                        ) -> Self::Future {
12733                            let inner = Arc::clone(&self.0);
12734                            let fut = async move {
12735                                <T as OrganizationService>::rotate_analytics_salt(
12736                                        &inner,
12737                                        request,
12738                                    )
12739                                    .await
12740                            };
12741                            Box::pin(fut)
12742                        }
12743                    }
12744                    let accept_compression_encodings = self.accept_compression_encodings;
12745                    let send_compression_encodings = self.send_compression_encodings;
12746                    let max_decoding_message_size = self.max_decoding_message_size;
12747                    let max_encoding_message_size = self.max_encoding_message_size;
12748                    let inner = self.inner.clone();
12749                    let fut = async move {
12750                        let method = RotateAnalyticsSaltSvc(inner);
12751                        let codec = tonic_prost::ProstCodec::default();
12752                        let mut grpc = tonic::server::Grpc::new(codec)
12753                            .apply_compression_config(
12754                                accept_compression_encodings,
12755                                send_compression_encodings,
12756                            )
12757                            .apply_max_message_size_config(
12758                                max_decoding_message_size,
12759                                max_encoding_message_size,
12760                            );
12761                        let res = grpc.unary(method, req).await;
12762                        Ok(res)
12763                    };
12764                    Box::pin(fut)
12765                }
12766                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12767                    #[allow(non_camel_case_types)]
12768                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12769                    impl<
12770                        T: OrganizationService,
12771                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12772                    for UpdateAnalyticsEpsilonSvc<T> {
12773                        type Response = super::UpdateAnalyticsEpsilonResponse;
12774                        type Future = BoxFuture<
12775                            tonic::Response<Self::Response>,
12776                            tonic::Status,
12777                        >;
12778                        fn call(
12779                            &mut self,
12780                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12781                        ) -> Self::Future {
12782                            let inner = Arc::clone(&self.0);
12783                            let fut = async move {
12784                                <T as OrganizationService>::update_analytics_epsilon(
12785                                        &inner,
12786                                        request,
12787                                    )
12788                                    .await
12789                            };
12790                            Box::pin(fut)
12791                        }
12792                    }
12793                    let accept_compression_encodings = self.accept_compression_encodings;
12794                    let send_compression_encodings = self.send_compression_encodings;
12795                    let max_decoding_message_size = self.max_decoding_message_size;
12796                    let max_encoding_message_size = self.max_encoding_message_size;
12797                    let inner = self.inner.clone();
12798                    let fut = async move {
12799                        let method = UpdateAnalyticsEpsilonSvc(inner);
12800                        let codec = tonic_prost::ProstCodec::default();
12801                        let mut grpc = tonic::server::Grpc::new(codec)
12802                            .apply_compression_config(
12803                                accept_compression_encodings,
12804                                send_compression_encodings,
12805                            )
12806                            .apply_max_message_size_config(
12807                                max_decoding_message_size,
12808                                max_encoding_message_size,
12809                            );
12810                        let res = grpc.unary(method, req).await;
12811                        Ok(res)
12812                    };
12813                    Box::pin(fut)
12814                }
12815                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
12816                    #[allow(non_camel_case_types)]
12817                    struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
12818                    impl<
12819                        T: OrganizationService,
12820                    > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
12821                    for GetOrgPrivacySettingsSvc<T> {
12822                        type Response = super::GetOrgPrivacySettingsResponse;
12823                        type Future = BoxFuture<
12824                            tonic::Response<Self::Response>,
12825                            tonic::Status,
12826                        >;
12827                        fn call(
12828                            &mut self,
12829                            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12830                        ) -> Self::Future {
12831                            let inner = Arc::clone(&self.0);
12832                            let fut = async move {
12833                                <T as OrganizationService>::get_org_privacy_settings(
12834                                        &inner,
12835                                        request,
12836                                    )
12837                                    .await
12838                            };
12839                            Box::pin(fut)
12840                        }
12841                    }
12842                    let accept_compression_encodings = self.accept_compression_encodings;
12843                    let send_compression_encodings = self.send_compression_encodings;
12844                    let max_decoding_message_size = self.max_decoding_message_size;
12845                    let max_encoding_message_size = self.max_encoding_message_size;
12846                    let inner = self.inner.clone();
12847                    let fut = async move {
12848                        let method = GetOrgPrivacySettingsSvc(inner);
12849                        let codec = tonic_prost::ProstCodec::default();
12850                        let mut grpc = tonic::server::Grpc::new(codec)
12851                            .apply_compression_config(
12852                                accept_compression_encodings,
12853                                send_compression_encodings,
12854                            )
12855                            .apply_max_message_size_config(
12856                                max_decoding_message_size,
12857                                max_encoding_message_size,
12858                            );
12859                        let res = grpc.unary(method, req).await;
12860                        Ok(res)
12861                    };
12862                    Box::pin(fut)
12863                }
12864                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
12865                    #[allow(non_camel_case_types)]
12866                    struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
12867                        pub Arc<T>,
12868                    );
12869                    impl<
12870                        T: OrganizationService,
12871                    > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
12872                    for UpdateOrgPrivacySettingsSvc<T> {
12873                        type Response = super::UpdateOrgPrivacySettingsResponse;
12874                        type Future = BoxFuture<
12875                            tonic::Response<Self::Response>,
12876                            tonic::Status,
12877                        >;
12878                        fn call(
12879                            &mut self,
12880                            request: tonic::Request<
12881                                super::UpdateOrgPrivacySettingsRequest,
12882                            >,
12883                        ) -> Self::Future {
12884                            let inner = Arc::clone(&self.0);
12885                            let fut = async move {
12886                                <T as OrganizationService>::update_org_privacy_settings(
12887                                        &inner,
12888                                        request,
12889                                    )
12890                                    .await
12891                            };
12892                            Box::pin(fut)
12893                        }
12894                    }
12895                    let accept_compression_encodings = self.accept_compression_encodings;
12896                    let send_compression_encodings = self.send_compression_encodings;
12897                    let max_decoding_message_size = self.max_decoding_message_size;
12898                    let max_encoding_message_size = self.max_encoding_message_size;
12899                    let inner = self.inner.clone();
12900                    let fut = async move {
12901                        let method = UpdateOrgPrivacySettingsSvc(inner);
12902                        let codec = tonic_prost::ProstCodec::default();
12903                        let mut grpc = tonic::server::Grpc::new(codec)
12904                            .apply_compression_config(
12905                                accept_compression_encodings,
12906                                send_compression_encodings,
12907                            )
12908                            .apply_max_message_size_config(
12909                                max_decoding_message_size,
12910                                max_encoding_message_size,
12911                            );
12912                        let res = grpc.unary(method, req).await;
12913                        Ok(res)
12914                    };
12915                    Box::pin(fut)
12916                }
12917                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
12918                    #[allow(non_camel_case_types)]
12919                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
12920                        pub Arc<T>,
12921                    );
12922                    impl<
12923                        T: OrganizationService,
12924                    > tonic::server::UnaryService<
12925                        super::CreateSandboxOrganizationRequest,
12926                    > for CreateSandboxOrganizationSvc<T> {
12927                        type Response = super::CreateSandboxOrganizationResponse;
12928                        type Future = BoxFuture<
12929                            tonic::Response<Self::Response>,
12930                            tonic::Status,
12931                        >;
12932                        fn call(
12933                            &mut self,
12934                            request: tonic::Request<
12935                                super::CreateSandboxOrganizationRequest,
12936                            >,
12937                        ) -> Self::Future {
12938                            let inner = Arc::clone(&self.0);
12939                            let fut = async move {
12940                                <T as OrganizationService>::create_sandbox_organization(
12941                                        &inner,
12942                                        request,
12943                                    )
12944                                    .await
12945                            };
12946                            Box::pin(fut)
12947                        }
12948                    }
12949                    let accept_compression_encodings = self.accept_compression_encodings;
12950                    let send_compression_encodings = self.send_compression_encodings;
12951                    let max_decoding_message_size = self.max_decoding_message_size;
12952                    let max_encoding_message_size = self.max_encoding_message_size;
12953                    let inner = self.inner.clone();
12954                    let fut = async move {
12955                        let method = CreateSandboxOrganizationSvc(inner);
12956                        let codec = tonic_prost::ProstCodec::default();
12957                        let mut grpc = tonic::server::Grpc::new(codec)
12958                            .apply_compression_config(
12959                                accept_compression_encodings,
12960                                send_compression_encodings,
12961                            )
12962                            .apply_max_message_size_config(
12963                                max_decoding_message_size,
12964                                max_encoding_message_size,
12965                            );
12966                        let res = grpc.unary(method, req).await;
12967                        Ok(res)
12968                    };
12969                    Box::pin(fut)
12970                }
12971                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
12972                    #[allow(non_camel_case_types)]
12973                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
12974                        pub Arc<T>,
12975                    );
12976                    impl<
12977                        T: OrganizationService,
12978                    > tonic::server::UnaryService<
12979                        super::DeleteSandboxOrganizationRequest,
12980                    > for DeleteSandboxOrganizationSvc<T> {
12981                        type Response = super::DeleteSandboxOrganizationResponse;
12982                        type Future = BoxFuture<
12983                            tonic::Response<Self::Response>,
12984                            tonic::Status,
12985                        >;
12986                        fn call(
12987                            &mut self,
12988                            request: tonic::Request<
12989                                super::DeleteSandboxOrganizationRequest,
12990                            >,
12991                        ) -> Self::Future {
12992                            let inner = Arc::clone(&self.0);
12993                            let fut = async move {
12994                                <T as OrganizationService>::delete_sandbox_organization(
12995                                        &inner,
12996                                        request,
12997                                    )
12998                                    .await
12999                            };
13000                            Box::pin(fut)
13001                        }
13002                    }
13003                    let accept_compression_encodings = self.accept_compression_encodings;
13004                    let send_compression_encodings = self.send_compression_encodings;
13005                    let max_decoding_message_size = self.max_decoding_message_size;
13006                    let max_encoding_message_size = self.max_encoding_message_size;
13007                    let inner = self.inner.clone();
13008                    let fut = async move {
13009                        let method = DeleteSandboxOrganizationSvc(inner);
13010                        let codec = tonic_prost::ProstCodec::default();
13011                        let mut grpc = tonic::server::Grpc::new(codec)
13012                            .apply_compression_config(
13013                                accept_compression_encodings,
13014                                send_compression_encodings,
13015                            )
13016                            .apply_max_message_size_config(
13017                                max_decoding_message_size,
13018                                max_encoding_message_size,
13019                            );
13020                        let res = grpc.unary(method, req).await;
13021                        Ok(res)
13022                    };
13023                    Box::pin(fut)
13024                }
13025                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
13026                    #[allow(non_camel_case_types)]
13027                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
13028                    impl<
13029                        T: OrganizationService,
13030                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
13031                    for ListSandboxFixturesSvc<T> {
13032                        type Response = super::ListSandboxFixturesResponse;
13033                        type Future = BoxFuture<
13034                            tonic::Response<Self::Response>,
13035                            tonic::Status,
13036                        >;
13037                        fn call(
13038                            &mut self,
13039                            request: tonic::Request<super::ListSandboxFixturesRequest>,
13040                        ) -> Self::Future {
13041                            let inner = Arc::clone(&self.0);
13042                            let fut = async move {
13043                                <T as OrganizationService>::list_sandbox_fixtures(
13044                                        &inner,
13045                                        request,
13046                                    )
13047                                    .await
13048                            };
13049                            Box::pin(fut)
13050                        }
13051                    }
13052                    let accept_compression_encodings = self.accept_compression_encodings;
13053                    let send_compression_encodings = self.send_compression_encodings;
13054                    let max_decoding_message_size = self.max_decoding_message_size;
13055                    let max_encoding_message_size = self.max_encoding_message_size;
13056                    let inner = self.inner.clone();
13057                    let fut = async move {
13058                        let method = ListSandboxFixturesSvc(inner);
13059                        let codec = tonic_prost::ProstCodec::default();
13060                        let mut grpc = tonic::server::Grpc::new(codec)
13061                            .apply_compression_config(
13062                                accept_compression_encodings,
13063                                send_compression_encodings,
13064                            )
13065                            .apply_max_message_size_config(
13066                                max_decoding_message_size,
13067                                max_encoding_message_size,
13068                            );
13069                        let res = grpc.unary(method, req).await;
13070                        Ok(res)
13071                    };
13072                    Box::pin(fut)
13073                }
13074                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
13075                    #[allow(non_camel_case_types)]
13076                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
13077                    impl<
13078                        T: OrganizationService,
13079                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
13080                    for ListUserOrganizationsSvc<T> {
13081                        type Response = super::ListUserOrganizationsResponse;
13082                        type Future = BoxFuture<
13083                            tonic::Response<Self::Response>,
13084                            tonic::Status,
13085                        >;
13086                        fn call(
13087                            &mut self,
13088                            request: tonic::Request<super::ListUserOrganizationsRequest>,
13089                        ) -> Self::Future {
13090                            let inner = Arc::clone(&self.0);
13091                            let fut = async move {
13092                                <T as OrganizationService>::list_user_organizations(
13093                                        &inner,
13094                                        request,
13095                                    )
13096                                    .await
13097                            };
13098                            Box::pin(fut)
13099                        }
13100                    }
13101                    let accept_compression_encodings = self.accept_compression_encodings;
13102                    let send_compression_encodings = self.send_compression_encodings;
13103                    let max_decoding_message_size = self.max_decoding_message_size;
13104                    let max_encoding_message_size = self.max_encoding_message_size;
13105                    let inner = self.inner.clone();
13106                    let fut = async move {
13107                        let method = ListUserOrganizationsSvc(inner);
13108                        let codec = tonic_prost::ProstCodec::default();
13109                        let mut grpc = tonic::server::Grpc::new(codec)
13110                            .apply_compression_config(
13111                                accept_compression_encodings,
13112                                send_compression_encodings,
13113                            )
13114                            .apply_max_message_size_config(
13115                                max_decoding_message_size,
13116                                max_encoding_message_size,
13117                            );
13118                        let res = grpc.unary(method, req).await;
13119                        Ok(res)
13120                    };
13121                    Box::pin(fut)
13122                }
13123                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
13124                    #[allow(non_camel_case_types)]
13125                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
13126                    impl<
13127                        T: OrganizationService,
13128                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
13129                    for ListUserSandboxesSvc<T> {
13130                        type Response = super::ListUserSandboxesResponse;
13131                        type Future = BoxFuture<
13132                            tonic::Response<Self::Response>,
13133                            tonic::Status,
13134                        >;
13135                        fn call(
13136                            &mut self,
13137                            request: tonic::Request<super::ListUserSandboxesRequest>,
13138                        ) -> Self::Future {
13139                            let inner = Arc::clone(&self.0);
13140                            let fut = async move {
13141                                <T as OrganizationService>::list_user_sandboxes(
13142                                        &inner,
13143                                        request,
13144                                    )
13145                                    .await
13146                            };
13147                            Box::pin(fut)
13148                        }
13149                    }
13150                    let accept_compression_encodings = self.accept_compression_encodings;
13151                    let send_compression_encodings = self.send_compression_encodings;
13152                    let max_decoding_message_size = self.max_decoding_message_size;
13153                    let max_encoding_message_size = self.max_encoding_message_size;
13154                    let inner = self.inner.clone();
13155                    let fut = async move {
13156                        let method = ListUserSandboxesSvc(inner);
13157                        let codec = tonic_prost::ProstCodec::default();
13158                        let mut grpc = tonic::server::Grpc::new(codec)
13159                            .apply_compression_config(
13160                                accept_compression_encodings,
13161                                send_compression_encodings,
13162                            )
13163                            .apply_max_message_size_config(
13164                                max_decoding_message_size,
13165                                max_encoding_message_size,
13166                            );
13167                        let res = grpc.unary(method, req).await;
13168                        Ok(res)
13169                    };
13170                    Box::pin(fut)
13171                }
13172                _ => {
13173                    Box::pin(async move {
13174                        let mut response = http::Response::new(
13175                            tonic::body::Body::default(),
13176                        );
13177                        let headers = response.headers_mut();
13178                        headers
13179                            .insert(
13180                                tonic::Status::GRPC_STATUS,
13181                                (tonic::Code::Unimplemented as i32).into(),
13182                            );
13183                        headers
13184                            .insert(
13185                                http::header::CONTENT_TYPE,
13186                                tonic::metadata::GRPC_CONTENT_TYPE,
13187                            );
13188                        Ok(response)
13189                    })
13190                }
13191            }
13192        }
13193    }
13194    impl<T> Clone for OrganizationServiceServer<T> {
13195        fn clone(&self) -> Self {
13196            let inner = self.inner.clone();
13197            Self {
13198                inner,
13199                accept_compression_encodings: self.accept_compression_encodings,
13200                send_compression_encodings: self.send_compression_encodings,
13201                max_decoding_message_size: self.max_decoding_message_size,
13202                max_encoding_message_size: self.max_encoding_message_size,
13203            }
13204        }
13205    }
13206    /// Generated gRPC service name
13207    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
13208    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
13209        const NAME: &'static str = SERVICE_NAME;
13210    }
13211}
13212/// Generated client implementations.
13213pub mod render_service_client {
13214    #![allow(
13215        unused_variables,
13216        dead_code,
13217        missing_docs,
13218        clippy::wildcard_imports,
13219        clippy::let_unit_value,
13220    )]
13221    use tonic::codegen::*;
13222    use tonic::codegen::http::Uri;
13223    /** Internal service for batch template rendering.
13224*/
13225    #[derive(Debug, Clone)]
13226    pub struct RenderServiceClient<T> {
13227        inner: tonic::client::Grpc<T>,
13228    }
13229    impl RenderServiceClient<tonic::transport::Channel> {
13230        /// Attempt to create a new client by connecting to a given endpoint.
13231        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13232        where
13233            D: TryInto<tonic::transport::Endpoint>,
13234            D::Error: Into<StdError>,
13235        {
13236            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13237            Ok(Self::new(conn))
13238        }
13239    }
13240    impl<T> RenderServiceClient<T>
13241    where
13242        T: tonic::client::GrpcService<tonic::body::Body>,
13243        T::Error: Into<StdError>,
13244        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13245        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13246    {
13247        pub fn new(inner: T) -> Self {
13248            let inner = tonic::client::Grpc::new(inner);
13249            Self { inner }
13250        }
13251        pub fn with_origin(inner: T, origin: Uri) -> Self {
13252            let inner = tonic::client::Grpc::with_origin(inner, origin);
13253            Self { inner }
13254        }
13255        pub fn with_interceptor<F>(
13256            inner: T,
13257            interceptor: F,
13258        ) -> RenderServiceClient<InterceptedService<T, F>>
13259        where
13260            F: tonic::service::Interceptor,
13261            T::ResponseBody: Default,
13262            T: tonic::codegen::Service<
13263                http::Request<tonic::body::Body>,
13264                Response = http::Response<
13265                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13266                >,
13267            >,
13268            <T as tonic::codegen::Service<
13269                http::Request<tonic::body::Body>,
13270            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13271        {
13272            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
13273        }
13274        /// Compress requests with the given encoding.
13275        ///
13276        /// This requires the server to support it otherwise it might respond with an
13277        /// error.
13278        #[must_use]
13279        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13280            self.inner = self.inner.send_compressed(encoding);
13281            self
13282        }
13283        /// Enable decompressing responses.
13284        #[must_use]
13285        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13286            self.inner = self.inner.accept_compressed(encoding);
13287            self
13288        }
13289        /// Limits the maximum size of a decoded message.
13290        ///
13291        /// Default: `4MB`
13292        #[must_use]
13293        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13294            self.inner = self.inner.max_decoding_message_size(limit);
13295            self
13296        }
13297        /// Limits the maximum size of an encoded message.
13298        ///
13299        /// Default: `usize::MAX`
13300        #[must_use]
13301        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13302            self.inner = self.inner.max_encoding_message_size(limit);
13303            self
13304        }
13305        /** Render a template for multiple users, streaming results as each completes.
13306 Authorization: Internal server-to-server only. Not exposed to external clients.
13307*/
13308        pub async fn render_batch(
13309            &mut self,
13310            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
13311        ) -> std::result::Result<
13312            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
13313            tonic::Status,
13314        > {
13315            self.inner
13316                .ready()
13317                .await
13318                .map_err(|e| {
13319                    tonic::Status::unknown(
13320                        format!("Service was not ready: {}", e.into()),
13321                    )
13322                })?;
13323            let codec = tonic_prost::ProstCodec::default();
13324            let path = http::uri::PathAndQuery::from_static(
13325                "/pidgr.v1.RenderService/RenderBatch",
13326            );
13327            let mut req = request.into_request();
13328            req.extensions_mut()
13329                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
13330            self.inner.server_streaming(req, path, codec).await
13331        }
13332    }
13333}
13334/// Generated server implementations.
13335pub mod render_service_server {
13336    #![allow(
13337        unused_variables,
13338        dead_code,
13339        missing_docs,
13340        clippy::wildcard_imports,
13341        clippy::let_unit_value,
13342    )]
13343    use tonic::codegen::*;
13344    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
13345    #[async_trait]
13346    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
13347        /// Server streaming response type for the RenderBatch method.
13348        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
13349                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
13350            >
13351            + std::marker::Send
13352            + 'static;
13353        /** Render a template for multiple users, streaming results as each completes.
13354 Authorization: Internal server-to-server only. Not exposed to external clients.
13355*/
13356        async fn render_batch(
13357            &self,
13358            request: tonic::Request<super::RenderBatchRequest>,
13359        ) -> std::result::Result<
13360            tonic::Response<Self::RenderBatchStream>,
13361            tonic::Status,
13362        >;
13363    }
13364    /** Internal service for batch template rendering.
13365*/
13366    #[derive(Debug)]
13367    pub struct RenderServiceServer<T> {
13368        inner: Arc<T>,
13369        accept_compression_encodings: EnabledCompressionEncodings,
13370        send_compression_encodings: EnabledCompressionEncodings,
13371        max_decoding_message_size: Option<usize>,
13372        max_encoding_message_size: Option<usize>,
13373    }
13374    impl<T> RenderServiceServer<T> {
13375        pub fn new(inner: T) -> Self {
13376            Self::from_arc(Arc::new(inner))
13377        }
13378        pub fn from_arc(inner: Arc<T>) -> Self {
13379            Self {
13380                inner,
13381                accept_compression_encodings: Default::default(),
13382                send_compression_encodings: Default::default(),
13383                max_decoding_message_size: None,
13384                max_encoding_message_size: None,
13385            }
13386        }
13387        pub fn with_interceptor<F>(
13388            inner: T,
13389            interceptor: F,
13390        ) -> InterceptedService<Self, F>
13391        where
13392            F: tonic::service::Interceptor,
13393        {
13394            InterceptedService::new(Self::new(inner), interceptor)
13395        }
13396        /// Enable decompressing requests with the given encoding.
13397        #[must_use]
13398        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13399            self.accept_compression_encodings.enable(encoding);
13400            self
13401        }
13402        /// Compress responses with the given encoding, if the client supports it.
13403        #[must_use]
13404        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13405            self.send_compression_encodings.enable(encoding);
13406            self
13407        }
13408        /// Limits the maximum size of a decoded message.
13409        ///
13410        /// Default: `4MB`
13411        #[must_use]
13412        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13413            self.max_decoding_message_size = Some(limit);
13414            self
13415        }
13416        /// Limits the maximum size of an encoded message.
13417        ///
13418        /// Default: `usize::MAX`
13419        #[must_use]
13420        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13421            self.max_encoding_message_size = Some(limit);
13422            self
13423        }
13424    }
13425    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
13426    where
13427        T: RenderService,
13428        B: Body + std::marker::Send + 'static,
13429        B::Error: Into<StdError> + std::marker::Send + 'static,
13430    {
13431        type Response = http::Response<tonic::body::Body>;
13432        type Error = std::convert::Infallible;
13433        type Future = BoxFuture<Self::Response, Self::Error>;
13434        fn poll_ready(
13435            &mut self,
13436            _cx: &mut Context<'_>,
13437        ) -> Poll<std::result::Result<(), Self::Error>> {
13438            Poll::Ready(Ok(()))
13439        }
13440        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13441            match req.uri().path() {
13442                "/pidgr.v1.RenderService/RenderBatch" => {
13443                    #[allow(non_camel_case_types)]
13444                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
13445                    impl<
13446                        T: RenderService,
13447                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
13448                    for RenderBatchSvc<T> {
13449                        type Response = super::RenderBatchResponse;
13450                        type ResponseStream = T::RenderBatchStream;
13451                        type Future = BoxFuture<
13452                            tonic::Response<Self::ResponseStream>,
13453                            tonic::Status,
13454                        >;
13455                        fn call(
13456                            &mut self,
13457                            request: tonic::Request<super::RenderBatchRequest>,
13458                        ) -> Self::Future {
13459                            let inner = Arc::clone(&self.0);
13460                            let fut = async move {
13461                                <T as RenderService>::render_batch(&inner, request).await
13462                            };
13463                            Box::pin(fut)
13464                        }
13465                    }
13466                    let accept_compression_encodings = self.accept_compression_encodings;
13467                    let send_compression_encodings = self.send_compression_encodings;
13468                    let max_decoding_message_size = self.max_decoding_message_size;
13469                    let max_encoding_message_size = self.max_encoding_message_size;
13470                    let inner = self.inner.clone();
13471                    let fut = async move {
13472                        let method = RenderBatchSvc(inner);
13473                        let codec = tonic_prost::ProstCodec::default();
13474                        let mut grpc = tonic::server::Grpc::new(codec)
13475                            .apply_compression_config(
13476                                accept_compression_encodings,
13477                                send_compression_encodings,
13478                            )
13479                            .apply_max_message_size_config(
13480                                max_decoding_message_size,
13481                                max_encoding_message_size,
13482                            );
13483                        let res = grpc.server_streaming(method, req).await;
13484                        Ok(res)
13485                    };
13486                    Box::pin(fut)
13487                }
13488                _ => {
13489                    Box::pin(async move {
13490                        let mut response = http::Response::new(
13491                            tonic::body::Body::default(),
13492                        );
13493                        let headers = response.headers_mut();
13494                        headers
13495                            .insert(
13496                                tonic::Status::GRPC_STATUS,
13497                                (tonic::Code::Unimplemented as i32).into(),
13498                            );
13499                        headers
13500                            .insert(
13501                                http::header::CONTENT_TYPE,
13502                                tonic::metadata::GRPC_CONTENT_TYPE,
13503                            );
13504                        Ok(response)
13505                    })
13506                }
13507            }
13508        }
13509    }
13510    impl<T> Clone for RenderServiceServer<T> {
13511        fn clone(&self) -> Self {
13512            let inner = self.inner.clone();
13513            Self {
13514                inner,
13515                accept_compression_encodings: self.accept_compression_encodings,
13516                send_compression_encodings: self.send_compression_encodings,
13517                max_decoding_message_size: self.max_decoding_message_size,
13518                max_encoding_message_size: self.max_encoding_message_size,
13519            }
13520        }
13521    }
13522    /// Generated gRPC service name
13523    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13524    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13525        const NAME: &'static str = SERVICE_NAME;
13526    }
13527}
13528/// Generated client implementations.
13529pub mod replay_service_client {
13530    #![allow(
13531        unused_variables,
13532        dead_code,
13533        missing_docs,
13534        clippy::wildcard_imports,
13535        clippy::let_unit_value,
13536    )]
13537    use tonic::codegen::*;
13538    use tonic::codegen::http::Uri;
13539    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13540 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13541*/
13542    #[derive(Debug, Clone)]
13543    pub struct ReplayServiceClient<T> {
13544        inner: tonic::client::Grpc<T>,
13545    }
13546    impl ReplayServiceClient<tonic::transport::Channel> {
13547        /// Attempt to create a new client by connecting to a given endpoint.
13548        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13549        where
13550            D: TryInto<tonic::transport::Endpoint>,
13551            D::Error: Into<StdError>,
13552        {
13553            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13554            Ok(Self::new(conn))
13555        }
13556    }
13557    impl<T> ReplayServiceClient<T>
13558    where
13559        T: tonic::client::GrpcService<tonic::body::Body>,
13560        T::Error: Into<StdError>,
13561        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13562        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13563    {
13564        pub fn new(inner: T) -> Self {
13565            let inner = tonic::client::Grpc::new(inner);
13566            Self { inner }
13567        }
13568        pub fn with_origin(inner: T, origin: Uri) -> Self {
13569            let inner = tonic::client::Grpc::with_origin(inner, origin);
13570            Self { inner }
13571        }
13572        pub fn with_interceptor<F>(
13573            inner: T,
13574            interceptor: F,
13575        ) -> ReplayServiceClient<InterceptedService<T, F>>
13576        where
13577            F: tonic::service::Interceptor,
13578            T::ResponseBody: Default,
13579            T: tonic::codegen::Service<
13580                http::Request<tonic::body::Body>,
13581                Response = http::Response<
13582                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13583                >,
13584            >,
13585            <T as tonic::codegen::Service<
13586                http::Request<tonic::body::Body>,
13587            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13588        {
13589            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13590        }
13591        /// Compress requests with the given encoding.
13592        ///
13593        /// This requires the server to support it otherwise it might respond with an
13594        /// error.
13595        #[must_use]
13596        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13597            self.inner = self.inner.send_compressed(encoding);
13598            self
13599        }
13600        /// Enable decompressing responses.
13601        #[must_use]
13602        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13603            self.inner = self.inner.accept_compressed(encoding);
13604            self
13605        }
13606        /// Limits the maximum size of a decoded message.
13607        ///
13608        /// Default: `4MB`
13609        #[must_use]
13610        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13611            self.inner = self.inner.max_decoding_message_size(limit);
13612            self
13613        }
13614        /// Limits the maximum size of an encoded message.
13615        ///
13616        /// Default: `usize::MAX`
13617        #[must_use]
13618        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13619            self.inner = self.inner.max_encoding_message_size(limit);
13620            self
13621        }
13622        /** List recent session recordings with optional campaign and time range filters.
13623 Authorization: Requires CAMPAIGNS_READ permission.
13624*/
13625        pub async fn list_session_recordings(
13626            &mut self,
13627            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13628        ) -> std::result::Result<
13629            tonic::Response<super::ListSessionRecordingsResponse>,
13630            tonic::Status,
13631        > {
13632            self.inner
13633                .ready()
13634                .await
13635                .map_err(|e| {
13636                    tonic::Status::unknown(
13637                        format!("Service was not ready: {}", e.into()),
13638                    )
13639                })?;
13640            let codec = tonic_prost::ProstCodec::default();
13641            let path = http::uri::PathAndQuery::from_static(
13642                "/pidgr.v1.ReplayService/ListSessionRecordings",
13643            );
13644            let mut req = request.into_request();
13645            req.extensions_mut()
13646                .insert(
13647                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13648                );
13649            self.inner.unary(req, path, codec).await
13650        }
13651        /** Fetch the full rrweb snapshot data for a single recording.
13652 Authorization: Requires CAMPAIGNS_READ permission.
13653*/
13654        pub async fn get_session_snapshots(
13655            &mut self,
13656            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13657        ) -> std::result::Result<
13658            tonic::Response<super::GetSessionSnapshotsResponse>,
13659            tonic::Status,
13660        > {
13661            self.inner
13662                .ready()
13663                .await
13664                .map_err(|e| {
13665                    tonic::Status::unknown(
13666                        format!("Service was not ready: {}", e.into()),
13667                    )
13668                })?;
13669            let codec = tonic_prost::ProstCodec::default();
13670            let path = http::uri::PathAndQuery::from_static(
13671                "/pidgr.v1.ReplayService/GetSessionSnapshots",
13672            );
13673            let mut req = request.into_request();
13674            req.extensions_mut()
13675                .insert(
13676                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13677                );
13678            self.inner.unary(req, path, codec).await
13679        }
13680    }
13681}
13682/// Generated server implementations.
13683pub mod replay_service_server {
13684    #![allow(
13685        unused_variables,
13686        dead_code,
13687        missing_docs,
13688        clippy::wildcard_imports,
13689        clippy::let_unit_value,
13690    )]
13691    use tonic::codegen::*;
13692    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
13693    #[async_trait]
13694    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13695        /** List recent session recordings with optional campaign and time range filters.
13696 Authorization: Requires CAMPAIGNS_READ permission.
13697*/
13698        async fn list_session_recordings(
13699            &self,
13700            request: tonic::Request<super::ListSessionRecordingsRequest>,
13701        ) -> std::result::Result<
13702            tonic::Response<super::ListSessionRecordingsResponse>,
13703            tonic::Status,
13704        >;
13705        /** Fetch the full rrweb snapshot data for a single recording.
13706 Authorization: Requires CAMPAIGNS_READ permission.
13707*/
13708        async fn get_session_snapshots(
13709            &self,
13710            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13711        ) -> std::result::Result<
13712            tonic::Response<super::GetSessionSnapshotsResponse>,
13713            tonic::Status,
13714        >;
13715    }
13716    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13717 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13718*/
13719    #[derive(Debug)]
13720    pub struct ReplayServiceServer<T> {
13721        inner: Arc<T>,
13722        accept_compression_encodings: EnabledCompressionEncodings,
13723        send_compression_encodings: EnabledCompressionEncodings,
13724        max_decoding_message_size: Option<usize>,
13725        max_encoding_message_size: Option<usize>,
13726    }
13727    impl<T> ReplayServiceServer<T> {
13728        pub fn new(inner: T) -> Self {
13729            Self::from_arc(Arc::new(inner))
13730        }
13731        pub fn from_arc(inner: Arc<T>) -> Self {
13732            Self {
13733                inner,
13734                accept_compression_encodings: Default::default(),
13735                send_compression_encodings: Default::default(),
13736                max_decoding_message_size: None,
13737                max_encoding_message_size: None,
13738            }
13739        }
13740        pub fn with_interceptor<F>(
13741            inner: T,
13742            interceptor: F,
13743        ) -> InterceptedService<Self, F>
13744        where
13745            F: tonic::service::Interceptor,
13746        {
13747            InterceptedService::new(Self::new(inner), interceptor)
13748        }
13749        /// Enable decompressing requests with the given encoding.
13750        #[must_use]
13751        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13752            self.accept_compression_encodings.enable(encoding);
13753            self
13754        }
13755        /// Compress responses with the given encoding, if the client supports it.
13756        #[must_use]
13757        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13758            self.send_compression_encodings.enable(encoding);
13759            self
13760        }
13761        /// Limits the maximum size of a decoded message.
13762        ///
13763        /// Default: `4MB`
13764        #[must_use]
13765        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13766            self.max_decoding_message_size = Some(limit);
13767            self
13768        }
13769        /// Limits the maximum size of an encoded message.
13770        ///
13771        /// Default: `usize::MAX`
13772        #[must_use]
13773        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13774            self.max_encoding_message_size = Some(limit);
13775            self
13776        }
13777    }
13778    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13779    where
13780        T: ReplayService,
13781        B: Body + std::marker::Send + 'static,
13782        B::Error: Into<StdError> + std::marker::Send + 'static,
13783    {
13784        type Response = http::Response<tonic::body::Body>;
13785        type Error = std::convert::Infallible;
13786        type Future = BoxFuture<Self::Response, Self::Error>;
13787        fn poll_ready(
13788            &mut self,
13789            _cx: &mut Context<'_>,
13790        ) -> Poll<std::result::Result<(), Self::Error>> {
13791            Poll::Ready(Ok(()))
13792        }
13793        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13794            match req.uri().path() {
13795                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13796                    #[allow(non_camel_case_types)]
13797                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13798                    impl<
13799                        T: ReplayService,
13800                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13801                    for ListSessionRecordingsSvc<T> {
13802                        type Response = super::ListSessionRecordingsResponse;
13803                        type Future = BoxFuture<
13804                            tonic::Response<Self::Response>,
13805                            tonic::Status,
13806                        >;
13807                        fn call(
13808                            &mut self,
13809                            request: tonic::Request<super::ListSessionRecordingsRequest>,
13810                        ) -> Self::Future {
13811                            let inner = Arc::clone(&self.0);
13812                            let fut = async move {
13813                                <T as ReplayService>::list_session_recordings(
13814                                        &inner,
13815                                        request,
13816                                    )
13817                                    .await
13818                            };
13819                            Box::pin(fut)
13820                        }
13821                    }
13822                    let accept_compression_encodings = self.accept_compression_encodings;
13823                    let send_compression_encodings = self.send_compression_encodings;
13824                    let max_decoding_message_size = self.max_decoding_message_size;
13825                    let max_encoding_message_size = self.max_encoding_message_size;
13826                    let inner = self.inner.clone();
13827                    let fut = async move {
13828                        let method = ListSessionRecordingsSvc(inner);
13829                        let codec = tonic_prost::ProstCodec::default();
13830                        let mut grpc = tonic::server::Grpc::new(codec)
13831                            .apply_compression_config(
13832                                accept_compression_encodings,
13833                                send_compression_encodings,
13834                            )
13835                            .apply_max_message_size_config(
13836                                max_decoding_message_size,
13837                                max_encoding_message_size,
13838                            );
13839                        let res = grpc.unary(method, req).await;
13840                        Ok(res)
13841                    };
13842                    Box::pin(fut)
13843                }
13844                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13845                    #[allow(non_camel_case_types)]
13846                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13847                    impl<
13848                        T: ReplayService,
13849                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13850                    for GetSessionSnapshotsSvc<T> {
13851                        type Response = super::GetSessionSnapshotsResponse;
13852                        type Future = BoxFuture<
13853                            tonic::Response<Self::Response>,
13854                            tonic::Status,
13855                        >;
13856                        fn call(
13857                            &mut self,
13858                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13859                        ) -> Self::Future {
13860                            let inner = Arc::clone(&self.0);
13861                            let fut = async move {
13862                                <T as ReplayService>::get_session_snapshots(&inner, request)
13863                                    .await
13864                            };
13865                            Box::pin(fut)
13866                        }
13867                    }
13868                    let accept_compression_encodings = self.accept_compression_encodings;
13869                    let send_compression_encodings = self.send_compression_encodings;
13870                    let max_decoding_message_size = self.max_decoding_message_size;
13871                    let max_encoding_message_size = self.max_encoding_message_size;
13872                    let inner = self.inner.clone();
13873                    let fut = async move {
13874                        let method = GetSessionSnapshotsSvc(inner);
13875                        let codec = tonic_prost::ProstCodec::default();
13876                        let mut grpc = tonic::server::Grpc::new(codec)
13877                            .apply_compression_config(
13878                                accept_compression_encodings,
13879                                send_compression_encodings,
13880                            )
13881                            .apply_max_message_size_config(
13882                                max_decoding_message_size,
13883                                max_encoding_message_size,
13884                            );
13885                        let res = grpc.unary(method, req).await;
13886                        Ok(res)
13887                    };
13888                    Box::pin(fut)
13889                }
13890                _ => {
13891                    Box::pin(async move {
13892                        let mut response = http::Response::new(
13893                            tonic::body::Body::default(),
13894                        );
13895                        let headers = response.headers_mut();
13896                        headers
13897                            .insert(
13898                                tonic::Status::GRPC_STATUS,
13899                                (tonic::Code::Unimplemented as i32).into(),
13900                            );
13901                        headers
13902                            .insert(
13903                                http::header::CONTENT_TYPE,
13904                                tonic::metadata::GRPC_CONTENT_TYPE,
13905                            );
13906                        Ok(response)
13907                    })
13908                }
13909            }
13910        }
13911    }
13912    impl<T> Clone for ReplayServiceServer<T> {
13913        fn clone(&self) -> Self {
13914            let inner = self.inner.clone();
13915            Self {
13916                inner,
13917                accept_compression_encodings: self.accept_compression_encodings,
13918                send_compression_encodings: self.send_compression_encodings,
13919                max_decoding_message_size: self.max_decoding_message_size,
13920                max_encoding_message_size: self.max_encoding_message_size,
13921            }
13922        }
13923    }
13924    /// Generated gRPC service name
13925    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
13926    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
13927        const NAME: &'static str = SERVICE_NAME;
13928    }
13929}
13930/// Generated client implementations.
13931pub mod role_service_client {
13932    #![allow(
13933        unused_variables,
13934        dead_code,
13935        missing_docs,
13936        clippy::wildcard_imports,
13937        clippy::let_unit_value,
13938    )]
13939    use tonic::codegen::*;
13940    use tonic::codegen::http::Uri;
13941    /** Manages roles and their permissions within an organization.
13942 All RPCs operate within the caller's org (extracted from JWT).
13943*/
13944    #[derive(Debug, Clone)]
13945    pub struct RoleServiceClient<T> {
13946        inner: tonic::client::Grpc<T>,
13947    }
13948    impl RoleServiceClient<tonic::transport::Channel> {
13949        /// Attempt to create a new client by connecting to a given endpoint.
13950        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13951        where
13952            D: TryInto<tonic::transport::Endpoint>,
13953            D::Error: Into<StdError>,
13954        {
13955            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13956            Ok(Self::new(conn))
13957        }
13958    }
13959    impl<T> RoleServiceClient<T>
13960    where
13961        T: tonic::client::GrpcService<tonic::body::Body>,
13962        T::Error: Into<StdError>,
13963        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13964        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13965    {
13966        pub fn new(inner: T) -> Self {
13967            let inner = tonic::client::Grpc::new(inner);
13968            Self { inner }
13969        }
13970        pub fn with_origin(inner: T, origin: Uri) -> Self {
13971            let inner = tonic::client::Grpc::with_origin(inner, origin);
13972            Self { inner }
13973        }
13974        pub fn with_interceptor<F>(
13975            inner: T,
13976            interceptor: F,
13977        ) -> RoleServiceClient<InterceptedService<T, F>>
13978        where
13979            F: tonic::service::Interceptor,
13980            T::ResponseBody: Default,
13981            T: tonic::codegen::Service<
13982                http::Request<tonic::body::Body>,
13983                Response = http::Response<
13984                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13985                >,
13986            >,
13987            <T as tonic::codegen::Service<
13988                http::Request<tonic::body::Body>,
13989            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13990        {
13991            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
13992        }
13993        /// Compress requests with the given encoding.
13994        ///
13995        /// This requires the server to support it otherwise it might respond with an
13996        /// error.
13997        #[must_use]
13998        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13999            self.inner = self.inner.send_compressed(encoding);
14000            self
14001        }
14002        /// Enable decompressing responses.
14003        #[must_use]
14004        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14005            self.inner = self.inner.accept_compressed(encoding);
14006            self
14007        }
14008        /// Limits the maximum size of a decoded message.
14009        ///
14010        /// Default: `4MB`
14011        #[must_use]
14012        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14013            self.inner = self.inner.max_decoding_message_size(limit);
14014            self
14015        }
14016        /// Limits the maximum size of an encoded message.
14017        ///
14018        /// Default: `usize::MAX`
14019        #[must_use]
14020        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14021            self.inner = self.inner.max_encoding_message_size(limit);
14022            self
14023        }
14024        /** List all roles in the organization with their permission sets.
14025 Authorization: Requires PERMISSION_ORG_READ.
14026*/
14027        pub async fn list_roles(
14028            &mut self,
14029            request: impl tonic::IntoRequest<super::ListRolesRequest>,
14030        ) -> std::result::Result<
14031            tonic::Response<super::ListRolesResponse>,
14032            tonic::Status,
14033        > {
14034            self.inner
14035                .ready()
14036                .await
14037                .map_err(|e| {
14038                    tonic::Status::unknown(
14039                        format!("Service was not ready: {}", e.into()),
14040                    )
14041                })?;
14042            let codec = tonic_prost::ProstCodec::default();
14043            let path = http::uri::PathAndQuery::from_static(
14044                "/pidgr.v1.RoleService/ListRoles",
14045            );
14046            let mut req = request.into_request();
14047            req.extensions_mut()
14048                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
14049            self.inner.unary(req, path, codec).await
14050        }
14051        /** Create a new custom role with a name and initial permissions.
14052 Slug is auto-generated from the name and immutable after creation.
14053 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14054*/
14055        pub async fn create_role(
14056            &mut self,
14057            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
14058        ) -> std::result::Result<
14059            tonic::Response<super::CreateRoleResponse>,
14060            tonic::Status,
14061        > {
14062            self.inner
14063                .ready()
14064                .await
14065                .map_err(|e| {
14066                    tonic::Status::unknown(
14067                        format!("Service was not ready: {}", e.into()),
14068                    )
14069                })?;
14070            let codec = tonic_prost::ProstCodec::default();
14071            let path = http::uri::PathAndQuery::from_static(
14072                "/pidgr.v1.RoleService/CreateRole",
14073            );
14074            let mut req = request.into_request();
14075            req.extensions_mut()
14076                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
14077            self.inner.unary(req, path, codec).await
14078        }
14079        /** Update a role's name and/or permissions.
14080 System roles (is_system=true) cannot be updated.
14081 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14082*/
14083        pub async fn update_role(
14084            &mut self,
14085            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
14086        ) -> std::result::Result<
14087            tonic::Response<super::UpdateRoleResponse>,
14088            tonic::Status,
14089        > {
14090            self.inner
14091                .ready()
14092                .await
14093                .map_err(|e| {
14094                    tonic::Status::unknown(
14095                        format!("Service was not ready: {}", e.into()),
14096                    )
14097                })?;
14098            let codec = tonic_prost::ProstCodec::default();
14099            let path = http::uri::PathAndQuery::from_static(
14100                "/pidgr.v1.RoleService/UpdateRole",
14101            );
14102            let mut req = request.into_request();
14103            req.extensions_mut()
14104                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
14105            self.inner.unary(req, path, codec).await
14106        }
14107        /** Delete a role. Fails if any users are assigned to it.
14108 System roles (is_system=true) cannot be deleted.
14109 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14110*/
14111        pub async fn delete_role(
14112            &mut self,
14113            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
14114        ) -> std::result::Result<
14115            tonic::Response<super::DeleteRoleResponse>,
14116            tonic::Status,
14117        > {
14118            self.inner
14119                .ready()
14120                .await
14121                .map_err(|e| {
14122                    tonic::Status::unknown(
14123                        format!("Service was not ready: {}", e.into()),
14124                    )
14125                })?;
14126            let codec = tonic_prost::ProstCodec::default();
14127            let path = http::uri::PathAndQuery::from_static(
14128                "/pidgr.v1.RoleService/DeleteRole",
14129            );
14130            let mut req = request.into_request();
14131            req.extensions_mut()
14132                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
14133            self.inner.unary(req, path, codec).await
14134        }
14135    }
14136}
14137/// Generated server implementations.
14138pub mod role_service_server {
14139    #![allow(
14140        unused_variables,
14141        dead_code,
14142        missing_docs,
14143        clippy::wildcard_imports,
14144        clippy::let_unit_value,
14145    )]
14146    use tonic::codegen::*;
14147    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
14148    #[async_trait]
14149    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
14150        /** List all roles in the organization with their permission sets.
14151 Authorization: Requires PERMISSION_ORG_READ.
14152*/
14153        async fn list_roles(
14154            &self,
14155            request: tonic::Request<super::ListRolesRequest>,
14156        ) -> std::result::Result<
14157            tonic::Response<super::ListRolesResponse>,
14158            tonic::Status,
14159        >;
14160        /** Create a new custom role with a name and initial permissions.
14161 Slug is auto-generated from the name and immutable after creation.
14162 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14163*/
14164        async fn create_role(
14165            &self,
14166            request: tonic::Request<super::CreateRoleRequest>,
14167        ) -> std::result::Result<
14168            tonic::Response<super::CreateRoleResponse>,
14169            tonic::Status,
14170        >;
14171        /** Update a role's name and/or permissions.
14172 System roles (is_system=true) cannot be updated.
14173 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14174*/
14175        async fn update_role(
14176            &self,
14177            request: tonic::Request<super::UpdateRoleRequest>,
14178        ) -> std::result::Result<
14179            tonic::Response<super::UpdateRoleResponse>,
14180            tonic::Status,
14181        >;
14182        /** Delete a role. Fails if any users are assigned to it.
14183 System roles (is_system=true) cannot be deleted.
14184 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
14185*/
14186        async fn delete_role(
14187            &self,
14188            request: tonic::Request<super::DeleteRoleRequest>,
14189        ) -> std::result::Result<
14190            tonic::Response<super::DeleteRoleResponse>,
14191            tonic::Status,
14192        >;
14193    }
14194    /** Manages roles and their permissions within an organization.
14195 All RPCs operate within the caller's org (extracted from JWT).
14196*/
14197    #[derive(Debug)]
14198    pub struct RoleServiceServer<T> {
14199        inner: Arc<T>,
14200        accept_compression_encodings: EnabledCompressionEncodings,
14201        send_compression_encodings: EnabledCompressionEncodings,
14202        max_decoding_message_size: Option<usize>,
14203        max_encoding_message_size: Option<usize>,
14204    }
14205    impl<T> RoleServiceServer<T> {
14206        pub fn new(inner: T) -> Self {
14207            Self::from_arc(Arc::new(inner))
14208        }
14209        pub fn from_arc(inner: Arc<T>) -> Self {
14210            Self {
14211                inner,
14212                accept_compression_encodings: Default::default(),
14213                send_compression_encodings: Default::default(),
14214                max_decoding_message_size: None,
14215                max_encoding_message_size: None,
14216            }
14217        }
14218        pub fn with_interceptor<F>(
14219            inner: T,
14220            interceptor: F,
14221        ) -> InterceptedService<Self, F>
14222        where
14223            F: tonic::service::Interceptor,
14224        {
14225            InterceptedService::new(Self::new(inner), interceptor)
14226        }
14227        /// Enable decompressing requests with the given encoding.
14228        #[must_use]
14229        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14230            self.accept_compression_encodings.enable(encoding);
14231            self
14232        }
14233        /// Compress responses with the given encoding, if the client supports it.
14234        #[must_use]
14235        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14236            self.send_compression_encodings.enable(encoding);
14237            self
14238        }
14239        /// Limits the maximum size of a decoded message.
14240        ///
14241        /// Default: `4MB`
14242        #[must_use]
14243        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14244            self.max_decoding_message_size = Some(limit);
14245            self
14246        }
14247        /// Limits the maximum size of an encoded message.
14248        ///
14249        /// Default: `usize::MAX`
14250        #[must_use]
14251        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14252            self.max_encoding_message_size = Some(limit);
14253            self
14254        }
14255    }
14256    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
14257    where
14258        T: RoleService,
14259        B: Body + std::marker::Send + 'static,
14260        B::Error: Into<StdError> + std::marker::Send + 'static,
14261    {
14262        type Response = http::Response<tonic::body::Body>;
14263        type Error = std::convert::Infallible;
14264        type Future = BoxFuture<Self::Response, Self::Error>;
14265        fn poll_ready(
14266            &mut self,
14267            _cx: &mut Context<'_>,
14268        ) -> Poll<std::result::Result<(), Self::Error>> {
14269            Poll::Ready(Ok(()))
14270        }
14271        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14272            match req.uri().path() {
14273                "/pidgr.v1.RoleService/ListRoles" => {
14274                    #[allow(non_camel_case_types)]
14275                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
14276                    impl<
14277                        T: RoleService,
14278                    > tonic::server::UnaryService<super::ListRolesRequest>
14279                    for ListRolesSvc<T> {
14280                        type Response = super::ListRolesResponse;
14281                        type Future = BoxFuture<
14282                            tonic::Response<Self::Response>,
14283                            tonic::Status,
14284                        >;
14285                        fn call(
14286                            &mut self,
14287                            request: tonic::Request<super::ListRolesRequest>,
14288                        ) -> Self::Future {
14289                            let inner = Arc::clone(&self.0);
14290                            let fut = async move {
14291                                <T as RoleService>::list_roles(&inner, request).await
14292                            };
14293                            Box::pin(fut)
14294                        }
14295                    }
14296                    let accept_compression_encodings = self.accept_compression_encodings;
14297                    let send_compression_encodings = self.send_compression_encodings;
14298                    let max_decoding_message_size = self.max_decoding_message_size;
14299                    let max_encoding_message_size = self.max_encoding_message_size;
14300                    let inner = self.inner.clone();
14301                    let fut = async move {
14302                        let method = ListRolesSvc(inner);
14303                        let codec = tonic_prost::ProstCodec::default();
14304                        let mut grpc = tonic::server::Grpc::new(codec)
14305                            .apply_compression_config(
14306                                accept_compression_encodings,
14307                                send_compression_encodings,
14308                            )
14309                            .apply_max_message_size_config(
14310                                max_decoding_message_size,
14311                                max_encoding_message_size,
14312                            );
14313                        let res = grpc.unary(method, req).await;
14314                        Ok(res)
14315                    };
14316                    Box::pin(fut)
14317                }
14318                "/pidgr.v1.RoleService/CreateRole" => {
14319                    #[allow(non_camel_case_types)]
14320                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
14321                    impl<
14322                        T: RoleService,
14323                    > tonic::server::UnaryService<super::CreateRoleRequest>
14324                    for CreateRoleSvc<T> {
14325                        type Response = super::CreateRoleResponse;
14326                        type Future = BoxFuture<
14327                            tonic::Response<Self::Response>,
14328                            tonic::Status,
14329                        >;
14330                        fn call(
14331                            &mut self,
14332                            request: tonic::Request<super::CreateRoleRequest>,
14333                        ) -> Self::Future {
14334                            let inner = Arc::clone(&self.0);
14335                            let fut = async move {
14336                                <T as RoleService>::create_role(&inner, request).await
14337                            };
14338                            Box::pin(fut)
14339                        }
14340                    }
14341                    let accept_compression_encodings = self.accept_compression_encodings;
14342                    let send_compression_encodings = self.send_compression_encodings;
14343                    let max_decoding_message_size = self.max_decoding_message_size;
14344                    let max_encoding_message_size = self.max_encoding_message_size;
14345                    let inner = self.inner.clone();
14346                    let fut = async move {
14347                        let method = CreateRoleSvc(inner);
14348                        let codec = tonic_prost::ProstCodec::default();
14349                        let mut grpc = tonic::server::Grpc::new(codec)
14350                            .apply_compression_config(
14351                                accept_compression_encodings,
14352                                send_compression_encodings,
14353                            )
14354                            .apply_max_message_size_config(
14355                                max_decoding_message_size,
14356                                max_encoding_message_size,
14357                            );
14358                        let res = grpc.unary(method, req).await;
14359                        Ok(res)
14360                    };
14361                    Box::pin(fut)
14362                }
14363                "/pidgr.v1.RoleService/UpdateRole" => {
14364                    #[allow(non_camel_case_types)]
14365                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
14366                    impl<
14367                        T: RoleService,
14368                    > tonic::server::UnaryService<super::UpdateRoleRequest>
14369                    for UpdateRoleSvc<T> {
14370                        type Response = super::UpdateRoleResponse;
14371                        type Future = BoxFuture<
14372                            tonic::Response<Self::Response>,
14373                            tonic::Status,
14374                        >;
14375                        fn call(
14376                            &mut self,
14377                            request: tonic::Request<super::UpdateRoleRequest>,
14378                        ) -> Self::Future {
14379                            let inner = Arc::clone(&self.0);
14380                            let fut = async move {
14381                                <T as RoleService>::update_role(&inner, request).await
14382                            };
14383                            Box::pin(fut)
14384                        }
14385                    }
14386                    let accept_compression_encodings = self.accept_compression_encodings;
14387                    let send_compression_encodings = self.send_compression_encodings;
14388                    let max_decoding_message_size = self.max_decoding_message_size;
14389                    let max_encoding_message_size = self.max_encoding_message_size;
14390                    let inner = self.inner.clone();
14391                    let fut = async move {
14392                        let method = UpdateRoleSvc(inner);
14393                        let codec = tonic_prost::ProstCodec::default();
14394                        let mut grpc = tonic::server::Grpc::new(codec)
14395                            .apply_compression_config(
14396                                accept_compression_encodings,
14397                                send_compression_encodings,
14398                            )
14399                            .apply_max_message_size_config(
14400                                max_decoding_message_size,
14401                                max_encoding_message_size,
14402                            );
14403                        let res = grpc.unary(method, req).await;
14404                        Ok(res)
14405                    };
14406                    Box::pin(fut)
14407                }
14408                "/pidgr.v1.RoleService/DeleteRole" => {
14409                    #[allow(non_camel_case_types)]
14410                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
14411                    impl<
14412                        T: RoleService,
14413                    > tonic::server::UnaryService<super::DeleteRoleRequest>
14414                    for DeleteRoleSvc<T> {
14415                        type Response = super::DeleteRoleResponse;
14416                        type Future = BoxFuture<
14417                            tonic::Response<Self::Response>,
14418                            tonic::Status,
14419                        >;
14420                        fn call(
14421                            &mut self,
14422                            request: tonic::Request<super::DeleteRoleRequest>,
14423                        ) -> Self::Future {
14424                            let inner = Arc::clone(&self.0);
14425                            let fut = async move {
14426                                <T as RoleService>::delete_role(&inner, request).await
14427                            };
14428                            Box::pin(fut)
14429                        }
14430                    }
14431                    let accept_compression_encodings = self.accept_compression_encodings;
14432                    let send_compression_encodings = self.send_compression_encodings;
14433                    let max_decoding_message_size = self.max_decoding_message_size;
14434                    let max_encoding_message_size = self.max_encoding_message_size;
14435                    let inner = self.inner.clone();
14436                    let fut = async move {
14437                        let method = DeleteRoleSvc(inner);
14438                        let codec = tonic_prost::ProstCodec::default();
14439                        let mut grpc = tonic::server::Grpc::new(codec)
14440                            .apply_compression_config(
14441                                accept_compression_encodings,
14442                                send_compression_encodings,
14443                            )
14444                            .apply_max_message_size_config(
14445                                max_decoding_message_size,
14446                                max_encoding_message_size,
14447                            );
14448                        let res = grpc.unary(method, req).await;
14449                        Ok(res)
14450                    };
14451                    Box::pin(fut)
14452                }
14453                _ => {
14454                    Box::pin(async move {
14455                        let mut response = http::Response::new(
14456                            tonic::body::Body::default(),
14457                        );
14458                        let headers = response.headers_mut();
14459                        headers
14460                            .insert(
14461                                tonic::Status::GRPC_STATUS,
14462                                (tonic::Code::Unimplemented as i32).into(),
14463                            );
14464                        headers
14465                            .insert(
14466                                http::header::CONTENT_TYPE,
14467                                tonic::metadata::GRPC_CONTENT_TYPE,
14468                            );
14469                        Ok(response)
14470                    })
14471                }
14472            }
14473        }
14474    }
14475    impl<T> Clone for RoleServiceServer<T> {
14476        fn clone(&self) -> Self {
14477            let inner = self.inner.clone();
14478            Self {
14479                inner,
14480                accept_compression_encodings: self.accept_compression_encodings,
14481                send_compression_encodings: self.send_compression_encodings,
14482                max_decoding_message_size: self.max_decoding_message_size,
14483                max_encoding_message_size: self.max_encoding_message_size,
14484            }
14485        }
14486    }
14487    /// Generated gRPC service name
14488    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
14489    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
14490        const NAME: &'static str = SERVICE_NAME;
14491    }
14492}
14493/// Generated client implementations.
14494pub mod sso_service_client {
14495    #![allow(
14496        unused_variables,
14497        dead_code,
14498        missing_docs,
14499        clippy::wildcard_imports,
14500        clippy::let_unit_value,
14501    )]
14502    use tonic::codegen::*;
14503    use tonic::codegen::http::Uri;
14504    /** Manages SSO identity provider configuration for organizations.
14505*/
14506    #[derive(Debug, Clone)]
14507    pub struct SsoServiceClient<T> {
14508        inner: tonic::client::Grpc<T>,
14509    }
14510    impl SsoServiceClient<tonic::transport::Channel> {
14511        /// Attempt to create a new client by connecting to a given endpoint.
14512        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14513        where
14514            D: TryInto<tonic::transport::Endpoint>,
14515            D::Error: Into<StdError>,
14516        {
14517            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14518            Ok(Self::new(conn))
14519        }
14520    }
14521    impl<T> SsoServiceClient<T>
14522    where
14523        T: tonic::client::GrpcService<tonic::body::Body>,
14524        T::Error: Into<StdError>,
14525        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14526        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14527    {
14528        pub fn new(inner: T) -> Self {
14529            let inner = tonic::client::Grpc::new(inner);
14530            Self { inner }
14531        }
14532        pub fn with_origin(inner: T, origin: Uri) -> Self {
14533            let inner = tonic::client::Grpc::with_origin(inner, origin);
14534            Self { inner }
14535        }
14536        pub fn with_interceptor<F>(
14537            inner: T,
14538            interceptor: F,
14539        ) -> SsoServiceClient<InterceptedService<T, F>>
14540        where
14541            F: tonic::service::Interceptor,
14542            T::ResponseBody: Default,
14543            T: tonic::codegen::Service<
14544                http::Request<tonic::body::Body>,
14545                Response = http::Response<
14546                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14547                >,
14548            >,
14549            <T as tonic::codegen::Service<
14550                http::Request<tonic::body::Body>,
14551            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14552        {
14553            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14554        }
14555        /// Compress requests with the given encoding.
14556        ///
14557        /// This requires the server to support it otherwise it might respond with an
14558        /// error.
14559        #[must_use]
14560        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14561            self.inner = self.inner.send_compressed(encoding);
14562            self
14563        }
14564        /// Enable decompressing responses.
14565        #[must_use]
14566        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14567            self.inner = self.inner.accept_compressed(encoding);
14568            self
14569        }
14570        /// Limits the maximum size of a decoded message.
14571        ///
14572        /// Default: `4MB`
14573        #[must_use]
14574        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14575            self.inner = self.inner.max_decoding_message_size(limit);
14576            self
14577        }
14578        /// Limits the maximum size of an encoded message.
14579        ///
14580        /// Default: `usize::MAX`
14581        #[must_use]
14582        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14583            self.inner = self.inner.max_encoding_message_size(limit);
14584            self
14585        }
14586        /** Check if an email domain has SSO configured.
14587 This is a pre-authentication endpoint — no JWT required.
14588 Authorization: None (public).
14589*/
14590        pub async fn check_sso_by_domain(
14591            &mut self,
14592            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14593        ) -> std::result::Result<
14594            tonic::Response<super::CheckSsoByDomainResponse>,
14595            tonic::Status,
14596        > {
14597            self.inner
14598                .ready()
14599                .await
14600                .map_err(|e| {
14601                    tonic::Status::unknown(
14602                        format!("Service was not ready: {}", e.into()),
14603                    )
14604                })?;
14605            let codec = tonic_prost::ProstCodec::default();
14606            let path = http::uri::PathAndQuery::from_static(
14607                "/pidgr.v1.SSOService/CheckSSOByDomain",
14608            );
14609            let mut req = request.into_request();
14610            req.extensions_mut()
14611                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14612            self.inner.unary(req, path, codec).await
14613        }
14614        /** Create an SSO provider for the organization.
14615 Validates the metadata URL before saving.
14616 Creates the corresponding identity provider in the auth service.
14617 Authorization: Requires PERMISSION_ORG_WRITE.
14618*/
14619        pub async fn create_sso_provider(
14620            &mut self,
14621            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14622        ) -> std::result::Result<
14623            tonic::Response<super::CreateSsoProviderResponse>,
14624            tonic::Status,
14625        > {
14626            self.inner
14627                .ready()
14628                .await
14629                .map_err(|e| {
14630                    tonic::Status::unknown(
14631                        format!("Service was not ready: {}", e.into()),
14632                    )
14633                })?;
14634            let codec = tonic_prost::ProstCodec::default();
14635            let path = http::uri::PathAndQuery::from_static(
14636                "/pidgr.v1.SSOService/CreateSSOProvider",
14637            );
14638            let mut req = request.into_request();
14639            req.extensions_mut()
14640                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14641            self.inner.unary(req, path, codec).await
14642        }
14643        /** Get the organization's SSO provider configuration.
14644 Authorization: Requires PERMISSION_ORG_READ.
14645*/
14646        pub async fn get_sso_provider(
14647            &mut self,
14648            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14649        ) -> std::result::Result<
14650            tonic::Response<super::GetSsoProviderResponse>,
14651            tonic::Status,
14652        > {
14653            self.inner
14654                .ready()
14655                .await
14656                .map_err(|e| {
14657                    tonic::Status::unknown(
14658                        format!("Service was not ready: {}", e.into()),
14659                    )
14660                })?;
14661            let codec = tonic_prost::ProstCodec::default();
14662            let path = http::uri::PathAndQuery::from_static(
14663                "/pidgr.v1.SSOService/GetSSOProvider",
14664            );
14665            let mut req = request.into_request();
14666            req.extensions_mut()
14667                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14668            self.inner.unary(req, path, codec).await
14669        }
14670        /** Delete the organization's SSO provider.
14671 Deletes the corresponding identity provider from the auth service.
14672 Users with that domain fall back to passkey/OTP.
14673 Authorization: Requires PERMISSION_ORG_WRITE.
14674*/
14675        pub async fn delete_sso_provider(
14676            &mut self,
14677            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14678        ) -> std::result::Result<
14679            tonic::Response<super::DeleteSsoProviderResponse>,
14680            tonic::Status,
14681        > {
14682            self.inner
14683                .ready()
14684                .await
14685                .map_err(|e| {
14686                    tonic::Status::unknown(
14687                        format!("Service was not ready: {}", e.into()),
14688                    )
14689                })?;
14690            let codec = tonic_prost::ProstCodec::default();
14691            let path = http::uri::PathAndQuery::from_static(
14692                "/pidgr.v1.SSOService/DeleteSSOProvider",
14693            );
14694            let mut req = request.into_request();
14695            req.extensions_mut()
14696                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14697            self.inner.unary(req, path, codec).await
14698        }
14699    }
14700}
14701/// Generated server implementations.
14702pub mod sso_service_server {
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    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
14712    #[async_trait]
14713    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14714        /** Check if an email domain has SSO configured.
14715 This is a pre-authentication endpoint — no JWT required.
14716 Authorization: None (public).
14717*/
14718        async fn check_sso_by_domain(
14719            &self,
14720            request: tonic::Request<super::CheckSsoByDomainRequest>,
14721        ) -> std::result::Result<
14722            tonic::Response<super::CheckSsoByDomainResponse>,
14723            tonic::Status,
14724        >;
14725        /** Create an SSO provider for the organization.
14726 Validates the metadata URL before saving.
14727 Creates the corresponding identity provider in the auth service.
14728 Authorization: Requires PERMISSION_ORG_WRITE.
14729*/
14730        async fn create_sso_provider(
14731            &self,
14732            request: tonic::Request<super::CreateSsoProviderRequest>,
14733        ) -> std::result::Result<
14734            tonic::Response<super::CreateSsoProviderResponse>,
14735            tonic::Status,
14736        >;
14737        /** Get the organization's SSO provider configuration.
14738 Authorization: Requires PERMISSION_ORG_READ.
14739*/
14740        async fn get_sso_provider(
14741            &self,
14742            request: tonic::Request<super::GetSsoProviderRequest>,
14743        ) -> std::result::Result<
14744            tonic::Response<super::GetSsoProviderResponse>,
14745            tonic::Status,
14746        >;
14747        /** Delete the organization's SSO provider.
14748 Deletes the corresponding identity provider from the auth service.
14749 Users with that domain fall back to passkey/OTP.
14750 Authorization: Requires PERMISSION_ORG_WRITE.
14751*/
14752        async fn delete_sso_provider(
14753            &self,
14754            request: tonic::Request<super::DeleteSsoProviderRequest>,
14755        ) -> std::result::Result<
14756            tonic::Response<super::DeleteSsoProviderResponse>,
14757            tonic::Status,
14758        >;
14759    }
14760    /** Manages SSO identity provider configuration for organizations.
14761*/
14762    #[derive(Debug)]
14763    pub struct SsoServiceServer<T> {
14764        inner: Arc<T>,
14765        accept_compression_encodings: EnabledCompressionEncodings,
14766        send_compression_encodings: EnabledCompressionEncodings,
14767        max_decoding_message_size: Option<usize>,
14768        max_encoding_message_size: Option<usize>,
14769    }
14770    impl<T> SsoServiceServer<T> {
14771        pub fn new(inner: T) -> Self {
14772            Self::from_arc(Arc::new(inner))
14773        }
14774        pub fn from_arc(inner: Arc<T>) -> Self {
14775            Self {
14776                inner,
14777                accept_compression_encodings: Default::default(),
14778                send_compression_encodings: Default::default(),
14779                max_decoding_message_size: None,
14780                max_encoding_message_size: None,
14781            }
14782        }
14783        pub fn with_interceptor<F>(
14784            inner: T,
14785            interceptor: F,
14786        ) -> InterceptedService<Self, F>
14787        where
14788            F: tonic::service::Interceptor,
14789        {
14790            InterceptedService::new(Self::new(inner), interceptor)
14791        }
14792        /// Enable decompressing requests with the given encoding.
14793        #[must_use]
14794        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14795            self.accept_compression_encodings.enable(encoding);
14796            self
14797        }
14798        /// Compress responses with the given encoding, if the client supports it.
14799        #[must_use]
14800        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14801            self.send_compression_encodings.enable(encoding);
14802            self
14803        }
14804        /// Limits the maximum size of a decoded message.
14805        ///
14806        /// Default: `4MB`
14807        #[must_use]
14808        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14809            self.max_decoding_message_size = Some(limit);
14810            self
14811        }
14812        /// Limits the maximum size of an encoded message.
14813        ///
14814        /// Default: `usize::MAX`
14815        #[must_use]
14816        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14817            self.max_encoding_message_size = Some(limit);
14818            self
14819        }
14820    }
14821    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14822    where
14823        T: SsoService,
14824        B: Body + std::marker::Send + 'static,
14825        B::Error: Into<StdError> + std::marker::Send + 'static,
14826    {
14827        type Response = http::Response<tonic::body::Body>;
14828        type Error = std::convert::Infallible;
14829        type Future = BoxFuture<Self::Response, Self::Error>;
14830        fn poll_ready(
14831            &mut self,
14832            _cx: &mut Context<'_>,
14833        ) -> Poll<std::result::Result<(), Self::Error>> {
14834            Poll::Ready(Ok(()))
14835        }
14836        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14837            match req.uri().path() {
14838                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14839                    #[allow(non_camel_case_types)]
14840                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14841                    impl<
14842                        T: SsoService,
14843                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14844                    for CheckSSOByDomainSvc<T> {
14845                        type Response = super::CheckSsoByDomainResponse;
14846                        type Future = BoxFuture<
14847                            tonic::Response<Self::Response>,
14848                            tonic::Status,
14849                        >;
14850                        fn call(
14851                            &mut self,
14852                            request: tonic::Request<super::CheckSsoByDomainRequest>,
14853                        ) -> Self::Future {
14854                            let inner = Arc::clone(&self.0);
14855                            let fut = async move {
14856                                <T as SsoService>::check_sso_by_domain(&inner, request)
14857                                    .await
14858                            };
14859                            Box::pin(fut)
14860                        }
14861                    }
14862                    let accept_compression_encodings = self.accept_compression_encodings;
14863                    let send_compression_encodings = self.send_compression_encodings;
14864                    let max_decoding_message_size = self.max_decoding_message_size;
14865                    let max_encoding_message_size = self.max_encoding_message_size;
14866                    let inner = self.inner.clone();
14867                    let fut = async move {
14868                        let method = CheckSSOByDomainSvc(inner);
14869                        let codec = tonic_prost::ProstCodec::default();
14870                        let mut grpc = tonic::server::Grpc::new(codec)
14871                            .apply_compression_config(
14872                                accept_compression_encodings,
14873                                send_compression_encodings,
14874                            )
14875                            .apply_max_message_size_config(
14876                                max_decoding_message_size,
14877                                max_encoding_message_size,
14878                            );
14879                        let res = grpc.unary(method, req).await;
14880                        Ok(res)
14881                    };
14882                    Box::pin(fut)
14883                }
14884                "/pidgr.v1.SSOService/CreateSSOProvider" => {
14885                    #[allow(non_camel_case_types)]
14886                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14887                    impl<
14888                        T: SsoService,
14889                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
14890                    for CreateSSOProviderSvc<T> {
14891                        type Response = super::CreateSsoProviderResponse;
14892                        type Future = BoxFuture<
14893                            tonic::Response<Self::Response>,
14894                            tonic::Status,
14895                        >;
14896                        fn call(
14897                            &mut self,
14898                            request: tonic::Request<super::CreateSsoProviderRequest>,
14899                        ) -> Self::Future {
14900                            let inner = Arc::clone(&self.0);
14901                            let fut = async move {
14902                                <T as SsoService>::create_sso_provider(&inner, request)
14903                                    .await
14904                            };
14905                            Box::pin(fut)
14906                        }
14907                    }
14908                    let accept_compression_encodings = self.accept_compression_encodings;
14909                    let send_compression_encodings = self.send_compression_encodings;
14910                    let max_decoding_message_size = self.max_decoding_message_size;
14911                    let max_encoding_message_size = self.max_encoding_message_size;
14912                    let inner = self.inner.clone();
14913                    let fut = async move {
14914                        let method = CreateSSOProviderSvc(inner);
14915                        let codec = tonic_prost::ProstCodec::default();
14916                        let mut grpc = tonic::server::Grpc::new(codec)
14917                            .apply_compression_config(
14918                                accept_compression_encodings,
14919                                send_compression_encodings,
14920                            )
14921                            .apply_max_message_size_config(
14922                                max_decoding_message_size,
14923                                max_encoding_message_size,
14924                            );
14925                        let res = grpc.unary(method, req).await;
14926                        Ok(res)
14927                    };
14928                    Box::pin(fut)
14929                }
14930                "/pidgr.v1.SSOService/GetSSOProvider" => {
14931                    #[allow(non_camel_case_types)]
14932                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
14933                    impl<
14934                        T: SsoService,
14935                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
14936                    for GetSSOProviderSvc<T> {
14937                        type Response = super::GetSsoProviderResponse;
14938                        type Future = BoxFuture<
14939                            tonic::Response<Self::Response>,
14940                            tonic::Status,
14941                        >;
14942                        fn call(
14943                            &mut self,
14944                            request: tonic::Request<super::GetSsoProviderRequest>,
14945                        ) -> Self::Future {
14946                            let inner = Arc::clone(&self.0);
14947                            let fut = async move {
14948                                <T as SsoService>::get_sso_provider(&inner, request).await
14949                            };
14950                            Box::pin(fut)
14951                        }
14952                    }
14953                    let accept_compression_encodings = self.accept_compression_encodings;
14954                    let send_compression_encodings = self.send_compression_encodings;
14955                    let max_decoding_message_size = self.max_decoding_message_size;
14956                    let max_encoding_message_size = self.max_encoding_message_size;
14957                    let inner = self.inner.clone();
14958                    let fut = async move {
14959                        let method = GetSSOProviderSvc(inner);
14960                        let codec = tonic_prost::ProstCodec::default();
14961                        let mut grpc = tonic::server::Grpc::new(codec)
14962                            .apply_compression_config(
14963                                accept_compression_encodings,
14964                                send_compression_encodings,
14965                            )
14966                            .apply_max_message_size_config(
14967                                max_decoding_message_size,
14968                                max_encoding_message_size,
14969                            );
14970                        let res = grpc.unary(method, req).await;
14971                        Ok(res)
14972                    };
14973                    Box::pin(fut)
14974                }
14975                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
14976                    #[allow(non_camel_case_types)]
14977                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
14978                    impl<
14979                        T: SsoService,
14980                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
14981                    for DeleteSSOProviderSvc<T> {
14982                        type Response = super::DeleteSsoProviderResponse;
14983                        type Future = BoxFuture<
14984                            tonic::Response<Self::Response>,
14985                            tonic::Status,
14986                        >;
14987                        fn call(
14988                            &mut self,
14989                            request: tonic::Request<super::DeleteSsoProviderRequest>,
14990                        ) -> Self::Future {
14991                            let inner = Arc::clone(&self.0);
14992                            let fut = async move {
14993                                <T as SsoService>::delete_sso_provider(&inner, request)
14994                                    .await
14995                            };
14996                            Box::pin(fut)
14997                        }
14998                    }
14999                    let accept_compression_encodings = self.accept_compression_encodings;
15000                    let send_compression_encodings = self.send_compression_encodings;
15001                    let max_decoding_message_size = self.max_decoding_message_size;
15002                    let max_encoding_message_size = self.max_encoding_message_size;
15003                    let inner = self.inner.clone();
15004                    let fut = async move {
15005                        let method = DeleteSSOProviderSvc(inner);
15006                        let codec = tonic_prost::ProstCodec::default();
15007                        let mut grpc = tonic::server::Grpc::new(codec)
15008                            .apply_compression_config(
15009                                accept_compression_encodings,
15010                                send_compression_encodings,
15011                            )
15012                            .apply_max_message_size_config(
15013                                max_decoding_message_size,
15014                                max_encoding_message_size,
15015                            );
15016                        let res = grpc.unary(method, req).await;
15017                        Ok(res)
15018                    };
15019                    Box::pin(fut)
15020                }
15021                _ => {
15022                    Box::pin(async move {
15023                        let mut response = http::Response::new(
15024                            tonic::body::Body::default(),
15025                        );
15026                        let headers = response.headers_mut();
15027                        headers
15028                            .insert(
15029                                tonic::Status::GRPC_STATUS,
15030                                (tonic::Code::Unimplemented as i32).into(),
15031                            );
15032                        headers
15033                            .insert(
15034                                http::header::CONTENT_TYPE,
15035                                tonic::metadata::GRPC_CONTENT_TYPE,
15036                            );
15037                        Ok(response)
15038                    })
15039                }
15040            }
15041        }
15042    }
15043    impl<T> Clone for SsoServiceServer<T> {
15044        fn clone(&self) -> Self {
15045            let inner = self.inner.clone();
15046            Self {
15047                inner,
15048                accept_compression_encodings: self.accept_compression_encodings,
15049                send_compression_encodings: self.send_compression_encodings,
15050                max_decoding_message_size: self.max_decoding_message_size,
15051                max_encoding_message_size: self.max_encoding_message_size,
15052            }
15053        }
15054    }
15055    /// Generated gRPC service name
15056    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
15057    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
15058        const NAME: &'static str = SERVICE_NAME;
15059    }
15060}
15061/// Generated client implementations.
15062pub mod team_service_client {
15063    #![allow(
15064        unused_variables,
15065        dead_code,
15066        missing_docs,
15067        clippy::wildcard_imports,
15068        clippy::let_unit_value,
15069    )]
15070    use tonic::codegen::*;
15071    use tonic::codegen::http::Uri;
15072    /** Manages organizational teams (departments, divisions) within an organization.
15073 Teams represent the organizational structure and can serve as sender identity.
15074 All RPCs operate within the caller's org (extracted from JWT).
15075*/
15076    #[derive(Debug, Clone)]
15077    pub struct TeamServiceClient<T> {
15078        inner: tonic::client::Grpc<T>,
15079    }
15080    impl TeamServiceClient<tonic::transport::Channel> {
15081        /// Attempt to create a new client by connecting to a given endpoint.
15082        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15083        where
15084            D: TryInto<tonic::transport::Endpoint>,
15085            D::Error: Into<StdError>,
15086        {
15087            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15088            Ok(Self::new(conn))
15089        }
15090    }
15091    impl<T> TeamServiceClient<T>
15092    where
15093        T: tonic::client::GrpcService<tonic::body::Body>,
15094        T::Error: Into<StdError>,
15095        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15096        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15097    {
15098        pub fn new(inner: T) -> Self {
15099            let inner = tonic::client::Grpc::new(inner);
15100            Self { inner }
15101        }
15102        pub fn with_origin(inner: T, origin: Uri) -> Self {
15103            let inner = tonic::client::Grpc::with_origin(inner, origin);
15104            Self { inner }
15105        }
15106        pub fn with_interceptor<F>(
15107            inner: T,
15108            interceptor: F,
15109        ) -> TeamServiceClient<InterceptedService<T, F>>
15110        where
15111            F: tonic::service::Interceptor,
15112            T::ResponseBody: Default,
15113            T: tonic::codegen::Service<
15114                http::Request<tonic::body::Body>,
15115                Response = http::Response<
15116                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15117                >,
15118            >,
15119            <T as tonic::codegen::Service<
15120                http::Request<tonic::body::Body>,
15121            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15122        {
15123            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
15124        }
15125        /// Compress requests with the given encoding.
15126        ///
15127        /// This requires the server to support it otherwise it might respond with an
15128        /// error.
15129        #[must_use]
15130        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15131            self.inner = self.inner.send_compressed(encoding);
15132            self
15133        }
15134        /// Enable decompressing responses.
15135        #[must_use]
15136        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15137            self.inner = self.inner.accept_compressed(encoding);
15138            self
15139        }
15140        /// Limits the maximum size of a decoded message.
15141        ///
15142        /// Default: `4MB`
15143        #[must_use]
15144        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15145            self.inner = self.inner.max_decoding_message_size(limit);
15146            self
15147        }
15148        /// Limits the maximum size of an encoded message.
15149        ///
15150        /// Default: `usize::MAX`
15151        #[must_use]
15152        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15153            self.inner = self.inner.max_encoding_message_size(limit);
15154            self
15155        }
15156        /** Create a new team in the organization.
15157 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15158*/
15159        pub async fn create_team(
15160            &mut self,
15161            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
15162        ) -> std::result::Result<
15163            tonic::Response<super::CreateTeamResponse>,
15164            tonic::Status,
15165        > {
15166            self.inner
15167                .ready()
15168                .await
15169                .map_err(|e| {
15170                    tonic::Status::unknown(
15171                        format!("Service was not ready: {}", e.into()),
15172                    )
15173                })?;
15174            let codec = tonic_prost::ProstCodec::default();
15175            let path = http::uri::PathAndQuery::from_static(
15176                "/pidgr.v1.TeamService/CreateTeam",
15177            );
15178            let mut req = request.into_request();
15179            req.extensions_mut()
15180                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
15181            self.inner.unary(req, path, codec).await
15182        }
15183        /** Retrieve a team by ID.
15184 Authorization: Caller must be a member of the team, or have
15185 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15186*/
15187        pub async fn get_team(
15188            &mut self,
15189            request: impl tonic::IntoRequest<super::GetTeamRequest>,
15190        ) -> std::result::Result<
15191            tonic::Response<super::GetTeamResponse>,
15192            tonic::Status,
15193        > {
15194            self.inner
15195                .ready()
15196                .await
15197                .map_err(|e| {
15198                    tonic::Status::unknown(
15199                        format!("Service was not ready: {}", e.into()),
15200                    )
15201                })?;
15202            let codec = tonic_prost::ProstCodec::default();
15203            let path = http::uri::PathAndQuery::from_static(
15204                "/pidgr.v1.TeamService/GetTeam",
15205            );
15206            let mut req = request.into_request();
15207            req.extensions_mut()
15208                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
15209            self.inner.unary(req, path, codec).await
15210        }
15211        /** List teams in the organization with pagination.
15212 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15213*/
15214        pub async fn list_teams(
15215            &mut self,
15216            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
15217        ) -> std::result::Result<
15218            tonic::Response<super::ListTeamsResponse>,
15219            tonic::Status,
15220        > {
15221            self.inner
15222                .ready()
15223                .await
15224                .map_err(|e| {
15225                    tonic::Status::unknown(
15226                        format!("Service was not ready: {}", e.into()),
15227                    )
15228                })?;
15229            let codec = tonic_prost::ProstCodec::default();
15230            let path = http::uri::PathAndQuery::from_static(
15231                "/pidgr.v1.TeamService/ListTeams",
15232            );
15233            let mut req = request.into_request();
15234            req.extensions_mut()
15235                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
15236            self.inner.unary(req, path, codec).await
15237        }
15238        /** Update a team's name and/or description.
15239 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15240*/
15241        pub async fn update_team(
15242            &mut self,
15243            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
15244        ) -> std::result::Result<
15245            tonic::Response<super::UpdateTeamResponse>,
15246            tonic::Status,
15247        > {
15248            self.inner
15249                .ready()
15250                .await
15251                .map_err(|e| {
15252                    tonic::Status::unknown(
15253                        format!("Service was not ready: {}", e.into()),
15254                    )
15255                })?;
15256            let codec = tonic_prost::ProstCodec::default();
15257            let path = http::uri::PathAndQuery::from_static(
15258                "/pidgr.v1.TeamService/UpdateTeam",
15259            );
15260            let mut req = request.into_request();
15261            req.extensions_mut()
15262                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
15263            self.inner.unary(req, path, codec).await
15264        }
15265        /** Delete a team and all its membership records. Default teams cannot be deleted.
15266 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15267*/
15268        pub async fn delete_team(
15269            &mut self,
15270            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
15271        ) -> std::result::Result<
15272            tonic::Response<super::DeleteTeamResponse>,
15273            tonic::Status,
15274        > {
15275            self.inner
15276                .ready()
15277                .await
15278                .map_err(|e| {
15279                    tonic::Status::unknown(
15280                        format!("Service was not ready: {}", e.into()),
15281                    )
15282                })?;
15283            let codec = tonic_prost::ProstCodec::default();
15284            let path = http::uri::PathAndQuery::from_static(
15285                "/pidgr.v1.TeamService/DeleteTeam",
15286            );
15287            let mut req = request.into_request();
15288            req.extensions_mut()
15289                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
15290            self.inner.unary(req, path, codec).await
15291        }
15292        /** Add one or more users to a team (idempotent).
15293 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15294*/
15295        pub async fn add_team_members(
15296            &mut self,
15297            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
15298        ) -> std::result::Result<
15299            tonic::Response<super::AddTeamMembersResponse>,
15300            tonic::Status,
15301        > {
15302            self.inner
15303                .ready()
15304                .await
15305                .map_err(|e| {
15306                    tonic::Status::unknown(
15307                        format!("Service was not ready: {}", e.into()),
15308                    )
15309                })?;
15310            let codec = tonic_prost::ProstCodec::default();
15311            let path = http::uri::PathAndQuery::from_static(
15312                "/pidgr.v1.TeamService/AddTeamMembers",
15313            );
15314            let mut req = request.into_request();
15315            req.extensions_mut()
15316                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
15317            self.inner.unary(req, path, codec).await
15318        }
15319        /** Remove one or more users from a team (idempotent).
15320 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15321*/
15322        pub async fn remove_team_members(
15323            &mut self,
15324            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
15325        ) -> std::result::Result<
15326            tonic::Response<super::RemoveTeamMembersResponse>,
15327            tonic::Status,
15328        > {
15329            self.inner
15330                .ready()
15331                .await
15332                .map_err(|e| {
15333                    tonic::Status::unknown(
15334                        format!("Service was not ready: {}", e.into()),
15335                    )
15336                })?;
15337            let codec = tonic_prost::ProstCodec::default();
15338            let path = http::uri::PathAndQuery::from_static(
15339                "/pidgr.v1.TeamService/RemoveTeamMembers",
15340            );
15341            let mut req = request.into_request();
15342            req.extensions_mut()
15343                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
15344            self.inner.unary(req, path, codec).await
15345        }
15346        /** List members of a team with pagination.
15347 Authorization: Caller must be a member of the team, or have
15348 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15349*/
15350        pub async fn list_team_members(
15351            &mut self,
15352            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
15353        ) -> std::result::Result<
15354            tonic::Response<super::ListTeamMembersResponse>,
15355            tonic::Status,
15356        > {
15357            self.inner
15358                .ready()
15359                .await
15360                .map_err(|e| {
15361                    tonic::Status::unknown(
15362                        format!("Service was not ready: {}", e.into()),
15363                    )
15364                })?;
15365            let codec = tonic_prost::ProstCodec::default();
15366            let path = http::uri::PathAndQuery::from_static(
15367                "/pidgr.v1.TeamService/ListTeamMembers",
15368            );
15369            let mut req = request.into_request();
15370            req.extensions_mut()
15371                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
15372            self.inner.unary(req, path, codec).await
15373        }
15374    }
15375}
15376/// Generated server implementations.
15377pub mod team_service_server {
15378    #![allow(
15379        unused_variables,
15380        dead_code,
15381        missing_docs,
15382        clippy::wildcard_imports,
15383        clippy::let_unit_value,
15384    )]
15385    use tonic::codegen::*;
15386    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
15387    #[async_trait]
15388    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
15389        /** Create a new team in the organization.
15390 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
15391*/
15392        async fn create_team(
15393            &self,
15394            request: tonic::Request<super::CreateTeamRequest>,
15395        ) -> std::result::Result<
15396            tonic::Response<super::CreateTeamResponse>,
15397            tonic::Status,
15398        >;
15399        /** Retrieve a team by ID.
15400 Authorization: Caller must be a member of the team, or have
15401 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15402*/
15403        async fn get_team(
15404            &self,
15405            request: tonic::Request<super::GetTeamRequest>,
15406        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
15407        /** List teams in the organization with pagination.
15408 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
15409*/
15410        async fn list_teams(
15411            &self,
15412            request: tonic::Request<super::ListTeamsRequest>,
15413        ) -> std::result::Result<
15414            tonic::Response<super::ListTeamsResponse>,
15415            tonic::Status,
15416        >;
15417        /** Update a team's name and/or description.
15418 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15419*/
15420        async fn update_team(
15421            &self,
15422            request: tonic::Request<super::UpdateTeamRequest>,
15423        ) -> std::result::Result<
15424            tonic::Response<super::UpdateTeamResponse>,
15425            tonic::Status,
15426        >;
15427        /** Delete a team and all its membership records. Default teams cannot be deleted.
15428 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15429*/
15430        async fn delete_team(
15431            &self,
15432            request: tonic::Request<super::DeleteTeamRequest>,
15433        ) -> std::result::Result<
15434            tonic::Response<super::DeleteTeamResponse>,
15435            tonic::Status,
15436        >;
15437        /** Add one or more users to a team (idempotent).
15438 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15439*/
15440        async fn add_team_members(
15441            &self,
15442            request: tonic::Request<super::AddTeamMembersRequest>,
15443        ) -> std::result::Result<
15444            tonic::Response<super::AddTeamMembersResponse>,
15445            tonic::Status,
15446        >;
15447        /** Remove one or more users from a team (idempotent).
15448 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
15449*/
15450        async fn remove_team_members(
15451            &self,
15452            request: tonic::Request<super::RemoveTeamMembersRequest>,
15453        ) -> std::result::Result<
15454            tonic::Response<super::RemoveTeamMembersResponse>,
15455            tonic::Status,
15456        >;
15457        /** List members of a team with pagination.
15458 Authorization: Caller must be a member of the team, or have
15459 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
15460*/
15461        async fn list_team_members(
15462            &self,
15463            request: tonic::Request<super::ListTeamMembersRequest>,
15464        ) -> std::result::Result<
15465            tonic::Response<super::ListTeamMembersResponse>,
15466            tonic::Status,
15467        >;
15468    }
15469    /** Manages organizational teams (departments, divisions) within an organization.
15470 Teams represent the organizational structure and can serve as sender identity.
15471 All RPCs operate within the caller's org (extracted from JWT).
15472*/
15473    #[derive(Debug)]
15474    pub struct TeamServiceServer<T> {
15475        inner: Arc<T>,
15476        accept_compression_encodings: EnabledCompressionEncodings,
15477        send_compression_encodings: EnabledCompressionEncodings,
15478        max_decoding_message_size: Option<usize>,
15479        max_encoding_message_size: Option<usize>,
15480    }
15481    impl<T> TeamServiceServer<T> {
15482        pub fn new(inner: T) -> Self {
15483            Self::from_arc(Arc::new(inner))
15484        }
15485        pub fn from_arc(inner: Arc<T>) -> Self {
15486            Self {
15487                inner,
15488                accept_compression_encodings: Default::default(),
15489                send_compression_encodings: Default::default(),
15490                max_decoding_message_size: None,
15491                max_encoding_message_size: None,
15492            }
15493        }
15494        pub fn with_interceptor<F>(
15495            inner: T,
15496            interceptor: F,
15497        ) -> InterceptedService<Self, F>
15498        where
15499            F: tonic::service::Interceptor,
15500        {
15501            InterceptedService::new(Self::new(inner), interceptor)
15502        }
15503        /// Enable decompressing requests with the given encoding.
15504        #[must_use]
15505        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15506            self.accept_compression_encodings.enable(encoding);
15507            self
15508        }
15509        /// Compress responses with the given encoding, if the client supports it.
15510        #[must_use]
15511        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15512            self.send_compression_encodings.enable(encoding);
15513            self
15514        }
15515        /// Limits the maximum size of a decoded message.
15516        ///
15517        /// Default: `4MB`
15518        #[must_use]
15519        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15520            self.max_decoding_message_size = Some(limit);
15521            self
15522        }
15523        /// Limits the maximum size of an encoded message.
15524        ///
15525        /// Default: `usize::MAX`
15526        #[must_use]
15527        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15528            self.max_encoding_message_size = Some(limit);
15529            self
15530        }
15531    }
15532    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15533    where
15534        T: TeamService,
15535        B: Body + std::marker::Send + 'static,
15536        B::Error: Into<StdError> + std::marker::Send + 'static,
15537    {
15538        type Response = http::Response<tonic::body::Body>;
15539        type Error = std::convert::Infallible;
15540        type Future = BoxFuture<Self::Response, Self::Error>;
15541        fn poll_ready(
15542            &mut self,
15543            _cx: &mut Context<'_>,
15544        ) -> Poll<std::result::Result<(), Self::Error>> {
15545            Poll::Ready(Ok(()))
15546        }
15547        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15548            match req.uri().path() {
15549                "/pidgr.v1.TeamService/CreateTeam" => {
15550                    #[allow(non_camel_case_types)]
15551                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15552                    impl<
15553                        T: TeamService,
15554                    > tonic::server::UnaryService<super::CreateTeamRequest>
15555                    for CreateTeamSvc<T> {
15556                        type Response = super::CreateTeamResponse;
15557                        type Future = BoxFuture<
15558                            tonic::Response<Self::Response>,
15559                            tonic::Status,
15560                        >;
15561                        fn call(
15562                            &mut self,
15563                            request: tonic::Request<super::CreateTeamRequest>,
15564                        ) -> Self::Future {
15565                            let inner = Arc::clone(&self.0);
15566                            let fut = async move {
15567                                <T as TeamService>::create_team(&inner, request).await
15568                            };
15569                            Box::pin(fut)
15570                        }
15571                    }
15572                    let accept_compression_encodings = self.accept_compression_encodings;
15573                    let send_compression_encodings = self.send_compression_encodings;
15574                    let max_decoding_message_size = self.max_decoding_message_size;
15575                    let max_encoding_message_size = self.max_encoding_message_size;
15576                    let inner = self.inner.clone();
15577                    let fut = async move {
15578                        let method = CreateTeamSvc(inner);
15579                        let codec = tonic_prost::ProstCodec::default();
15580                        let mut grpc = tonic::server::Grpc::new(codec)
15581                            .apply_compression_config(
15582                                accept_compression_encodings,
15583                                send_compression_encodings,
15584                            )
15585                            .apply_max_message_size_config(
15586                                max_decoding_message_size,
15587                                max_encoding_message_size,
15588                            );
15589                        let res = grpc.unary(method, req).await;
15590                        Ok(res)
15591                    };
15592                    Box::pin(fut)
15593                }
15594                "/pidgr.v1.TeamService/GetTeam" => {
15595                    #[allow(non_camel_case_types)]
15596                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15597                    impl<
15598                        T: TeamService,
15599                    > tonic::server::UnaryService<super::GetTeamRequest>
15600                    for GetTeamSvc<T> {
15601                        type Response = super::GetTeamResponse;
15602                        type Future = BoxFuture<
15603                            tonic::Response<Self::Response>,
15604                            tonic::Status,
15605                        >;
15606                        fn call(
15607                            &mut self,
15608                            request: tonic::Request<super::GetTeamRequest>,
15609                        ) -> Self::Future {
15610                            let inner = Arc::clone(&self.0);
15611                            let fut = async move {
15612                                <T as TeamService>::get_team(&inner, request).await
15613                            };
15614                            Box::pin(fut)
15615                        }
15616                    }
15617                    let accept_compression_encodings = self.accept_compression_encodings;
15618                    let send_compression_encodings = self.send_compression_encodings;
15619                    let max_decoding_message_size = self.max_decoding_message_size;
15620                    let max_encoding_message_size = self.max_encoding_message_size;
15621                    let inner = self.inner.clone();
15622                    let fut = async move {
15623                        let method = GetTeamSvc(inner);
15624                        let codec = tonic_prost::ProstCodec::default();
15625                        let mut grpc = tonic::server::Grpc::new(codec)
15626                            .apply_compression_config(
15627                                accept_compression_encodings,
15628                                send_compression_encodings,
15629                            )
15630                            .apply_max_message_size_config(
15631                                max_decoding_message_size,
15632                                max_encoding_message_size,
15633                            );
15634                        let res = grpc.unary(method, req).await;
15635                        Ok(res)
15636                    };
15637                    Box::pin(fut)
15638                }
15639                "/pidgr.v1.TeamService/ListTeams" => {
15640                    #[allow(non_camel_case_types)]
15641                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15642                    impl<
15643                        T: TeamService,
15644                    > tonic::server::UnaryService<super::ListTeamsRequest>
15645                    for ListTeamsSvc<T> {
15646                        type Response = super::ListTeamsResponse;
15647                        type Future = BoxFuture<
15648                            tonic::Response<Self::Response>,
15649                            tonic::Status,
15650                        >;
15651                        fn call(
15652                            &mut self,
15653                            request: tonic::Request<super::ListTeamsRequest>,
15654                        ) -> Self::Future {
15655                            let inner = Arc::clone(&self.0);
15656                            let fut = async move {
15657                                <T as TeamService>::list_teams(&inner, request).await
15658                            };
15659                            Box::pin(fut)
15660                        }
15661                    }
15662                    let accept_compression_encodings = self.accept_compression_encodings;
15663                    let send_compression_encodings = self.send_compression_encodings;
15664                    let max_decoding_message_size = self.max_decoding_message_size;
15665                    let max_encoding_message_size = self.max_encoding_message_size;
15666                    let inner = self.inner.clone();
15667                    let fut = async move {
15668                        let method = ListTeamsSvc(inner);
15669                        let codec = tonic_prost::ProstCodec::default();
15670                        let mut grpc = tonic::server::Grpc::new(codec)
15671                            .apply_compression_config(
15672                                accept_compression_encodings,
15673                                send_compression_encodings,
15674                            )
15675                            .apply_max_message_size_config(
15676                                max_decoding_message_size,
15677                                max_encoding_message_size,
15678                            );
15679                        let res = grpc.unary(method, req).await;
15680                        Ok(res)
15681                    };
15682                    Box::pin(fut)
15683                }
15684                "/pidgr.v1.TeamService/UpdateTeam" => {
15685                    #[allow(non_camel_case_types)]
15686                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15687                    impl<
15688                        T: TeamService,
15689                    > tonic::server::UnaryService<super::UpdateTeamRequest>
15690                    for UpdateTeamSvc<T> {
15691                        type Response = super::UpdateTeamResponse;
15692                        type Future = BoxFuture<
15693                            tonic::Response<Self::Response>,
15694                            tonic::Status,
15695                        >;
15696                        fn call(
15697                            &mut self,
15698                            request: tonic::Request<super::UpdateTeamRequest>,
15699                        ) -> Self::Future {
15700                            let inner = Arc::clone(&self.0);
15701                            let fut = async move {
15702                                <T as TeamService>::update_team(&inner, request).await
15703                            };
15704                            Box::pin(fut)
15705                        }
15706                    }
15707                    let accept_compression_encodings = self.accept_compression_encodings;
15708                    let send_compression_encodings = self.send_compression_encodings;
15709                    let max_decoding_message_size = self.max_decoding_message_size;
15710                    let max_encoding_message_size = self.max_encoding_message_size;
15711                    let inner = self.inner.clone();
15712                    let fut = async move {
15713                        let method = UpdateTeamSvc(inner);
15714                        let codec = tonic_prost::ProstCodec::default();
15715                        let mut grpc = tonic::server::Grpc::new(codec)
15716                            .apply_compression_config(
15717                                accept_compression_encodings,
15718                                send_compression_encodings,
15719                            )
15720                            .apply_max_message_size_config(
15721                                max_decoding_message_size,
15722                                max_encoding_message_size,
15723                            );
15724                        let res = grpc.unary(method, req).await;
15725                        Ok(res)
15726                    };
15727                    Box::pin(fut)
15728                }
15729                "/pidgr.v1.TeamService/DeleteTeam" => {
15730                    #[allow(non_camel_case_types)]
15731                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15732                    impl<
15733                        T: TeamService,
15734                    > tonic::server::UnaryService<super::DeleteTeamRequest>
15735                    for DeleteTeamSvc<T> {
15736                        type Response = super::DeleteTeamResponse;
15737                        type Future = BoxFuture<
15738                            tonic::Response<Self::Response>,
15739                            tonic::Status,
15740                        >;
15741                        fn call(
15742                            &mut self,
15743                            request: tonic::Request<super::DeleteTeamRequest>,
15744                        ) -> Self::Future {
15745                            let inner = Arc::clone(&self.0);
15746                            let fut = async move {
15747                                <T as TeamService>::delete_team(&inner, request).await
15748                            };
15749                            Box::pin(fut)
15750                        }
15751                    }
15752                    let accept_compression_encodings = self.accept_compression_encodings;
15753                    let send_compression_encodings = self.send_compression_encodings;
15754                    let max_decoding_message_size = self.max_decoding_message_size;
15755                    let max_encoding_message_size = self.max_encoding_message_size;
15756                    let inner = self.inner.clone();
15757                    let fut = async move {
15758                        let method = DeleteTeamSvc(inner);
15759                        let codec = tonic_prost::ProstCodec::default();
15760                        let mut grpc = tonic::server::Grpc::new(codec)
15761                            .apply_compression_config(
15762                                accept_compression_encodings,
15763                                send_compression_encodings,
15764                            )
15765                            .apply_max_message_size_config(
15766                                max_decoding_message_size,
15767                                max_encoding_message_size,
15768                            );
15769                        let res = grpc.unary(method, req).await;
15770                        Ok(res)
15771                    };
15772                    Box::pin(fut)
15773                }
15774                "/pidgr.v1.TeamService/AddTeamMembers" => {
15775                    #[allow(non_camel_case_types)]
15776                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15777                    impl<
15778                        T: TeamService,
15779                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
15780                    for AddTeamMembersSvc<T> {
15781                        type Response = super::AddTeamMembersResponse;
15782                        type Future = BoxFuture<
15783                            tonic::Response<Self::Response>,
15784                            tonic::Status,
15785                        >;
15786                        fn call(
15787                            &mut self,
15788                            request: tonic::Request<super::AddTeamMembersRequest>,
15789                        ) -> Self::Future {
15790                            let inner = Arc::clone(&self.0);
15791                            let fut = async move {
15792                                <T as TeamService>::add_team_members(&inner, request).await
15793                            };
15794                            Box::pin(fut)
15795                        }
15796                    }
15797                    let accept_compression_encodings = self.accept_compression_encodings;
15798                    let send_compression_encodings = self.send_compression_encodings;
15799                    let max_decoding_message_size = self.max_decoding_message_size;
15800                    let max_encoding_message_size = self.max_encoding_message_size;
15801                    let inner = self.inner.clone();
15802                    let fut = async move {
15803                        let method = AddTeamMembersSvc(inner);
15804                        let codec = tonic_prost::ProstCodec::default();
15805                        let mut grpc = tonic::server::Grpc::new(codec)
15806                            .apply_compression_config(
15807                                accept_compression_encodings,
15808                                send_compression_encodings,
15809                            )
15810                            .apply_max_message_size_config(
15811                                max_decoding_message_size,
15812                                max_encoding_message_size,
15813                            );
15814                        let res = grpc.unary(method, req).await;
15815                        Ok(res)
15816                    };
15817                    Box::pin(fut)
15818                }
15819                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15820                    #[allow(non_camel_case_types)]
15821                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15822                    impl<
15823                        T: TeamService,
15824                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15825                    for RemoveTeamMembersSvc<T> {
15826                        type Response = super::RemoveTeamMembersResponse;
15827                        type Future = BoxFuture<
15828                            tonic::Response<Self::Response>,
15829                            tonic::Status,
15830                        >;
15831                        fn call(
15832                            &mut self,
15833                            request: tonic::Request<super::RemoveTeamMembersRequest>,
15834                        ) -> Self::Future {
15835                            let inner = Arc::clone(&self.0);
15836                            let fut = async move {
15837                                <T as TeamService>::remove_team_members(&inner, request)
15838                                    .await
15839                            };
15840                            Box::pin(fut)
15841                        }
15842                    }
15843                    let accept_compression_encodings = self.accept_compression_encodings;
15844                    let send_compression_encodings = self.send_compression_encodings;
15845                    let max_decoding_message_size = self.max_decoding_message_size;
15846                    let max_encoding_message_size = self.max_encoding_message_size;
15847                    let inner = self.inner.clone();
15848                    let fut = async move {
15849                        let method = RemoveTeamMembersSvc(inner);
15850                        let codec = tonic_prost::ProstCodec::default();
15851                        let mut grpc = tonic::server::Grpc::new(codec)
15852                            .apply_compression_config(
15853                                accept_compression_encodings,
15854                                send_compression_encodings,
15855                            )
15856                            .apply_max_message_size_config(
15857                                max_decoding_message_size,
15858                                max_encoding_message_size,
15859                            );
15860                        let res = grpc.unary(method, req).await;
15861                        Ok(res)
15862                    };
15863                    Box::pin(fut)
15864                }
15865                "/pidgr.v1.TeamService/ListTeamMembers" => {
15866                    #[allow(non_camel_case_types)]
15867                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15868                    impl<
15869                        T: TeamService,
15870                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
15871                    for ListTeamMembersSvc<T> {
15872                        type Response = super::ListTeamMembersResponse;
15873                        type Future = BoxFuture<
15874                            tonic::Response<Self::Response>,
15875                            tonic::Status,
15876                        >;
15877                        fn call(
15878                            &mut self,
15879                            request: tonic::Request<super::ListTeamMembersRequest>,
15880                        ) -> Self::Future {
15881                            let inner = Arc::clone(&self.0);
15882                            let fut = async move {
15883                                <T as TeamService>::list_team_members(&inner, request).await
15884                            };
15885                            Box::pin(fut)
15886                        }
15887                    }
15888                    let accept_compression_encodings = self.accept_compression_encodings;
15889                    let send_compression_encodings = self.send_compression_encodings;
15890                    let max_decoding_message_size = self.max_decoding_message_size;
15891                    let max_encoding_message_size = self.max_encoding_message_size;
15892                    let inner = self.inner.clone();
15893                    let fut = async move {
15894                        let method = ListTeamMembersSvc(inner);
15895                        let codec = tonic_prost::ProstCodec::default();
15896                        let mut grpc = tonic::server::Grpc::new(codec)
15897                            .apply_compression_config(
15898                                accept_compression_encodings,
15899                                send_compression_encodings,
15900                            )
15901                            .apply_max_message_size_config(
15902                                max_decoding_message_size,
15903                                max_encoding_message_size,
15904                            );
15905                        let res = grpc.unary(method, req).await;
15906                        Ok(res)
15907                    };
15908                    Box::pin(fut)
15909                }
15910                _ => {
15911                    Box::pin(async move {
15912                        let mut response = http::Response::new(
15913                            tonic::body::Body::default(),
15914                        );
15915                        let headers = response.headers_mut();
15916                        headers
15917                            .insert(
15918                                tonic::Status::GRPC_STATUS,
15919                                (tonic::Code::Unimplemented as i32).into(),
15920                            );
15921                        headers
15922                            .insert(
15923                                http::header::CONTENT_TYPE,
15924                                tonic::metadata::GRPC_CONTENT_TYPE,
15925                            );
15926                        Ok(response)
15927                    })
15928                }
15929            }
15930        }
15931    }
15932    impl<T> Clone for TeamServiceServer<T> {
15933        fn clone(&self) -> Self {
15934            let inner = self.inner.clone();
15935            Self {
15936                inner,
15937                accept_compression_encodings: self.accept_compression_encodings,
15938                send_compression_encodings: self.send_compression_encodings,
15939                max_decoding_message_size: self.max_decoding_message_size,
15940                max_encoding_message_size: self.max_encoding_message_size,
15941            }
15942        }
15943    }
15944    /// Generated gRPC service name
15945    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
15946    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
15947        const NAME: &'static str = SERVICE_NAME;
15948    }
15949}
15950/// Generated client implementations.
15951pub mod template_service_client {
15952    #![allow(
15953        unused_variables,
15954        dead_code,
15955        missing_docs,
15956        clippy::wildcard_imports,
15957        clippy::let_unit_value,
15958    )]
15959    use tonic::codegen::*;
15960    use tonic::codegen::http::Uri;
15961    /** Manages versioned message templates used by campaigns.
15962 Templates are append-only — updates create new versions while preserving history.
15963*/
15964    #[derive(Debug, Clone)]
15965    pub struct TemplateServiceClient<T> {
15966        inner: tonic::client::Grpc<T>,
15967    }
15968    impl TemplateServiceClient<tonic::transport::Channel> {
15969        /// Attempt to create a new client by connecting to a given endpoint.
15970        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15971        where
15972            D: TryInto<tonic::transport::Endpoint>,
15973            D::Error: Into<StdError>,
15974        {
15975            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15976            Ok(Self::new(conn))
15977        }
15978    }
15979    impl<T> TemplateServiceClient<T>
15980    where
15981        T: tonic::client::GrpcService<tonic::body::Body>,
15982        T::Error: Into<StdError>,
15983        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15984        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15985    {
15986        pub fn new(inner: T) -> Self {
15987            let inner = tonic::client::Grpc::new(inner);
15988            Self { inner }
15989        }
15990        pub fn with_origin(inner: T, origin: Uri) -> Self {
15991            let inner = tonic::client::Grpc::with_origin(inner, origin);
15992            Self { inner }
15993        }
15994        pub fn with_interceptor<F>(
15995            inner: T,
15996            interceptor: F,
15997        ) -> TemplateServiceClient<InterceptedService<T, F>>
15998        where
15999            F: tonic::service::Interceptor,
16000            T::ResponseBody: Default,
16001            T: tonic::codegen::Service<
16002                http::Request<tonic::body::Body>,
16003                Response = http::Response<
16004                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16005                >,
16006            >,
16007            <T as tonic::codegen::Service<
16008                http::Request<tonic::body::Body>,
16009            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16010        {
16011            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
16012        }
16013        /// Compress requests with the given encoding.
16014        ///
16015        /// This requires the server to support it otherwise it might respond with an
16016        /// error.
16017        #[must_use]
16018        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16019            self.inner = self.inner.send_compressed(encoding);
16020            self
16021        }
16022        /// Enable decompressing responses.
16023        #[must_use]
16024        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16025            self.inner = self.inner.accept_compressed(encoding);
16026            self
16027        }
16028        /// Limits the maximum size of a decoded message.
16029        ///
16030        /// Default: `4MB`
16031        #[must_use]
16032        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16033            self.inner = self.inner.max_decoding_message_size(limit);
16034            self
16035        }
16036        /// Limits the maximum size of an encoded message.
16037        ///
16038        /// Default: `usize::MAX`
16039        #[must_use]
16040        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16041            self.inner = self.inner.max_encoding_message_size(limit);
16042            self
16043        }
16044        /** Create a new template with a body and variable definitions.
16045 Authorization: Requires MANAGER+ role.
16046*/
16047        pub async fn create_template(
16048            &mut self,
16049            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
16050        ) -> std::result::Result<
16051            tonic::Response<super::CreateTemplateResponse>,
16052            tonic::Status,
16053        > {
16054            self.inner
16055                .ready()
16056                .await
16057                .map_err(|e| {
16058                    tonic::Status::unknown(
16059                        format!("Service was not ready: {}", e.into()),
16060                    )
16061                })?;
16062            let codec = tonic_prost::ProstCodec::default();
16063            let path = http::uri::PathAndQuery::from_static(
16064                "/pidgr.v1.TemplateService/CreateTemplate",
16065            );
16066            let mut req = request.into_request();
16067            req.extensions_mut()
16068                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
16069            self.inner.unary(req, path, codec).await
16070        }
16071        /** Update an existing template, creating a new version.
16072 Authorization: Requires MANAGER+ role.
16073*/
16074        pub async fn update_template(
16075            &mut self,
16076            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
16077        ) -> std::result::Result<
16078            tonic::Response<super::UpdateTemplateResponse>,
16079            tonic::Status,
16080        > {
16081            self.inner
16082                .ready()
16083                .await
16084                .map_err(|e| {
16085                    tonic::Status::unknown(
16086                        format!("Service was not ready: {}", e.into()),
16087                    )
16088                })?;
16089            let codec = tonic_prost::ProstCodec::default();
16090            let path = http::uri::PathAndQuery::from_static(
16091                "/pidgr.v1.TemplateService/UpdateTemplate",
16092            );
16093            let mut req = request.into_request();
16094            req.extensions_mut()
16095                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
16096            self.inner.unary(req, path, codec).await
16097        }
16098        /** Retrieve a specific template by ID and optional version.
16099 Authorization: Authenticated user within the organization.
16100*/
16101        pub async fn get_template(
16102            &mut self,
16103            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
16104        ) -> std::result::Result<
16105            tonic::Response<super::GetTemplateResponse>,
16106            tonic::Status,
16107        > {
16108            self.inner
16109                .ready()
16110                .await
16111                .map_err(|e| {
16112                    tonic::Status::unknown(
16113                        format!("Service was not ready: {}", e.into()),
16114                    )
16115                })?;
16116            let codec = tonic_prost::ProstCodec::default();
16117            let path = http::uri::PathAndQuery::from_static(
16118                "/pidgr.v1.TemplateService/GetTemplate",
16119            );
16120            let mut req = request.into_request();
16121            req.extensions_mut()
16122                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
16123            self.inner.unary(req, path, codec).await
16124        }
16125        /** List all templates for the organization with pagination.
16126 Authorization: Authenticated user within the organization.
16127*/
16128        pub async fn list_templates(
16129            &mut self,
16130            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
16131        ) -> std::result::Result<
16132            tonic::Response<super::ListTemplatesResponse>,
16133            tonic::Status,
16134        > {
16135            self.inner
16136                .ready()
16137                .await
16138                .map_err(|e| {
16139                    tonic::Status::unknown(
16140                        format!("Service was not ready: {}", e.into()),
16141                    )
16142                })?;
16143            let codec = tonic_prost::ProstCodec::default();
16144            let path = http::uri::PathAndQuery::from_static(
16145                "/pidgr.v1.TemplateService/ListTemplates",
16146            );
16147            let mut req = request.into_request();
16148            req.extensions_mut()
16149                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
16150            self.inner.unary(req, path, codec).await
16151        }
16152        /** Create a locale-specific translation of a template.
16153 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16154*/
16155        pub async fn create_template_translation(
16156            &mut self,
16157            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
16158        ) -> std::result::Result<
16159            tonic::Response<super::CreateTemplateTranslationResponse>,
16160            tonic::Status,
16161        > {
16162            self.inner
16163                .ready()
16164                .await
16165                .map_err(|e| {
16166                    tonic::Status::unknown(
16167                        format!("Service was not ready: {}", e.into()),
16168                    )
16169                })?;
16170            let codec = tonic_prost::ProstCodec::default();
16171            let path = http::uri::PathAndQuery::from_static(
16172                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
16173            );
16174            let mut req = request.into_request();
16175            req.extensions_mut()
16176                .insert(
16177                    GrpcMethod::new(
16178                        "pidgr.v1.TemplateService",
16179                        "CreateTemplateTranslation",
16180                    ),
16181                );
16182            self.inner.unary(req, path, codec).await
16183        }
16184        /** Update an existing template translation.
16185 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16186*/
16187        pub async fn update_template_translation(
16188            &mut self,
16189            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
16190        ) -> std::result::Result<
16191            tonic::Response<super::UpdateTemplateTranslationResponse>,
16192            tonic::Status,
16193        > {
16194            self.inner
16195                .ready()
16196                .await
16197                .map_err(|e| {
16198                    tonic::Status::unknown(
16199                        format!("Service was not ready: {}", e.into()),
16200                    )
16201                })?;
16202            let codec = tonic_prost::ProstCodec::default();
16203            let path = http::uri::PathAndQuery::from_static(
16204                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
16205            );
16206            let mut req = request.into_request();
16207            req.extensions_mut()
16208                .insert(
16209                    GrpcMethod::new(
16210                        "pidgr.v1.TemplateService",
16211                        "UpdateTemplateTranslation",
16212                    ),
16213                );
16214            self.inner.unary(req, path, codec).await
16215        }
16216        /** List all translations for a template version.
16217 Authorization: Requires PERMISSION_TEMPLATES_READ.
16218*/
16219        pub async fn list_template_translations(
16220            &mut self,
16221            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
16222        ) -> std::result::Result<
16223            tonic::Response<super::ListTemplateTranslationsResponse>,
16224            tonic::Status,
16225        > {
16226            self.inner
16227                .ready()
16228                .await
16229                .map_err(|e| {
16230                    tonic::Status::unknown(
16231                        format!("Service was not ready: {}", e.into()),
16232                    )
16233                })?;
16234            let codec = tonic_prost::ProstCodec::default();
16235            let path = http::uri::PathAndQuery::from_static(
16236                "/pidgr.v1.TemplateService/ListTemplateTranslations",
16237            );
16238            let mut req = request.into_request();
16239            req.extensions_mut()
16240                .insert(
16241                    GrpcMethod::new(
16242                        "pidgr.v1.TemplateService",
16243                        "ListTemplateTranslations",
16244                    ),
16245                );
16246            self.inner.unary(req, path, codec).await
16247        }
16248        /** Approve a template translation for use in campaigns.
16249 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16250*/
16251        pub async fn approve_template_translation(
16252            &mut self,
16253            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
16254        ) -> std::result::Result<
16255            tonic::Response<super::ApproveTemplateTranslationResponse>,
16256            tonic::Status,
16257        > {
16258            self.inner
16259                .ready()
16260                .await
16261                .map_err(|e| {
16262                    tonic::Status::unknown(
16263                        format!("Service was not ready: {}", e.into()),
16264                    )
16265                })?;
16266            let codec = tonic_prost::ProstCodec::default();
16267            let path = http::uri::PathAndQuery::from_static(
16268                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
16269            );
16270            let mut req = request.into_request();
16271            req.extensions_mut()
16272                .insert(
16273                    GrpcMethod::new(
16274                        "pidgr.v1.TemplateService",
16275                        "ApproveTemplateTranslation",
16276                    ),
16277                );
16278            self.inner.unary(req, path, codec).await
16279        }
16280    }
16281}
16282/// Generated server implementations.
16283pub mod template_service_server {
16284    #![allow(
16285        unused_variables,
16286        dead_code,
16287        missing_docs,
16288        clippy::wildcard_imports,
16289        clippy::let_unit_value,
16290    )]
16291    use tonic::codegen::*;
16292    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
16293    #[async_trait]
16294    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
16295        /** Create a new template with a body and variable definitions.
16296 Authorization: Requires MANAGER+ role.
16297*/
16298        async fn create_template(
16299            &self,
16300            request: tonic::Request<super::CreateTemplateRequest>,
16301        ) -> std::result::Result<
16302            tonic::Response<super::CreateTemplateResponse>,
16303            tonic::Status,
16304        >;
16305        /** Update an existing template, creating a new version.
16306 Authorization: Requires MANAGER+ role.
16307*/
16308        async fn update_template(
16309            &self,
16310            request: tonic::Request<super::UpdateTemplateRequest>,
16311        ) -> std::result::Result<
16312            tonic::Response<super::UpdateTemplateResponse>,
16313            tonic::Status,
16314        >;
16315        /** Retrieve a specific template by ID and optional version.
16316 Authorization: Authenticated user within the organization.
16317*/
16318        async fn get_template(
16319            &self,
16320            request: tonic::Request<super::GetTemplateRequest>,
16321        ) -> std::result::Result<
16322            tonic::Response<super::GetTemplateResponse>,
16323            tonic::Status,
16324        >;
16325        /** List all templates for the organization with pagination.
16326 Authorization: Authenticated user within the organization.
16327*/
16328        async fn list_templates(
16329            &self,
16330            request: tonic::Request<super::ListTemplatesRequest>,
16331        ) -> std::result::Result<
16332            tonic::Response<super::ListTemplatesResponse>,
16333            tonic::Status,
16334        >;
16335        /** Create a locale-specific translation of a template.
16336 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16337*/
16338        async fn create_template_translation(
16339            &self,
16340            request: tonic::Request<super::CreateTemplateTranslationRequest>,
16341        ) -> std::result::Result<
16342            tonic::Response<super::CreateTemplateTranslationResponse>,
16343            tonic::Status,
16344        >;
16345        /** Update an existing template translation.
16346 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
16347*/
16348        async fn update_template_translation(
16349            &self,
16350            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
16351        ) -> std::result::Result<
16352            tonic::Response<super::UpdateTemplateTranslationResponse>,
16353            tonic::Status,
16354        >;
16355        /** List all translations for a template version.
16356 Authorization: Requires PERMISSION_TEMPLATES_READ.
16357*/
16358        async fn list_template_translations(
16359            &self,
16360            request: tonic::Request<super::ListTemplateTranslationsRequest>,
16361        ) -> std::result::Result<
16362            tonic::Response<super::ListTemplateTranslationsResponse>,
16363            tonic::Status,
16364        >;
16365        /** Approve a template translation for use in campaigns.
16366 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
16367*/
16368        async fn approve_template_translation(
16369            &self,
16370            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
16371        ) -> std::result::Result<
16372            tonic::Response<super::ApproveTemplateTranslationResponse>,
16373            tonic::Status,
16374        >;
16375    }
16376    /** Manages versioned message templates used by campaigns.
16377 Templates are append-only — updates create new versions while preserving history.
16378*/
16379    #[derive(Debug)]
16380    pub struct TemplateServiceServer<T> {
16381        inner: Arc<T>,
16382        accept_compression_encodings: EnabledCompressionEncodings,
16383        send_compression_encodings: EnabledCompressionEncodings,
16384        max_decoding_message_size: Option<usize>,
16385        max_encoding_message_size: Option<usize>,
16386    }
16387    impl<T> TemplateServiceServer<T> {
16388        pub fn new(inner: T) -> Self {
16389            Self::from_arc(Arc::new(inner))
16390        }
16391        pub fn from_arc(inner: Arc<T>) -> Self {
16392            Self {
16393                inner,
16394                accept_compression_encodings: Default::default(),
16395                send_compression_encodings: Default::default(),
16396                max_decoding_message_size: None,
16397                max_encoding_message_size: None,
16398            }
16399        }
16400        pub fn with_interceptor<F>(
16401            inner: T,
16402            interceptor: F,
16403        ) -> InterceptedService<Self, F>
16404        where
16405            F: tonic::service::Interceptor,
16406        {
16407            InterceptedService::new(Self::new(inner), interceptor)
16408        }
16409        /// Enable decompressing requests with the given encoding.
16410        #[must_use]
16411        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16412            self.accept_compression_encodings.enable(encoding);
16413            self
16414        }
16415        /// Compress responses with the given encoding, if the client supports it.
16416        #[must_use]
16417        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16418            self.send_compression_encodings.enable(encoding);
16419            self
16420        }
16421        /// Limits the maximum size of a decoded message.
16422        ///
16423        /// Default: `4MB`
16424        #[must_use]
16425        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16426            self.max_decoding_message_size = Some(limit);
16427            self
16428        }
16429        /// Limits the maximum size of an encoded message.
16430        ///
16431        /// Default: `usize::MAX`
16432        #[must_use]
16433        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16434            self.max_encoding_message_size = Some(limit);
16435            self
16436        }
16437    }
16438    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
16439    where
16440        T: TemplateService,
16441        B: Body + std::marker::Send + 'static,
16442        B::Error: Into<StdError> + std::marker::Send + 'static,
16443    {
16444        type Response = http::Response<tonic::body::Body>;
16445        type Error = std::convert::Infallible;
16446        type Future = BoxFuture<Self::Response, Self::Error>;
16447        fn poll_ready(
16448            &mut self,
16449            _cx: &mut Context<'_>,
16450        ) -> Poll<std::result::Result<(), Self::Error>> {
16451            Poll::Ready(Ok(()))
16452        }
16453        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16454            match req.uri().path() {
16455                "/pidgr.v1.TemplateService/CreateTemplate" => {
16456                    #[allow(non_camel_case_types)]
16457                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
16458                    impl<
16459                        T: TemplateService,
16460                    > tonic::server::UnaryService<super::CreateTemplateRequest>
16461                    for CreateTemplateSvc<T> {
16462                        type Response = super::CreateTemplateResponse;
16463                        type Future = BoxFuture<
16464                            tonic::Response<Self::Response>,
16465                            tonic::Status,
16466                        >;
16467                        fn call(
16468                            &mut self,
16469                            request: tonic::Request<super::CreateTemplateRequest>,
16470                        ) -> Self::Future {
16471                            let inner = Arc::clone(&self.0);
16472                            let fut = async move {
16473                                <T as TemplateService>::create_template(&inner, request)
16474                                    .await
16475                            };
16476                            Box::pin(fut)
16477                        }
16478                    }
16479                    let accept_compression_encodings = self.accept_compression_encodings;
16480                    let send_compression_encodings = self.send_compression_encodings;
16481                    let max_decoding_message_size = self.max_decoding_message_size;
16482                    let max_encoding_message_size = self.max_encoding_message_size;
16483                    let inner = self.inner.clone();
16484                    let fut = async move {
16485                        let method = CreateTemplateSvc(inner);
16486                        let codec = tonic_prost::ProstCodec::default();
16487                        let mut grpc = tonic::server::Grpc::new(codec)
16488                            .apply_compression_config(
16489                                accept_compression_encodings,
16490                                send_compression_encodings,
16491                            )
16492                            .apply_max_message_size_config(
16493                                max_decoding_message_size,
16494                                max_encoding_message_size,
16495                            );
16496                        let res = grpc.unary(method, req).await;
16497                        Ok(res)
16498                    };
16499                    Box::pin(fut)
16500                }
16501                "/pidgr.v1.TemplateService/UpdateTemplate" => {
16502                    #[allow(non_camel_case_types)]
16503                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
16504                    impl<
16505                        T: TemplateService,
16506                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
16507                    for UpdateTemplateSvc<T> {
16508                        type Response = super::UpdateTemplateResponse;
16509                        type Future = BoxFuture<
16510                            tonic::Response<Self::Response>,
16511                            tonic::Status,
16512                        >;
16513                        fn call(
16514                            &mut self,
16515                            request: tonic::Request<super::UpdateTemplateRequest>,
16516                        ) -> Self::Future {
16517                            let inner = Arc::clone(&self.0);
16518                            let fut = async move {
16519                                <T as TemplateService>::update_template(&inner, request)
16520                                    .await
16521                            };
16522                            Box::pin(fut)
16523                        }
16524                    }
16525                    let accept_compression_encodings = self.accept_compression_encodings;
16526                    let send_compression_encodings = self.send_compression_encodings;
16527                    let max_decoding_message_size = self.max_decoding_message_size;
16528                    let max_encoding_message_size = self.max_encoding_message_size;
16529                    let inner = self.inner.clone();
16530                    let fut = async move {
16531                        let method = UpdateTemplateSvc(inner);
16532                        let codec = tonic_prost::ProstCodec::default();
16533                        let mut grpc = tonic::server::Grpc::new(codec)
16534                            .apply_compression_config(
16535                                accept_compression_encodings,
16536                                send_compression_encodings,
16537                            )
16538                            .apply_max_message_size_config(
16539                                max_decoding_message_size,
16540                                max_encoding_message_size,
16541                            );
16542                        let res = grpc.unary(method, req).await;
16543                        Ok(res)
16544                    };
16545                    Box::pin(fut)
16546                }
16547                "/pidgr.v1.TemplateService/GetTemplate" => {
16548                    #[allow(non_camel_case_types)]
16549                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16550                    impl<
16551                        T: TemplateService,
16552                    > tonic::server::UnaryService<super::GetTemplateRequest>
16553                    for GetTemplateSvc<T> {
16554                        type Response = super::GetTemplateResponse;
16555                        type Future = BoxFuture<
16556                            tonic::Response<Self::Response>,
16557                            tonic::Status,
16558                        >;
16559                        fn call(
16560                            &mut self,
16561                            request: tonic::Request<super::GetTemplateRequest>,
16562                        ) -> Self::Future {
16563                            let inner = Arc::clone(&self.0);
16564                            let fut = async move {
16565                                <T as TemplateService>::get_template(&inner, request).await
16566                            };
16567                            Box::pin(fut)
16568                        }
16569                    }
16570                    let accept_compression_encodings = self.accept_compression_encodings;
16571                    let send_compression_encodings = self.send_compression_encodings;
16572                    let max_decoding_message_size = self.max_decoding_message_size;
16573                    let max_encoding_message_size = self.max_encoding_message_size;
16574                    let inner = self.inner.clone();
16575                    let fut = async move {
16576                        let method = GetTemplateSvc(inner);
16577                        let codec = tonic_prost::ProstCodec::default();
16578                        let mut grpc = tonic::server::Grpc::new(codec)
16579                            .apply_compression_config(
16580                                accept_compression_encodings,
16581                                send_compression_encodings,
16582                            )
16583                            .apply_max_message_size_config(
16584                                max_decoding_message_size,
16585                                max_encoding_message_size,
16586                            );
16587                        let res = grpc.unary(method, req).await;
16588                        Ok(res)
16589                    };
16590                    Box::pin(fut)
16591                }
16592                "/pidgr.v1.TemplateService/ListTemplates" => {
16593                    #[allow(non_camel_case_types)]
16594                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16595                    impl<
16596                        T: TemplateService,
16597                    > tonic::server::UnaryService<super::ListTemplatesRequest>
16598                    for ListTemplatesSvc<T> {
16599                        type Response = super::ListTemplatesResponse;
16600                        type Future = BoxFuture<
16601                            tonic::Response<Self::Response>,
16602                            tonic::Status,
16603                        >;
16604                        fn call(
16605                            &mut self,
16606                            request: tonic::Request<super::ListTemplatesRequest>,
16607                        ) -> Self::Future {
16608                            let inner = Arc::clone(&self.0);
16609                            let fut = async move {
16610                                <T as TemplateService>::list_templates(&inner, request)
16611                                    .await
16612                            };
16613                            Box::pin(fut)
16614                        }
16615                    }
16616                    let accept_compression_encodings = self.accept_compression_encodings;
16617                    let send_compression_encodings = self.send_compression_encodings;
16618                    let max_decoding_message_size = self.max_decoding_message_size;
16619                    let max_encoding_message_size = self.max_encoding_message_size;
16620                    let inner = self.inner.clone();
16621                    let fut = async move {
16622                        let method = ListTemplatesSvc(inner);
16623                        let codec = tonic_prost::ProstCodec::default();
16624                        let mut grpc = tonic::server::Grpc::new(codec)
16625                            .apply_compression_config(
16626                                accept_compression_encodings,
16627                                send_compression_encodings,
16628                            )
16629                            .apply_max_message_size_config(
16630                                max_decoding_message_size,
16631                                max_encoding_message_size,
16632                            );
16633                        let res = grpc.unary(method, req).await;
16634                        Ok(res)
16635                    };
16636                    Box::pin(fut)
16637                }
16638                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16639                    #[allow(non_camel_case_types)]
16640                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16641                    impl<
16642                        T: TemplateService,
16643                    > tonic::server::UnaryService<
16644                        super::CreateTemplateTranslationRequest,
16645                    > for CreateTemplateTranslationSvc<T> {
16646                        type Response = super::CreateTemplateTranslationResponse;
16647                        type Future = BoxFuture<
16648                            tonic::Response<Self::Response>,
16649                            tonic::Status,
16650                        >;
16651                        fn call(
16652                            &mut self,
16653                            request: tonic::Request<
16654                                super::CreateTemplateTranslationRequest,
16655                            >,
16656                        ) -> Self::Future {
16657                            let inner = Arc::clone(&self.0);
16658                            let fut = async move {
16659                                <T as TemplateService>::create_template_translation(
16660                                        &inner,
16661                                        request,
16662                                    )
16663                                    .await
16664                            };
16665                            Box::pin(fut)
16666                        }
16667                    }
16668                    let accept_compression_encodings = self.accept_compression_encodings;
16669                    let send_compression_encodings = self.send_compression_encodings;
16670                    let max_decoding_message_size = self.max_decoding_message_size;
16671                    let max_encoding_message_size = self.max_encoding_message_size;
16672                    let inner = self.inner.clone();
16673                    let fut = async move {
16674                        let method = CreateTemplateTranslationSvc(inner);
16675                        let codec = tonic_prost::ProstCodec::default();
16676                        let mut grpc = tonic::server::Grpc::new(codec)
16677                            .apply_compression_config(
16678                                accept_compression_encodings,
16679                                send_compression_encodings,
16680                            )
16681                            .apply_max_message_size_config(
16682                                max_decoding_message_size,
16683                                max_encoding_message_size,
16684                            );
16685                        let res = grpc.unary(method, req).await;
16686                        Ok(res)
16687                    };
16688                    Box::pin(fut)
16689                }
16690                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16691                    #[allow(non_camel_case_types)]
16692                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16693                    impl<
16694                        T: TemplateService,
16695                    > tonic::server::UnaryService<
16696                        super::UpdateTemplateTranslationRequest,
16697                    > for UpdateTemplateTranslationSvc<T> {
16698                        type Response = super::UpdateTemplateTranslationResponse;
16699                        type Future = BoxFuture<
16700                            tonic::Response<Self::Response>,
16701                            tonic::Status,
16702                        >;
16703                        fn call(
16704                            &mut self,
16705                            request: tonic::Request<
16706                                super::UpdateTemplateTranslationRequest,
16707                            >,
16708                        ) -> Self::Future {
16709                            let inner = Arc::clone(&self.0);
16710                            let fut = async move {
16711                                <T as TemplateService>::update_template_translation(
16712                                        &inner,
16713                                        request,
16714                                    )
16715                                    .await
16716                            };
16717                            Box::pin(fut)
16718                        }
16719                    }
16720                    let accept_compression_encodings = self.accept_compression_encodings;
16721                    let send_compression_encodings = self.send_compression_encodings;
16722                    let max_decoding_message_size = self.max_decoding_message_size;
16723                    let max_encoding_message_size = self.max_encoding_message_size;
16724                    let inner = self.inner.clone();
16725                    let fut = async move {
16726                        let method = UpdateTemplateTranslationSvc(inner);
16727                        let codec = tonic_prost::ProstCodec::default();
16728                        let mut grpc = tonic::server::Grpc::new(codec)
16729                            .apply_compression_config(
16730                                accept_compression_encodings,
16731                                send_compression_encodings,
16732                            )
16733                            .apply_max_message_size_config(
16734                                max_decoding_message_size,
16735                                max_encoding_message_size,
16736                            );
16737                        let res = grpc.unary(method, req).await;
16738                        Ok(res)
16739                    };
16740                    Box::pin(fut)
16741                }
16742                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16743                    #[allow(non_camel_case_types)]
16744                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16745                    impl<
16746                        T: TemplateService,
16747                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16748                    for ListTemplateTranslationsSvc<T> {
16749                        type Response = super::ListTemplateTranslationsResponse;
16750                        type Future = BoxFuture<
16751                            tonic::Response<Self::Response>,
16752                            tonic::Status,
16753                        >;
16754                        fn call(
16755                            &mut self,
16756                            request: tonic::Request<
16757                                super::ListTemplateTranslationsRequest,
16758                            >,
16759                        ) -> Self::Future {
16760                            let inner = Arc::clone(&self.0);
16761                            let fut = async move {
16762                                <T as TemplateService>::list_template_translations(
16763                                        &inner,
16764                                        request,
16765                                    )
16766                                    .await
16767                            };
16768                            Box::pin(fut)
16769                        }
16770                    }
16771                    let accept_compression_encodings = self.accept_compression_encodings;
16772                    let send_compression_encodings = self.send_compression_encodings;
16773                    let max_decoding_message_size = self.max_decoding_message_size;
16774                    let max_encoding_message_size = self.max_encoding_message_size;
16775                    let inner = self.inner.clone();
16776                    let fut = async move {
16777                        let method = ListTemplateTranslationsSvc(inner);
16778                        let codec = tonic_prost::ProstCodec::default();
16779                        let mut grpc = tonic::server::Grpc::new(codec)
16780                            .apply_compression_config(
16781                                accept_compression_encodings,
16782                                send_compression_encodings,
16783                            )
16784                            .apply_max_message_size_config(
16785                                max_decoding_message_size,
16786                                max_encoding_message_size,
16787                            );
16788                        let res = grpc.unary(method, req).await;
16789                        Ok(res)
16790                    };
16791                    Box::pin(fut)
16792                }
16793                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16794                    #[allow(non_camel_case_types)]
16795                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16796                    impl<
16797                        T: TemplateService,
16798                    > tonic::server::UnaryService<
16799                        super::ApproveTemplateTranslationRequest,
16800                    > for ApproveTemplateTranslationSvc<T> {
16801                        type Response = super::ApproveTemplateTranslationResponse;
16802                        type Future = BoxFuture<
16803                            tonic::Response<Self::Response>,
16804                            tonic::Status,
16805                        >;
16806                        fn call(
16807                            &mut self,
16808                            request: tonic::Request<
16809                                super::ApproveTemplateTranslationRequest,
16810                            >,
16811                        ) -> Self::Future {
16812                            let inner = Arc::clone(&self.0);
16813                            let fut = async move {
16814                                <T as TemplateService>::approve_template_translation(
16815                                        &inner,
16816                                        request,
16817                                    )
16818                                    .await
16819                            };
16820                            Box::pin(fut)
16821                        }
16822                    }
16823                    let accept_compression_encodings = self.accept_compression_encodings;
16824                    let send_compression_encodings = self.send_compression_encodings;
16825                    let max_decoding_message_size = self.max_decoding_message_size;
16826                    let max_encoding_message_size = self.max_encoding_message_size;
16827                    let inner = self.inner.clone();
16828                    let fut = async move {
16829                        let method = ApproveTemplateTranslationSvc(inner);
16830                        let codec = tonic_prost::ProstCodec::default();
16831                        let mut grpc = tonic::server::Grpc::new(codec)
16832                            .apply_compression_config(
16833                                accept_compression_encodings,
16834                                send_compression_encodings,
16835                            )
16836                            .apply_max_message_size_config(
16837                                max_decoding_message_size,
16838                                max_encoding_message_size,
16839                            );
16840                        let res = grpc.unary(method, req).await;
16841                        Ok(res)
16842                    };
16843                    Box::pin(fut)
16844                }
16845                _ => {
16846                    Box::pin(async move {
16847                        let mut response = http::Response::new(
16848                            tonic::body::Body::default(),
16849                        );
16850                        let headers = response.headers_mut();
16851                        headers
16852                            .insert(
16853                                tonic::Status::GRPC_STATUS,
16854                                (tonic::Code::Unimplemented as i32).into(),
16855                            );
16856                        headers
16857                            .insert(
16858                                http::header::CONTENT_TYPE,
16859                                tonic::metadata::GRPC_CONTENT_TYPE,
16860                            );
16861                        Ok(response)
16862                    })
16863                }
16864            }
16865        }
16866    }
16867    impl<T> Clone for TemplateServiceServer<T> {
16868        fn clone(&self) -> Self {
16869            let inner = self.inner.clone();
16870            Self {
16871                inner,
16872                accept_compression_encodings: self.accept_compression_encodings,
16873                send_compression_encodings: self.send_compression_encodings,
16874                max_decoding_message_size: self.max_decoding_message_size,
16875                max_encoding_message_size: self.max_encoding_message_size,
16876            }
16877        }
16878    }
16879    /// Generated gRPC service name
16880    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16881    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16882        const NAME: &'static str = SERVICE_NAME;
16883    }
16884}
16885/// Generated client implementations.
16886pub mod token_service_client {
16887    #![allow(
16888        unused_variables,
16889        dead_code,
16890        missing_docs,
16891        clippy::wildcard_imports,
16892        clippy::let_unit_value,
16893    )]
16894    use tonic::codegen::*;
16895    use tonic::codegen::http::Uri;
16896    /** HMAC-signed deeplink-token signing and validation.
16897
16898 Deeplink tokens carry the (campaign, recipient, step) tuple that
16899 authorizes a third-party-channel deeplink
16900 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16901 pidgr-api with a per-org HMAC key managed by the platform's key store;
16902 rotation is automatic with a 7-day overlap window so callers do not
16903 have to coordinate.
16904*/
16905    #[derive(Debug, Clone)]
16906    pub struct TokenServiceClient<T> {
16907        inner: tonic::client::Grpc<T>,
16908    }
16909    impl TokenServiceClient<tonic::transport::Channel> {
16910        /// Attempt to create a new client by connecting to a given endpoint.
16911        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16912        where
16913            D: TryInto<tonic::transport::Endpoint>,
16914            D::Error: Into<StdError>,
16915        {
16916            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16917            Ok(Self::new(conn))
16918        }
16919    }
16920    impl<T> TokenServiceClient<T>
16921    where
16922        T: tonic::client::GrpcService<tonic::body::Body>,
16923        T::Error: Into<StdError>,
16924        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16925        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16926    {
16927        pub fn new(inner: T) -> Self {
16928            let inner = tonic::client::Grpc::new(inner);
16929            Self { inner }
16930        }
16931        pub fn with_origin(inner: T, origin: Uri) -> Self {
16932            let inner = tonic::client::Grpc::with_origin(inner, origin);
16933            Self { inner }
16934        }
16935        pub fn with_interceptor<F>(
16936            inner: T,
16937            interceptor: F,
16938        ) -> TokenServiceClient<InterceptedService<T, F>>
16939        where
16940            F: tonic::service::Interceptor,
16941            T::ResponseBody: Default,
16942            T: tonic::codegen::Service<
16943                http::Request<tonic::body::Body>,
16944                Response = http::Response<
16945                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16946                >,
16947            >,
16948            <T as tonic::codegen::Service<
16949                http::Request<tonic::body::Body>,
16950            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16951        {
16952            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
16953        }
16954        /// Compress requests with the given encoding.
16955        ///
16956        /// This requires the server to support it otherwise it might respond with an
16957        /// error.
16958        #[must_use]
16959        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16960            self.inner = self.inner.send_compressed(encoding);
16961            self
16962        }
16963        /// Enable decompressing responses.
16964        #[must_use]
16965        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16966            self.inner = self.inner.accept_compressed(encoding);
16967            self
16968        }
16969        /// Limits the maximum size of a decoded message.
16970        ///
16971        /// Default: `4MB`
16972        #[must_use]
16973        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16974            self.inner = self.inner.max_decoding_message_size(limit);
16975            self
16976        }
16977        /// Limits the maximum size of an encoded message.
16978        ///
16979        /// Default: `usize::MAX`
16980        #[must_use]
16981        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16982            self.inner = self.inner.max_encoding_message_size(limit);
16983            self
16984        }
16985        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16986 the dispatch layer assembling a deeplink during message
16987 composition).
16988*/
16989        pub async fn sign_deeplink_token(
16990            &mut self,
16991            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
16992        ) -> std::result::Result<
16993            tonic::Response<super::SignDeeplinkTokenResponse>,
16994            tonic::Status,
16995        > {
16996            self.inner
16997                .ready()
16998                .await
16999                .map_err(|e| {
17000                    tonic::Status::unknown(
17001                        format!("Service was not ready: {}", e.into()),
17002                    )
17003                })?;
17004            let codec = tonic_prost::ProstCodec::default();
17005            let path = http::uri::PathAndQuery::from_static(
17006                "/pidgr.v1.TokenService/SignDeeplinkToken",
17007            );
17008            let mut req = request.into_request();
17009            req.extensions_mut()
17010                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
17011            self.inner.unary(req, path, codec).await
17012        }
17013        /** Validate a deeplink token. Authorization: unauthenticated (caller
17014 is the native app validating before showing the auth gate). The
17015 token IS the lookup key; valid responses carry the decoded payload.
17016*/
17017        pub async fn validate_deeplink_token(
17018            &mut self,
17019            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
17020        ) -> std::result::Result<
17021            tonic::Response<super::ValidateDeeplinkTokenResponse>,
17022            tonic::Status,
17023        > {
17024            self.inner
17025                .ready()
17026                .await
17027                .map_err(|e| {
17028                    tonic::Status::unknown(
17029                        format!("Service was not ready: {}", e.into()),
17030                    )
17031                })?;
17032            let codec = tonic_prost::ProstCodec::default();
17033            let path = http::uri::PathAndQuery::from_static(
17034                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
17035            );
17036            let mut req = request.into_request();
17037            req.extensions_mut()
17038                .insert(
17039                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
17040                );
17041            self.inner.unary(req, path, codec).await
17042        }
17043    }
17044}
17045/// Generated server implementations.
17046pub mod token_service_server {
17047    #![allow(
17048        unused_variables,
17049        dead_code,
17050        missing_docs,
17051        clippy::wildcard_imports,
17052        clippy::let_unit_value,
17053    )]
17054    use tonic::codegen::*;
17055    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
17056    #[async_trait]
17057    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
17058        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
17059 the dispatch layer assembling a deeplink during message
17060 composition).
17061*/
17062        async fn sign_deeplink_token(
17063            &self,
17064            request: tonic::Request<super::SignDeeplinkTokenRequest>,
17065        ) -> std::result::Result<
17066            tonic::Response<super::SignDeeplinkTokenResponse>,
17067            tonic::Status,
17068        >;
17069        /** Validate a deeplink token. Authorization: unauthenticated (caller
17070 is the native app validating before showing the auth gate). The
17071 token IS the lookup key; valid responses carry the decoded payload.
17072*/
17073        async fn validate_deeplink_token(
17074            &self,
17075            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17076        ) -> std::result::Result<
17077            tonic::Response<super::ValidateDeeplinkTokenResponse>,
17078            tonic::Status,
17079        >;
17080    }
17081    /** HMAC-signed deeplink-token signing and validation.
17082
17083 Deeplink tokens carry the (campaign, recipient, step) tuple that
17084 authorizes a third-party-channel deeplink
17085 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
17086 pidgr-api with a per-org HMAC key managed by the platform's key store;
17087 rotation is automatic with a 7-day overlap window so callers do not
17088 have to coordinate.
17089*/
17090    #[derive(Debug)]
17091    pub struct TokenServiceServer<T> {
17092        inner: Arc<T>,
17093        accept_compression_encodings: EnabledCompressionEncodings,
17094        send_compression_encodings: EnabledCompressionEncodings,
17095        max_decoding_message_size: Option<usize>,
17096        max_encoding_message_size: Option<usize>,
17097    }
17098    impl<T> TokenServiceServer<T> {
17099        pub fn new(inner: T) -> Self {
17100            Self::from_arc(Arc::new(inner))
17101        }
17102        pub fn from_arc(inner: Arc<T>) -> Self {
17103            Self {
17104                inner,
17105                accept_compression_encodings: Default::default(),
17106                send_compression_encodings: Default::default(),
17107                max_decoding_message_size: None,
17108                max_encoding_message_size: None,
17109            }
17110        }
17111        pub fn with_interceptor<F>(
17112            inner: T,
17113            interceptor: F,
17114        ) -> InterceptedService<Self, F>
17115        where
17116            F: tonic::service::Interceptor,
17117        {
17118            InterceptedService::new(Self::new(inner), interceptor)
17119        }
17120        /// Enable decompressing requests with the given encoding.
17121        #[must_use]
17122        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17123            self.accept_compression_encodings.enable(encoding);
17124            self
17125        }
17126        /// Compress responses with the given encoding, if the client supports it.
17127        #[must_use]
17128        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17129            self.send_compression_encodings.enable(encoding);
17130            self
17131        }
17132        /// Limits the maximum size of a decoded message.
17133        ///
17134        /// Default: `4MB`
17135        #[must_use]
17136        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17137            self.max_decoding_message_size = Some(limit);
17138            self
17139        }
17140        /// Limits the maximum size of an encoded message.
17141        ///
17142        /// Default: `usize::MAX`
17143        #[must_use]
17144        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17145            self.max_encoding_message_size = Some(limit);
17146            self
17147        }
17148    }
17149    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
17150    where
17151        T: TokenService,
17152        B: Body + std::marker::Send + 'static,
17153        B::Error: Into<StdError> + std::marker::Send + 'static,
17154    {
17155        type Response = http::Response<tonic::body::Body>;
17156        type Error = std::convert::Infallible;
17157        type Future = BoxFuture<Self::Response, Self::Error>;
17158        fn poll_ready(
17159            &mut self,
17160            _cx: &mut Context<'_>,
17161        ) -> Poll<std::result::Result<(), Self::Error>> {
17162            Poll::Ready(Ok(()))
17163        }
17164        fn call(&mut self, req: http::Request<B>) -> Self::Future {
17165            match req.uri().path() {
17166                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
17167                    #[allow(non_camel_case_types)]
17168                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17169                    impl<
17170                        T: TokenService,
17171                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
17172                    for SignDeeplinkTokenSvc<T> {
17173                        type Response = super::SignDeeplinkTokenResponse;
17174                        type Future = BoxFuture<
17175                            tonic::Response<Self::Response>,
17176                            tonic::Status,
17177                        >;
17178                        fn call(
17179                            &mut self,
17180                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
17181                        ) -> Self::Future {
17182                            let inner = Arc::clone(&self.0);
17183                            let fut = async move {
17184                                <T as TokenService>::sign_deeplink_token(&inner, request)
17185                                    .await
17186                            };
17187                            Box::pin(fut)
17188                        }
17189                    }
17190                    let accept_compression_encodings = self.accept_compression_encodings;
17191                    let send_compression_encodings = self.send_compression_encodings;
17192                    let max_decoding_message_size = self.max_decoding_message_size;
17193                    let max_encoding_message_size = self.max_encoding_message_size;
17194                    let inner = self.inner.clone();
17195                    let fut = async move {
17196                        let method = SignDeeplinkTokenSvc(inner);
17197                        let codec = tonic_prost::ProstCodec::default();
17198                        let mut grpc = tonic::server::Grpc::new(codec)
17199                            .apply_compression_config(
17200                                accept_compression_encodings,
17201                                send_compression_encodings,
17202                            )
17203                            .apply_max_message_size_config(
17204                                max_decoding_message_size,
17205                                max_encoding_message_size,
17206                            );
17207                        let res = grpc.unary(method, req).await;
17208                        Ok(res)
17209                    };
17210                    Box::pin(fut)
17211                }
17212                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
17213                    #[allow(non_camel_case_types)]
17214                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17215                    impl<
17216                        T: TokenService,
17217                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
17218                    for ValidateDeeplinkTokenSvc<T> {
17219                        type Response = super::ValidateDeeplinkTokenResponse;
17220                        type Future = BoxFuture<
17221                            tonic::Response<Self::Response>,
17222                            tonic::Status,
17223                        >;
17224                        fn call(
17225                            &mut self,
17226                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17227                        ) -> Self::Future {
17228                            let inner = Arc::clone(&self.0);
17229                            let fut = async move {
17230                                <T as TokenService>::validate_deeplink_token(
17231                                        &inner,
17232                                        request,
17233                                    )
17234                                    .await
17235                            };
17236                            Box::pin(fut)
17237                        }
17238                    }
17239                    let accept_compression_encodings = self.accept_compression_encodings;
17240                    let send_compression_encodings = self.send_compression_encodings;
17241                    let max_decoding_message_size = self.max_decoding_message_size;
17242                    let max_encoding_message_size = self.max_encoding_message_size;
17243                    let inner = self.inner.clone();
17244                    let fut = async move {
17245                        let method = ValidateDeeplinkTokenSvc(inner);
17246                        let codec = tonic_prost::ProstCodec::default();
17247                        let mut grpc = tonic::server::Grpc::new(codec)
17248                            .apply_compression_config(
17249                                accept_compression_encodings,
17250                                send_compression_encodings,
17251                            )
17252                            .apply_max_message_size_config(
17253                                max_decoding_message_size,
17254                                max_encoding_message_size,
17255                            );
17256                        let res = grpc.unary(method, req).await;
17257                        Ok(res)
17258                    };
17259                    Box::pin(fut)
17260                }
17261                _ => {
17262                    Box::pin(async move {
17263                        let mut response = http::Response::new(
17264                            tonic::body::Body::default(),
17265                        );
17266                        let headers = response.headers_mut();
17267                        headers
17268                            .insert(
17269                                tonic::Status::GRPC_STATUS,
17270                                (tonic::Code::Unimplemented as i32).into(),
17271                            );
17272                        headers
17273                            .insert(
17274                                http::header::CONTENT_TYPE,
17275                                tonic::metadata::GRPC_CONTENT_TYPE,
17276                            );
17277                        Ok(response)
17278                    })
17279                }
17280            }
17281        }
17282    }
17283    impl<T> Clone for TokenServiceServer<T> {
17284        fn clone(&self) -> Self {
17285            let inner = self.inner.clone();
17286            Self {
17287                inner,
17288                accept_compression_encodings: self.accept_compression_encodings,
17289                send_compression_encodings: self.send_compression_encodings,
17290                max_decoding_message_size: self.max_decoding_message_size,
17291                max_encoding_message_size: self.max_encoding_message_size,
17292            }
17293        }
17294    }
17295    /// Generated gRPC service name
17296    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
17297    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
17298        const NAME: &'static str = SERVICE_NAME;
17299    }
17300}