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_ORG_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_ORG_WRITE.
7449*/
7450        pub async fn trigger_archetype_clustering(
7451            &mut self,
7452            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7453        ) -> std::result::Result<
7454            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7455            tonic::Status,
7456        > {
7457            self.inner
7458                .ready()
7459                .await
7460                .map_err(|e| {
7461                    tonic::Status::unknown(
7462                        format!("Service was not ready: {}", e.into()),
7463                    )
7464                })?;
7465            let codec = tonic_prost::ProstCodec::default();
7466            let path = http::uri::PathAndQuery::from_static(
7467                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7468            );
7469            let mut req = request.into_request();
7470            req.extensions_mut()
7471                .insert(
7472                    GrpcMethod::new(
7473                        "pidgr.v1.InsightsService",
7474                        "TriggerArchetypeClustering",
7475                    ),
7476                );
7477            self.inner.unary(req, path, codec).await
7478        }
7479        /** Draft a campaign body for the given archetype using Bedrock with the
7480 campaign-for-archetype prompt template. Used by the Compass
7481 "Target this archetype" CTA to pre-fill the wizard's body field.
7482 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7483 returns NOT_FOUND.
7484 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7485*/
7486        pub async fn generate_campaign_body_draft(
7487            &mut self,
7488            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7489        ) -> std::result::Result<
7490            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7491            tonic::Status,
7492        > {
7493            self.inner
7494                .ready()
7495                .await
7496                .map_err(|e| {
7497                    tonic::Status::unknown(
7498                        format!("Service was not ready: {}", e.into()),
7499                    )
7500                })?;
7501            let codec = tonic_prost::ProstCodec::default();
7502            let path = http::uri::PathAndQuery::from_static(
7503                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7504            );
7505            let mut req = request.into_request();
7506            req.extensions_mut()
7507                .insert(
7508                    GrpcMethod::new(
7509                        "pidgr.v1.InsightsService",
7510                        "GenerateCampaignBodyDraft",
7511                    ),
7512                );
7513            self.inner.unary(req, path, codec).await
7514        }
7515        /** Organization-wide communication profile: which kinds of messages the
7516 organization sends, and how much messaging lands on one person.
7517 Requires no configuration by the organization.
7518 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7519*/
7520        pub async fn get_org_communication_profile(
7521            &mut self,
7522            request: impl tonic::IntoRequest<super::GetOrgCommunicationProfileRequest>,
7523        ) -> std::result::Result<
7524            tonic::Response<super::GetOrgCommunicationProfileResponse>,
7525            tonic::Status,
7526        > {
7527            self.inner
7528                .ready()
7529                .await
7530                .map_err(|e| {
7531                    tonic::Status::unknown(
7532                        format!("Service was not ready: {}", e.into()),
7533                    )
7534                })?;
7535            let codec = tonic_prost::ProstCodec::default();
7536            let path = http::uri::PathAndQuery::from_static(
7537                "/pidgr.v1.InsightsService/GetOrgCommunicationProfile",
7538            );
7539            let mut req = request.into_request();
7540            req.extensions_mut()
7541                .insert(
7542                    GrpcMethod::new(
7543                        "pidgr.v1.InsightsService",
7544                        "GetOrgCommunicationProfile",
7545                    ),
7546                );
7547            self.inner.unary(req, path, codec).await
7548        }
7549        /** Retrieve a stored diagnosis of the organization's measurement
7550 system: the most recent run, or a specific earlier one. Findings
7551 are advisory and always cite the records behind them; nothing here
7552 scores the organization or blocks anything it does.
7553 Authorization: Requires PERMISSION_ORG_READ.
7554*/
7555        pub async fn get_org_diagnosis(
7556            &mut self,
7557            request: impl tonic::IntoRequest<super::GetOrgDiagnosisRequest>,
7558        ) -> std::result::Result<
7559            tonic::Response<super::GetOrgDiagnosisResponse>,
7560            tonic::Status,
7561        > {
7562            self.inner
7563                .ready()
7564                .await
7565                .map_err(|e| {
7566                    tonic::Status::unknown(
7567                        format!("Service was not ready: {}", e.into()),
7568                    )
7569                })?;
7570            let codec = tonic_prost::ProstCodec::default();
7571            let path = http::uri::PathAndQuery::from_static(
7572                "/pidgr.v1.InsightsService/GetOrgDiagnosis",
7573            );
7574            let mut req = request.into_request();
7575            req.extensions_mut()
7576                .insert(GrpcMethod::new("pidgr.v1.InsightsService", "GetOrgDiagnosis"));
7577            self.inner.unary(req, path, codec).await
7578        }
7579        /** List the organization's diagnoses, newest first, each with the
7580 metrics snapshot taken when it ran.
7581 Authorization: Requires PERMISSION_ORG_READ.
7582*/
7583        pub async fn list_org_diagnoses(
7584            &mut self,
7585            request: impl tonic::IntoRequest<super::ListOrgDiagnosesRequest>,
7586        ) -> std::result::Result<
7587            tonic::Response<super::ListOrgDiagnosesResponse>,
7588            tonic::Status,
7589        > {
7590            self.inner
7591                .ready()
7592                .await
7593                .map_err(|e| {
7594                    tonic::Status::unknown(
7595                        format!("Service was not ready: {}", e.into()),
7596                    )
7597                })?;
7598            let codec = tonic_prost::ProstCodec::default();
7599            let path = http::uri::PathAndQuery::from_static(
7600                "/pidgr.v1.InsightsService/ListOrgDiagnoses",
7601            );
7602            let mut req = request.into_request();
7603            req.extensions_mut()
7604                .insert(GrpcMethod::new("pidgr.v1.InsightsService", "ListOrgDiagnoses"));
7605            self.inner.unary(req, path, codec).await
7606        }
7607        /** Run a diagnosis now instead of waiting for the next scheduled one.
7608 Rate-limited per month with the remaining allowance returned on
7609 every call; exhausting it returns RESOURCE_EXHAUSTED. Returns
7610 FAILED_PRECONDITION for an organization with no declared
7611 objectives, since a run would have nothing to read and an empty
7612 diagnosis says something the data does not support.
7613
7614 The permission is the organization one rather than the campaign
7615 one: this reads the whole declared set and the whole history, which
7616 is a different thing to be trusted with than operating one
7617 campaign.
7618 Authorization: Requires PERMISSION_ORG_WRITE.
7619*/
7620        pub async fn trigger_org_diagnosis(
7621            &mut self,
7622            request: impl tonic::IntoRequest<super::TriggerOrgDiagnosisRequest>,
7623        ) -> std::result::Result<
7624            tonic::Response<super::TriggerOrgDiagnosisResponse>,
7625            tonic::Status,
7626        > {
7627            self.inner
7628                .ready()
7629                .await
7630                .map_err(|e| {
7631                    tonic::Status::unknown(
7632                        format!("Service was not ready: {}", e.into()),
7633                    )
7634                })?;
7635            let codec = tonic_prost::ProstCodec::default();
7636            let path = http::uri::PathAndQuery::from_static(
7637                "/pidgr.v1.InsightsService/TriggerOrgDiagnosis",
7638            );
7639            let mut req = request.into_request();
7640            req.extensions_mut()
7641                .insert(
7642                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerOrgDiagnosis"),
7643                );
7644            self.inner.unary(req, path, codec).await
7645        }
7646    }
7647}
7648/// Generated server implementations.
7649pub mod insights_service_server {
7650    #![allow(
7651        unused_variables,
7652        dead_code,
7653        missing_docs,
7654        clippy::wildcard_imports,
7655        clippy::let_unit_value,
7656    )]
7657    use tonic::codegen::*;
7658    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7659    #[async_trait]
7660    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7661        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7662 Returns empty archetypes if insufficient data (cold start).
7663 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7664*/
7665        async fn get_group_archetypes(
7666            &self,
7667            request: tonic::Request<super::GetGroupArchetypesRequest>,
7668        ) -> std::result::Result<
7669            tonic::Response<super::GetGroupArchetypesResponse>,
7670            tonic::Status,
7671        >;
7672        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7673 Returns a confidence interval that narrows as more campaign data accumulates.
7674 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7675*/
7676        async fn predict_campaign_ack(
7677            &self,
7678            request: tonic::Request<super::PredictCampaignAckRequest>,
7679        ) -> std::result::Result<
7680            tonic::Response<super::PredictCampaignAckResponse>,
7681            tonic::Status,
7682        >;
7683        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7684 Advisory is informational only — never drives automated decisions.
7685 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7686*/
7687        async fn get_campaign_advisory(
7688            &self,
7689            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7690        ) -> std::result::Result<
7691            tonic::Response<super::GetCampaignAdvisoryResponse>,
7692            tonic::Status,
7693        >;
7694        /** Generate an AI-powered narrative summary of a group's insights.
7695 Combines archetype, prediction, and campaign data into human-readable analysis.
7696 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7697*/
7698        async fn get_insight_narrative(
7699            &self,
7700            request: tonic::Request<super::GetInsightNarrativeRequest>,
7701        ) -> std::result::Result<
7702            tonic::Response<super::GetInsightNarrativeResponse>,
7703            tonic::Status,
7704        >;
7705        /** Manually trigger the ML training pipeline for the caller's organization.
7706 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7707 Authorization: Requires PERMISSION_ORG_WRITE.
7708*/
7709        async fn trigger_ml_pipeline(
7710            &self,
7711            request: tonic::Request<super::TriggerMlPipelineRequest>,
7712        ) -> std::result::Result<
7713            tonic::Response<super::TriggerMlPipelineResponse>,
7714            tonic::Status,
7715        >;
7716        /** Manually retrigger archetype clustering for a single group, reusing
7717 the already-deployed SageMaker clustering model. Cheaper than a
7718 full TriggerMLPipeline run because no training happens. Shares the
7719 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7720 get N manual retrains per month across both RPCs.
7721 Authorization: Requires PERMISSION_ORG_WRITE.
7722*/
7723        async fn trigger_archetype_clustering(
7724            &self,
7725            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7726        ) -> std::result::Result<
7727            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7728            tonic::Status,
7729        >;
7730        /** Draft a campaign body for the given archetype using Bedrock with the
7731 campaign-for-archetype prompt template. Used by the Compass
7732 "Target this archetype" CTA to pre-fill the wizard's body field.
7733 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7734 returns NOT_FOUND.
7735 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7736*/
7737        async fn generate_campaign_body_draft(
7738            &self,
7739            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7740        ) -> std::result::Result<
7741            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7742            tonic::Status,
7743        >;
7744        /** Organization-wide communication profile: which kinds of messages the
7745 organization sends, and how much messaging lands on one person.
7746 Requires no configuration by the organization.
7747 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7748*/
7749        async fn get_org_communication_profile(
7750            &self,
7751            request: tonic::Request<super::GetOrgCommunicationProfileRequest>,
7752        ) -> std::result::Result<
7753            tonic::Response<super::GetOrgCommunicationProfileResponse>,
7754            tonic::Status,
7755        >;
7756        /** Retrieve a stored diagnosis of the organization's measurement
7757 system: the most recent run, or a specific earlier one. Findings
7758 are advisory and always cite the records behind them; nothing here
7759 scores the organization or blocks anything it does.
7760 Authorization: Requires PERMISSION_ORG_READ.
7761*/
7762        async fn get_org_diagnosis(
7763            &self,
7764            request: tonic::Request<super::GetOrgDiagnosisRequest>,
7765        ) -> std::result::Result<
7766            tonic::Response<super::GetOrgDiagnosisResponse>,
7767            tonic::Status,
7768        >;
7769        /** List the organization's diagnoses, newest first, each with the
7770 metrics snapshot taken when it ran.
7771 Authorization: Requires PERMISSION_ORG_READ.
7772*/
7773        async fn list_org_diagnoses(
7774            &self,
7775            request: tonic::Request<super::ListOrgDiagnosesRequest>,
7776        ) -> std::result::Result<
7777            tonic::Response<super::ListOrgDiagnosesResponse>,
7778            tonic::Status,
7779        >;
7780        /** Run a diagnosis now instead of waiting for the next scheduled one.
7781 Rate-limited per month with the remaining allowance returned on
7782 every call; exhausting it returns RESOURCE_EXHAUSTED. Returns
7783 FAILED_PRECONDITION for an organization with no declared
7784 objectives, since a run would have nothing to read and an empty
7785 diagnosis says something the data does not support.
7786
7787 The permission is the organization one rather than the campaign
7788 one: this reads the whole declared set and the whole history, which
7789 is a different thing to be trusted with than operating one
7790 campaign.
7791 Authorization: Requires PERMISSION_ORG_WRITE.
7792*/
7793        async fn trigger_org_diagnosis(
7794            &self,
7795            request: tonic::Request<super::TriggerOrgDiagnosisRequest>,
7796        ) -> std::result::Result<
7797            tonic::Response<super::TriggerOrgDiagnosisResponse>,
7798            tonic::Status,
7799        >;
7800    }
7801    /** Provides cohort-level AI insights for campaign planning and optimization.
7802 All predictions are aggregate — no individual-level profiling.
7803 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7804 All RPCs operate within the caller's org (extracted from JWT).
7805*/
7806    #[derive(Debug)]
7807    pub struct InsightsServiceServer<T> {
7808        inner: Arc<T>,
7809        accept_compression_encodings: EnabledCompressionEncodings,
7810        send_compression_encodings: EnabledCompressionEncodings,
7811        max_decoding_message_size: Option<usize>,
7812        max_encoding_message_size: Option<usize>,
7813    }
7814    impl<T> InsightsServiceServer<T> {
7815        pub fn new(inner: T) -> Self {
7816            Self::from_arc(Arc::new(inner))
7817        }
7818        pub fn from_arc(inner: Arc<T>) -> Self {
7819            Self {
7820                inner,
7821                accept_compression_encodings: Default::default(),
7822                send_compression_encodings: Default::default(),
7823                max_decoding_message_size: None,
7824                max_encoding_message_size: None,
7825            }
7826        }
7827        pub fn with_interceptor<F>(
7828            inner: T,
7829            interceptor: F,
7830        ) -> InterceptedService<Self, F>
7831        where
7832            F: tonic::service::Interceptor,
7833        {
7834            InterceptedService::new(Self::new(inner), interceptor)
7835        }
7836        /// Enable decompressing requests with the given encoding.
7837        #[must_use]
7838        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7839            self.accept_compression_encodings.enable(encoding);
7840            self
7841        }
7842        /// Compress responses with the given encoding, if the client supports it.
7843        #[must_use]
7844        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7845            self.send_compression_encodings.enable(encoding);
7846            self
7847        }
7848        /// Limits the maximum size of a decoded message.
7849        ///
7850        /// Default: `4MB`
7851        #[must_use]
7852        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7853            self.max_decoding_message_size = Some(limit);
7854            self
7855        }
7856        /// Limits the maximum size of an encoded message.
7857        ///
7858        /// Default: `usize::MAX`
7859        #[must_use]
7860        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7861            self.max_encoding_message_size = Some(limit);
7862            self
7863        }
7864    }
7865    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7866    where
7867        T: InsightsService,
7868        B: Body + std::marker::Send + 'static,
7869        B::Error: Into<StdError> + std::marker::Send + 'static,
7870    {
7871        type Response = http::Response<tonic::body::Body>;
7872        type Error = std::convert::Infallible;
7873        type Future = BoxFuture<Self::Response, Self::Error>;
7874        fn poll_ready(
7875            &mut self,
7876            _cx: &mut Context<'_>,
7877        ) -> Poll<std::result::Result<(), Self::Error>> {
7878            Poll::Ready(Ok(()))
7879        }
7880        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7881            match req.uri().path() {
7882                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7883                    #[allow(non_camel_case_types)]
7884                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7885                    impl<
7886                        T: InsightsService,
7887                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7888                    for GetGroupArchetypesSvc<T> {
7889                        type Response = super::GetGroupArchetypesResponse;
7890                        type Future = BoxFuture<
7891                            tonic::Response<Self::Response>,
7892                            tonic::Status,
7893                        >;
7894                        fn call(
7895                            &mut self,
7896                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7897                        ) -> Self::Future {
7898                            let inner = Arc::clone(&self.0);
7899                            let fut = async move {
7900                                <T as InsightsService>::get_group_archetypes(
7901                                        &inner,
7902                                        request,
7903                                    )
7904                                    .await
7905                            };
7906                            Box::pin(fut)
7907                        }
7908                    }
7909                    let accept_compression_encodings = self.accept_compression_encodings;
7910                    let send_compression_encodings = self.send_compression_encodings;
7911                    let max_decoding_message_size = self.max_decoding_message_size;
7912                    let max_encoding_message_size = self.max_encoding_message_size;
7913                    let inner = self.inner.clone();
7914                    let fut = async move {
7915                        let method = GetGroupArchetypesSvc(inner);
7916                        let codec = tonic_prost::ProstCodec::default();
7917                        let mut grpc = tonic::server::Grpc::new(codec)
7918                            .apply_compression_config(
7919                                accept_compression_encodings,
7920                                send_compression_encodings,
7921                            )
7922                            .apply_max_message_size_config(
7923                                max_decoding_message_size,
7924                                max_encoding_message_size,
7925                            );
7926                        let res = grpc.unary(method, req).await;
7927                        Ok(res)
7928                    };
7929                    Box::pin(fut)
7930                }
7931                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7932                    #[allow(non_camel_case_types)]
7933                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7934                    impl<
7935                        T: InsightsService,
7936                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7937                    for PredictCampaignACKSvc<T> {
7938                        type Response = super::PredictCampaignAckResponse;
7939                        type Future = BoxFuture<
7940                            tonic::Response<Self::Response>,
7941                            tonic::Status,
7942                        >;
7943                        fn call(
7944                            &mut self,
7945                            request: tonic::Request<super::PredictCampaignAckRequest>,
7946                        ) -> Self::Future {
7947                            let inner = Arc::clone(&self.0);
7948                            let fut = async move {
7949                                <T as InsightsService>::predict_campaign_ack(
7950                                        &inner,
7951                                        request,
7952                                    )
7953                                    .await
7954                            };
7955                            Box::pin(fut)
7956                        }
7957                    }
7958                    let accept_compression_encodings = self.accept_compression_encodings;
7959                    let send_compression_encodings = self.send_compression_encodings;
7960                    let max_decoding_message_size = self.max_decoding_message_size;
7961                    let max_encoding_message_size = self.max_encoding_message_size;
7962                    let inner = self.inner.clone();
7963                    let fut = async move {
7964                        let method = PredictCampaignACKSvc(inner);
7965                        let codec = tonic_prost::ProstCodec::default();
7966                        let mut grpc = tonic::server::Grpc::new(codec)
7967                            .apply_compression_config(
7968                                accept_compression_encodings,
7969                                send_compression_encodings,
7970                            )
7971                            .apply_max_message_size_config(
7972                                max_decoding_message_size,
7973                                max_encoding_message_size,
7974                            );
7975                        let res = grpc.unary(method, req).await;
7976                        Ok(res)
7977                    };
7978                    Box::pin(fut)
7979                }
7980                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7981                    #[allow(non_camel_case_types)]
7982                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7983                    impl<
7984                        T: InsightsService,
7985                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7986                    for GetCampaignAdvisorySvc<T> {
7987                        type Response = super::GetCampaignAdvisoryResponse;
7988                        type Future = BoxFuture<
7989                            tonic::Response<Self::Response>,
7990                            tonic::Status,
7991                        >;
7992                        fn call(
7993                            &mut self,
7994                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7995                        ) -> Self::Future {
7996                            let inner = Arc::clone(&self.0);
7997                            let fut = async move {
7998                                <T as InsightsService>::get_campaign_advisory(
7999                                        &inner,
8000                                        request,
8001                                    )
8002                                    .await
8003                            };
8004                            Box::pin(fut)
8005                        }
8006                    }
8007                    let accept_compression_encodings = self.accept_compression_encodings;
8008                    let send_compression_encodings = self.send_compression_encodings;
8009                    let max_decoding_message_size = self.max_decoding_message_size;
8010                    let max_encoding_message_size = self.max_encoding_message_size;
8011                    let inner = self.inner.clone();
8012                    let fut = async move {
8013                        let method = GetCampaignAdvisorySvc(inner);
8014                        let codec = tonic_prost::ProstCodec::default();
8015                        let mut grpc = tonic::server::Grpc::new(codec)
8016                            .apply_compression_config(
8017                                accept_compression_encodings,
8018                                send_compression_encodings,
8019                            )
8020                            .apply_max_message_size_config(
8021                                max_decoding_message_size,
8022                                max_encoding_message_size,
8023                            );
8024                        let res = grpc.unary(method, req).await;
8025                        Ok(res)
8026                    };
8027                    Box::pin(fut)
8028                }
8029                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
8030                    #[allow(non_camel_case_types)]
8031                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
8032                    impl<
8033                        T: InsightsService,
8034                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
8035                    for GetInsightNarrativeSvc<T> {
8036                        type Response = super::GetInsightNarrativeResponse;
8037                        type Future = BoxFuture<
8038                            tonic::Response<Self::Response>,
8039                            tonic::Status,
8040                        >;
8041                        fn call(
8042                            &mut self,
8043                            request: tonic::Request<super::GetInsightNarrativeRequest>,
8044                        ) -> Self::Future {
8045                            let inner = Arc::clone(&self.0);
8046                            let fut = async move {
8047                                <T as InsightsService>::get_insight_narrative(
8048                                        &inner,
8049                                        request,
8050                                    )
8051                                    .await
8052                            };
8053                            Box::pin(fut)
8054                        }
8055                    }
8056                    let accept_compression_encodings = self.accept_compression_encodings;
8057                    let send_compression_encodings = self.send_compression_encodings;
8058                    let max_decoding_message_size = self.max_decoding_message_size;
8059                    let max_encoding_message_size = self.max_encoding_message_size;
8060                    let inner = self.inner.clone();
8061                    let fut = async move {
8062                        let method = GetInsightNarrativeSvc(inner);
8063                        let codec = tonic_prost::ProstCodec::default();
8064                        let mut grpc = tonic::server::Grpc::new(codec)
8065                            .apply_compression_config(
8066                                accept_compression_encodings,
8067                                send_compression_encodings,
8068                            )
8069                            .apply_max_message_size_config(
8070                                max_decoding_message_size,
8071                                max_encoding_message_size,
8072                            );
8073                        let res = grpc.unary(method, req).await;
8074                        Ok(res)
8075                    };
8076                    Box::pin(fut)
8077                }
8078                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
8079                    #[allow(non_camel_case_types)]
8080                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
8081                    impl<
8082                        T: InsightsService,
8083                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
8084                    for TriggerMLPipelineSvc<T> {
8085                        type Response = super::TriggerMlPipelineResponse;
8086                        type Future = BoxFuture<
8087                            tonic::Response<Self::Response>,
8088                            tonic::Status,
8089                        >;
8090                        fn call(
8091                            &mut self,
8092                            request: tonic::Request<super::TriggerMlPipelineRequest>,
8093                        ) -> Self::Future {
8094                            let inner = Arc::clone(&self.0);
8095                            let fut = async move {
8096                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
8097                                    .await
8098                            };
8099                            Box::pin(fut)
8100                        }
8101                    }
8102                    let accept_compression_encodings = self.accept_compression_encodings;
8103                    let send_compression_encodings = self.send_compression_encodings;
8104                    let max_decoding_message_size = self.max_decoding_message_size;
8105                    let max_encoding_message_size = self.max_encoding_message_size;
8106                    let inner = self.inner.clone();
8107                    let fut = async move {
8108                        let method = TriggerMLPipelineSvc(inner);
8109                        let codec = tonic_prost::ProstCodec::default();
8110                        let mut grpc = tonic::server::Grpc::new(codec)
8111                            .apply_compression_config(
8112                                accept_compression_encodings,
8113                                send_compression_encodings,
8114                            )
8115                            .apply_max_message_size_config(
8116                                max_decoding_message_size,
8117                                max_encoding_message_size,
8118                            );
8119                        let res = grpc.unary(method, req).await;
8120                        Ok(res)
8121                    };
8122                    Box::pin(fut)
8123                }
8124                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
8125                    #[allow(non_camel_case_types)]
8126                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
8127                    impl<
8128                        T: InsightsService,
8129                    > tonic::server::UnaryService<
8130                        super::TriggerArchetypeClusteringRequest,
8131                    > for TriggerArchetypeClusteringSvc<T> {
8132                        type Response = super::TriggerArchetypeClusteringResponse;
8133                        type Future = BoxFuture<
8134                            tonic::Response<Self::Response>,
8135                            tonic::Status,
8136                        >;
8137                        fn call(
8138                            &mut self,
8139                            request: tonic::Request<
8140                                super::TriggerArchetypeClusteringRequest,
8141                            >,
8142                        ) -> Self::Future {
8143                            let inner = Arc::clone(&self.0);
8144                            let fut = async move {
8145                                <T as InsightsService>::trigger_archetype_clustering(
8146                                        &inner,
8147                                        request,
8148                                    )
8149                                    .await
8150                            };
8151                            Box::pin(fut)
8152                        }
8153                    }
8154                    let accept_compression_encodings = self.accept_compression_encodings;
8155                    let send_compression_encodings = self.send_compression_encodings;
8156                    let max_decoding_message_size = self.max_decoding_message_size;
8157                    let max_encoding_message_size = self.max_encoding_message_size;
8158                    let inner = self.inner.clone();
8159                    let fut = async move {
8160                        let method = TriggerArchetypeClusteringSvc(inner);
8161                        let codec = tonic_prost::ProstCodec::default();
8162                        let mut grpc = tonic::server::Grpc::new(codec)
8163                            .apply_compression_config(
8164                                accept_compression_encodings,
8165                                send_compression_encodings,
8166                            )
8167                            .apply_max_message_size_config(
8168                                max_decoding_message_size,
8169                                max_encoding_message_size,
8170                            );
8171                        let res = grpc.unary(method, req).await;
8172                        Ok(res)
8173                    };
8174                    Box::pin(fut)
8175                }
8176                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
8177                    #[allow(non_camel_case_types)]
8178                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
8179                    impl<
8180                        T: InsightsService,
8181                    > tonic::server::UnaryService<
8182                        super::GenerateCampaignBodyDraftRequest,
8183                    > for GenerateCampaignBodyDraftSvc<T> {
8184                        type Response = super::GenerateCampaignBodyDraftResponse;
8185                        type Future = BoxFuture<
8186                            tonic::Response<Self::Response>,
8187                            tonic::Status,
8188                        >;
8189                        fn call(
8190                            &mut self,
8191                            request: tonic::Request<
8192                                super::GenerateCampaignBodyDraftRequest,
8193                            >,
8194                        ) -> Self::Future {
8195                            let inner = Arc::clone(&self.0);
8196                            let fut = async move {
8197                                <T as InsightsService>::generate_campaign_body_draft(
8198                                        &inner,
8199                                        request,
8200                                    )
8201                                    .await
8202                            };
8203                            Box::pin(fut)
8204                        }
8205                    }
8206                    let accept_compression_encodings = self.accept_compression_encodings;
8207                    let send_compression_encodings = self.send_compression_encodings;
8208                    let max_decoding_message_size = self.max_decoding_message_size;
8209                    let max_encoding_message_size = self.max_encoding_message_size;
8210                    let inner = self.inner.clone();
8211                    let fut = async move {
8212                        let method = GenerateCampaignBodyDraftSvc(inner);
8213                        let codec = tonic_prost::ProstCodec::default();
8214                        let mut grpc = tonic::server::Grpc::new(codec)
8215                            .apply_compression_config(
8216                                accept_compression_encodings,
8217                                send_compression_encodings,
8218                            )
8219                            .apply_max_message_size_config(
8220                                max_decoding_message_size,
8221                                max_encoding_message_size,
8222                            );
8223                        let res = grpc.unary(method, req).await;
8224                        Ok(res)
8225                    };
8226                    Box::pin(fut)
8227                }
8228                "/pidgr.v1.InsightsService/GetOrgCommunicationProfile" => {
8229                    #[allow(non_camel_case_types)]
8230                    struct GetOrgCommunicationProfileSvc<T: InsightsService>(pub Arc<T>);
8231                    impl<
8232                        T: InsightsService,
8233                    > tonic::server::UnaryService<
8234                        super::GetOrgCommunicationProfileRequest,
8235                    > for GetOrgCommunicationProfileSvc<T> {
8236                        type Response = super::GetOrgCommunicationProfileResponse;
8237                        type Future = BoxFuture<
8238                            tonic::Response<Self::Response>,
8239                            tonic::Status,
8240                        >;
8241                        fn call(
8242                            &mut self,
8243                            request: tonic::Request<
8244                                super::GetOrgCommunicationProfileRequest,
8245                            >,
8246                        ) -> Self::Future {
8247                            let inner = Arc::clone(&self.0);
8248                            let fut = async move {
8249                                <T as InsightsService>::get_org_communication_profile(
8250                                        &inner,
8251                                        request,
8252                                    )
8253                                    .await
8254                            };
8255                            Box::pin(fut)
8256                        }
8257                    }
8258                    let accept_compression_encodings = self.accept_compression_encodings;
8259                    let send_compression_encodings = self.send_compression_encodings;
8260                    let max_decoding_message_size = self.max_decoding_message_size;
8261                    let max_encoding_message_size = self.max_encoding_message_size;
8262                    let inner = self.inner.clone();
8263                    let fut = async move {
8264                        let method = GetOrgCommunicationProfileSvc(inner);
8265                        let codec = tonic_prost::ProstCodec::default();
8266                        let mut grpc = tonic::server::Grpc::new(codec)
8267                            .apply_compression_config(
8268                                accept_compression_encodings,
8269                                send_compression_encodings,
8270                            )
8271                            .apply_max_message_size_config(
8272                                max_decoding_message_size,
8273                                max_encoding_message_size,
8274                            );
8275                        let res = grpc.unary(method, req).await;
8276                        Ok(res)
8277                    };
8278                    Box::pin(fut)
8279                }
8280                "/pidgr.v1.InsightsService/GetOrgDiagnosis" => {
8281                    #[allow(non_camel_case_types)]
8282                    struct GetOrgDiagnosisSvc<T: InsightsService>(pub Arc<T>);
8283                    impl<
8284                        T: InsightsService,
8285                    > tonic::server::UnaryService<super::GetOrgDiagnosisRequest>
8286                    for GetOrgDiagnosisSvc<T> {
8287                        type Response = super::GetOrgDiagnosisResponse;
8288                        type Future = BoxFuture<
8289                            tonic::Response<Self::Response>,
8290                            tonic::Status,
8291                        >;
8292                        fn call(
8293                            &mut self,
8294                            request: tonic::Request<super::GetOrgDiagnosisRequest>,
8295                        ) -> Self::Future {
8296                            let inner = Arc::clone(&self.0);
8297                            let fut = async move {
8298                                <T as InsightsService>::get_org_diagnosis(&inner, request)
8299                                    .await
8300                            };
8301                            Box::pin(fut)
8302                        }
8303                    }
8304                    let accept_compression_encodings = self.accept_compression_encodings;
8305                    let send_compression_encodings = self.send_compression_encodings;
8306                    let max_decoding_message_size = self.max_decoding_message_size;
8307                    let max_encoding_message_size = self.max_encoding_message_size;
8308                    let inner = self.inner.clone();
8309                    let fut = async move {
8310                        let method = GetOrgDiagnosisSvc(inner);
8311                        let codec = tonic_prost::ProstCodec::default();
8312                        let mut grpc = tonic::server::Grpc::new(codec)
8313                            .apply_compression_config(
8314                                accept_compression_encodings,
8315                                send_compression_encodings,
8316                            )
8317                            .apply_max_message_size_config(
8318                                max_decoding_message_size,
8319                                max_encoding_message_size,
8320                            );
8321                        let res = grpc.unary(method, req).await;
8322                        Ok(res)
8323                    };
8324                    Box::pin(fut)
8325                }
8326                "/pidgr.v1.InsightsService/ListOrgDiagnoses" => {
8327                    #[allow(non_camel_case_types)]
8328                    struct ListOrgDiagnosesSvc<T: InsightsService>(pub Arc<T>);
8329                    impl<
8330                        T: InsightsService,
8331                    > tonic::server::UnaryService<super::ListOrgDiagnosesRequest>
8332                    for ListOrgDiagnosesSvc<T> {
8333                        type Response = super::ListOrgDiagnosesResponse;
8334                        type Future = BoxFuture<
8335                            tonic::Response<Self::Response>,
8336                            tonic::Status,
8337                        >;
8338                        fn call(
8339                            &mut self,
8340                            request: tonic::Request<super::ListOrgDiagnosesRequest>,
8341                        ) -> Self::Future {
8342                            let inner = Arc::clone(&self.0);
8343                            let fut = async move {
8344                                <T as InsightsService>::list_org_diagnoses(&inner, request)
8345                                    .await
8346                            };
8347                            Box::pin(fut)
8348                        }
8349                    }
8350                    let accept_compression_encodings = self.accept_compression_encodings;
8351                    let send_compression_encodings = self.send_compression_encodings;
8352                    let max_decoding_message_size = self.max_decoding_message_size;
8353                    let max_encoding_message_size = self.max_encoding_message_size;
8354                    let inner = self.inner.clone();
8355                    let fut = async move {
8356                        let method = ListOrgDiagnosesSvc(inner);
8357                        let codec = tonic_prost::ProstCodec::default();
8358                        let mut grpc = tonic::server::Grpc::new(codec)
8359                            .apply_compression_config(
8360                                accept_compression_encodings,
8361                                send_compression_encodings,
8362                            )
8363                            .apply_max_message_size_config(
8364                                max_decoding_message_size,
8365                                max_encoding_message_size,
8366                            );
8367                        let res = grpc.unary(method, req).await;
8368                        Ok(res)
8369                    };
8370                    Box::pin(fut)
8371                }
8372                "/pidgr.v1.InsightsService/TriggerOrgDiagnosis" => {
8373                    #[allow(non_camel_case_types)]
8374                    struct TriggerOrgDiagnosisSvc<T: InsightsService>(pub Arc<T>);
8375                    impl<
8376                        T: InsightsService,
8377                    > tonic::server::UnaryService<super::TriggerOrgDiagnosisRequest>
8378                    for TriggerOrgDiagnosisSvc<T> {
8379                        type Response = super::TriggerOrgDiagnosisResponse;
8380                        type Future = BoxFuture<
8381                            tonic::Response<Self::Response>,
8382                            tonic::Status,
8383                        >;
8384                        fn call(
8385                            &mut self,
8386                            request: tonic::Request<super::TriggerOrgDiagnosisRequest>,
8387                        ) -> Self::Future {
8388                            let inner = Arc::clone(&self.0);
8389                            let fut = async move {
8390                                <T as InsightsService>::trigger_org_diagnosis(
8391                                        &inner,
8392                                        request,
8393                                    )
8394                                    .await
8395                            };
8396                            Box::pin(fut)
8397                        }
8398                    }
8399                    let accept_compression_encodings = self.accept_compression_encodings;
8400                    let send_compression_encodings = self.send_compression_encodings;
8401                    let max_decoding_message_size = self.max_decoding_message_size;
8402                    let max_encoding_message_size = self.max_encoding_message_size;
8403                    let inner = self.inner.clone();
8404                    let fut = async move {
8405                        let method = TriggerOrgDiagnosisSvc(inner);
8406                        let codec = tonic_prost::ProstCodec::default();
8407                        let mut grpc = tonic::server::Grpc::new(codec)
8408                            .apply_compression_config(
8409                                accept_compression_encodings,
8410                                send_compression_encodings,
8411                            )
8412                            .apply_max_message_size_config(
8413                                max_decoding_message_size,
8414                                max_encoding_message_size,
8415                            );
8416                        let res = grpc.unary(method, req).await;
8417                        Ok(res)
8418                    };
8419                    Box::pin(fut)
8420                }
8421                _ => {
8422                    Box::pin(async move {
8423                        let mut response = http::Response::new(
8424                            tonic::body::Body::default(),
8425                        );
8426                        let headers = response.headers_mut();
8427                        headers
8428                            .insert(
8429                                tonic::Status::GRPC_STATUS,
8430                                (tonic::Code::Unimplemented as i32).into(),
8431                            );
8432                        headers
8433                            .insert(
8434                                http::header::CONTENT_TYPE,
8435                                tonic::metadata::GRPC_CONTENT_TYPE,
8436                            );
8437                        Ok(response)
8438                    })
8439                }
8440            }
8441        }
8442    }
8443    impl<T> Clone for InsightsServiceServer<T> {
8444        fn clone(&self) -> Self {
8445            let inner = self.inner.clone();
8446            Self {
8447                inner,
8448                accept_compression_encodings: self.accept_compression_encodings,
8449                send_compression_encodings: self.send_compression_encodings,
8450                max_decoding_message_size: self.max_decoding_message_size,
8451                max_encoding_message_size: self.max_encoding_message_size,
8452            }
8453        }
8454    }
8455    /// Generated gRPC service name
8456    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
8457    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
8458        const NAME: &'static str = SERVICE_NAME;
8459    }
8460}
8461/// Generated client implementations.
8462pub mod integrations_service_client {
8463    #![allow(
8464        unused_variables,
8465        dead_code,
8466        missing_docs,
8467        clippy::wildcard_imports,
8468        clippy::let_unit_value,
8469    )]
8470    use tonic::codegen::*;
8471    use tonic::codegen::http::Uri;
8472    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8473
8474 Auth model:
8475   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8476     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8477   - UpsertReachability / RemoveReachability / GetReachability /
8478     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8479     caller's `custom:org_id` claim).
8480   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8481     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
8482     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
8483
8484 Cross-org access is denied with `permission_denied`.
8485*/
8486    #[derive(Debug, Clone)]
8487    pub struct IntegrationsServiceClient<T> {
8488        inner: tonic::client::Grpc<T>,
8489    }
8490    impl IntegrationsServiceClient<tonic::transport::Channel> {
8491        /// Attempt to create a new client by connecting to a given endpoint.
8492        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8493        where
8494            D: TryInto<tonic::transport::Endpoint>,
8495            D::Error: Into<StdError>,
8496        {
8497            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8498            Ok(Self::new(conn))
8499        }
8500    }
8501    impl<T> IntegrationsServiceClient<T>
8502    where
8503        T: tonic::client::GrpcService<tonic::body::Body>,
8504        T::Error: Into<StdError>,
8505        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8506        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8507    {
8508        pub fn new(inner: T) -> Self {
8509            let inner = tonic::client::Grpc::new(inner);
8510            Self { inner }
8511        }
8512        pub fn with_origin(inner: T, origin: Uri) -> Self {
8513            let inner = tonic::client::Grpc::with_origin(inner, origin);
8514            Self { inner }
8515        }
8516        pub fn with_interceptor<F>(
8517            inner: T,
8518            interceptor: F,
8519        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
8520        where
8521            F: tonic::service::Interceptor,
8522            T::ResponseBody: Default,
8523            T: tonic::codegen::Service<
8524                http::Request<tonic::body::Body>,
8525                Response = http::Response<
8526                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8527                >,
8528            >,
8529            <T as tonic::codegen::Service<
8530                http::Request<tonic::body::Body>,
8531            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8532        {
8533            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
8534        }
8535        /// Compress requests with the given encoding.
8536        ///
8537        /// This requires the server to support it otherwise it might respond with an
8538        /// error.
8539        #[must_use]
8540        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8541            self.inner = self.inner.send_compressed(encoding);
8542            self
8543        }
8544        /// Enable decompressing responses.
8545        #[must_use]
8546        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8547            self.inner = self.inner.accept_compressed(encoding);
8548            self
8549        }
8550        /// Limits the maximum size of a decoded message.
8551        ///
8552        /// Default: `4MB`
8553        #[must_use]
8554        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8555            self.inner = self.inner.max_decoding_message_size(limit);
8556            self
8557        }
8558        /// Limits the maximum size of an encoded message.
8559        ///
8560        /// Default: `usize::MAX`
8561        #[must_use]
8562        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8563            self.inner = self.inner.max_encoding_message_size(limit);
8564            self
8565        }
8566        /** Dispatch a single rendered message to one channel. Idempotent on
8567 `dispatch_id`. Internal-mTLS only.
8568*/
8569        pub async fn dispatch_to_channel(
8570            &mut self,
8571            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8572        ) -> std::result::Result<
8573            tonic::Response<super::DispatchToChannelResponse>,
8574            tonic::Status,
8575        > {
8576            self.inner
8577                .ready()
8578                .await
8579                .map_err(|e| {
8580                    tonic::Status::unknown(
8581                        format!("Service was not ready: {}", e.into()),
8582                    )
8583                })?;
8584            let codec = tonic_prost::ProstCodec::default();
8585            let path = http::uri::PathAndQuery::from_static(
8586                "/pidgr.v1.IntegrationsService/DispatchToChannel",
8587            );
8588            let mut req = request.into_request();
8589            req.extensions_mut()
8590                .insert(
8591                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8592                );
8593            self.inner.unary(req, path, codec).await
8594        }
8595        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8596 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8597 audit row BEFORE the registry commit.
8598*/
8599        pub async fn upsert_reachability(
8600            &mut self,
8601            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8602        ) -> std::result::Result<
8603            tonic::Response<super::UpsertReachabilityResponse>,
8604            tonic::Status,
8605        > {
8606            self.inner
8607                .ready()
8608                .await
8609                .map_err(|e| {
8610                    tonic::Status::unknown(
8611                        format!("Service was not ready: {}", e.into()),
8612                    )
8613                })?;
8614            let codec = tonic_prost::ProstCodec::default();
8615            let path = http::uri::PathAndQuery::from_static(
8616                "/pidgr.v1.IntegrationsService/UpsertReachability",
8617            );
8618            let mut req = request.into_request();
8619            req.extensions_mut()
8620                .insert(
8621                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8622                );
8623            self.inner.unary(req, path, codec).await
8624        }
8625        /** Remove a reachability identifier. Idempotent. Emits a
8626 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8627*/
8628        pub async fn remove_reachability(
8629            &mut self,
8630            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8631        ) -> std::result::Result<
8632            tonic::Response<super::RemoveReachabilityResponse>,
8633            tonic::Status,
8634        > {
8635            self.inner
8636                .ready()
8637                .await
8638                .map_err(|e| {
8639                    tonic::Status::unknown(
8640                        format!("Service was not ready: {}", e.into()),
8641                    )
8642                })?;
8643            let codec = tonic_prost::ProstCodec::default();
8644            let path = http::uri::PathAndQuery::from_static(
8645                "/pidgr.v1.IntegrationsService/RemoveReachability",
8646            );
8647            let mut req = request.into_request();
8648            req.extensions_mut()
8649                .insert(
8650                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8651                );
8652            self.inner.unary(req, path, codec).await
8653        }
8654        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8655 Does not return plaintext or envelope ciphertext.
8656*/
8657        pub async fn get_reachability(
8658            &mut self,
8659            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8660        ) -> std::result::Result<
8661            tonic::Response<super::GetReachabilityResponse>,
8662            tonic::Status,
8663        > {
8664            self.inner
8665                .ready()
8666                .await
8667                .map_err(|e| {
8668                    tonic::Status::unknown(
8669                        format!("Service was not ready: {}", e.into()),
8670                    )
8671                })?;
8672            let codec = tonic_prost::ProstCodec::default();
8673            let path = http::uri::PathAndQuery::from_static(
8674                "/pidgr.v1.IntegrationsService/GetReachability",
8675            );
8676            let mut req = request.into_request();
8677            req.extensions_mut()
8678                .insert(
8679                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8680                );
8681            self.inner.unary(req, path, codec).await
8682        }
8683        /** List per-channel reachability metadata for a single user. Used by the
8684 admin per-user matrix view. Does not return plaintext or ciphertext.
8685*/
8686        pub async fn list_reachability_for_user(
8687            &mut self,
8688            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8689        ) -> std::result::Result<
8690            tonic::Response<super::ListReachabilityForUserResponse>,
8691            tonic::Status,
8692        > {
8693            self.inner
8694                .ready()
8695                .await
8696                .map_err(|e| {
8697                    tonic::Status::unknown(
8698                        format!("Service was not ready: {}", e.into()),
8699                    )
8700                })?;
8701            let codec = tonic_prost::ProstCodec::default();
8702            let path = http::uri::PathAndQuery::from_static(
8703                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8704            );
8705            let mut req = request.into_request();
8706            req.extensions_mut()
8707                .insert(
8708                    GrpcMethod::new(
8709                        "pidgr.v1.IntegrationsService",
8710                        "ListReachabilityForUser",
8711                    ),
8712                );
8713            self.inner.unary(req, path, codec).await
8714        }
8715        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8716 no policy is configured — NOT a NOT_FOUND.
8717*/
8718        pub async fn get_region_policy(
8719            &mut self,
8720            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8721        ) -> std::result::Result<
8722            tonic::Response<super::GetRegionPolicyResponse>,
8723            tonic::Status,
8724        > {
8725            self.inner
8726                .ready()
8727                .await
8728                .map_err(|e| {
8729                    tonic::Status::unknown(
8730                        format!("Service was not ready: {}", e.into()),
8731                    )
8732                })?;
8733            let codec = tonic_prost::ProstCodec::default();
8734            let path = http::uri::PathAndQuery::from_static(
8735                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8736            );
8737            let mut req = request.into_request();
8738            req.extensions_mut()
8739                .insert(
8740                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8741                );
8742            self.inner.unary(req, path, codec).await
8743        }
8744        /** Admin-only upsert of the per-(org, channel) region allowlist.
8745*/
8746        pub async fn set_region_policy(
8747            &mut self,
8748            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8749        ) -> std::result::Result<
8750            tonic::Response<super::SetRegionPolicyResponse>,
8751            tonic::Status,
8752        > {
8753            self.inner
8754                .ready()
8755                .await
8756                .map_err(|e| {
8757                    tonic::Status::unknown(
8758                        format!("Service was not ready: {}", e.into()),
8759                    )
8760                })?;
8761            let codec = tonic_prost::ProstCodec::default();
8762            let path = http::uri::PathAndQuery::from_static(
8763                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8764            );
8765            let mut req = request.into_request();
8766            req.extensions_mut()
8767                .insert(
8768                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8769                );
8770            self.inner.unary(req, path, codec).await
8771        }
8772        /** Read the current calendar-month cost-cap state. Returns the channel
8773 default cap when no row exists; never NOT_FOUND.
8774*/
8775        pub async fn get_cost_cap_policy(
8776            &mut self,
8777            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8778        ) -> std::result::Result<
8779            tonic::Response<super::GetCostCapPolicyResponse>,
8780            tonic::Status,
8781        > {
8782            self.inner
8783                .ready()
8784                .await
8785                .map_err(|e| {
8786                    tonic::Status::unknown(
8787                        format!("Service was not ready: {}", e.into()),
8788                    )
8789                })?;
8790            let codec = tonic_prost::ProstCodec::default();
8791            let path = http::uri::PathAndQuery::from_static(
8792                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8793            );
8794            let mut req = request.into_request();
8795            req.extensions_mut()
8796                .insert(
8797                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8798                );
8799            self.inner.unary(req, path, codec).await
8800        }
8801        /** Admin-only upsert of the current calendar-month cost cap.
8802*/
8803        pub async fn set_cost_cap_policy(
8804            &mut self,
8805            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8806        ) -> std::result::Result<
8807            tonic::Response<super::SetCostCapPolicyResponse>,
8808            tonic::Status,
8809        > {
8810            self.inner
8811                .ready()
8812                .await
8813                .map_err(|e| {
8814                    tonic::Status::unknown(
8815                        format!("Service was not ready: {}", e.into()),
8816                    )
8817                })?;
8818            let codec = tonic_prost::ProstCodec::default();
8819            let path = http::uri::PathAndQuery::from_static(
8820                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8821            );
8822            let mut req = request.into_request();
8823            req.extensions_mut()
8824                .insert(
8825                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8826                );
8827            self.inner.unary(req, path, codec).await
8828        }
8829        /** Read the org's generic-webhook channel configuration. The signing secret
8830 is never returned. Returns an empty-url config when none exists — NOT a
8831 NOT_FOUND.
8832*/
8833        pub async fn get_org_webhook_config(
8834            &mut self,
8835            request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8836        ) -> std::result::Result<
8837            tonic::Response<super::GetOrgWebhookConfigResponse>,
8838            tonic::Status,
8839        > {
8840            self.inner
8841                .ready()
8842                .await
8843                .map_err(|e| {
8844                    tonic::Status::unknown(
8845                        format!("Service was not ready: {}", e.into()),
8846                    )
8847                })?;
8848            let codec = tonic_prost::ProstCodec::default();
8849            let path = http::uri::PathAndQuery::from_static(
8850                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8851            );
8852            let mut req = request.into_request();
8853            req.extensions_mut()
8854                .insert(
8855                    GrpcMethod::new(
8856                        "pidgr.v1.IntegrationsService",
8857                        "GetOrgWebhookConfig",
8858                    ),
8859                );
8860            self.inner.unary(req, path, codec).await
8861        }
8862        /** Admin-only upsert of the org's generic-webhook configuration. Validates
8863 the destination URL (https-only, public hosts) and envelope-encrypts the
8864 secret at rest.
8865*/
8866        pub async fn set_org_webhook_config(
8867            &mut self,
8868            request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8869        ) -> std::result::Result<
8870            tonic::Response<super::SetOrgWebhookConfigResponse>,
8871            tonic::Status,
8872        > {
8873            self.inner
8874                .ready()
8875                .await
8876                .map_err(|e| {
8877                    tonic::Status::unknown(
8878                        format!("Service was not ready: {}", e.into()),
8879                    )
8880                })?;
8881            let codec = tonic_prost::ProstCodec::default();
8882            let path = http::uri::PathAndQuery::from_static(
8883                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8884            );
8885            let mut req = request.into_request();
8886            req.extensions_mut()
8887                .insert(
8888                    GrpcMethod::new(
8889                        "pidgr.v1.IntegrationsService",
8890                        "SetOrgWebhookConfig",
8891                    ),
8892                );
8893            self.inner.unary(req, path, codec).await
8894        }
8895        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
8896 user follows to bind a third-party channel (Telegram bot-follow, Slack
8897 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
8898 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
8899 are rejected with `invalid_argument`.
8900*/
8901        pub async fn create_channel_connect_link(
8902            &mut self,
8903            request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8904        ) -> std::result::Result<
8905            tonic::Response<super::CreateChannelConnectLinkResponse>,
8906            tonic::Status,
8907        > {
8908            self.inner
8909                .ready()
8910                .await
8911                .map_err(|e| {
8912                    tonic::Status::unknown(
8913                        format!("Service was not ready: {}", e.into()),
8914                    )
8915                })?;
8916            let codec = tonic_prost::ProstCodec::default();
8917            let path = http::uri::PathAndQuery::from_static(
8918                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8919            );
8920            let mut req = request.into_request();
8921            req.extensions_mut()
8922                .insert(
8923                    GrpcMethod::new(
8924                        "pidgr.v1.IntegrationsService",
8925                        "CreateChannelConnectLink",
8926                    ),
8927                );
8928            self.inner.unary(req, path, codec).await
8929        }
8930        /** CreateSlackWorkspaceInstallAuthorization mints a short-lived HMAC token
8931 authorizing a Slack workspace install into the caller's authorized org.
8932 The admin passes it to the integrations install-start endpoint, which
8933 verifies it and installs the bot into THAT org — fixing the multi-org
8934 mis-routing where the install always landed on the caller's JWT home org.
8935 Cognito JWT (admin only, org-scoped); cross-org is permission_denied.
8936*/
8937        pub async fn create_slack_workspace_install_authorization(
8938            &mut self,
8939            request: impl tonic::IntoRequest<
8940                super::CreateSlackWorkspaceInstallAuthorizationRequest,
8941            >,
8942        ) -> std::result::Result<
8943            tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
8944            tonic::Status,
8945        > {
8946            self.inner
8947                .ready()
8948                .await
8949                .map_err(|e| {
8950                    tonic::Status::unknown(
8951                        format!("Service was not ready: {}", e.into()),
8952                    )
8953                })?;
8954            let codec = tonic_prost::ProstCodec::default();
8955            let path = http::uri::PathAndQuery::from_static(
8956                "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization",
8957            );
8958            let mut req = request.into_request();
8959            req.extensions_mut()
8960                .insert(
8961                    GrpcMethod::new(
8962                        "pidgr.v1.IntegrationsService",
8963                        "CreateSlackWorkspaceInstallAuthorization",
8964                    ),
8965                );
8966            self.inner.unary(req, path, codec).await
8967        }
8968    }
8969}
8970/// Generated server implementations.
8971pub mod integrations_service_server {
8972    #![allow(
8973        unused_variables,
8974        dead_code,
8975        missing_docs,
8976        clippy::wildcard_imports,
8977        clippy::let_unit_value,
8978    )]
8979    use tonic::codegen::*;
8980    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8981    #[async_trait]
8982    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8983        /** Dispatch a single rendered message to one channel. Idempotent on
8984 `dispatch_id`. Internal-mTLS only.
8985*/
8986        async fn dispatch_to_channel(
8987            &self,
8988            request: tonic::Request<super::DispatchToChannelRequest>,
8989        ) -> std::result::Result<
8990            tonic::Response<super::DispatchToChannelResponse>,
8991            tonic::Status,
8992        >;
8993        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8994 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8995 audit row BEFORE the registry commit.
8996*/
8997        async fn upsert_reachability(
8998            &self,
8999            request: tonic::Request<super::UpsertReachabilityRequest>,
9000        ) -> std::result::Result<
9001            tonic::Response<super::UpsertReachabilityResponse>,
9002            tonic::Status,
9003        >;
9004        /** Remove a reachability identifier. Idempotent. Emits a
9005 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
9006*/
9007        async fn remove_reachability(
9008            &self,
9009            request: tonic::Request<super::RemoveReachabilityRequest>,
9010        ) -> std::result::Result<
9011            tonic::Response<super::RemoveReachabilityResponse>,
9012            tonic::Status,
9013        >;
9014        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
9015 Does not return plaintext or envelope ciphertext.
9016*/
9017        async fn get_reachability(
9018            &self,
9019            request: tonic::Request<super::GetReachabilityRequest>,
9020        ) -> std::result::Result<
9021            tonic::Response<super::GetReachabilityResponse>,
9022            tonic::Status,
9023        >;
9024        /** List per-channel reachability metadata for a single user. Used by the
9025 admin per-user matrix view. Does not return plaintext or ciphertext.
9026*/
9027        async fn list_reachability_for_user(
9028            &self,
9029            request: tonic::Request<super::ListReachabilityForUserRequest>,
9030        ) -> std::result::Result<
9031            tonic::Response<super::ListReachabilityForUserResponse>,
9032            tonic::Status,
9033        >;
9034        /** Read the per-(org, channel) region allowlist. Returns an empty list when
9035 no policy is configured — NOT a NOT_FOUND.
9036*/
9037        async fn get_region_policy(
9038            &self,
9039            request: tonic::Request<super::GetRegionPolicyRequest>,
9040        ) -> std::result::Result<
9041            tonic::Response<super::GetRegionPolicyResponse>,
9042            tonic::Status,
9043        >;
9044        /** Admin-only upsert of the per-(org, channel) region allowlist.
9045*/
9046        async fn set_region_policy(
9047            &self,
9048            request: tonic::Request<super::SetRegionPolicyRequest>,
9049        ) -> std::result::Result<
9050            tonic::Response<super::SetRegionPolicyResponse>,
9051            tonic::Status,
9052        >;
9053        /** Read the current calendar-month cost-cap state. Returns the channel
9054 default cap when no row exists; never NOT_FOUND.
9055*/
9056        async fn get_cost_cap_policy(
9057            &self,
9058            request: tonic::Request<super::GetCostCapPolicyRequest>,
9059        ) -> std::result::Result<
9060            tonic::Response<super::GetCostCapPolicyResponse>,
9061            tonic::Status,
9062        >;
9063        /** Admin-only upsert of the current calendar-month cost cap.
9064*/
9065        async fn set_cost_cap_policy(
9066            &self,
9067            request: tonic::Request<super::SetCostCapPolicyRequest>,
9068        ) -> std::result::Result<
9069            tonic::Response<super::SetCostCapPolicyResponse>,
9070            tonic::Status,
9071        >;
9072        /** Read the org's generic-webhook channel configuration. The signing secret
9073 is never returned. Returns an empty-url config when none exists — NOT a
9074 NOT_FOUND.
9075*/
9076        async fn get_org_webhook_config(
9077            &self,
9078            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9079        ) -> std::result::Result<
9080            tonic::Response<super::GetOrgWebhookConfigResponse>,
9081            tonic::Status,
9082        >;
9083        /** Admin-only upsert of the org's generic-webhook configuration. Validates
9084 the destination URL (https-only, public hosts) and envelope-encrypts the
9085 secret at rest.
9086*/
9087        async fn set_org_webhook_config(
9088            &self,
9089            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9090        ) -> std::result::Result<
9091            tonic::Response<super::SetOrgWebhookConfigResponse>,
9092            tonic::Status,
9093        >;
9094        /** CreateChannelConnectLink mints a short-lived, HMAC-signed opt-in link a
9095 user follows to bind a third-party channel (Telegram bot-follow, Slack
9096 OAuth, LINE follow-code) to their (org, user). Wraps the api-side
9097 internal/linktoken minter. Channels other than TELEGRAM, SLACK, and LINE
9098 are rejected with `invalid_argument`.
9099*/
9100        async fn create_channel_connect_link(
9101            &self,
9102            request: tonic::Request<super::CreateChannelConnectLinkRequest>,
9103        ) -> std::result::Result<
9104            tonic::Response<super::CreateChannelConnectLinkResponse>,
9105            tonic::Status,
9106        >;
9107        /** CreateSlackWorkspaceInstallAuthorization mints a short-lived HMAC token
9108 authorizing a Slack workspace install into the caller's authorized org.
9109 The admin passes it to the integrations install-start endpoint, which
9110 verifies it and installs the bot into THAT org — fixing the multi-org
9111 mis-routing where the install always landed on the caller's JWT home org.
9112 Cognito JWT (admin only, org-scoped); cross-org is permission_denied.
9113*/
9114        async fn create_slack_workspace_install_authorization(
9115            &self,
9116            request: tonic::Request<
9117                super::CreateSlackWorkspaceInstallAuthorizationRequest,
9118            >,
9119        ) -> std::result::Result<
9120            tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
9121            tonic::Status,
9122        >;
9123    }
9124    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
9125
9126 Auth model:
9127   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
9128     on behalf of pidgr-api dispatch activities. Never exposed publicly.
9129   - UpsertReachability / RemoveReachability / GetReachability /
9130     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
9131     caller's `custom:org_id` claim).
9132   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
9133     SetCostCapPolicy / GetOrgWebhookConfig / SetOrgWebhookConfig /
9134     CreateChannelConnectLink: Cognito JWT (admin only, org-scoped).
9135
9136 Cross-org access is denied with `permission_denied`.
9137*/
9138    #[derive(Debug)]
9139    pub struct IntegrationsServiceServer<T> {
9140        inner: Arc<T>,
9141        accept_compression_encodings: EnabledCompressionEncodings,
9142        send_compression_encodings: EnabledCompressionEncodings,
9143        max_decoding_message_size: Option<usize>,
9144        max_encoding_message_size: Option<usize>,
9145    }
9146    impl<T> IntegrationsServiceServer<T> {
9147        pub fn new(inner: T) -> Self {
9148            Self::from_arc(Arc::new(inner))
9149        }
9150        pub fn from_arc(inner: Arc<T>) -> Self {
9151            Self {
9152                inner,
9153                accept_compression_encodings: Default::default(),
9154                send_compression_encodings: Default::default(),
9155                max_decoding_message_size: None,
9156                max_encoding_message_size: None,
9157            }
9158        }
9159        pub fn with_interceptor<F>(
9160            inner: T,
9161            interceptor: F,
9162        ) -> InterceptedService<Self, F>
9163        where
9164            F: tonic::service::Interceptor,
9165        {
9166            InterceptedService::new(Self::new(inner), interceptor)
9167        }
9168        /// Enable decompressing requests with the given encoding.
9169        #[must_use]
9170        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9171            self.accept_compression_encodings.enable(encoding);
9172            self
9173        }
9174        /// Compress responses with the given encoding, if the client supports it.
9175        #[must_use]
9176        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9177            self.send_compression_encodings.enable(encoding);
9178            self
9179        }
9180        /// Limits the maximum size of a decoded message.
9181        ///
9182        /// Default: `4MB`
9183        #[must_use]
9184        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9185            self.max_decoding_message_size = Some(limit);
9186            self
9187        }
9188        /// Limits the maximum size of an encoded message.
9189        ///
9190        /// Default: `usize::MAX`
9191        #[must_use]
9192        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9193            self.max_encoding_message_size = Some(limit);
9194            self
9195        }
9196    }
9197    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
9198    where
9199        T: IntegrationsService,
9200        B: Body + std::marker::Send + 'static,
9201        B::Error: Into<StdError> + std::marker::Send + 'static,
9202    {
9203        type Response = http::Response<tonic::body::Body>;
9204        type Error = std::convert::Infallible;
9205        type Future = BoxFuture<Self::Response, Self::Error>;
9206        fn poll_ready(
9207            &mut self,
9208            _cx: &mut Context<'_>,
9209        ) -> Poll<std::result::Result<(), Self::Error>> {
9210            Poll::Ready(Ok(()))
9211        }
9212        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9213            match req.uri().path() {
9214                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
9215                    #[allow(non_camel_case_types)]
9216                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
9217                    impl<
9218                        T: IntegrationsService,
9219                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
9220                    for DispatchToChannelSvc<T> {
9221                        type Response = super::DispatchToChannelResponse;
9222                        type Future = BoxFuture<
9223                            tonic::Response<Self::Response>,
9224                            tonic::Status,
9225                        >;
9226                        fn call(
9227                            &mut self,
9228                            request: tonic::Request<super::DispatchToChannelRequest>,
9229                        ) -> Self::Future {
9230                            let inner = Arc::clone(&self.0);
9231                            let fut = async move {
9232                                <T as IntegrationsService>::dispatch_to_channel(
9233                                        &inner,
9234                                        request,
9235                                    )
9236                                    .await
9237                            };
9238                            Box::pin(fut)
9239                        }
9240                    }
9241                    let accept_compression_encodings = self.accept_compression_encodings;
9242                    let send_compression_encodings = self.send_compression_encodings;
9243                    let max_decoding_message_size = self.max_decoding_message_size;
9244                    let max_encoding_message_size = self.max_encoding_message_size;
9245                    let inner = self.inner.clone();
9246                    let fut = async move {
9247                        let method = DispatchToChannelSvc(inner);
9248                        let codec = tonic_prost::ProstCodec::default();
9249                        let mut grpc = tonic::server::Grpc::new(codec)
9250                            .apply_compression_config(
9251                                accept_compression_encodings,
9252                                send_compression_encodings,
9253                            )
9254                            .apply_max_message_size_config(
9255                                max_decoding_message_size,
9256                                max_encoding_message_size,
9257                            );
9258                        let res = grpc.unary(method, req).await;
9259                        Ok(res)
9260                    };
9261                    Box::pin(fut)
9262                }
9263                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
9264                    #[allow(non_camel_case_types)]
9265                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
9266                    impl<
9267                        T: IntegrationsService,
9268                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
9269                    for UpsertReachabilitySvc<T> {
9270                        type Response = super::UpsertReachabilityResponse;
9271                        type Future = BoxFuture<
9272                            tonic::Response<Self::Response>,
9273                            tonic::Status,
9274                        >;
9275                        fn call(
9276                            &mut self,
9277                            request: tonic::Request<super::UpsertReachabilityRequest>,
9278                        ) -> Self::Future {
9279                            let inner = Arc::clone(&self.0);
9280                            let fut = async move {
9281                                <T as IntegrationsService>::upsert_reachability(
9282                                        &inner,
9283                                        request,
9284                                    )
9285                                    .await
9286                            };
9287                            Box::pin(fut)
9288                        }
9289                    }
9290                    let accept_compression_encodings = self.accept_compression_encodings;
9291                    let send_compression_encodings = self.send_compression_encodings;
9292                    let max_decoding_message_size = self.max_decoding_message_size;
9293                    let max_encoding_message_size = self.max_encoding_message_size;
9294                    let inner = self.inner.clone();
9295                    let fut = async move {
9296                        let method = UpsertReachabilitySvc(inner);
9297                        let codec = tonic_prost::ProstCodec::default();
9298                        let mut grpc = tonic::server::Grpc::new(codec)
9299                            .apply_compression_config(
9300                                accept_compression_encodings,
9301                                send_compression_encodings,
9302                            )
9303                            .apply_max_message_size_config(
9304                                max_decoding_message_size,
9305                                max_encoding_message_size,
9306                            );
9307                        let res = grpc.unary(method, req).await;
9308                        Ok(res)
9309                    };
9310                    Box::pin(fut)
9311                }
9312                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
9313                    #[allow(non_camel_case_types)]
9314                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
9315                    impl<
9316                        T: IntegrationsService,
9317                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
9318                    for RemoveReachabilitySvc<T> {
9319                        type Response = super::RemoveReachabilityResponse;
9320                        type Future = BoxFuture<
9321                            tonic::Response<Self::Response>,
9322                            tonic::Status,
9323                        >;
9324                        fn call(
9325                            &mut self,
9326                            request: tonic::Request<super::RemoveReachabilityRequest>,
9327                        ) -> Self::Future {
9328                            let inner = Arc::clone(&self.0);
9329                            let fut = async move {
9330                                <T as IntegrationsService>::remove_reachability(
9331                                        &inner,
9332                                        request,
9333                                    )
9334                                    .await
9335                            };
9336                            Box::pin(fut)
9337                        }
9338                    }
9339                    let accept_compression_encodings = self.accept_compression_encodings;
9340                    let send_compression_encodings = self.send_compression_encodings;
9341                    let max_decoding_message_size = self.max_decoding_message_size;
9342                    let max_encoding_message_size = self.max_encoding_message_size;
9343                    let inner = self.inner.clone();
9344                    let fut = async move {
9345                        let method = RemoveReachabilitySvc(inner);
9346                        let codec = tonic_prost::ProstCodec::default();
9347                        let mut grpc = tonic::server::Grpc::new(codec)
9348                            .apply_compression_config(
9349                                accept_compression_encodings,
9350                                send_compression_encodings,
9351                            )
9352                            .apply_max_message_size_config(
9353                                max_decoding_message_size,
9354                                max_encoding_message_size,
9355                            );
9356                        let res = grpc.unary(method, req).await;
9357                        Ok(res)
9358                    };
9359                    Box::pin(fut)
9360                }
9361                "/pidgr.v1.IntegrationsService/GetReachability" => {
9362                    #[allow(non_camel_case_types)]
9363                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
9364                    impl<
9365                        T: IntegrationsService,
9366                    > tonic::server::UnaryService<super::GetReachabilityRequest>
9367                    for GetReachabilitySvc<T> {
9368                        type Response = super::GetReachabilityResponse;
9369                        type Future = BoxFuture<
9370                            tonic::Response<Self::Response>,
9371                            tonic::Status,
9372                        >;
9373                        fn call(
9374                            &mut self,
9375                            request: tonic::Request<super::GetReachabilityRequest>,
9376                        ) -> Self::Future {
9377                            let inner = Arc::clone(&self.0);
9378                            let fut = async move {
9379                                <T as IntegrationsService>::get_reachability(
9380                                        &inner,
9381                                        request,
9382                                    )
9383                                    .await
9384                            };
9385                            Box::pin(fut)
9386                        }
9387                    }
9388                    let accept_compression_encodings = self.accept_compression_encodings;
9389                    let send_compression_encodings = self.send_compression_encodings;
9390                    let max_decoding_message_size = self.max_decoding_message_size;
9391                    let max_encoding_message_size = self.max_encoding_message_size;
9392                    let inner = self.inner.clone();
9393                    let fut = async move {
9394                        let method = GetReachabilitySvc(inner);
9395                        let codec = tonic_prost::ProstCodec::default();
9396                        let mut grpc = tonic::server::Grpc::new(codec)
9397                            .apply_compression_config(
9398                                accept_compression_encodings,
9399                                send_compression_encodings,
9400                            )
9401                            .apply_max_message_size_config(
9402                                max_decoding_message_size,
9403                                max_encoding_message_size,
9404                            );
9405                        let res = grpc.unary(method, req).await;
9406                        Ok(res)
9407                    };
9408                    Box::pin(fut)
9409                }
9410                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
9411                    #[allow(non_camel_case_types)]
9412                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
9413                        pub Arc<T>,
9414                    );
9415                    impl<
9416                        T: IntegrationsService,
9417                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
9418                    for ListReachabilityForUserSvc<T> {
9419                        type Response = super::ListReachabilityForUserResponse;
9420                        type Future = BoxFuture<
9421                            tonic::Response<Self::Response>,
9422                            tonic::Status,
9423                        >;
9424                        fn call(
9425                            &mut self,
9426                            request: tonic::Request<
9427                                super::ListReachabilityForUserRequest,
9428                            >,
9429                        ) -> Self::Future {
9430                            let inner = Arc::clone(&self.0);
9431                            let fut = async move {
9432                                <T as IntegrationsService>::list_reachability_for_user(
9433                                        &inner,
9434                                        request,
9435                                    )
9436                                    .await
9437                            };
9438                            Box::pin(fut)
9439                        }
9440                    }
9441                    let accept_compression_encodings = self.accept_compression_encodings;
9442                    let send_compression_encodings = self.send_compression_encodings;
9443                    let max_decoding_message_size = self.max_decoding_message_size;
9444                    let max_encoding_message_size = self.max_encoding_message_size;
9445                    let inner = self.inner.clone();
9446                    let fut = async move {
9447                        let method = ListReachabilityForUserSvc(inner);
9448                        let codec = tonic_prost::ProstCodec::default();
9449                        let mut grpc = tonic::server::Grpc::new(codec)
9450                            .apply_compression_config(
9451                                accept_compression_encodings,
9452                                send_compression_encodings,
9453                            )
9454                            .apply_max_message_size_config(
9455                                max_decoding_message_size,
9456                                max_encoding_message_size,
9457                            );
9458                        let res = grpc.unary(method, req).await;
9459                        Ok(res)
9460                    };
9461                    Box::pin(fut)
9462                }
9463                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
9464                    #[allow(non_camel_case_types)]
9465                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9466                    impl<
9467                        T: IntegrationsService,
9468                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
9469                    for GetRegionPolicySvc<T> {
9470                        type Response = super::GetRegionPolicyResponse;
9471                        type Future = BoxFuture<
9472                            tonic::Response<Self::Response>,
9473                            tonic::Status,
9474                        >;
9475                        fn call(
9476                            &mut self,
9477                            request: tonic::Request<super::GetRegionPolicyRequest>,
9478                        ) -> Self::Future {
9479                            let inner = Arc::clone(&self.0);
9480                            let fut = async move {
9481                                <T as IntegrationsService>::get_region_policy(
9482                                        &inner,
9483                                        request,
9484                                    )
9485                                    .await
9486                            };
9487                            Box::pin(fut)
9488                        }
9489                    }
9490                    let accept_compression_encodings = self.accept_compression_encodings;
9491                    let send_compression_encodings = self.send_compression_encodings;
9492                    let max_decoding_message_size = self.max_decoding_message_size;
9493                    let max_encoding_message_size = self.max_encoding_message_size;
9494                    let inner = self.inner.clone();
9495                    let fut = async move {
9496                        let method = GetRegionPolicySvc(inner);
9497                        let codec = tonic_prost::ProstCodec::default();
9498                        let mut grpc = tonic::server::Grpc::new(codec)
9499                            .apply_compression_config(
9500                                accept_compression_encodings,
9501                                send_compression_encodings,
9502                            )
9503                            .apply_max_message_size_config(
9504                                max_decoding_message_size,
9505                                max_encoding_message_size,
9506                            );
9507                        let res = grpc.unary(method, req).await;
9508                        Ok(res)
9509                    };
9510                    Box::pin(fut)
9511                }
9512                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
9513                    #[allow(non_camel_case_types)]
9514                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9515                    impl<
9516                        T: IntegrationsService,
9517                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
9518                    for SetRegionPolicySvc<T> {
9519                        type Response = super::SetRegionPolicyResponse;
9520                        type Future = BoxFuture<
9521                            tonic::Response<Self::Response>,
9522                            tonic::Status,
9523                        >;
9524                        fn call(
9525                            &mut self,
9526                            request: tonic::Request<super::SetRegionPolicyRequest>,
9527                        ) -> Self::Future {
9528                            let inner = Arc::clone(&self.0);
9529                            let fut = async move {
9530                                <T as IntegrationsService>::set_region_policy(
9531                                        &inner,
9532                                        request,
9533                                    )
9534                                    .await
9535                            };
9536                            Box::pin(fut)
9537                        }
9538                    }
9539                    let accept_compression_encodings = self.accept_compression_encodings;
9540                    let send_compression_encodings = self.send_compression_encodings;
9541                    let max_decoding_message_size = self.max_decoding_message_size;
9542                    let max_encoding_message_size = self.max_encoding_message_size;
9543                    let inner = self.inner.clone();
9544                    let fut = async move {
9545                        let method = SetRegionPolicySvc(inner);
9546                        let codec = tonic_prost::ProstCodec::default();
9547                        let mut grpc = tonic::server::Grpc::new(codec)
9548                            .apply_compression_config(
9549                                accept_compression_encodings,
9550                                send_compression_encodings,
9551                            )
9552                            .apply_max_message_size_config(
9553                                max_decoding_message_size,
9554                                max_encoding_message_size,
9555                            );
9556                        let res = grpc.unary(method, req).await;
9557                        Ok(res)
9558                    };
9559                    Box::pin(fut)
9560                }
9561                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
9562                    #[allow(non_camel_case_types)]
9563                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9564                    impl<
9565                        T: IntegrationsService,
9566                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
9567                    for GetCostCapPolicySvc<T> {
9568                        type Response = super::GetCostCapPolicyResponse;
9569                        type Future = BoxFuture<
9570                            tonic::Response<Self::Response>,
9571                            tonic::Status,
9572                        >;
9573                        fn call(
9574                            &mut self,
9575                            request: tonic::Request<super::GetCostCapPolicyRequest>,
9576                        ) -> Self::Future {
9577                            let inner = Arc::clone(&self.0);
9578                            let fut = async move {
9579                                <T as IntegrationsService>::get_cost_cap_policy(
9580                                        &inner,
9581                                        request,
9582                                    )
9583                                    .await
9584                            };
9585                            Box::pin(fut)
9586                        }
9587                    }
9588                    let accept_compression_encodings = self.accept_compression_encodings;
9589                    let send_compression_encodings = self.send_compression_encodings;
9590                    let max_decoding_message_size = self.max_decoding_message_size;
9591                    let max_encoding_message_size = self.max_encoding_message_size;
9592                    let inner = self.inner.clone();
9593                    let fut = async move {
9594                        let method = GetCostCapPolicySvc(inner);
9595                        let codec = tonic_prost::ProstCodec::default();
9596                        let mut grpc = tonic::server::Grpc::new(codec)
9597                            .apply_compression_config(
9598                                accept_compression_encodings,
9599                                send_compression_encodings,
9600                            )
9601                            .apply_max_message_size_config(
9602                                max_decoding_message_size,
9603                                max_encoding_message_size,
9604                            );
9605                        let res = grpc.unary(method, req).await;
9606                        Ok(res)
9607                    };
9608                    Box::pin(fut)
9609                }
9610                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
9611                    #[allow(non_camel_case_types)]
9612                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9613                    impl<
9614                        T: IntegrationsService,
9615                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9616                    for SetCostCapPolicySvc<T> {
9617                        type Response = super::SetCostCapPolicyResponse;
9618                        type Future = BoxFuture<
9619                            tonic::Response<Self::Response>,
9620                            tonic::Status,
9621                        >;
9622                        fn call(
9623                            &mut self,
9624                            request: tonic::Request<super::SetCostCapPolicyRequest>,
9625                        ) -> Self::Future {
9626                            let inner = Arc::clone(&self.0);
9627                            let fut = async move {
9628                                <T as IntegrationsService>::set_cost_cap_policy(
9629                                        &inner,
9630                                        request,
9631                                    )
9632                                    .await
9633                            };
9634                            Box::pin(fut)
9635                        }
9636                    }
9637                    let accept_compression_encodings = self.accept_compression_encodings;
9638                    let send_compression_encodings = self.send_compression_encodings;
9639                    let max_decoding_message_size = self.max_decoding_message_size;
9640                    let max_encoding_message_size = self.max_encoding_message_size;
9641                    let inner = self.inner.clone();
9642                    let fut = async move {
9643                        let method = SetCostCapPolicySvc(inner);
9644                        let codec = tonic_prost::ProstCodec::default();
9645                        let mut grpc = tonic::server::Grpc::new(codec)
9646                            .apply_compression_config(
9647                                accept_compression_encodings,
9648                                send_compression_encodings,
9649                            )
9650                            .apply_max_message_size_config(
9651                                max_decoding_message_size,
9652                                max_encoding_message_size,
9653                            );
9654                        let res = grpc.unary(method, req).await;
9655                        Ok(res)
9656                    };
9657                    Box::pin(fut)
9658                }
9659                "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9660                    #[allow(non_camel_case_types)]
9661                    struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9662                    impl<
9663                        T: IntegrationsService,
9664                    > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9665                    for GetOrgWebhookConfigSvc<T> {
9666                        type Response = super::GetOrgWebhookConfigResponse;
9667                        type Future = BoxFuture<
9668                            tonic::Response<Self::Response>,
9669                            tonic::Status,
9670                        >;
9671                        fn call(
9672                            &mut self,
9673                            request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9674                        ) -> Self::Future {
9675                            let inner = Arc::clone(&self.0);
9676                            let fut = async move {
9677                                <T as IntegrationsService>::get_org_webhook_config(
9678                                        &inner,
9679                                        request,
9680                                    )
9681                                    .await
9682                            };
9683                            Box::pin(fut)
9684                        }
9685                    }
9686                    let accept_compression_encodings = self.accept_compression_encodings;
9687                    let send_compression_encodings = self.send_compression_encodings;
9688                    let max_decoding_message_size = self.max_decoding_message_size;
9689                    let max_encoding_message_size = self.max_encoding_message_size;
9690                    let inner = self.inner.clone();
9691                    let fut = async move {
9692                        let method = GetOrgWebhookConfigSvc(inner);
9693                        let codec = tonic_prost::ProstCodec::default();
9694                        let mut grpc = tonic::server::Grpc::new(codec)
9695                            .apply_compression_config(
9696                                accept_compression_encodings,
9697                                send_compression_encodings,
9698                            )
9699                            .apply_max_message_size_config(
9700                                max_decoding_message_size,
9701                                max_encoding_message_size,
9702                            );
9703                        let res = grpc.unary(method, req).await;
9704                        Ok(res)
9705                    };
9706                    Box::pin(fut)
9707                }
9708                "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9709                    #[allow(non_camel_case_types)]
9710                    struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9711                    impl<
9712                        T: IntegrationsService,
9713                    > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9714                    for SetOrgWebhookConfigSvc<T> {
9715                        type Response = super::SetOrgWebhookConfigResponse;
9716                        type Future = BoxFuture<
9717                            tonic::Response<Self::Response>,
9718                            tonic::Status,
9719                        >;
9720                        fn call(
9721                            &mut self,
9722                            request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9723                        ) -> Self::Future {
9724                            let inner = Arc::clone(&self.0);
9725                            let fut = async move {
9726                                <T as IntegrationsService>::set_org_webhook_config(
9727                                        &inner,
9728                                        request,
9729                                    )
9730                                    .await
9731                            };
9732                            Box::pin(fut)
9733                        }
9734                    }
9735                    let accept_compression_encodings = self.accept_compression_encodings;
9736                    let send_compression_encodings = self.send_compression_encodings;
9737                    let max_decoding_message_size = self.max_decoding_message_size;
9738                    let max_encoding_message_size = self.max_encoding_message_size;
9739                    let inner = self.inner.clone();
9740                    let fut = async move {
9741                        let method = SetOrgWebhookConfigSvc(inner);
9742                        let codec = tonic_prost::ProstCodec::default();
9743                        let mut grpc = tonic::server::Grpc::new(codec)
9744                            .apply_compression_config(
9745                                accept_compression_encodings,
9746                                send_compression_encodings,
9747                            )
9748                            .apply_max_message_size_config(
9749                                max_decoding_message_size,
9750                                max_encoding_message_size,
9751                            );
9752                        let res = grpc.unary(method, req).await;
9753                        Ok(res)
9754                    };
9755                    Box::pin(fut)
9756                }
9757                "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9758                    #[allow(non_camel_case_types)]
9759                    struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9760                        pub Arc<T>,
9761                    );
9762                    impl<
9763                        T: IntegrationsService,
9764                    > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9765                    for CreateChannelConnectLinkSvc<T> {
9766                        type Response = super::CreateChannelConnectLinkResponse;
9767                        type Future = BoxFuture<
9768                            tonic::Response<Self::Response>,
9769                            tonic::Status,
9770                        >;
9771                        fn call(
9772                            &mut self,
9773                            request: tonic::Request<
9774                                super::CreateChannelConnectLinkRequest,
9775                            >,
9776                        ) -> Self::Future {
9777                            let inner = Arc::clone(&self.0);
9778                            let fut = async move {
9779                                <T as IntegrationsService>::create_channel_connect_link(
9780                                        &inner,
9781                                        request,
9782                                    )
9783                                    .await
9784                            };
9785                            Box::pin(fut)
9786                        }
9787                    }
9788                    let accept_compression_encodings = self.accept_compression_encodings;
9789                    let send_compression_encodings = self.send_compression_encodings;
9790                    let max_decoding_message_size = self.max_decoding_message_size;
9791                    let max_encoding_message_size = self.max_encoding_message_size;
9792                    let inner = self.inner.clone();
9793                    let fut = async move {
9794                        let method = CreateChannelConnectLinkSvc(inner);
9795                        let codec = tonic_prost::ProstCodec::default();
9796                        let mut grpc = tonic::server::Grpc::new(codec)
9797                            .apply_compression_config(
9798                                accept_compression_encodings,
9799                                send_compression_encodings,
9800                            )
9801                            .apply_max_message_size_config(
9802                                max_decoding_message_size,
9803                                max_encoding_message_size,
9804                            );
9805                        let res = grpc.unary(method, req).await;
9806                        Ok(res)
9807                    };
9808                    Box::pin(fut)
9809                }
9810                "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization" => {
9811                    #[allow(non_camel_case_types)]
9812                    struct CreateSlackWorkspaceInstallAuthorizationSvc<
9813                        T: IntegrationsService,
9814                    >(
9815                        pub Arc<T>,
9816                    );
9817                    impl<
9818                        T: IntegrationsService,
9819                    > tonic::server::UnaryService<
9820                        super::CreateSlackWorkspaceInstallAuthorizationRequest,
9821                    > for CreateSlackWorkspaceInstallAuthorizationSvc<T> {
9822                        type Response = super::CreateSlackWorkspaceInstallAuthorizationResponse;
9823                        type Future = BoxFuture<
9824                            tonic::Response<Self::Response>,
9825                            tonic::Status,
9826                        >;
9827                        fn call(
9828                            &mut self,
9829                            request: tonic::Request<
9830                                super::CreateSlackWorkspaceInstallAuthorizationRequest,
9831                            >,
9832                        ) -> Self::Future {
9833                            let inner = Arc::clone(&self.0);
9834                            let fut = async move {
9835                                <T as IntegrationsService>::create_slack_workspace_install_authorization(
9836                                        &inner,
9837                                        request,
9838                                    )
9839                                    .await
9840                            };
9841                            Box::pin(fut)
9842                        }
9843                    }
9844                    let accept_compression_encodings = self.accept_compression_encodings;
9845                    let send_compression_encodings = self.send_compression_encodings;
9846                    let max_decoding_message_size = self.max_decoding_message_size;
9847                    let max_encoding_message_size = self.max_encoding_message_size;
9848                    let inner = self.inner.clone();
9849                    let fut = async move {
9850                        let method = CreateSlackWorkspaceInstallAuthorizationSvc(inner);
9851                        let codec = tonic_prost::ProstCodec::default();
9852                        let mut grpc = tonic::server::Grpc::new(codec)
9853                            .apply_compression_config(
9854                                accept_compression_encodings,
9855                                send_compression_encodings,
9856                            )
9857                            .apply_max_message_size_config(
9858                                max_decoding_message_size,
9859                                max_encoding_message_size,
9860                            );
9861                        let res = grpc.unary(method, req).await;
9862                        Ok(res)
9863                    };
9864                    Box::pin(fut)
9865                }
9866                _ => {
9867                    Box::pin(async move {
9868                        let mut response = http::Response::new(
9869                            tonic::body::Body::default(),
9870                        );
9871                        let headers = response.headers_mut();
9872                        headers
9873                            .insert(
9874                                tonic::Status::GRPC_STATUS,
9875                                (tonic::Code::Unimplemented as i32).into(),
9876                            );
9877                        headers
9878                            .insert(
9879                                http::header::CONTENT_TYPE,
9880                                tonic::metadata::GRPC_CONTENT_TYPE,
9881                            );
9882                        Ok(response)
9883                    })
9884                }
9885            }
9886        }
9887    }
9888    impl<T> Clone for IntegrationsServiceServer<T> {
9889        fn clone(&self) -> Self {
9890            let inner = self.inner.clone();
9891            Self {
9892                inner,
9893                accept_compression_encodings: self.accept_compression_encodings,
9894                send_compression_encodings: self.send_compression_encodings,
9895                max_decoding_message_size: self.max_decoding_message_size,
9896                max_encoding_message_size: self.max_encoding_message_size,
9897            }
9898        }
9899    }
9900    /// Generated gRPC service name
9901    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9902    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9903        const NAME: &'static str = SERVICE_NAME;
9904    }
9905}
9906/// Generated client implementations.
9907pub mod invite_link_service_client {
9908    #![allow(
9909        unused_variables,
9910        dead_code,
9911        missing_docs,
9912        clippy::wildcard_imports,
9913        clippy::let_unit_value,
9914    )]
9915    use tonic::codegen::*;
9916    use tonic::codegen::http::Uri;
9917    /** Manages shareable invite links for organization self-join.
9918 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9919 ValidateInviteLink is unauthenticated — the token IS the authorization.
9920 RedeemInviteLink requires a valid JWT.
9921*/
9922    #[derive(Debug, Clone)]
9923    pub struct InviteLinkServiceClient<T> {
9924        inner: tonic::client::Grpc<T>,
9925    }
9926    impl InviteLinkServiceClient<tonic::transport::Channel> {
9927        /// Attempt to create a new client by connecting to a given endpoint.
9928        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9929        where
9930            D: TryInto<tonic::transport::Endpoint>,
9931            D::Error: Into<StdError>,
9932        {
9933            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9934            Ok(Self::new(conn))
9935        }
9936    }
9937    impl<T> InviteLinkServiceClient<T>
9938    where
9939        T: tonic::client::GrpcService<tonic::body::Body>,
9940        T::Error: Into<StdError>,
9941        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9942        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9943    {
9944        pub fn new(inner: T) -> Self {
9945            let inner = tonic::client::Grpc::new(inner);
9946            Self { inner }
9947        }
9948        pub fn with_origin(inner: T, origin: Uri) -> Self {
9949            let inner = tonic::client::Grpc::with_origin(inner, origin);
9950            Self { inner }
9951        }
9952        pub fn with_interceptor<F>(
9953            inner: T,
9954            interceptor: F,
9955        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9956        where
9957            F: tonic::service::Interceptor,
9958            T::ResponseBody: Default,
9959            T: tonic::codegen::Service<
9960                http::Request<tonic::body::Body>,
9961                Response = http::Response<
9962                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9963                >,
9964            >,
9965            <T as tonic::codegen::Service<
9966                http::Request<tonic::body::Body>,
9967            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9968        {
9969            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9970        }
9971        /// Compress requests with the given encoding.
9972        ///
9973        /// This requires the server to support it otherwise it might respond with an
9974        /// error.
9975        #[must_use]
9976        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9977            self.inner = self.inner.send_compressed(encoding);
9978            self
9979        }
9980        /// Enable decompressing responses.
9981        #[must_use]
9982        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9983            self.inner = self.inner.accept_compressed(encoding);
9984            self
9985        }
9986        /// Limits the maximum size of a decoded message.
9987        ///
9988        /// Default: `4MB`
9989        #[must_use]
9990        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9991            self.inner = self.inner.max_decoding_message_size(limit);
9992            self
9993        }
9994        /// Limits the maximum size of an encoded message.
9995        ///
9996        /// Default: `usize::MAX`
9997        #[must_use]
9998        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9999            self.inner = self.inner.max_encoding_message_size(limit);
10000            self
10001        }
10002        /** Create a new shareable invite link for the organization.
10003 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10004*/
10005        pub async fn create_invite_link(
10006            &mut self,
10007            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
10008        ) -> std::result::Result<
10009            tonic::Response<super::CreateInviteLinkResponse>,
10010            tonic::Status,
10011        > {
10012            self.inner
10013                .ready()
10014                .await
10015                .map_err(|e| {
10016                    tonic::Status::unknown(
10017                        format!("Service was not ready: {}", e.into()),
10018                    )
10019                })?;
10020            let codec = tonic_prost::ProstCodec::default();
10021            let path = http::uri::PathAndQuery::from_static(
10022                "/pidgr.v1.InviteLinkService/CreateInviteLink",
10023            );
10024            let mut req = request.into_request();
10025            req.extensions_mut()
10026                .insert(
10027                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
10028                );
10029            self.inner.unary(req, path, codec).await
10030        }
10031        /** List all invite links for the organization.
10032 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10033*/
10034        pub async fn list_invite_links(
10035            &mut self,
10036            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
10037        ) -> std::result::Result<
10038            tonic::Response<super::ListInviteLinksResponse>,
10039            tonic::Status,
10040        > {
10041            self.inner
10042                .ready()
10043                .await
10044                .map_err(|e| {
10045                    tonic::Status::unknown(
10046                        format!("Service was not ready: {}", e.into()),
10047                    )
10048                })?;
10049            let codec = tonic_prost::ProstCodec::default();
10050            let path = http::uri::PathAndQuery::from_static(
10051                "/pidgr.v1.InviteLinkService/ListInviteLinks",
10052            );
10053            let mut req = request.into_request();
10054            req.extensions_mut()
10055                .insert(
10056                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
10057                );
10058            self.inner.unary(req, path, codec).await
10059        }
10060        /** Revoke an invite link, making it immediately unusable. Idempotent.
10061 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10062*/
10063        pub async fn revoke_invite_link(
10064            &mut self,
10065            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
10066        ) -> std::result::Result<
10067            tonic::Response<super::RevokeInviteLinkResponse>,
10068            tonic::Status,
10069        > {
10070            self.inner
10071                .ready()
10072                .await
10073                .map_err(|e| {
10074                    tonic::Status::unknown(
10075                        format!("Service was not ready: {}", e.into()),
10076                    )
10077                })?;
10078            let codec = tonic_prost::ProstCodec::default();
10079            let path = http::uri::PathAndQuery::from_static(
10080                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
10081            );
10082            let mut req = request.into_request();
10083            req.extensions_mut()
10084                .insert(
10085                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
10086                );
10087            self.inner.unary(req, path, codec).await
10088        }
10089        /** Validate an invite link and provision a user account if needed.
10090 This is a pre-authentication endpoint — no JWT required.
10091 Rate limited to 10 requests per minute per IP.
10092 Authorization: None (token-based).
10093*/
10094        pub async fn validate_invite_link(
10095            &mut self,
10096            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
10097        ) -> std::result::Result<
10098            tonic::Response<super::ValidateInviteLinkResponse>,
10099            tonic::Status,
10100        > {
10101            self.inner
10102                .ready()
10103                .await
10104                .map_err(|e| {
10105                    tonic::Status::unknown(
10106                        format!("Service was not ready: {}", e.into()),
10107                    )
10108                })?;
10109            let codec = tonic_prost::ProstCodec::default();
10110            let path = http::uri::PathAndQuery::from_static(
10111                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
10112            );
10113            let mut req = request.into_request();
10114            req.extensions_mut()
10115                .insert(
10116                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
10117                );
10118            self.inner.unary(req, path, codec).await
10119        }
10120        /** Redeem an invite link to join an organization.
10121 Requires a valid JWT — the email is extracted from the token.
10122 Authorization: JWT required.
10123*/
10124        pub async fn redeem_invite_link(
10125            &mut self,
10126            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
10127        ) -> std::result::Result<
10128            tonic::Response<super::RedeemInviteLinkResponse>,
10129            tonic::Status,
10130        > {
10131            self.inner
10132                .ready()
10133                .await
10134                .map_err(|e| {
10135                    tonic::Status::unknown(
10136                        format!("Service was not ready: {}", e.into()),
10137                    )
10138                })?;
10139            let codec = tonic_prost::ProstCodec::default();
10140            let path = http::uri::PathAndQuery::from_static(
10141                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
10142            );
10143            let mut req = request.into_request();
10144            req.extensions_mut()
10145                .insert(
10146                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
10147                );
10148            self.inner.unary(req, path, codec).await
10149        }
10150    }
10151}
10152/// Generated server implementations.
10153pub mod invite_link_service_server {
10154    #![allow(
10155        unused_variables,
10156        dead_code,
10157        missing_docs,
10158        clippy::wildcard_imports,
10159        clippy::let_unit_value,
10160    )]
10161    use tonic::codegen::*;
10162    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
10163    #[async_trait]
10164    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
10165        /** Create a new shareable invite link for the organization.
10166 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10167*/
10168        async fn create_invite_link(
10169            &self,
10170            request: tonic::Request<super::CreateInviteLinkRequest>,
10171        ) -> std::result::Result<
10172            tonic::Response<super::CreateInviteLinkResponse>,
10173            tonic::Status,
10174        >;
10175        /** List all invite links for the organization.
10176 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10177*/
10178        async fn list_invite_links(
10179            &self,
10180            request: tonic::Request<super::ListInviteLinksRequest>,
10181        ) -> std::result::Result<
10182            tonic::Response<super::ListInviteLinksResponse>,
10183            tonic::Status,
10184        >;
10185        /** Revoke an invite link, making it immediately unusable. Idempotent.
10186 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10187*/
10188        async fn revoke_invite_link(
10189            &self,
10190            request: tonic::Request<super::RevokeInviteLinkRequest>,
10191        ) -> std::result::Result<
10192            tonic::Response<super::RevokeInviteLinkResponse>,
10193            tonic::Status,
10194        >;
10195        /** Validate an invite link and provision a user account if needed.
10196 This is a pre-authentication endpoint — no JWT required.
10197 Rate limited to 10 requests per minute per IP.
10198 Authorization: None (token-based).
10199*/
10200        async fn validate_invite_link(
10201            &self,
10202            request: tonic::Request<super::ValidateInviteLinkRequest>,
10203        ) -> std::result::Result<
10204            tonic::Response<super::ValidateInviteLinkResponse>,
10205            tonic::Status,
10206        >;
10207        /** Redeem an invite link to join an organization.
10208 Requires a valid JWT — the email is extracted from the token.
10209 Authorization: JWT required.
10210*/
10211        async fn redeem_invite_link(
10212            &self,
10213            request: tonic::Request<super::RedeemInviteLinkRequest>,
10214        ) -> std::result::Result<
10215            tonic::Response<super::RedeemInviteLinkResponse>,
10216            tonic::Status,
10217        >;
10218    }
10219    /** Manages shareable invite links for organization self-join.
10220 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
10221 ValidateInviteLink is unauthenticated — the token IS the authorization.
10222 RedeemInviteLink requires a valid JWT.
10223*/
10224    #[derive(Debug)]
10225    pub struct InviteLinkServiceServer<T> {
10226        inner: Arc<T>,
10227        accept_compression_encodings: EnabledCompressionEncodings,
10228        send_compression_encodings: EnabledCompressionEncodings,
10229        max_decoding_message_size: Option<usize>,
10230        max_encoding_message_size: Option<usize>,
10231    }
10232    impl<T> InviteLinkServiceServer<T> {
10233        pub fn new(inner: T) -> Self {
10234            Self::from_arc(Arc::new(inner))
10235        }
10236        pub fn from_arc(inner: Arc<T>) -> Self {
10237            Self {
10238                inner,
10239                accept_compression_encodings: Default::default(),
10240                send_compression_encodings: Default::default(),
10241                max_decoding_message_size: None,
10242                max_encoding_message_size: None,
10243            }
10244        }
10245        pub fn with_interceptor<F>(
10246            inner: T,
10247            interceptor: F,
10248        ) -> InterceptedService<Self, F>
10249        where
10250            F: tonic::service::Interceptor,
10251        {
10252            InterceptedService::new(Self::new(inner), interceptor)
10253        }
10254        /// Enable decompressing requests with the given encoding.
10255        #[must_use]
10256        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10257            self.accept_compression_encodings.enable(encoding);
10258            self
10259        }
10260        /// Compress responses with the given encoding, if the client supports it.
10261        #[must_use]
10262        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10263            self.send_compression_encodings.enable(encoding);
10264            self
10265        }
10266        /// Limits the maximum size of a decoded message.
10267        ///
10268        /// Default: `4MB`
10269        #[must_use]
10270        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10271            self.max_decoding_message_size = Some(limit);
10272            self
10273        }
10274        /// Limits the maximum size of an encoded message.
10275        ///
10276        /// Default: `usize::MAX`
10277        #[must_use]
10278        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10279            self.max_encoding_message_size = Some(limit);
10280            self
10281        }
10282    }
10283    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
10284    where
10285        T: InviteLinkService,
10286        B: Body + std::marker::Send + 'static,
10287        B::Error: Into<StdError> + std::marker::Send + 'static,
10288    {
10289        type Response = http::Response<tonic::body::Body>;
10290        type Error = std::convert::Infallible;
10291        type Future = BoxFuture<Self::Response, Self::Error>;
10292        fn poll_ready(
10293            &mut self,
10294            _cx: &mut Context<'_>,
10295        ) -> Poll<std::result::Result<(), Self::Error>> {
10296            Poll::Ready(Ok(()))
10297        }
10298        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10299            match req.uri().path() {
10300                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
10301                    #[allow(non_camel_case_types)]
10302                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10303                    impl<
10304                        T: InviteLinkService,
10305                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
10306                    for CreateInviteLinkSvc<T> {
10307                        type Response = super::CreateInviteLinkResponse;
10308                        type Future = BoxFuture<
10309                            tonic::Response<Self::Response>,
10310                            tonic::Status,
10311                        >;
10312                        fn call(
10313                            &mut self,
10314                            request: tonic::Request<super::CreateInviteLinkRequest>,
10315                        ) -> Self::Future {
10316                            let inner = Arc::clone(&self.0);
10317                            let fut = async move {
10318                                <T as InviteLinkService>::create_invite_link(
10319                                        &inner,
10320                                        request,
10321                                    )
10322                                    .await
10323                            };
10324                            Box::pin(fut)
10325                        }
10326                    }
10327                    let accept_compression_encodings = self.accept_compression_encodings;
10328                    let send_compression_encodings = self.send_compression_encodings;
10329                    let max_decoding_message_size = self.max_decoding_message_size;
10330                    let max_encoding_message_size = self.max_encoding_message_size;
10331                    let inner = self.inner.clone();
10332                    let fut = async move {
10333                        let method = CreateInviteLinkSvc(inner);
10334                        let codec = tonic_prost::ProstCodec::default();
10335                        let mut grpc = tonic::server::Grpc::new(codec)
10336                            .apply_compression_config(
10337                                accept_compression_encodings,
10338                                send_compression_encodings,
10339                            )
10340                            .apply_max_message_size_config(
10341                                max_decoding_message_size,
10342                                max_encoding_message_size,
10343                            );
10344                        let res = grpc.unary(method, req).await;
10345                        Ok(res)
10346                    };
10347                    Box::pin(fut)
10348                }
10349                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
10350                    #[allow(non_camel_case_types)]
10351                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
10352                    impl<
10353                        T: InviteLinkService,
10354                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
10355                    for ListInviteLinksSvc<T> {
10356                        type Response = super::ListInviteLinksResponse;
10357                        type Future = BoxFuture<
10358                            tonic::Response<Self::Response>,
10359                            tonic::Status,
10360                        >;
10361                        fn call(
10362                            &mut self,
10363                            request: tonic::Request<super::ListInviteLinksRequest>,
10364                        ) -> Self::Future {
10365                            let inner = Arc::clone(&self.0);
10366                            let fut = async move {
10367                                <T as InviteLinkService>::list_invite_links(&inner, request)
10368                                    .await
10369                            };
10370                            Box::pin(fut)
10371                        }
10372                    }
10373                    let accept_compression_encodings = self.accept_compression_encodings;
10374                    let send_compression_encodings = self.send_compression_encodings;
10375                    let max_decoding_message_size = self.max_decoding_message_size;
10376                    let max_encoding_message_size = self.max_encoding_message_size;
10377                    let inner = self.inner.clone();
10378                    let fut = async move {
10379                        let method = ListInviteLinksSvc(inner);
10380                        let codec = tonic_prost::ProstCodec::default();
10381                        let mut grpc = tonic::server::Grpc::new(codec)
10382                            .apply_compression_config(
10383                                accept_compression_encodings,
10384                                send_compression_encodings,
10385                            )
10386                            .apply_max_message_size_config(
10387                                max_decoding_message_size,
10388                                max_encoding_message_size,
10389                            );
10390                        let res = grpc.unary(method, req).await;
10391                        Ok(res)
10392                    };
10393                    Box::pin(fut)
10394                }
10395                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
10396                    #[allow(non_camel_case_types)]
10397                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10398                    impl<
10399                        T: InviteLinkService,
10400                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
10401                    for RevokeInviteLinkSvc<T> {
10402                        type Response = super::RevokeInviteLinkResponse;
10403                        type Future = BoxFuture<
10404                            tonic::Response<Self::Response>,
10405                            tonic::Status,
10406                        >;
10407                        fn call(
10408                            &mut self,
10409                            request: tonic::Request<super::RevokeInviteLinkRequest>,
10410                        ) -> Self::Future {
10411                            let inner = Arc::clone(&self.0);
10412                            let fut = async move {
10413                                <T as InviteLinkService>::revoke_invite_link(
10414                                        &inner,
10415                                        request,
10416                                    )
10417                                    .await
10418                            };
10419                            Box::pin(fut)
10420                        }
10421                    }
10422                    let accept_compression_encodings = self.accept_compression_encodings;
10423                    let send_compression_encodings = self.send_compression_encodings;
10424                    let max_decoding_message_size = self.max_decoding_message_size;
10425                    let max_encoding_message_size = self.max_encoding_message_size;
10426                    let inner = self.inner.clone();
10427                    let fut = async move {
10428                        let method = RevokeInviteLinkSvc(inner);
10429                        let codec = tonic_prost::ProstCodec::default();
10430                        let mut grpc = tonic::server::Grpc::new(codec)
10431                            .apply_compression_config(
10432                                accept_compression_encodings,
10433                                send_compression_encodings,
10434                            )
10435                            .apply_max_message_size_config(
10436                                max_decoding_message_size,
10437                                max_encoding_message_size,
10438                            );
10439                        let res = grpc.unary(method, req).await;
10440                        Ok(res)
10441                    };
10442                    Box::pin(fut)
10443                }
10444                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
10445                    #[allow(non_camel_case_types)]
10446                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10447                    impl<
10448                        T: InviteLinkService,
10449                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
10450                    for ValidateInviteLinkSvc<T> {
10451                        type Response = super::ValidateInviteLinkResponse;
10452                        type Future = BoxFuture<
10453                            tonic::Response<Self::Response>,
10454                            tonic::Status,
10455                        >;
10456                        fn call(
10457                            &mut self,
10458                            request: tonic::Request<super::ValidateInviteLinkRequest>,
10459                        ) -> Self::Future {
10460                            let inner = Arc::clone(&self.0);
10461                            let fut = async move {
10462                                <T as InviteLinkService>::validate_invite_link(
10463                                        &inner,
10464                                        request,
10465                                    )
10466                                    .await
10467                            };
10468                            Box::pin(fut)
10469                        }
10470                    }
10471                    let accept_compression_encodings = self.accept_compression_encodings;
10472                    let send_compression_encodings = self.send_compression_encodings;
10473                    let max_decoding_message_size = self.max_decoding_message_size;
10474                    let max_encoding_message_size = self.max_encoding_message_size;
10475                    let inner = self.inner.clone();
10476                    let fut = async move {
10477                        let method = ValidateInviteLinkSvc(inner);
10478                        let codec = tonic_prost::ProstCodec::default();
10479                        let mut grpc = tonic::server::Grpc::new(codec)
10480                            .apply_compression_config(
10481                                accept_compression_encodings,
10482                                send_compression_encodings,
10483                            )
10484                            .apply_max_message_size_config(
10485                                max_decoding_message_size,
10486                                max_encoding_message_size,
10487                            );
10488                        let res = grpc.unary(method, req).await;
10489                        Ok(res)
10490                    };
10491                    Box::pin(fut)
10492                }
10493                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
10494                    #[allow(non_camel_case_types)]
10495                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10496                    impl<
10497                        T: InviteLinkService,
10498                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
10499                    for RedeemInviteLinkSvc<T> {
10500                        type Response = super::RedeemInviteLinkResponse;
10501                        type Future = BoxFuture<
10502                            tonic::Response<Self::Response>,
10503                            tonic::Status,
10504                        >;
10505                        fn call(
10506                            &mut self,
10507                            request: tonic::Request<super::RedeemInviteLinkRequest>,
10508                        ) -> Self::Future {
10509                            let inner = Arc::clone(&self.0);
10510                            let fut = async move {
10511                                <T as InviteLinkService>::redeem_invite_link(
10512                                        &inner,
10513                                        request,
10514                                    )
10515                                    .await
10516                            };
10517                            Box::pin(fut)
10518                        }
10519                    }
10520                    let accept_compression_encodings = self.accept_compression_encodings;
10521                    let send_compression_encodings = self.send_compression_encodings;
10522                    let max_decoding_message_size = self.max_decoding_message_size;
10523                    let max_encoding_message_size = self.max_encoding_message_size;
10524                    let inner = self.inner.clone();
10525                    let fut = async move {
10526                        let method = RedeemInviteLinkSvc(inner);
10527                        let codec = tonic_prost::ProstCodec::default();
10528                        let mut grpc = tonic::server::Grpc::new(codec)
10529                            .apply_compression_config(
10530                                accept_compression_encodings,
10531                                send_compression_encodings,
10532                            )
10533                            .apply_max_message_size_config(
10534                                max_decoding_message_size,
10535                                max_encoding_message_size,
10536                            );
10537                        let res = grpc.unary(method, req).await;
10538                        Ok(res)
10539                    };
10540                    Box::pin(fut)
10541                }
10542                _ => {
10543                    Box::pin(async move {
10544                        let mut response = http::Response::new(
10545                            tonic::body::Body::default(),
10546                        );
10547                        let headers = response.headers_mut();
10548                        headers
10549                            .insert(
10550                                tonic::Status::GRPC_STATUS,
10551                                (tonic::Code::Unimplemented as i32).into(),
10552                            );
10553                        headers
10554                            .insert(
10555                                http::header::CONTENT_TYPE,
10556                                tonic::metadata::GRPC_CONTENT_TYPE,
10557                            );
10558                        Ok(response)
10559                    })
10560                }
10561            }
10562        }
10563    }
10564    impl<T> Clone for InviteLinkServiceServer<T> {
10565        fn clone(&self) -> Self {
10566            let inner = self.inner.clone();
10567            Self {
10568                inner,
10569                accept_compression_encodings: self.accept_compression_encodings,
10570                send_compression_encodings: self.send_compression_encodings,
10571                max_decoding_message_size: self.max_decoding_message_size,
10572                max_encoding_message_size: self.max_encoding_message_size,
10573            }
10574        }
10575    }
10576    /// Generated gRPC service name
10577    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
10578    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
10579        const NAME: &'static str = SERVICE_NAME;
10580    }
10581}
10582/// Generated client implementations.
10583pub mod member_service_client {
10584    #![allow(
10585        unused_variables,
10586        dead_code,
10587        missing_docs,
10588        clippy::wildcard_imports,
10589        clippy::let_unit_value,
10590    )]
10591    use tonic::codegen::*;
10592    use tonic::codegen::http::Uri;
10593    /** Manages members (users) within an organization.
10594 All RPCs operate within the caller's org (extracted from JWT).
10595*/
10596    #[derive(Debug, Clone)]
10597    pub struct MemberServiceClient<T> {
10598        inner: tonic::client::Grpc<T>,
10599    }
10600    impl MemberServiceClient<tonic::transport::Channel> {
10601        /// Attempt to create a new client by connecting to a given endpoint.
10602        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10603        where
10604            D: TryInto<tonic::transport::Endpoint>,
10605            D::Error: Into<StdError>,
10606        {
10607            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10608            Ok(Self::new(conn))
10609        }
10610    }
10611    impl<T> MemberServiceClient<T>
10612    where
10613        T: tonic::client::GrpcService<tonic::body::Body>,
10614        T::Error: Into<StdError>,
10615        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10616        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10617    {
10618        pub fn new(inner: T) -> Self {
10619            let inner = tonic::client::Grpc::new(inner);
10620            Self { inner }
10621        }
10622        pub fn with_origin(inner: T, origin: Uri) -> Self {
10623            let inner = tonic::client::Grpc::with_origin(inner, origin);
10624            Self { inner }
10625        }
10626        pub fn with_interceptor<F>(
10627            inner: T,
10628            interceptor: F,
10629        ) -> MemberServiceClient<InterceptedService<T, F>>
10630        where
10631            F: tonic::service::Interceptor,
10632            T::ResponseBody: Default,
10633            T: tonic::codegen::Service<
10634                http::Request<tonic::body::Body>,
10635                Response = http::Response<
10636                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10637                >,
10638            >,
10639            <T as tonic::codegen::Service<
10640                http::Request<tonic::body::Body>,
10641            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10642        {
10643            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
10644        }
10645        /// Compress requests with the given encoding.
10646        ///
10647        /// This requires the server to support it otherwise it might respond with an
10648        /// error.
10649        #[must_use]
10650        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10651            self.inner = self.inner.send_compressed(encoding);
10652            self
10653        }
10654        /// Enable decompressing responses.
10655        #[must_use]
10656        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10657            self.inner = self.inner.accept_compressed(encoding);
10658            self
10659        }
10660        /// Limits the maximum size of a decoded message.
10661        ///
10662        /// Default: `4MB`
10663        #[must_use]
10664        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10665            self.inner = self.inner.max_decoding_message_size(limit);
10666            self
10667        }
10668        /// Limits the maximum size of an encoded message.
10669        ///
10670        /// Default: `usize::MAX`
10671        #[must_use]
10672        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10673            self.inner = self.inner.max_encoding_message_size(limit);
10674            self
10675        }
10676        /** Invite a new user to the organization via email.
10677 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10678*/
10679        pub async fn invite_user(
10680            &mut self,
10681            request: impl tonic::IntoRequest<super::InviteUserRequest>,
10682        ) -> std::result::Result<
10683            tonic::Response<super::InviteUserResponse>,
10684            tonic::Status,
10685        > {
10686            self.inner
10687                .ready()
10688                .await
10689                .map_err(|e| {
10690                    tonic::Status::unknown(
10691                        format!("Service was not ready: {}", e.into()),
10692                    )
10693                })?;
10694            let codec = tonic_prost::ProstCodec::default();
10695            let path = http::uri::PathAndQuery::from_static(
10696                "/pidgr.v1.MemberService/InviteUser",
10697            );
10698            let mut req = request.into_request();
10699            req.extensions_mut()
10700                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10701            self.inner.unary(req, path, codec).await
10702        }
10703        /** Retrieve a user by ID within the organization.
10704 Self-lookup (empty user_id) is allowed for any authenticated user.
10705 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10706*/
10707        pub async fn get_user(
10708            &mut self,
10709            request: impl tonic::IntoRequest<super::GetUserRequest>,
10710        ) -> std::result::Result<
10711            tonic::Response<super::GetUserResponse>,
10712            tonic::Status,
10713        > {
10714            self.inner
10715                .ready()
10716                .await
10717                .map_err(|e| {
10718                    tonic::Status::unknown(
10719                        format!("Service was not ready: {}", e.into()),
10720                    )
10721                })?;
10722            let codec = tonic_prost::ProstCodec::default();
10723            let path = http::uri::PathAndQuery::from_static(
10724                "/pidgr.v1.MemberService/GetUser",
10725            );
10726            let mut req = request.into_request();
10727            req.extensions_mut()
10728                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10729            self.inner.unary(req, path, codec).await
10730        }
10731        /** List all users in the organization with pagination.
10732 Authorization: Requires PERMISSION_MEMBERS_READ.
10733*/
10734        pub async fn list_users(
10735            &mut self,
10736            request: impl tonic::IntoRequest<super::ListUsersRequest>,
10737        ) -> std::result::Result<
10738            tonic::Response<super::ListUsersResponse>,
10739            tonic::Status,
10740        > {
10741            self.inner
10742                .ready()
10743                .await
10744                .map_err(|e| {
10745                    tonic::Status::unknown(
10746                        format!("Service was not ready: {}", e.into()),
10747                    )
10748                })?;
10749            let codec = tonic_prost::ProstCodec::default();
10750            let path = http::uri::PathAndQuery::from_static(
10751                "/pidgr.v1.MemberService/ListUsers",
10752            );
10753            let mut req = request.into_request();
10754            req.extensions_mut()
10755                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10756            self.inner.unary(req, path, codec).await
10757        }
10758        /** Change a user's role within the organization.
10759 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10760*/
10761        pub async fn update_user_role(
10762            &mut self,
10763            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10764        ) -> std::result::Result<
10765            tonic::Response<super::UpdateUserRoleResponse>,
10766            tonic::Status,
10767        > {
10768            self.inner
10769                .ready()
10770                .await
10771                .map_err(|e| {
10772                    tonic::Status::unknown(
10773                        format!("Service was not ready: {}", e.into()),
10774                    )
10775                })?;
10776            let codec = tonic_prost::ProstCodec::default();
10777            let path = http::uri::PathAndQuery::from_static(
10778                "/pidgr.v1.MemberService/UpdateUserRole",
10779            );
10780            let mut req = request.into_request();
10781            req.extensions_mut()
10782                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10783            self.inner.unary(req, path, codec).await
10784        }
10785        /** Deactivate a user within the organization.
10786 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10787*/
10788        pub async fn deactivate_user(
10789            &mut self,
10790            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10791        ) -> std::result::Result<
10792            tonic::Response<super::DeactivateUserResponse>,
10793            tonic::Status,
10794        > {
10795            self.inner
10796                .ready()
10797                .await
10798                .map_err(|e| {
10799                    tonic::Status::unknown(
10800                        format!("Service was not ready: {}", e.into()),
10801                    )
10802                })?;
10803            let codec = tonic_prost::ProstCodec::default();
10804            let path = http::uri::PathAndQuery::from_static(
10805                "/pidgr.v1.MemberService/DeactivateUser",
10806            );
10807            let mut req = request.into_request();
10808            req.extensions_mut()
10809                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10810            self.inner.unary(req, path, codec).await
10811        }
10812        /** Reactivate a deactivated user, restoring their status to INVITED.
10813 The user must complete the invite link flow again to become ACTIVE.
10814 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10815*/
10816        pub async fn reactivate_user(
10817            &mut self,
10818            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10819        ) -> std::result::Result<
10820            tonic::Response<super::ReactivateUserResponse>,
10821            tonic::Status,
10822        > {
10823            self.inner
10824                .ready()
10825                .await
10826                .map_err(|e| {
10827                    tonic::Status::unknown(
10828                        format!("Service was not ready: {}", e.into()),
10829                    )
10830                })?;
10831            let codec = tonic_prost::ProstCodec::default();
10832            let path = http::uri::PathAndQuery::from_static(
10833                "/pidgr.v1.MemberService/ReactivateUser",
10834            );
10835            let mut req = request.into_request();
10836            req.extensions_mut()
10837                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10838            self.inner.unary(req, path, codec).await
10839        }
10840        /** Revoke an invitation for a user who has not yet completed registration.
10841 Hard-deletes the user record (INVITED users have no data to preserve).
10842 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10843*/
10844        pub async fn revoke_invite(
10845            &mut self,
10846            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10847        ) -> std::result::Result<
10848            tonic::Response<super::RevokeInviteResponse>,
10849            tonic::Status,
10850        > {
10851            self.inner
10852                .ready()
10853                .await
10854                .map_err(|e| {
10855                    tonic::Status::unknown(
10856                        format!("Service was not ready: {}", e.into()),
10857                    )
10858                })?;
10859            let codec = tonic_prost::ProstCodec::default();
10860            let path = http::uri::PathAndQuery::from_static(
10861                "/pidgr.v1.MemberService/RevokeInvite",
10862            );
10863            let mut req = request.into_request();
10864            req.extensions_mut()
10865                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10866            self.inner.unary(req, path, codec).await
10867        }
10868        /** Update a user's profile attributes (department, title, etc.).
10869 Self-update (empty user_id or matching JWT sub) requires no special permission.
10870 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10871*/
10872        pub async fn update_user_profile(
10873            &mut self,
10874            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10875        ) -> std::result::Result<
10876            tonic::Response<super::UpdateUserProfileResponse>,
10877            tonic::Status,
10878        > {
10879            self.inner
10880                .ready()
10881                .await
10882                .map_err(|e| {
10883                    tonic::Status::unknown(
10884                        format!("Service was not ready: {}", e.into()),
10885                    )
10886                })?;
10887            let codec = tonic_prost::ProstCodec::default();
10888            let path = http::uri::PathAndQuery::from_static(
10889                "/pidgr.v1.MemberService/UpdateUserProfile",
10890            );
10891            let mut req = request.into_request();
10892            req.extensions_mut()
10893                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10894            self.inner.unary(req, path, codec).await
10895        }
10896        /** Retrieve the caller's platform settings (theme, etc.).
10897 Authorization: Any authenticated user (self-only).
10898*/
10899        pub async fn get_user_settings(
10900            &mut self,
10901            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10902        ) -> std::result::Result<
10903            tonic::Response<super::GetUserSettingsResponse>,
10904            tonic::Status,
10905        > {
10906            self.inner
10907                .ready()
10908                .await
10909                .map_err(|e| {
10910                    tonic::Status::unknown(
10911                        format!("Service was not ready: {}", e.into()),
10912                    )
10913                })?;
10914            let codec = tonic_prost::ProstCodec::default();
10915            let path = http::uri::PathAndQuery::from_static(
10916                "/pidgr.v1.MemberService/GetUserSettings",
10917            );
10918            let mut req = request.into_request();
10919            req.extensions_mut()
10920                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10921            self.inner.unary(req, path, codec).await
10922        }
10923        /** Update the caller's platform settings.
10924 Only fields with non-default values are applied; others are left unchanged.
10925 Authorization: Any authenticated user (self-only).
10926*/
10927        pub async fn update_user_settings(
10928            &mut self,
10929            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10930        ) -> std::result::Result<
10931            tonic::Response<super::UpdateUserSettingsResponse>,
10932            tonic::Status,
10933        > {
10934            self.inner
10935                .ready()
10936                .await
10937                .map_err(|e| {
10938                    tonic::Status::unknown(
10939                        format!("Service was not ready: {}", e.into()),
10940                    )
10941                })?;
10942            let codec = tonic_prost::ProstCodec::default();
10943            let path = http::uri::PathAndQuery::from_static(
10944                "/pidgr.v1.MemberService/UpdateUserSettings",
10945            );
10946            let mut req = request.into_request();
10947            req.extensions_mut()
10948                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10949            self.inner.unary(req, path, codec).await
10950        }
10951        /** Invite multiple users to the organization in a single call.
10952 Emails are deduplicated. Each email is processed independently — individual
10953 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10954 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10955*/
10956        pub async fn bulk_invite_users(
10957            &mut self,
10958            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10959        ) -> std::result::Result<
10960            tonic::Response<super::BulkInviteUsersResponse>,
10961            tonic::Status,
10962        > {
10963            self.inner
10964                .ready()
10965                .await
10966                .map_err(|e| {
10967                    tonic::Status::unknown(
10968                        format!("Service was not ready: {}", e.into()),
10969                    )
10970                })?;
10971            let codec = tonic_prost::ProstCodec::default();
10972            let path = http::uri::PathAndQuery::from_static(
10973                "/pidgr.v1.MemberService/BulkInviteUsers",
10974            );
10975            let mut req = request.into_request();
10976            req.extensions_mut()
10977                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10978            self.inner.unary(req, path, codec).await
10979        }
10980        /** Confirm passkey enrollment after client-side WebAuthn registration.
10981 Verifies the caller has at least one registered credential server-side,
10982 then marks the user as passkey-enrolled in the identity provider.
10983 Authorization: Any authenticated user (self-only, no permission required).
10984*/
10985        pub async fn confirm_passkey_enrollment(
10986            &mut self,
10987            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10988        ) -> std::result::Result<
10989            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10990            tonic::Status,
10991        > {
10992            self.inner
10993                .ready()
10994                .await
10995                .map_err(|e| {
10996                    tonic::Status::unknown(
10997                        format!("Service was not ready: {}", e.into()),
10998                    )
10999                })?;
11000            let codec = tonic_prost::ProstCodec::default();
11001            let path = http::uri::PathAndQuery::from_static(
11002                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
11003            );
11004            let mut req = request.into_request();
11005            req.extensions_mut()
11006                .insert(
11007                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
11008                );
11009            self.inner.unary(req, path, codec).await
11010        }
11011        /** Update the data governance region for a user. Triggers a data migration
11012 workflow if the region changed. Admin-only operation.
11013 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11014*/
11015        pub async fn update_user_region(
11016            &mut self,
11017            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
11018        ) -> std::result::Result<
11019            tonic::Response<super::UpdateUserRegionResponse>,
11020            tonic::Status,
11021        > {
11022            self.inner
11023                .ready()
11024                .await
11025                .map_err(|e| {
11026                    tonic::Status::unknown(
11027                        format!("Service was not ready: {}", e.into()),
11028                    )
11029                })?;
11030            let codec = tonic_prost::ProstCodec::default();
11031            let path = http::uri::PathAndQuery::from_static(
11032                "/pidgr.v1.MemberService/UpdateUserRegion",
11033            );
11034            let mut req = request.into_request();
11035            req.extensions_mut()
11036                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
11037            self.inner.unary(req, path, codec).await
11038        }
11039    }
11040}
11041/// Generated server implementations.
11042pub mod member_service_server {
11043    #![allow(
11044        unused_variables,
11045        dead_code,
11046        missing_docs,
11047        clippy::wildcard_imports,
11048        clippy::let_unit_value,
11049    )]
11050    use tonic::codegen::*;
11051    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
11052    #[async_trait]
11053    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
11054        /** Invite a new user to the organization via email.
11055 Authorization: Requires PERMISSION_MEMBERS_INVITE.
11056*/
11057        async fn invite_user(
11058            &self,
11059            request: tonic::Request<super::InviteUserRequest>,
11060        ) -> std::result::Result<
11061            tonic::Response<super::InviteUserResponse>,
11062            tonic::Status,
11063        >;
11064        /** Retrieve a user by ID within the organization.
11065 Self-lookup (empty user_id) is allowed for any authenticated user.
11066 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
11067*/
11068        async fn get_user(
11069            &self,
11070            request: tonic::Request<super::GetUserRequest>,
11071        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
11072        /** List all users in the organization with pagination.
11073 Authorization: Requires PERMISSION_MEMBERS_READ.
11074*/
11075        async fn list_users(
11076            &self,
11077            request: tonic::Request<super::ListUsersRequest>,
11078        ) -> std::result::Result<
11079            tonic::Response<super::ListUsersResponse>,
11080            tonic::Status,
11081        >;
11082        /** Change a user's role within the organization.
11083 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11084*/
11085        async fn update_user_role(
11086            &self,
11087            request: tonic::Request<super::UpdateUserRoleRequest>,
11088        ) -> std::result::Result<
11089            tonic::Response<super::UpdateUserRoleResponse>,
11090            tonic::Status,
11091        >;
11092        /** Deactivate a user within the organization.
11093 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11094*/
11095        async fn deactivate_user(
11096            &self,
11097            request: tonic::Request<super::DeactivateUserRequest>,
11098        ) -> std::result::Result<
11099            tonic::Response<super::DeactivateUserResponse>,
11100            tonic::Status,
11101        >;
11102        /** Reactivate a deactivated user, restoring their status to INVITED.
11103 The user must complete the invite link flow again to become ACTIVE.
11104 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11105*/
11106        async fn reactivate_user(
11107            &self,
11108            request: tonic::Request<super::ReactivateUserRequest>,
11109        ) -> std::result::Result<
11110            tonic::Response<super::ReactivateUserResponse>,
11111            tonic::Status,
11112        >;
11113        /** Revoke an invitation for a user who has not yet completed registration.
11114 Hard-deletes the user record (INVITED users have no data to preserve).
11115 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11116*/
11117        async fn revoke_invite(
11118            &self,
11119            request: tonic::Request<super::RevokeInviteRequest>,
11120        ) -> std::result::Result<
11121            tonic::Response<super::RevokeInviteResponse>,
11122            tonic::Status,
11123        >;
11124        /** Update a user's profile attributes (department, title, etc.).
11125 Self-update (empty user_id or matching JWT sub) requires no special permission.
11126 Updating another user requires PERMISSION_MEMBERS_MANAGE.
11127*/
11128        async fn update_user_profile(
11129            &self,
11130            request: tonic::Request<super::UpdateUserProfileRequest>,
11131        ) -> std::result::Result<
11132            tonic::Response<super::UpdateUserProfileResponse>,
11133            tonic::Status,
11134        >;
11135        /** Retrieve the caller's platform settings (theme, etc.).
11136 Authorization: Any authenticated user (self-only).
11137*/
11138        async fn get_user_settings(
11139            &self,
11140            request: tonic::Request<super::GetUserSettingsRequest>,
11141        ) -> std::result::Result<
11142            tonic::Response<super::GetUserSettingsResponse>,
11143            tonic::Status,
11144        >;
11145        /** Update the caller's platform settings.
11146 Only fields with non-default values are applied; others are left unchanged.
11147 Authorization: Any authenticated user (self-only).
11148*/
11149        async fn update_user_settings(
11150            &self,
11151            request: tonic::Request<super::UpdateUserSettingsRequest>,
11152        ) -> std::result::Result<
11153            tonic::Response<super::UpdateUserSettingsResponse>,
11154            tonic::Status,
11155        >;
11156        /** Invite multiple users to the organization in a single call.
11157 Emails are deduplicated. Each email is processed independently — individual
11158 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
11159 Authorization: Requires PERMISSION_MEMBERS_INVITE.
11160*/
11161        async fn bulk_invite_users(
11162            &self,
11163            request: tonic::Request<super::BulkInviteUsersRequest>,
11164        ) -> std::result::Result<
11165            tonic::Response<super::BulkInviteUsersResponse>,
11166            tonic::Status,
11167        >;
11168        /** Confirm passkey enrollment after client-side WebAuthn registration.
11169 Verifies the caller has at least one registered credential server-side,
11170 then marks the user as passkey-enrolled in the identity provider.
11171 Authorization: Any authenticated user (self-only, no permission required).
11172*/
11173        async fn confirm_passkey_enrollment(
11174            &self,
11175            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
11176        ) -> std::result::Result<
11177            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
11178            tonic::Status,
11179        >;
11180        /** Update the data governance region for a user. Triggers a data migration
11181 workflow if the region changed. Admin-only operation.
11182 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11183*/
11184        async fn update_user_region(
11185            &self,
11186            request: tonic::Request<super::UpdateUserRegionRequest>,
11187        ) -> std::result::Result<
11188            tonic::Response<super::UpdateUserRegionResponse>,
11189            tonic::Status,
11190        >;
11191    }
11192    /** Manages members (users) within an organization.
11193 All RPCs operate within the caller's org (extracted from JWT).
11194*/
11195    #[derive(Debug)]
11196    pub struct MemberServiceServer<T> {
11197        inner: Arc<T>,
11198        accept_compression_encodings: EnabledCompressionEncodings,
11199        send_compression_encodings: EnabledCompressionEncodings,
11200        max_decoding_message_size: Option<usize>,
11201        max_encoding_message_size: Option<usize>,
11202    }
11203    impl<T> MemberServiceServer<T> {
11204        pub fn new(inner: T) -> Self {
11205            Self::from_arc(Arc::new(inner))
11206        }
11207        pub fn from_arc(inner: Arc<T>) -> Self {
11208            Self {
11209                inner,
11210                accept_compression_encodings: Default::default(),
11211                send_compression_encodings: Default::default(),
11212                max_decoding_message_size: None,
11213                max_encoding_message_size: None,
11214            }
11215        }
11216        pub fn with_interceptor<F>(
11217            inner: T,
11218            interceptor: F,
11219        ) -> InterceptedService<Self, F>
11220        where
11221            F: tonic::service::Interceptor,
11222        {
11223            InterceptedService::new(Self::new(inner), interceptor)
11224        }
11225        /// Enable decompressing requests with the given encoding.
11226        #[must_use]
11227        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11228            self.accept_compression_encodings.enable(encoding);
11229            self
11230        }
11231        /// Compress responses with the given encoding, if the client supports it.
11232        #[must_use]
11233        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11234            self.send_compression_encodings.enable(encoding);
11235            self
11236        }
11237        /// Limits the maximum size of a decoded message.
11238        ///
11239        /// Default: `4MB`
11240        #[must_use]
11241        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11242            self.max_decoding_message_size = Some(limit);
11243            self
11244        }
11245        /// Limits the maximum size of an encoded message.
11246        ///
11247        /// Default: `usize::MAX`
11248        #[must_use]
11249        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11250            self.max_encoding_message_size = Some(limit);
11251            self
11252        }
11253    }
11254    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
11255    where
11256        T: MemberService,
11257        B: Body + std::marker::Send + 'static,
11258        B::Error: Into<StdError> + std::marker::Send + 'static,
11259    {
11260        type Response = http::Response<tonic::body::Body>;
11261        type Error = std::convert::Infallible;
11262        type Future = BoxFuture<Self::Response, Self::Error>;
11263        fn poll_ready(
11264            &mut self,
11265            _cx: &mut Context<'_>,
11266        ) -> Poll<std::result::Result<(), Self::Error>> {
11267            Poll::Ready(Ok(()))
11268        }
11269        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11270            match req.uri().path() {
11271                "/pidgr.v1.MemberService/InviteUser" => {
11272                    #[allow(non_camel_case_types)]
11273                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
11274                    impl<
11275                        T: MemberService,
11276                    > tonic::server::UnaryService<super::InviteUserRequest>
11277                    for InviteUserSvc<T> {
11278                        type Response = super::InviteUserResponse;
11279                        type Future = BoxFuture<
11280                            tonic::Response<Self::Response>,
11281                            tonic::Status,
11282                        >;
11283                        fn call(
11284                            &mut self,
11285                            request: tonic::Request<super::InviteUserRequest>,
11286                        ) -> Self::Future {
11287                            let inner = Arc::clone(&self.0);
11288                            let fut = async move {
11289                                <T as MemberService>::invite_user(&inner, request).await
11290                            };
11291                            Box::pin(fut)
11292                        }
11293                    }
11294                    let accept_compression_encodings = self.accept_compression_encodings;
11295                    let send_compression_encodings = self.send_compression_encodings;
11296                    let max_decoding_message_size = self.max_decoding_message_size;
11297                    let max_encoding_message_size = self.max_encoding_message_size;
11298                    let inner = self.inner.clone();
11299                    let fut = async move {
11300                        let method = InviteUserSvc(inner);
11301                        let codec = tonic_prost::ProstCodec::default();
11302                        let mut grpc = tonic::server::Grpc::new(codec)
11303                            .apply_compression_config(
11304                                accept_compression_encodings,
11305                                send_compression_encodings,
11306                            )
11307                            .apply_max_message_size_config(
11308                                max_decoding_message_size,
11309                                max_encoding_message_size,
11310                            );
11311                        let res = grpc.unary(method, req).await;
11312                        Ok(res)
11313                    };
11314                    Box::pin(fut)
11315                }
11316                "/pidgr.v1.MemberService/GetUser" => {
11317                    #[allow(non_camel_case_types)]
11318                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
11319                    impl<
11320                        T: MemberService,
11321                    > tonic::server::UnaryService<super::GetUserRequest>
11322                    for GetUserSvc<T> {
11323                        type Response = super::GetUserResponse;
11324                        type Future = BoxFuture<
11325                            tonic::Response<Self::Response>,
11326                            tonic::Status,
11327                        >;
11328                        fn call(
11329                            &mut self,
11330                            request: tonic::Request<super::GetUserRequest>,
11331                        ) -> Self::Future {
11332                            let inner = Arc::clone(&self.0);
11333                            let fut = async move {
11334                                <T as MemberService>::get_user(&inner, request).await
11335                            };
11336                            Box::pin(fut)
11337                        }
11338                    }
11339                    let accept_compression_encodings = self.accept_compression_encodings;
11340                    let send_compression_encodings = self.send_compression_encodings;
11341                    let max_decoding_message_size = self.max_decoding_message_size;
11342                    let max_encoding_message_size = self.max_encoding_message_size;
11343                    let inner = self.inner.clone();
11344                    let fut = async move {
11345                        let method = GetUserSvc(inner);
11346                        let codec = tonic_prost::ProstCodec::default();
11347                        let mut grpc = tonic::server::Grpc::new(codec)
11348                            .apply_compression_config(
11349                                accept_compression_encodings,
11350                                send_compression_encodings,
11351                            )
11352                            .apply_max_message_size_config(
11353                                max_decoding_message_size,
11354                                max_encoding_message_size,
11355                            );
11356                        let res = grpc.unary(method, req).await;
11357                        Ok(res)
11358                    };
11359                    Box::pin(fut)
11360                }
11361                "/pidgr.v1.MemberService/ListUsers" => {
11362                    #[allow(non_camel_case_types)]
11363                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
11364                    impl<
11365                        T: MemberService,
11366                    > tonic::server::UnaryService<super::ListUsersRequest>
11367                    for ListUsersSvc<T> {
11368                        type Response = super::ListUsersResponse;
11369                        type Future = BoxFuture<
11370                            tonic::Response<Self::Response>,
11371                            tonic::Status,
11372                        >;
11373                        fn call(
11374                            &mut self,
11375                            request: tonic::Request<super::ListUsersRequest>,
11376                        ) -> Self::Future {
11377                            let inner = Arc::clone(&self.0);
11378                            let fut = async move {
11379                                <T as MemberService>::list_users(&inner, request).await
11380                            };
11381                            Box::pin(fut)
11382                        }
11383                    }
11384                    let accept_compression_encodings = self.accept_compression_encodings;
11385                    let send_compression_encodings = self.send_compression_encodings;
11386                    let max_decoding_message_size = self.max_decoding_message_size;
11387                    let max_encoding_message_size = self.max_encoding_message_size;
11388                    let inner = self.inner.clone();
11389                    let fut = async move {
11390                        let method = ListUsersSvc(inner);
11391                        let codec = tonic_prost::ProstCodec::default();
11392                        let mut grpc = tonic::server::Grpc::new(codec)
11393                            .apply_compression_config(
11394                                accept_compression_encodings,
11395                                send_compression_encodings,
11396                            )
11397                            .apply_max_message_size_config(
11398                                max_decoding_message_size,
11399                                max_encoding_message_size,
11400                            );
11401                        let res = grpc.unary(method, req).await;
11402                        Ok(res)
11403                    };
11404                    Box::pin(fut)
11405                }
11406                "/pidgr.v1.MemberService/UpdateUserRole" => {
11407                    #[allow(non_camel_case_types)]
11408                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
11409                    impl<
11410                        T: MemberService,
11411                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
11412                    for UpdateUserRoleSvc<T> {
11413                        type Response = super::UpdateUserRoleResponse;
11414                        type Future = BoxFuture<
11415                            tonic::Response<Self::Response>,
11416                            tonic::Status,
11417                        >;
11418                        fn call(
11419                            &mut self,
11420                            request: tonic::Request<super::UpdateUserRoleRequest>,
11421                        ) -> Self::Future {
11422                            let inner = Arc::clone(&self.0);
11423                            let fut = async move {
11424                                <T as MemberService>::update_user_role(&inner, request)
11425                                    .await
11426                            };
11427                            Box::pin(fut)
11428                        }
11429                    }
11430                    let accept_compression_encodings = self.accept_compression_encodings;
11431                    let send_compression_encodings = self.send_compression_encodings;
11432                    let max_decoding_message_size = self.max_decoding_message_size;
11433                    let max_encoding_message_size = self.max_encoding_message_size;
11434                    let inner = self.inner.clone();
11435                    let fut = async move {
11436                        let method = UpdateUserRoleSvc(inner);
11437                        let codec = tonic_prost::ProstCodec::default();
11438                        let mut grpc = tonic::server::Grpc::new(codec)
11439                            .apply_compression_config(
11440                                accept_compression_encodings,
11441                                send_compression_encodings,
11442                            )
11443                            .apply_max_message_size_config(
11444                                max_decoding_message_size,
11445                                max_encoding_message_size,
11446                            );
11447                        let res = grpc.unary(method, req).await;
11448                        Ok(res)
11449                    };
11450                    Box::pin(fut)
11451                }
11452                "/pidgr.v1.MemberService/DeactivateUser" => {
11453                    #[allow(non_camel_case_types)]
11454                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
11455                    impl<
11456                        T: MemberService,
11457                    > tonic::server::UnaryService<super::DeactivateUserRequest>
11458                    for DeactivateUserSvc<T> {
11459                        type Response = super::DeactivateUserResponse;
11460                        type Future = BoxFuture<
11461                            tonic::Response<Self::Response>,
11462                            tonic::Status,
11463                        >;
11464                        fn call(
11465                            &mut self,
11466                            request: tonic::Request<super::DeactivateUserRequest>,
11467                        ) -> Self::Future {
11468                            let inner = Arc::clone(&self.0);
11469                            let fut = async move {
11470                                <T as MemberService>::deactivate_user(&inner, request).await
11471                            };
11472                            Box::pin(fut)
11473                        }
11474                    }
11475                    let accept_compression_encodings = self.accept_compression_encodings;
11476                    let send_compression_encodings = self.send_compression_encodings;
11477                    let max_decoding_message_size = self.max_decoding_message_size;
11478                    let max_encoding_message_size = self.max_encoding_message_size;
11479                    let inner = self.inner.clone();
11480                    let fut = async move {
11481                        let method = DeactivateUserSvc(inner);
11482                        let codec = tonic_prost::ProstCodec::default();
11483                        let mut grpc = tonic::server::Grpc::new(codec)
11484                            .apply_compression_config(
11485                                accept_compression_encodings,
11486                                send_compression_encodings,
11487                            )
11488                            .apply_max_message_size_config(
11489                                max_decoding_message_size,
11490                                max_encoding_message_size,
11491                            );
11492                        let res = grpc.unary(method, req).await;
11493                        Ok(res)
11494                    };
11495                    Box::pin(fut)
11496                }
11497                "/pidgr.v1.MemberService/ReactivateUser" => {
11498                    #[allow(non_camel_case_types)]
11499                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
11500                    impl<
11501                        T: MemberService,
11502                    > tonic::server::UnaryService<super::ReactivateUserRequest>
11503                    for ReactivateUserSvc<T> {
11504                        type Response = super::ReactivateUserResponse;
11505                        type Future = BoxFuture<
11506                            tonic::Response<Self::Response>,
11507                            tonic::Status,
11508                        >;
11509                        fn call(
11510                            &mut self,
11511                            request: tonic::Request<super::ReactivateUserRequest>,
11512                        ) -> Self::Future {
11513                            let inner = Arc::clone(&self.0);
11514                            let fut = async move {
11515                                <T as MemberService>::reactivate_user(&inner, request).await
11516                            };
11517                            Box::pin(fut)
11518                        }
11519                    }
11520                    let accept_compression_encodings = self.accept_compression_encodings;
11521                    let send_compression_encodings = self.send_compression_encodings;
11522                    let max_decoding_message_size = self.max_decoding_message_size;
11523                    let max_encoding_message_size = self.max_encoding_message_size;
11524                    let inner = self.inner.clone();
11525                    let fut = async move {
11526                        let method = ReactivateUserSvc(inner);
11527                        let codec = tonic_prost::ProstCodec::default();
11528                        let mut grpc = tonic::server::Grpc::new(codec)
11529                            .apply_compression_config(
11530                                accept_compression_encodings,
11531                                send_compression_encodings,
11532                            )
11533                            .apply_max_message_size_config(
11534                                max_decoding_message_size,
11535                                max_encoding_message_size,
11536                            );
11537                        let res = grpc.unary(method, req).await;
11538                        Ok(res)
11539                    };
11540                    Box::pin(fut)
11541                }
11542                "/pidgr.v1.MemberService/RevokeInvite" => {
11543                    #[allow(non_camel_case_types)]
11544                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
11545                    impl<
11546                        T: MemberService,
11547                    > tonic::server::UnaryService<super::RevokeInviteRequest>
11548                    for RevokeInviteSvc<T> {
11549                        type Response = super::RevokeInviteResponse;
11550                        type Future = BoxFuture<
11551                            tonic::Response<Self::Response>,
11552                            tonic::Status,
11553                        >;
11554                        fn call(
11555                            &mut self,
11556                            request: tonic::Request<super::RevokeInviteRequest>,
11557                        ) -> Self::Future {
11558                            let inner = Arc::clone(&self.0);
11559                            let fut = async move {
11560                                <T as MemberService>::revoke_invite(&inner, request).await
11561                            };
11562                            Box::pin(fut)
11563                        }
11564                    }
11565                    let accept_compression_encodings = self.accept_compression_encodings;
11566                    let send_compression_encodings = self.send_compression_encodings;
11567                    let max_decoding_message_size = self.max_decoding_message_size;
11568                    let max_encoding_message_size = self.max_encoding_message_size;
11569                    let inner = self.inner.clone();
11570                    let fut = async move {
11571                        let method = RevokeInviteSvc(inner);
11572                        let codec = tonic_prost::ProstCodec::default();
11573                        let mut grpc = tonic::server::Grpc::new(codec)
11574                            .apply_compression_config(
11575                                accept_compression_encodings,
11576                                send_compression_encodings,
11577                            )
11578                            .apply_max_message_size_config(
11579                                max_decoding_message_size,
11580                                max_encoding_message_size,
11581                            );
11582                        let res = grpc.unary(method, req).await;
11583                        Ok(res)
11584                    };
11585                    Box::pin(fut)
11586                }
11587                "/pidgr.v1.MemberService/UpdateUserProfile" => {
11588                    #[allow(non_camel_case_types)]
11589                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
11590                    impl<
11591                        T: MemberService,
11592                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
11593                    for UpdateUserProfileSvc<T> {
11594                        type Response = super::UpdateUserProfileResponse;
11595                        type Future = BoxFuture<
11596                            tonic::Response<Self::Response>,
11597                            tonic::Status,
11598                        >;
11599                        fn call(
11600                            &mut self,
11601                            request: tonic::Request<super::UpdateUserProfileRequest>,
11602                        ) -> Self::Future {
11603                            let inner = Arc::clone(&self.0);
11604                            let fut = async move {
11605                                <T as MemberService>::update_user_profile(&inner, request)
11606                                    .await
11607                            };
11608                            Box::pin(fut)
11609                        }
11610                    }
11611                    let accept_compression_encodings = self.accept_compression_encodings;
11612                    let send_compression_encodings = self.send_compression_encodings;
11613                    let max_decoding_message_size = self.max_decoding_message_size;
11614                    let max_encoding_message_size = self.max_encoding_message_size;
11615                    let inner = self.inner.clone();
11616                    let fut = async move {
11617                        let method = UpdateUserProfileSvc(inner);
11618                        let codec = tonic_prost::ProstCodec::default();
11619                        let mut grpc = tonic::server::Grpc::new(codec)
11620                            .apply_compression_config(
11621                                accept_compression_encodings,
11622                                send_compression_encodings,
11623                            )
11624                            .apply_max_message_size_config(
11625                                max_decoding_message_size,
11626                                max_encoding_message_size,
11627                            );
11628                        let res = grpc.unary(method, req).await;
11629                        Ok(res)
11630                    };
11631                    Box::pin(fut)
11632                }
11633                "/pidgr.v1.MemberService/GetUserSettings" => {
11634                    #[allow(non_camel_case_types)]
11635                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
11636                    impl<
11637                        T: MemberService,
11638                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
11639                    for GetUserSettingsSvc<T> {
11640                        type Response = super::GetUserSettingsResponse;
11641                        type Future = BoxFuture<
11642                            tonic::Response<Self::Response>,
11643                            tonic::Status,
11644                        >;
11645                        fn call(
11646                            &mut self,
11647                            request: tonic::Request<super::GetUserSettingsRequest>,
11648                        ) -> Self::Future {
11649                            let inner = Arc::clone(&self.0);
11650                            let fut = async move {
11651                                <T as MemberService>::get_user_settings(&inner, request)
11652                                    .await
11653                            };
11654                            Box::pin(fut)
11655                        }
11656                    }
11657                    let accept_compression_encodings = self.accept_compression_encodings;
11658                    let send_compression_encodings = self.send_compression_encodings;
11659                    let max_decoding_message_size = self.max_decoding_message_size;
11660                    let max_encoding_message_size = self.max_encoding_message_size;
11661                    let inner = self.inner.clone();
11662                    let fut = async move {
11663                        let method = GetUserSettingsSvc(inner);
11664                        let codec = tonic_prost::ProstCodec::default();
11665                        let mut grpc = tonic::server::Grpc::new(codec)
11666                            .apply_compression_config(
11667                                accept_compression_encodings,
11668                                send_compression_encodings,
11669                            )
11670                            .apply_max_message_size_config(
11671                                max_decoding_message_size,
11672                                max_encoding_message_size,
11673                            );
11674                        let res = grpc.unary(method, req).await;
11675                        Ok(res)
11676                    };
11677                    Box::pin(fut)
11678                }
11679                "/pidgr.v1.MemberService/UpdateUserSettings" => {
11680                    #[allow(non_camel_case_types)]
11681                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11682                    impl<
11683                        T: MemberService,
11684                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11685                    for UpdateUserSettingsSvc<T> {
11686                        type Response = super::UpdateUserSettingsResponse;
11687                        type Future = BoxFuture<
11688                            tonic::Response<Self::Response>,
11689                            tonic::Status,
11690                        >;
11691                        fn call(
11692                            &mut self,
11693                            request: tonic::Request<super::UpdateUserSettingsRequest>,
11694                        ) -> Self::Future {
11695                            let inner = Arc::clone(&self.0);
11696                            let fut = async move {
11697                                <T as MemberService>::update_user_settings(&inner, request)
11698                                    .await
11699                            };
11700                            Box::pin(fut)
11701                        }
11702                    }
11703                    let accept_compression_encodings = self.accept_compression_encodings;
11704                    let send_compression_encodings = self.send_compression_encodings;
11705                    let max_decoding_message_size = self.max_decoding_message_size;
11706                    let max_encoding_message_size = self.max_encoding_message_size;
11707                    let inner = self.inner.clone();
11708                    let fut = async move {
11709                        let method = UpdateUserSettingsSvc(inner);
11710                        let codec = tonic_prost::ProstCodec::default();
11711                        let mut grpc = tonic::server::Grpc::new(codec)
11712                            .apply_compression_config(
11713                                accept_compression_encodings,
11714                                send_compression_encodings,
11715                            )
11716                            .apply_max_message_size_config(
11717                                max_decoding_message_size,
11718                                max_encoding_message_size,
11719                            );
11720                        let res = grpc.unary(method, req).await;
11721                        Ok(res)
11722                    };
11723                    Box::pin(fut)
11724                }
11725                "/pidgr.v1.MemberService/BulkInviteUsers" => {
11726                    #[allow(non_camel_case_types)]
11727                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11728                    impl<
11729                        T: MemberService,
11730                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11731                    for BulkInviteUsersSvc<T> {
11732                        type Response = super::BulkInviteUsersResponse;
11733                        type Future = BoxFuture<
11734                            tonic::Response<Self::Response>,
11735                            tonic::Status,
11736                        >;
11737                        fn call(
11738                            &mut self,
11739                            request: tonic::Request<super::BulkInviteUsersRequest>,
11740                        ) -> Self::Future {
11741                            let inner = Arc::clone(&self.0);
11742                            let fut = async move {
11743                                <T as MemberService>::bulk_invite_users(&inner, request)
11744                                    .await
11745                            };
11746                            Box::pin(fut)
11747                        }
11748                    }
11749                    let accept_compression_encodings = self.accept_compression_encodings;
11750                    let send_compression_encodings = self.send_compression_encodings;
11751                    let max_decoding_message_size = self.max_decoding_message_size;
11752                    let max_encoding_message_size = self.max_encoding_message_size;
11753                    let inner = self.inner.clone();
11754                    let fut = async move {
11755                        let method = BulkInviteUsersSvc(inner);
11756                        let codec = tonic_prost::ProstCodec::default();
11757                        let mut grpc = tonic::server::Grpc::new(codec)
11758                            .apply_compression_config(
11759                                accept_compression_encodings,
11760                                send_compression_encodings,
11761                            )
11762                            .apply_max_message_size_config(
11763                                max_decoding_message_size,
11764                                max_encoding_message_size,
11765                            );
11766                        let res = grpc.unary(method, req).await;
11767                        Ok(res)
11768                    };
11769                    Box::pin(fut)
11770                }
11771                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11772                    #[allow(non_camel_case_types)]
11773                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11774                    impl<
11775                        T: MemberService,
11776                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11777                    for ConfirmPasskeyEnrollmentSvc<T> {
11778                        type Response = super::ConfirmPasskeyEnrollmentResponse;
11779                        type Future = BoxFuture<
11780                            tonic::Response<Self::Response>,
11781                            tonic::Status,
11782                        >;
11783                        fn call(
11784                            &mut self,
11785                            request: tonic::Request<
11786                                super::ConfirmPasskeyEnrollmentRequest,
11787                            >,
11788                        ) -> Self::Future {
11789                            let inner = Arc::clone(&self.0);
11790                            let fut = async move {
11791                                <T as MemberService>::confirm_passkey_enrollment(
11792                                        &inner,
11793                                        request,
11794                                    )
11795                                    .await
11796                            };
11797                            Box::pin(fut)
11798                        }
11799                    }
11800                    let accept_compression_encodings = self.accept_compression_encodings;
11801                    let send_compression_encodings = self.send_compression_encodings;
11802                    let max_decoding_message_size = self.max_decoding_message_size;
11803                    let max_encoding_message_size = self.max_encoding_message_size;
11804                    let inner = self.inner.clone();
11805                    let fut = async move {
11806                        let method = ConfirmPasskeyEnrollmentSvc(inner);
11807                        let codec = tonic_prost::ProstCodec::default();
11808                        let mut grpc = tonic::server::Grpc::new(codec)
11809                            .apply_compression_config(
11810                                accept_compression_encodings,
11811                                send_compression_encodings,
11812                            )
11813                            .apply_max_message_size_config(
11814                                max_decoding_message_size,
11815                                max_encoding_message_size,
11816                            );
11817                        let res = grpc.unary(method, req).await;
11818                        Ok(res)
11819                    };
11820                    Box::pin(fut)
11821                }
11822                "/pidgr.v1.MemberService/UpdateUserRegion" => {
11823                    #[allow(non_camel_case_types)]
11824                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11825                    impl<
11826                        T: MemberService,
11827                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11828                    for UpdateUserRegionSvc<T> {
11829                        type Response = super::UpdateUserRegionResponse;
11830                        type Future = BoxFuture<
11831                            tonic::Response<Self::Response>,
11832                            tonic::Status,
11833                        >;
11834                        fn call(
11835                            &mut self,
11836                            request: tonic::Request<super::UpdateUserRegionRequest>,
11837                        ) -> Self::Future {
11838                            let inner = Arc::clone(&self.0);
11839                            let fut = async move {
11840                                <T as MemberService>::update_user_region(&inner, request)
11841                                    .await
11842                            };
11843                            Box::pin(fut)
11844                        }
11845                    }
11846                    let accept_compression_encodings = self.accept_compression_encodings;
11847                    let send_compression_encodings = self.send_compression_encodings;
11848                    let max_decoding_message_size = self.max_decoding_message_size;
11849                    let max_encoding_message_size = self.max_encoding_message_size;
11850                    let inner = self.inner.clone();
11851                    let fut = async move {
11852                        let method = UpdateUserRegionSvc(inner);
11853                        let codec = tonic_prost::ProstCodec::default();
11854                        let mut grpc = tonic::server::Grpc::new(codec)
11855                            .apply_compression_config(
11856                                accept_compression_encodings,
11857                                send_compression_encodings,
11858                            )
11859                            .apply_max_message_size_config(
11860                                max_decoding_message_size,
11861                                max_encoding_message_size,
11862                            );
11863                        let res = grpc.unary(method, req).await;
11864                        Ok(res)
11865                    };
11866                    Box::pin(fut)
11867                }
11868                _ => {
11869                    Box::pin(async move {
11870                        let mut response = http::Response::new(
11871                            tonic::body::Body::default(),
11872                        );
11873                        let headers = response.headers_mut();
11874                        headers
11875                            .insert(
11876                                tonic::Status::GRPC_STATUS,
11877                                (tonic::Code::Unimplemented as i32).into(),
11878                            );
11879                        headers
11880                            .insert(
11881                                http::header::CONTENT_TYPE,
11882                                tonic::metadata::GRPC_CONTENT_TYPE,
11883                            );
11884                        Ok(response)
11885                    })
11886                }
11887            }
11888        }
11889    }
11890    impl<T> Clone for MemberServiceServer<T> {
11891        fn clone(&self) -> Self {
11892            let inner = self.inner.clone();
11893            Self {
11894                inner,
11895                accept_compression_encodings: self.accept_compression_encodings,
11896                send_compression_encodings: self.send_compression_encodings,
11897                max_decoding_message_size: self.max_decoding_message_size,
11898                max_encoding_message_size: self.max_encoding_message_size,
11899            }
11900        }
11901    }
11902    /// Generated gRPC service name
11903    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11904    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11905        const NAME: &'static str = SERVICE_NAME;
11906    }
11907}
11908/// Generated client implementations.
11909pub mod objectives_service_client {
11910    #![allow(
11911        unused_variables,
11912        dead_code,
11913        missing_docs,
11914        clippy::wildcard_imports,
11915        clippy::let_unit_value,
11916    )]
11917    use tonic::codegen::*;
11918    use tonic::codegen::http::Uri;
11919    /** Manages the objectives an organization declares, the indicators that
11920 observe them, and the links between campaigns and the objective they
11921 serve.
11922
11923 Nothing here is required by the rest of the platform: a campaign
11924 without a linked objective behaves exactly as it would without this
11925 service. Objective and indicator content is authored by the
11926 organization — the service supplies structure and advisory findings,
11927 never the content itself, and never blocks a write on the strength of
11928 an advisory.
11929
11930 All RPCs operate within the caller's org (extracted from JWT).
11931*/
11932    #[derive(Debug, Clone)]
11933    pub struct ObjectivesServiceClient<T> {
11934        inner: tonic::client::Grpc<T>,
11935    }
11936    impl ObjectivesServiceClient<tonic::transport::Channel> {
11937        /// Attempt to create a new client by connecting to a given endpoint.
11938        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11939        where
11940            D: TryInto<tonic::transport::Endpoint>,
11941            D::Error: Into<StdError>,
11942        {
11943            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11944            Ok(Self::new(conn))
11945        }
11946    }
11947    impl<T> ObjectivesServiceClient<T>
11948    where
11949        T: tonic::client::GrpcService<tonic::body::Body>,
11950        T::Error: Into<StdError>,
11951        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11952        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11953    {
11954        pub fn new(inner: T) -> Self {
11955            let inner = tonic::client::Grpc::new(inner);
11956            Self { inner }
11957        }
11958        pub fn with_origin(inner: T, origin: Uri) -> Self {
11959            let inner = tonic::client::Grpc::with_origin(inner, origin);
11960            Self { inner }
11961        }
11962        pub fn with_interceptor<F>(
11963            inner: T,
11964            interceptor: F,
11965        ) -> ObjectivesServiceClient<InterceptedService<T, F>>
11966        where
11967            F: tonic::service::Interceptor,
11968            T::ResponseBody: Default,
11969            T: tonic::codegen::Service<
11970                http::Request<tonic::body::Body>,
11971                Response = http::Response<
11972                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11973                >,
11974            >,
11975            <T as tonic::codegen::Service<
11976                http::Request<tonic::body::Body>,
11977            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11978        {
11979            ObjectivesServiceClient::new(InterceptedService::new(inner, interceptor))
11980        }
11981        /// Compress requests with the given encoding.
11982        ///
11983        /// This requires the server to support it otherwise it might respond with an
11984        /// error.
11985        #[must_use]
11986        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11987            self.inner = self.inner.send_compressed(encoding);
11988            self
11989        }
11990        /// Enable decompressing responses.
11991        #[must_use]
11992        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11993            self.inner = self.inner.accept_compressed(encoding);
11994            self
11995        }
11996        /// Limits the maximum size of a decoded message.
11997        ///
11998        /// Default: `4MB`
11999        #[must_use]
12000        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12001            self.inner = self.inner.max_decoding_message_size(limit);
12002            self
12003        }
12004        /// Limits the maximum size of an encoded message.
12005        ///
12006        /// Default: `usize::MAX`
12007        #[must_use]
12008        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12009            self.inner = self.inner.max_encoding_message_size(limit);
12010            self
12011        }
12012        /** Create an objective. Wording problems are returned as advisories on
12013 the response; the objective is stored either way.
12014 Authorization: Requires PERMISSION_ORG_WRITE.
12015*/
12016        pub async fn create_objective(
12017            &mut self,
12018            request: impl tonic::IntoRequest<super::CreateObjectiveRequest>,
12019        ) -> std::result::Result<
12020            tonic::Response<super::CreateObjectiveResponse>,
12021            tonic::Status,
12022        > {
12023            self.inner
12024                .ready()
12025                .await
12026                .map_err(|e| {
12027                    tonic::Status::unknown(
12028                        format!("Service was not ready: {}", e.into()),
12029                    )
12030                })?;
12031            let codec = tonic_prost::ProstCodec::default();
12032            let path = http::uri::PathAndQuery::from_static(
12033                "/pidgr.v1.ObjectivesService/CreateObjective",
12034            );
12035            let mut req = request.into_request();
12036            req.extensions_mut()
12037                .insert(
12038                    GrpcMethod::new("pidgr.v1.ObjectivesService", "CreateObjective"),
12039                );
12040            self.inner.unary(req, path, codec).await
12041        }
12042        /** Update an objective's wording, owner, kind, state or end date.
12043 Archiving is a state change made here — existing campaign links are
12044 kept so that past campaigns remain interpretable. Wording problems
12045 are returned as advisories; the update is applied either way.
12046 Authorization: Requires PERMISSION_ORG_WRITE.
12047*/
12048        pub async fn update_objective(
12049            &mut self,
12050            request: impl tonic::IntoRequest<super::UpdateObjectiveRequest>,
12051        ) -> std::result::Result<
12052            tonic::Response<super::UpdateObjectiveResponse>,
12053            tonic::Status,
12054        > {
12055            self.inner
12056                .ready()
12057                .await
12058                .map_err(|e| {
12059                    tonic::Status::unknown(
12060                        format!("Service was not ready: {}", e.into()),
12061                    )
12062                })?;
12063            let codec = tonic_prost::ProstCodec::default();
12064            let path = http::uri::PathAndQuery::from_static(
12065                "/pidgr.v1.ObjectivesService/UpdateObjective",
12066            );
12067            let mut req = request.into_request();
12068            req.extensions_mut()
12069                .insert(
12070                    GrpcMethod::new("pidgr.v1.ObjectivesService", "UpdateObjective"),
12071                );
12072            self.inner.unary(req, path, codec).await
12073        }
12074        /** Retrieve one objective together with its indicators.
12075 Authorization: Requires PERMISSION_ORG_READ.
12076*/
12077        pub async fn get_objective(
12078            &mut self,
12079            request: impl tonic::IntoRequest<super::GetObjectiveRequest>,
12080        ) -> std::result::Result<
12081            tonic::Response<super::GetObjectiveResponse>,
12082            tonic::Status,
12083        > {
12084            self.inner
12085                .ready()
12086                .await
12087                .map_err(|e| {
12088                    tonic::Status::unknown(
12089                        format!("Service was not ready: {}", e.into()),
12090                    )
12091                })?;
12092            let codec = tonic_prost::ProstCodec::default();
12093            let path = http::uri::PathAndQuery::from_static(
12094                "/pidgr.v1.ObjectivesService/GetObjective",
12095            );
12096            let mut req = request.into_request();
12097            req.extensions_mut()
12098                .insert(GrpcMethod::new("pidgr.v1.ObjectivesService", "GetObjective"));
12099            self.inner.unary(req, path, codec).await
12100        }
12101        /** List the organization's objectives.
12102 Authorization: Requires PERMISSION_ORG_READ.
12103*/
12104        pub async fn list_objectives(
12105            &mut self,
12106            request: impl tonic::IntoRequest<super::ListObjectivesRequest>,
12107        ) -> std::result::Result<
12108            tonic::Response<super::ListObjectivesResponse>,
12109            tonic::Status,
12110        > {
12111            self.inner
12112                .ready()
12113                .await
12114                .map_err(|e| {
12115                    tonic::Status::unknown(
12116                        format!("Service was not ready: {}", e.into()),
12117                    )
12118                })?;
12119            let codec = tonic_prost::ProstCodec::default();
12120            let path = http::uri::PathAndQuery::from_static(
12121                "/pidgr.v1.ObjectivesService/ListObjectives",
12122            );
12123            let mut req = request.into_request();
12124            req.extensions_mut()
12125                .insert(GrpcMethod::new("pidgr.v1.ObjectivesService", "ListObjectives"));
12126            self.inner.unary(req, path, codec).await
12127        }
12128        /** Attach an indicator to an objective. An evidence source kind that
12129 is not yet implemented returns UNIMPLEMENTED. Declaring a
12130 verification campaign as the source returns any notice that follows
12131 from the size of the units it would reach; like every other finding
12132 here it is advisory and the indicator is stored either way.
12133 Authorization: Requires PERMISSION_ORG_WRITE.
12134*/
12135        pub async fn add_indicator(
12136            &mut self,
12137            request: impl tonic::IntoRequest<super::AddIndicatorRequest>,
12138        ) -> std::result::Result<
12139            tonic::Response<super::AddIndicatorResponse>,
12140            tonic::Status,
12141        > {
12142            self.inner
12143                .ready()
12144                .await
12145                .map_err(|e| {
12146                    tonic::Status::unknown(
12147                        format!("Service was not ready: {}", e.into()),
12148                    )
12149                })?;
12150            let codec = tonic_prost::ProstCodec::default();
12151            let path = http::uri::PathAndQuery::from_static(
12152                "/pidgr.v1.ObjectivesService/AddIndicator",
12153            );
12154            let mut req = request.into_request();
12155            req.extensions_mut()
12156                .insert(GrpcMethod::new("pidgr.v1.ObjectivesService", "AddIndicator"));
12157            self.inner.unary(req, path, codec).await
12158        }
12159        /** Update an indicator. Notices are recomputed against the evidence
12160 source as it stands after the update.
12161 Authorization: Requires PERMISSION_ORG_WRITE.
12162*/
12163        pub async fn update_indicator(
12164            &mut self,
12165            request: impl tonic::IntoRequest<super::UpdateIndicatorRequest>,
12166        ) -> std::result::Result<
12167            tonic::Response<super::UpdateIndicatorResponse>,
12168            tonic::Status,
12169        > {
12170            self.inner
12171                .ready()
12172                .await
12173                .map_err(|e| {
12174                    tonic::Status::unknown(
12175                        format!("Service was not ready: {}", e.into()),
12176                    )
12177                })?;
12178            let codec = tonic_prost::ProstCodec::default();
12179            let path = http::uri::PathAndQuery::from_static(
12180                "/pidgr.v1.ObjectivesService/UpdateIndicator",
12181            );
12182            let mut req = request.into_request();
12183            req.extensions_mut()
12184                .insert(
12185                    GrpcMethod::new("pidgr.v1.ObjectivesService", "UpdateIndicator"),
12186                );
12187            self.inner.unary(req, path, codec).await
12188        }
12189        /** Detach an indicator from its objective.
12190 Authorization: Requires PERMISSION_ORG_WRITE.
12191*/
12192        pub async fn remove_indicator(
12193            &mut self,
12194            request: impl tonic::IntoRequest<super::RemoveIndicatorRequest>,
12195        ) -> std::result::Result<
12196            tonic::Response<super::RemoveIndicatorResponse>,
12197            tonic::Status,
12198        > {
12199            self.inner
12200                .ready()
12201                .await
12202                .map_err(|e| {
12203                    tonic::Status::unknown(
12204                        format!("Service was not ready: {}", e.into()),
12205                    )
12206                })?;
12207            let codec = tonic_prost::ProstCodec::default();
12208            let path = http::uri::PathAndQuery::from_static(
12209                "/pidgr.v1.ObjectivesService/RemoveIndicator",
12210            );
12211            let mut req = request.into_request();
12212            req.extensions_mut()
12213                .insert(
12214                    GrpcMethod::new("pidgr.v1.ObjectivesService", "RemoveIndicator"),
12215                );
12216            self.inner.unary(req, path, codec).await
12217        }
12218        /** Propose candidate indicators for a declared objective. Nothing is
12219 stored and nothing is attached: the response is material for a
12220 person to accept, edit or discard, and an accepted candidate
12221 becomes an indicator only through AddIndicator. Gated on the write
12222 permission rather than the read one because producing candidates
12223 spends the organization's model budget and only makes sense to
12224 someone who can act on the result.
12225 Authorization: Requires PERMISSION_ORG_WRITE.
12226*/
12227        pub async fn suggest_indicators(
12228            &mut self,
12229            request: impl tonic::IntoRequest<super::SuggestIndicatorsRequest>,
12230        ) -> std::result::Result<
12231            tonic::Response<super::SuggestIndicatorsResponse>,
12232            tonic::Status,
12233        > {
12234            self.inner
12235                .ready()
12236                .await
12237                .map_err(|e| {
12238                    tonic::Status::unknown(
12239                        format!("Service was not ready: {}", e.into()),
12240                    )
12241                })?;
12242            let codec = tonic_prost::ProstCodec::default();
12243            let path = http::uri::PathAndQuery::from_static(
12244                "/pidgr.v1.ObjectivesService/SuggestIndicators",
12245            );
12246            let mut req = request.into_request();
12247            req.extensions_mut()
12248                .insert(
12249                    GrpcMethod::new("pidgr.v1.ObjectivesService", "SuggestIndicators"),
12250                );
12251            self.inner.unary(req, path, codec).await
12252        }
12253        /** Declare that a campaign serves an objective. Idempotent.
12254 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
12255*/
12256        pub async fn link_campaign_to_objective(
12257            &mut self,
12258            request: impl tonic::IntoRequest<super::LinkCampaignToObjectiveRequest>,
12259        ) -> std::result::Result<
12260            tonic::Response<super::LinkCampaignToObjectiveResponse>,
12261            tonic::Status,
12262        > {
12263            self.inner
12264                .ready()
12265                .await
12266                .map_err(|e| {
12267                    tonic::Status::unknown(
12268                        format!("Service was not ready: {}", e.into()),
12269                    )
12270                })?;
12271            let codec = tonic_prost::ProstCodec::default();
12272            let path = http::uri::PathAndQuery::from_static(
12273                "/pidgr.v1.ObjectivesService/LinkCampaignToObjective",
12274            );
12275            let mut req = request.into_request();
12276            req.extensions_mut()
12277                .insert(
12278                    GrpcMethod::new(
12279                        "pidgr.v1.ObjectivesService",
12280                        "LinkCampaignToObjective",
12281                    ),
12282                );
12283            self.inner.unary(req, path, codec).await
12284        }
12285        /** Remove the declaration that a campaign serves an objective.
12286 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
12287*/
12288        pub async fn unlink_campaign_from_objective(
12289            &mut self,
12290            request: impl tonic::IntoRequest<super::UnlinkCampaignFromObjectiveRequest>,
12291        ) -> std::result::Result<
12292            tonic::Response<super::UnlinkCampaignFromObjectiveResponse>,
12293            tonic::Status,
12294        > {
12295            self.inner
12296                .ready()
12297                .await
12298                .map_err(|e| {
12299                    tonic::Status::unknown(
12300                        format!("Service was not ready: {}", e.into()),
12301                    )
12302                })?;
12303            let codec = tonic_prost::ProstCodec::default();
12304            let path = http::uri::PathAndQuery::from_static(
12305                "/pidgr.v1.ObjectivesService/UnlinkCampaignFromObjective",
12306            );
12307            let mut req = request.into_request();
12308            req.extensions_mut()
12309                .insert(
12310                    GrpcMethod::new(
12311                        "pidgr.v1.ObjectivesService",
12312                        "UnlinkCampaignFromObjective",
12313                    ),
12314                );
12315            self.inner.unary(req, path, codec).await
12316        }
12317        /** List campaign-to-objective links from either end: the campaigns
12318 that serve one objective, or the objectives one campaign serves.
12319 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
12320*/
12321        pub async fn list_campaign_objective_links(
12322            &mut self,
12323            request: impl tonic::IntoRequest<super::ListCampaignObjectiveLinksRequest>,
12324        ) -> std::result::Result<
12325            tonic::Response<super::ListCampaignObjectiveLinksResponse>,
12326            tonic::Status,
12327        > {
12328            self.inner
12329                .ready()
12330                .await
12331                .map_err(|e| {
12332                    tonic::Status::unknown(
12333                        format!("Service was not ready: {}", e.into()),
12334                    )
12335                })?;
12336            let codec = tonic_prost::ProstCodec::default();
12337            let path = http::uri::PathAndQuery::from_static(
12338                "/pidgr.v1.ObjectivesService/ListCampaignObjectiveLinks",
12339            );
12340            let mut req = request.into_request();
12341            req.extensions_mut()
12342                .insert(
12343                    GrpcMethod::new(
12344                        "pidgr.v1.ObjectivesService",
12345                        "ListCampaignObjectiveLinks",
12346                    ),
12347                );
12348            self.inner.unary(req, path, codec).await
12349        }
12350    }
12351}
12352/// Generated server implementations.
12353pub mod objectives_service_server {
12354    #![allow(
12355        unused_variables,
12356        dead_code,
12357        missing_docs,
12358        clippy::wildcard_imports,
12359        clippy::let_unit_value,
12360    )]
12361    use tonic::codegen::*;
12362    /// Generated trait containing gRPC methods that should be implemented for use with ObjectivesServiceServer.
12363    #[async_trait]
12364    pub trait ObjectivesService: std::marker::Send + std::marker::Sync + 'static {
12365        /** Create an objective. Wording problems are returned as advisories on
12366 the response; the objective is stored either way.
12367 Authorization: Requires PERMISSION_ORG_WRITE.
12368*/
12369        async fn create_objective(
12370            &self,
12371            request: tonic::Request<super::CreateObjectiveRequest>,
12372        ) -> std::result::Result<
12373            tonic::Response<super::CreateObjectiveResponse>,
12374            tonic::Status,
12375        >;
12376        /** Update an objective's wording, owner, kind, state or end date.
12377 Archiving is a state change made here — existing campaign links are
12378 kept so that past campaigns remain interpretable. Wording problems
12379 are returned as advisories; the update is applied either way.
12380 Authorization: Requires PERMISSION_ORG_WRITE.
12381*/
12382        async fn update_objective(
12383            &self,
12384            request: tonic::Request<super::UpdateObjectiveRequest>,
12385        ) -> std::result::Result<
12386            tonic::Response<super::UpdateObjectiveResponse>,
12387            tonic::Status,
12388        >;
12389        /** Retrieve one objective together with its indicators.
12390 Authorization: Requires PERMISSION_ORG_READ.
12391*/
12392        async fn get_objective(
12393            &self,
12394            request: tonic::Request<super::GetObjectiveRequest>,
12395        ) -> std::result::Result<
12396            tonic::Response<super::GetObjectiveResponse>,
12397            tonic::Status,
12398        >;
12399        /** List the organization's objectives.
12400 Authorization: Requires PERMISSION_ORG_READ.
12401*/
12402        async fn list_objectives(
12403            &self,
12404            request: tonic::Request<super::ListObjectivesRequest>,
12405        ) -> std::result::Result<
12406            tonic::Response<super::ListObjectivesResponse>,
12407            tonic::Status,
12408        >;
12409        /** Attach an indicator to an objective. An evidence source kind that
12410 is not yet implemented returns UNIMPLEMENTED. Declaring a
12411 verification campaign as the source returns any notice that follows
12412 from the size of the units it would reach; like every other finding
12413 here it is advisory and the indicator is stored either way.
12414 Authorization: Requires PERMISSION_ORG_WRITE.
12415*/
12416        async fn add_indicator(
12417            &self,
12418            request: tonic::Request<super::AddIndicatorRequest>,
12419        ) -> std::result::Result<
12420            tonic::Response<super::AddIndicatorResponse>,
12421            tonic::Status,
12422        >;
12423        /** Update an indicator. Notices are recomputed against the evidence
12424 source as it stands after the update.
12425 Authorization: Requires PERMISSION_ORG_WRITE.
12426*/
12427        async fn update_indicator(
12428            &self,
12429            request: tonic::Request<super::UpdateIndicatorRequest>,
12430        ) -> std::result::Result<
12431            tonic::Response<super::UpdateIndicatorResponse>,
12432            tonic::Status,
12433        >;
12434        /** Detach an indicator from its objective.
12435 Authorization: Requires PERMISSION_ORG_WRITE.
12436*/
12437        async fn remove_indicator(
12438            &self,
12439            request: tonic::Request<super::RemoveIndicatorRequest>,
12440        ) -> std::result::Result<
12441            tonic::Response<super::RemoveIndicatorResponse>,
12442            tonic::Status,
12443        >;
12444        /** Propose candidate indicators for a declared objective. Nothing is
12445 stored and nothing is attached: the response is material for a
12446 person to accept, edit or discard, and an accepted candidate
12447 becomes an indicator only through AddIndicator. Gated on the write
12448 permission rather than the read one because producing candidates
12449 spends the organization's model budget and only makes sense to
12450 someone who can act on the result.
12451 Authorization: Requires PERMISSION_ORG_WRITE.
12452*/
12453        async fn suggest_indicators(
12454            &self,
12455            request: tonic::Request<super::SuggestIndicatorsRequest>,
12456        ) -> std::result::Result<
12457            tonic::Response<super::SuggestIndicatorsResponse>,
12458            tonic::Status,
12459        >;
12460        /** Declare that a campaign serves an objective. Idempotent.
12461 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
12462*/
12463        async fn link_campaign_to_objective(
12464            &self,
12465            request: tonic::Request<super::LinkCampaignToObjectiveRequest>,
12466        ) -> std::result::Result<
12467            tonic::Response<super::LinkCampaignToObjectiveResponse>,
12468            tonic::Status,
12469        >;
12470        /** Remove the declaration that a campaign serves an objective.
12471 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
12472*/
12473        async fn unlink_campaign_from_objective(
12474            &self,
12475            request: tonic::Request<super::UnlinkCampaignFromObjectiveRequest>,
12476        ) -> std::result::Result<
12477            tonic::Response<super::UnlinkCampaignFromObjectiveResponse>,
12478            tonic::Status,
12479        >;
12480        /** List campaign-to-objective links from either end: the campaigns
12481 that serve one objective, or the objectives one campaign serves.
12482 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
12483*/
12484        async fn list_campaign_objective_links(
12485            &self,
12486            request: tonic::Request<super::ListCampaignObjectiveLinksRequest>,
12487        ) -> std::result::Result<
12488            tonic::Response<super::ListCampaignObjectiveLinksResponse>,
12489            tonic::Status,
12490        >;
12491    }
12492    /** Manages the objectives an organization declares, the indicators that
12493 observe them, and the links between campaigns and the objective they
12494 serve.
12495
12496 Nothing here is required by the rest of the platform: a campaign
12497 without a linked objective behaves exactly as it would without this
12498 service. Objective and indicator content is authored by the
12499 organization — the service supplies structure and advisory findings,
12500 never the content itself, and never blocks a write on the strength of
12501 an advisory.
12502
12503 All RPCs operate within the caller's org (extracted from JWT).
12504*/
12505    #[derive(Debug)]
12506    pub struct ObjectivesServiceServer<T> {
12507        inner: Arc<T>,
12508        accept_compression_encodings: EnabledCompressionEncodings,
12509        send_compression_encodings: EnabledCompressionEncodings,
12510        max_decoding_message_size: Option<usize>,
12511        max_encoding_message_size: Option<usize>,
12512    }
12513    impl<T> ObjectivesServiceServer<T> {
12514        pub fn new(inner: T) -> Self {
12515            Self::from_arc(Arc::new(inner))
12516        }
12517        pub fn from_arc(inner: Arc<T>) -> Self {
12518            Self {
12519                inner,
12520                accept_compression_encodings: Default::default(),
12521                send_compression_encodings: Default::default(),
12522                max_decoding_message_size: None,
12523                max_encoding_message_size: None,
12524            }
12525        }
12526        pub fn with_interceptor<F>(
12527            inner: T,
12528            interceptor: F,
12529        ) -> InterceptedService<Self, F>
12530        where
12531            F: tonic::service::Interceptor,
12532        {
12533            InterceptedService::new(Self::new(inner), interceptor)
12534        }
12535        /// Enable decompressing requests with the given encoding.
12536        #[must_use]
12537        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12538            self.accept_compression_encodings.enable(encoding);
12539            self
12540        }
12541        /// Compress responses with the given encoding, if the client supports it.
12542        #[must_use]
12543        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12544            self.send_compression_encodings.enable(encoding);
12545            self
12546        }
12547        /// Limits the maximum size of a decoded message.
12548        ///
12549        /// Default: `4MB`
12550        #[must_use]
12551        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12552            self.max_decoding_message_size = Some(limit);
12553            self
12554        }
12555        /// Limits the maximum size of an encoded message.
12556        ///
12557        /// Default: `usize::MAX`
12558        #[must_use]
12559        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12560            self.max_encoding_message_size = Some(limit);
12561            self
12562        }
12563    }
12564    impl<T, B> tonic::codegen::Service<http::Request<B>> for ObjectivesServiceServer<T>
12565    where
12566        T: ObjectivesService,
12567        B: Body + std::marker::Send + 'static,
12568        B::Error: Into<StdError> + std::marker::Send + 'static,
12569    {
12570        type Response = http::Response<tonic::body::Body>;
12571        type Error = std::convert::Infallible;
12572        type Future = BoxFuture<Self::Response, Self::Error>;
12573        fn poll_ready(
12574            &mut self,
12575            _cx: &mut Context<'_>,
12576        ) -> Poll<std::result::Result<(), Self::Error>> {
12577            Poll::Ready(Ok(()))
12578        }
12579        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12580            match req.uri().path() {
12581                "/pidgr.v1.ObjectivesService/CreateObjective" => {
12582                    #[allow(non_camel_case_types)]
12583                    struct CreateObjectiveSvc<T: ObjectivesService>(pub Arc<T>);
12584                    impl<
12585                        T: ObjectivesService,
12586                    > tonic::server::UnaryService<super::CreateObjectiveRequest>
12587                    for CreateObjectiveSvc<T> {
12588                        type Response = super::CreateObjectiveResponse;
12589                        type Future = BoxFuture<
12590                            tonic::Response<Self::Response>,
12591                            tonic::Status,
12592                        >;
12593                        fn call(
12594                            &mut self,
12595                            request: tonic::Request<super::CreateObjectiveRequest>,
12596                        ) -> Self::Future {
12597                            let inner = Arc::clone(&self.0);
12598                            let fut = async move {
12599                                <T as ObjectivesService>::create_objective(&inner, request)
12600                                    .await
12601                            };
12602                            Box::pin(fut)
12603                        }
12604                    }
12605                    let accept_compression_encodings = self.accept_compression_encodings;
12606                    let send_compression_encodings = self.send_compression_encodings;
12607                    let max_decoding_message_size = self.max_decoding_message_size;
12608                    let max_encoding_message_size = self.max_encoding_message_size;
12609                    let inner = self.inner.clone();
12610                    let fut = async move {
12611                        let method = CreateObjectiveSvc(inner);
12612                        let codec = tonic_prost::ProstCodec::default();
12613                        let mut grpc = tonic::server::Grpc::new(codec)
12614                            .apply_compression_config(
12615                                accept_compression_encodings,
12616                                send_compression_encodings,
12617                            )
12618                            .apply_max_message_size_config(
12619                                max_decoding_message_size,
12620                                max_encoding_message_size,
12621                            );
12622                        let res = grpc.unary(method, req).await;
12623                        Ok(res)
12624                    };
12625                    Box::pin(fut)
12626                }
12627                "/pidgr.v1.ObjectivesService/UpdateObjective" => {
12628                    #[allow(non_camel_case_types)]
12629                    struct UpdateObjectiveSvc<T: ObjectivesService>(pub Arc<T>);
12630                    impl<
12631                        T: ObjectivesService,
12632                    > tonic::server::UnaryService<super::UpdateObjectiveRequest>
12633                    for UpdateObjectiveSvc<T> {
12634                        type Response = super::UpdateObjectiveResponse;
12635                        type Future = BoxFuture<
12636                            tonic::Response<Self::Response>,
12637                            tonic::Status,
12638                        >;
12639                        fn call(
12640                            &mut self,
12641                            request: tonic::Request<super::UpdateObjectiveRequest>,
12642                        ) -> Self::Future {
12643                            let inner = Arc::clone(&self.0);
12644                            let fut = async move {
12645                                <T as ObjectivesService>::update_objective(&inner, request)
12646                                    .await
12647                            };
12648                            Box::pin(fut)
12649                        }
12650                    }
12651                    let accept_compression_encodings = self.accept_compression_encodings;
12652                    let send_compression_encodings = self.send_compression_encodings;
12653                    let max_decoding_message_size = self.max_decoding_message_size;
12654                    let max_encoding_message_size = self.max_encoding_message_size;
12655                    let inner = self.inner.clone();
12656                    let fut = async move {
12657                        let method = UpdateObjectiveSvc(inner);
12658                        let codec = tonic_prost::ProstCodec::default();
12659                        let mut grpc = tonic::server::Grpc::new(codec)
12660                            .apply_compression_config(
12661                                accept_compression_encodings,
12662                                send_compression_encodings,
12663                            )
12664                            .apply_max_message_size_config(
12665                                max_decoding_message_size,
12666                                max_encoding_message_size,
12667                            );
12668                        let res = grpc.unary(method, req).await;
12669                        Ok(res)
12670                    };
12671                    Box::pin(fut)
12672                }
12673                "/pidgr.v1.ObjectivesService/GetObjective" => {
12674                    #[allow(non_camel_case_types)]
12675                    struct GetObjectiveSvc<T: ObjectivesService>(pub Arc<T>);
12676                    impl<
12677                        T: ObjectivesService,
12678                    > tonic::server::UnaryService<super::GetObjectiveRequest>
12679                    for GetObjectiveSvc<T> {
12680                        type Response = super::GetObjectiveResponse;
12681                        type Future = BoxFuture<
12682                            tonic::Response<Self::Response>,
12683                            tonic::Status,
12684                        >;
12685                        fn call(
12686                            &mut self,
12687                            request: tonic::Request<super::GetObjectiveRequest>,
12688                        ) -> Self::Future {
12689                            let inner = Arc::clone(&self.0);
12690                            let fut = async move {
12691                                <T as ObjectivesService>::get_objective(&inner, request)
12692                                    .await
12693                            };
12694                            Box::pin(fut)
12695                        }
12696                    }
12697                    let accept_compression_encodings = self.accept_compression_encodings;
12698                    let send_compression_encodings = self.send_compression_encodings;
12699                    let max_decoding_message_size = self.max_decoding_message_size;
12700                    let max_encoding_message_size = self.max_encoding_message_size;
12701                    let inner = self.inner.clone();
12702                    let fut = async move {
12703                        let method = GetObjectiveSvc(inner);
12704                        let codec = tonic_prost::ProstCodec::default();
12705                        let mut grpc = tonic::server::Grpc::new(codec)
12706                            .apply_compression_config(
12707                                accept_compression_encodings,
12708                                send_compression_encodings,
12709                            )
12710                            .apply_max_message_size_config(
12711                                max_decoding_message_size,
12712                                max_encoding_message_size,
12713                            );
12714                        let res = grpc.unary(method, req).await;
12715                        Ok(res)
12716                    };
12717                    Box::pin(fut)
12718                }
12719                "/pidgr.v1.ObjectivesService/ListObjectives" => {
12720                    #[allow(non_camel_case_types)]
12721                    struct ListObjectivesSvc<T: ObjectivesService>(pub Arc<T>);
12722                    impl<
12723                        T: ObjectivesService,
12724                    > tonic::server::UnaryService<super::ListObjectivesRequest>
12725                    for ListObjectivesSvc<T> {
12726                        type Response = super::ListObjectivesResponse;
12727                        type Future = BoxFuture<
12728                            tonic::Response<Self::Response>,
12729                            tonic::Status,
12730                        >;
12731                        fn call(
12732                            &mut self,
12733                            request: tonic::Request<super::ListObjectivesRequest>,
12734                        ) -> Self::Future {
12735                            let inner = Arc::clone(&self.0);
12736                            let fut = async move {
12737                                <T as ObjectivesService>::list_objectives(&inner, request)
12738                                    .await
12739                            };
12740                            Box::pin(fut)
12741                        }
12742                    }
12743                    let accept_compression_encodings = self.accept_compression_encodings;
12744                    let send_compression_encodings = self.send_compression_encodings;
12745                    let max_decoding_message_size = self.max_decoding_message_size;
12746                    let max_encoding_message_size = self.max_encoding_message_size;
12747                    let inner = self.inner.clone();
12748                    let fut = async move {
12749                        let method = ListObjectivesSvc(inner);
12750                        let codec = tonic_prost::ProstCodec::default();
12751                        let mut grpc = tonic::server::Grpc::new(codec)
12752                            .apply_compression_config(
12753                                accept_compression_encodings,
12754                                send_compression_encodings,
12755                            )
12756                            .apply_max_message_size_config(
12757                                max_decoding_message_size,
12758                                max_encoding_message_size,
12759                            );
12760                        let res = grpc.unary(method, req).await;
12761                        Ok(res)
12762                    };
12763                    Box::pin(fut)
12764                }
12765                "/pidgr.v1.ObjectivesService/AddIndicator" => {
12766                    #[allow(non_camel_case_types)]
12767                    struct AddIndicatorSvc<T: ObjectivesService>(pub Arc<T>);
12768                    impl<
12769                        T: ObjectivesService,
12770                    > tonic::server::UnaryService<super::AddIndicatorRequest>
12771                    for AddIndicatorSvc<T> {
12772                        type Response = super::AddIndicatorResponse;
12773                        type Future = BoxFuture<
12774                            tonic::Response<Self::Response>,
12775                            tonic::Status,
12776                        >;
12777                        fn call(
12778                            &mut self,
12779                            request: tonic::Request<super::AddIndicatorRequest>,
12780                        ) -> Self::Future {
12781                            let inner = Arc::clone(&self.0);
12782                            let fut = async move {
12783                                <T as ObjectivesService>::add_indicator(&inner, request)
12784                                    .await
12785                            };
12786                            Box::pin(fut)
12787                        }
12788                    }
12789                    let accept_compression_encodings = self.accept_compression_encodings;
12790                    let send_compression_encodings = self.send_compression_encodings;
12791                    let max_decoding_message_size = self.max_decoding_message_size;
12792                    let max_encoding_message_size = self.max_encoding_message_size;
12793                    let inner = self.inner.clone();
12794                    let fut = async move {
12795                        let method = AddIndicatorSvc(inner);
12796                        let codec = tonic_prost::ProstCodec::default();
12797                        let mut grpc = tonic::server::Grpc::new(codec)
12798                            .apply_compression_config(
12799                                accept_compression_encodings,
12800                                send_compression_encodings,
12801                            )
12802                            .apply_max_message_size_config(
12803                                max_decoding_message_size,
12804                                max_encoding_message_size,
12805                            );
12806                        let res = grpc.unary(method, req).await;
12807                        Ok(res)
12808                    };
12809                    Box::pin(fut)
12810                }
12811                "/pidgr.v1.ObjectivesService/UpdateIndicator" => {
12812                    #[allow(non_camel_case_types)]
12813                    struct UpdateIndicatorSvc<T: ObjectivesService>(pub Arc<T>);
12814                    impl<
12815                        T: ObjectivesService,
12816                    > tonic::server::UnaryService<super::UpdateIndicatorRequest>
12817                    for UpdateIndicatorSvc<T> {
12818                        type Response = super::UpdateIndicatorResponse;
12819                        type Future = BoxFuture<
12820                            tonic::Response<Self::Response>,
12821                            tonic::Status,
12822                        >;
12823                        fn call(
12824                            &mut self,
12825                            request: tonic::Request<super::UpdateIndicatorRequest>,
12826                        ) -> Self::Future {
12827                            let inner = Arc::clone(&self.0);
12828                            let fut = async move {
12829                                <T as ObjectivesService>::update_indicator(&inner, request)
12830                                    .await
12831                            };
12832                            Box::pin(fut)
12833                        }
12834                    }
12835                    let accept_compression_encodings = self.accept_compression_encodings;
12836                    let send_compression_encodings = self.send_compression_encodings;
12837                    let max_decoding_message_size = self.max_decoding_message_size;
12838                    let max_encoding_message_size = self.max_encoding_message_size;
12839                    let inner = self.inner.clone();
12840                    let fut = async move {
12841                        let method = UpdateIndicatorSvc(inner);
12842                        let codec = tonic_prost::ProstCodec::default();
12843                        let mut grpc = tonic::server::Grpc::new(codec)
12844                            .apply_compression_config(
12845                                accept_compression_encodings,
12846                                send_compression_encodings,
12847                            )
12848                            .apply_max_message_size_config(
12849                                max_decoding_message_size,
12850                                max_encoding_message_size,
12851                            );
12852                        let res = grpc.unary(method, req).await;
12853                        Ok(res)
12854                    };
12855                    Box::pin(fut)
12856                }
12857                "/pidgr.v1.ObjectivesService/RemoveIndicator" => {
12858                    #[allow(non_camel_case_types)]
12859                    struct RemoveIndicatorSvc<T: ObjectivesService>(pub Arc<T>);
12860                    impl<
12861                        T: ObjectivesService,
12862                    > tonic::server::UnaryService<super::RemoveIndicatorRequest>
12863                    for RemoveIndicatorSvc<T> {
12864                        type Response = super::RemoveIndicatorResponse;
12865                        type Future = BoxFuture<
12866                            tonic::Response<Self::Response>,
12867                            tonic::Status,
12868                        >;
12869                        fn call(
12870                            &mut self,
12871                            request: tonic::Request<super::RemoveIndicatorRequest>,
12872                        ) -> Self::Future {
12873                            let inner = Arc::clone(&self.0);
12874                            let fut = async move {
12875                                <T as ObjectivesService>::remove_indicator(&inner, request)
12876                                    .await
12877                            };
12878                            Box::pin(fut)
12879                        }
12880                    }
12881                    let accept_compression_encodings = self.accept_compression_encodings;
12882                    let send_compression_encodings = self.send_compression_encodings;
12883                    let max_decoding_message_size = self.max_decoding_message_size;
12884                    let max_encoding_message_size = self.max_encoding_message_size;
12885                    let inner = self.inner.clone();
12886                    let fut = async move {
12887                        let method = RemoveIndicatorSvc(inner);
12888                        let codec = tonic_prost::ProstCodec::default();
12889                        let mut grpc = tonic::server::Grpc::new(codec)
12890                            .apply_compression_config(
12891                                accept_compression_encodings,
12892                                send_compression_encodings,
12893                            )
12894                            .apply_max_message_size_config(
12895                                max_decoding_message_size,
12896                                max_encoding_message_size,
12897                            );
12898                        let res = grpc.unary(method, req).await;
12899                        Ok(res)
12900                    };
12901                    Box::pin(fut)
12902                }
12903                "/pidgr.v1.ObjectivesService/SuggestIndicators" => {
12904                    #[allow(non_camel_case_types)]
12905                    struct SuggestIndicatorsSvc<T: ObjectivesService>(pub Arc<T>);
12906                    impl<
12907                        T: ObjectivesService,
12908                    > tonic::server::UnaryService<super::SuggestIndicatorsRequest>
12909                    for SuggestIndicatorsSvc<T> {
12910                        type Response = super::SuggestIndicatorsResponse;
12911                        type Future = BoxFuture<
12912                            tonic::Response<Self::Response>,
12913                            tonic::Status,
12914                        >;
12915                        fn call(
12916                            &mut self,
12917                            request: tonic::Request<super::SuggestIndicatorsRequest>,
12918                        ) -> Self::Future {
12919                            let inner = Arc::clone(&self.0);
12920                            let fut = async move {
12921                                <T as ObjectivesService>::suggest_indicators(
12922                                        &inner,
12923                                        request,
12924                                    )
12925                                    .await
12926                            };
12927                            Box::pin(fut)
12928                        }
12929                    }
12930                    let accept_compression_encodings = self.accept_compression_encodings;
12931                    let send_compression_encodings = self.send_compression_encodings;
12932                    let max_decoding_message_size = self.max_decoding_message_size;
12933                    let max_encoding_message_size = self.max_encoding_message_size;
12934                    let inner = self.inner.clone();
12935                    let fut = async move {
12936                        let method = SuggestIndicatorsSvc(inner);
12937                        let codec = tonic_prost::ProstCodec::default();
12938                        let mut grpc = tonic::server::Grpc::new(codec)
12939                            .apply_compression_config(
12940                                accept_compression_encodings,
12941                                send_compression_encodings,
12942                            )
12943                            .apply_max_message_size_config(
12944                                max_decoding_message_size,
12945                                max_encoding_message_size,
12946                            );
12947                        let res = grpc.unary(method, req).await;
12948                        Ok(res)
12949                    };
12950                    Box::pin(fut)
12951                }
12952                "/pidgr.v1.ObjectivesService/LinkCampaignToObjective" => {
12953                    #[allow(non_camel_case_types)]
12954                    struct LinkCampaignToObjectiveSvc<T: ObjectivesService>(pub Arc<T>);
12955                    impl<
12956                        T: ObjectivesService,
12957                    > tonic::server::UnaryService<super::LinkCampaignToObjectiveRequest>
12958                    for LinkCampaignToObjectiveSvc<T> {
12959                        type Response = super::LinkCampaignToObjectiveResponse;
12960                        type Future = BoxFuture<
12961                            tonic::Response<Self::Response>,
12962                            tonic::Status,
12963                        >;
12964                        fn call(
12965                            &mut self,
12966                            request: tonic::Request<
12967                                super::LinkCampaignToObjectiveRequest,
12968                            >,
12969                        ) -> Self::Future {
12970                            let inner = Arc::clone(&self.0);
12971                            let fut = async move {
12972                                <T as ObjectivesService>::link_campaign_to_objective(
12973                                        &inner,
12974                                        request,
12975                                    )
12976                                    .await
12977                            };
12978                            Box::pin(fut)
12979                        }
12980                    }
12981                    let accept_compression_encodings = self.accept_compression_encodings;
12982                    let send_compression_encodings = self.send_compression_encodings;
12983                    let max_decoding_message_size = self.max_decoding_message_size;
12984                    let max_encoding_message_size = self.max_encoding_message_size;
12985                    let inner = self.inner.clone();
12986                    let fut = async move {
12987                        let method = LinkCampaignToObjectiveSvc(inner);
12988                        let codec = tonic_prost::ProstCodec::default();
12989                        let mut grpc = tonic::server::Grpc::new(codec)
12990                            .apply_compression_config(
12991                                accept_compression_encodings,
12992                                send_compression_encodings,
12993                            )
12994                            .apply_max_message_size_config(
12995                                max_decoding_message_size,
12996                                max_encoding_message_size,
12997                            );
12998                        let res = grpc.unary(method, req).await;
12999                        Ok(res)
13000                    };
13001                    Box::pin(fut)
13002                }
13003                "/pidgr.v1.ObjectivesService/UnlinkCampaignFromObjective" => {
13004                    #[allow(non_camel_case_types)]
13005                    struct UnlinkCampaignFromObjectiveSvc<T: ObjectivesService>(
13006                        pub Arc<T>,
13007                    );
13008                    impl<
13009                        T: ObjectivesService,
13010                    > tonic::server::UnaryService<
13011                        super::UnlinkCampaignFromObjectiveRequest,
13012                    > for UnlinkCampaignFromObjectiveSvc<T> {
13013                        type Response = super::UnlinkCampaignFromObjectiveResponse;
13014                        type Future = BoxFuture<
13015                            tonic::Response<Self::Response>,
13016                            tonic::Status,
13017                        >;
13018                        fn call(
13019                            &mut self,
13020                            request: tonic::Request<
13021                                super::UnlinkCampaignFromObjectiveRequest,
13022                            >,
13023                        ) -> Self::Future {
13024                            let inner = Arc::clone(&self.0);
13025                            let fut = async move {
13026                                <T as ObjectivesService>::unlink_campaign_from_objective(
13027                                        &inner,
13028                                        request,
13029                                    )
13030                                    .await
13031                            };
13032                            Box::pin(fut)
13033                        }
13034                    }
13035                    let accept_compression_encodings = self.accept_compression_encodings;
13036                    let send_compression_encodings = self.send_compression_encodings;
13037                    let max_decoding_message_size = self.max_decoding_message_size;
13038                    let max_encoding_message_size = self.max_encoding_message_size;
13039                    let inner = self.inner.clone();
13040                    let fut = async move {
13041                        let method = UnlinkCampaignFromObjectiveSvc(inner);
13042                        let codec = tonic_prost::ProstCodec::default();
13043                        let mut grpc = tonic::server::Grpc::new(codec)
13044                            .apply_compression_config(
13045                                accept_compression_encodings,
13046                                send_compression_encodings,
13047                            )
13048                            .apply_max_message_size_config(
13049                                max_decoding_message_size,
13050                                max_encoding_message_size,
13051                            );
13052                        let res = grpc.unary(method, req).await;
13053                        Ok(res)
13054                    };
13055                    Box::pin(fut)
13056                }
13057                "/pidgr.v1.ObjectivesService/ListCampaignObjectiveLinks" => {
13058                    #[allow(non_camel_case_types)]
13059                    struct ListCampaignObjectiveLinksSvc<T: ObjectivesService>(
13060                        pub Arc<T>,
13061                    );
13062                    impl<
13063                        T: ObjectivesService,
13064                    > tonic::server::UnaryService<
13065                        super::ListCampaignObjectiveLinksRequest,
13066                    > for ListCampaignObjectiveLinksSvc<T> {
13067                        type Response = super::ListCampaignObjectiveLinksResponse;
13068                        type Future = BoxFuture<
13069                            tonic::Response<Self::Response>,
13070                            tonic::Status,
13071                        >;
13072                        fn call(
13073                            &mut self,
13074                            request: tonic::Request<
13075                                super::ListCampaignObjectiveLinksRequest,
13076                            >,
13077                        ) -> Self::Future {
13078                            let inner = Arc::clone(&self.0);
13079                            let fut = async move {
13080                                <T as ObjectivesService>::list_campaign_objective_links(
13081                                        &inner,
13082                                        request,
13083                                    )
13084                                    .await
13085                            };
13086                            Box::pin(fut)
13087                        }
13088                    }
13089                    let accept_compression_encodings = self.accept_compression_encodings;
13090                    let send_compression_encodings = self.send_compression_encodings;
13091                    let max_decoding_message_size = self.max_decoding_message_size;
13092                    let max_encoding_message_size = self.max_encoding_message_size;
13093                    let inner = self.inner.clone();
13094                    let fut = async move {
13095                        let method = ListCampaignObjectiveLinksSvc(inner);
13096                        let codec = tonic_prost::ProstCodec::default();
13097                        let mut grpc = tonic::server::Grpc::new(codec)
13098                            .apply_compression_config(
13099                                accept_compression_encodings,
13100                                send_compression_encodings,
13101                            )
13102                            .apply_max_message_size_config(
13103                                max_decoding_message_size,
13104                                max_encoding_message_size,
13105                            );
13106                        let res = grpc.unary(method, req).await;
13107                        Ok(res)
13108                    };
13109                    Box::pin(fut)
13110                }
13111                _ => {
13112                    Box::pin(async move {
13113                        let mut response = http::Response::new(
13114                            tonic::body::Body::default(),
13115                        );
13116                        let headers = response.headers_mut();
13117                        headers
13118                            .insert(
13119                                tonic::Status::GRPC_STATUS,
13120                                (tonic::Code::Unimplemented as i32).into(),
13121                            );
13122                        headers
13123                            .insert(
13124                                http::header::CONTENT_TYPE,
13125                                tonic::metadata::GRPC_CONTENT_TYPE,
13126                            );
13127                        Ok(response)
13128                    })
13129                }
13130            }
13131        }
13132    }
13133    impl<T> Clone for ObjectivesServiceServer<T> {
13134        fn clone(&self) -> Self {
13135            let inner = self.inner.clone();
13136            Self {
13137                inner,
13138                accept_compression_encodings: self.accept_compression_encodings,
13139                send_compression_encodings: self.send_compression_encodings,
13140                max_decoding_message_size: self.max_decoding_message_size,
13141                max_encoding_message_size: self.max_encoding_message_size,
13142            }
13143        }
13144    }
13145    /// Generated gRPC service name
13146    pub const SERVICE_NAME: &str = "pidgr.v1.ObjectivesService";
13147    impl<T> tonic::server::NamedService for ObjectivesServiceServer<T> {
13148        const NAME: &'static str = SERVICE_NAME;
13149    }
13150}
13151/// Generated client implementations.
13152pub mod org_security_keys_service_client {
13153    #![allow(
13154        unused_variables,
13155        dead_code,
13156        missing_docs,
13157        clippy::wildcard_imports,
13158        clippy::let_unit_value,
13159    )]
13160    use tonic::codegen::*;
13161    use tonic::codegen::http::Uri;
13162    /** OrgSecurityKeysService exposes per-org secret key material to internal
13163 services that need it for HMAC computation, signature verification, or
13164 envelope-key derivation.
13165
13166 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
13167 material. The server MUST require a client certificate from a known
13168 internal service (allowlisted by subject DN) and MUST reject any request
13169 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
13170
13171 Callers (today: pidgr-integrations) cache returned peppers in-process
13172 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
13173 keep dispatch hot-path latency bounded.
13174*/
13175    #[derive(Debug, Clone)]
13176    pub struct OrgSecurityKeysServiceClient<T> {
13177        inner: tonic::client::Grpc<T>,
13178    }
13179    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
13180        /// Attempt to create a new client by connecting to a given endpoint.
13181        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13182        where
13183            D: TryInto<tonic::transport::Endpoint>,
13184            D::Error: Into<StdError>,
13185        {
13186            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13187            Ok(Self::new(conn))
13188        }
13189    }
13190    impl<T> OrgSecurityKeysServiceClient<T>
13191    where
13192        T: tonic::client::GrpcService<tonic::body::Body>,
13193        T::Error: Into<StdError>,
13194        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13195        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13196    {
13197        pub fn new(inner: T) -> Self {
13198            let inner = tonic::client::Grpc::new(inner);
13199            Self { inner }
13200        }
13201        pub fn with_origin(inner: T, origin: Uri) -> Self {
13202            let inner = tonic::client::Grpc::with_origin(inner, origin);
13203            Self { inner }
13204        }
13205        pub fn with_interceptor<F>(
13206            inner: T,
13207            interceptor: F,
13208        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
13209        where
13210            F: tonic::service::Interceptor,
13211            T::ResponseBody: Default,
13212            T: tonic::codegen::Service<
13213                http::Request<tonic::body::Body>,
13214                Response = http::Response<
13215                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13216                >,
13217            >,
13218            <T as tonic::codegen::Service<
13219                http::Request<tonic::body::Body>,
13220            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13221        {
13222            OrgSecurityKeysServiceClient::new(
13223                InterceptedService::new(inner, interceptor),
13224            )
13225        }
13226        /// Compress requests with the given encoding.
13227        ///
13228        /// This requires the server to support it otherwise it might respond with an
13229        /// error.
13230        #[must_use]
13231        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13232            self.inner = self.inner.send_compressed(encoding);
13233            self
13234        }
13235        /// Enable decompressing responses.
13236        #[must_use]
13237        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13238            self.inner = self.inner.accept_compressed(encoding);
13239            self
13240        }
13241        /// Limits the maximum size of a decoded message.
13242        ///
13243        /// Default: `4MB`
13244        #[must_use]
13245        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13246            self.inner = self.inner.max_decoding_message_size(limit);
13247            self
13248        }
13249        /// Limits the maximum size of an encoded message.
13250        ///
13251        /// Default: `usize::MAX`
13252        #[must_use]
13253        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13254            self.inner = self.inner.max_encoding_message_size(limit);
13255            self
13256        }
13257        /** Return all non-retired pepper versions for one (org_id, purpose). Used
13258 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
13259 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
13260*/
13261        pub async fn get_peppers(
13262            &mut self,
13263            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
13264        ) -> std::result::Result<
13265            tonic::Response<super::GetPeppersResponse>,
13266            tonic::Status,
13267        > {
13268            self.inner
13269                .ready()
13270                .await
13271                .map_err(|e| {
13272                    tonic::Status::unknown(
13273                        format!("Service was not ready: {}", e.into()),
13274                    )
13275                })?;
13276            let codec = tonic_prost::ProstCodec::default();
13277            let path = http::uri::PathAndQuery::from_static(
13278                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
13279            );
13280            let mut req = request.into_request();
13281            req.extensions_mut()
13282                .insert(
13283                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
13284                );
13285            self.inner.unary(req, path, codec).await
13286        }
13287    }
13288}
13289/// Generated server implementations.
13290pub mod org_security_keys_service_server {
13291    #![allow(
13292        unused_variables,
13293        dead_code,
13294        missing_docs,
13295        clippy::wildcard_imports,
13296        clippy::let_unit_value,
13297    )]
13298    use tonic::codegen::*;
13299    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
13300    #[async_trait]
13301    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
13302        /** Return all non-retired pepper versions for one (org_id, purpose). Used
13303 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
13304 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
13305*/
13306        async fn get_peppers(
13307            &self,
13308            request: tonic::Request<super::GetPeppersRequest>,
13309        ) -> std::result::Result<
13310            tonic::Response<super::GetPeppersResponse>,
13311            tonic::Status,
13312        >;
13313    }
13314    /** OrgSecurityKeysService exposes per-org secret key material to internal
13315 services that need it for HMAC computation, signature verification, or
13316 envelope-key derivation.
13317
13318 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
13319 material. The server MUST require a client certificate from a known
13320 internal service (allowlisted by subject DN) and MUST reject any request
13321 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
13322
13323 Callers (today: pidgr-integrations) cache returned peppers in-process
13324 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
13325 keep dispatch hot-path latency bounded.
13326*/
13327    #[derive(Debug)]
13328    pub struct OrgSecurityKeysServiceServer<T> {
13329        inner: Arc<T>,
13330        accept_compression_encodings: EnabledCompressionEncodings,
13331        send_compression_encodings: EnabledCompressionEncodings,
13332        max_decoding_message_size: Option<usize>,
13333        max_encoding_message_size: Option<usize>,
13334    }
13335    impl<T> OrgSecurityKeysServiceServer<T> {
13336        pub fn new(inner: T) -> Self {
13337            Self::from_arc(Arc::new(inner))
13338        }
13339        pub fn from_arc(inner: Arc<T>) -> Self {
13340            Self {
13341                inner,
13342                accept_compression_encodings: Default::default(),
13343                send_compression_encodings: Default::default(),
13344                max_decoding_message_size: None,
13345                max_encoding_message_size: None,
13346            }
13347        }
13348        pub fn with_interceptor<F>(
13349            inner: T,
13350            interceptor: F,
13351        ) -> InterceptedService<Self, F>
13352        where
13353            F: tonic::service::Interceptor,
13354        {
13355            InterceptedService::new(Self::new(inner), interceptor)
13356        }
13357        /// Enable decompressing requests with the given encoding.
13358        #[must_use]
13359        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13360            self.accept_compression_encodings.enable(encoding);
13361            self
13362        }
13363        /// Compress responses with the given encoding, if the client supports it.
13364        #[must_use]
13365        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13366            self.send_compression_encodings.enable(encoding);
13367            self
13368        }
13369        /// Limits the maximum size of a decoded message.
13370        ///
13371        /// Default: `4MB`
13372        #[must_use]
13373        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13374            self.max_decoding_message_size = Some(limit);
13375            self
13376        }
13377        /// Limits the maximum size of an encoded message.
13378        ///
13379        /// Default: `usize::MAX`
13380        #[must_use]
13381        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13382            self.max_encoding_message_size = Some(limit);
13383            self
13384        }
13385    }
13386    impl<T, B> tonic::codegen::Service<http::Request<B>>
13387    for OrgSecurityKeysServiceServer<T>
13388    where
13389        T: OrgSecurityKeysService,
13390        B: Body + std::marker::Send + 'static,
13391        B::Error: Into<StdError> + std::marker::Send + 'static,
13392    {
13393        type Response = http::Response<tonic::body::Body>;
13394        type Error = std::convert::Infallible;
13395        type Future = BoxFuture<Self::Response, Self::Error>;
13396        fn poll_ready(
13397            &mut self,
13398            _cx: &mut Context<'_>,
13399        ) -> Poll<std::result::Result<(), Self::Error>> {
13400            Poll::Ready(Ok(()))
13401        }
13402        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13403            match req.uri().path() {
13404                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
13405                    #[allow(non_camel_case_types)]
13406                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
13407                    impl<
13408                        T: OrgSecurityKeysService,
13409                    > tonic::server::UnaryService<super::GetPeppersRequest>
13410                    for GetPeppersSvc<T> {
13411                        type Response = super::GetPeppersResponse;
13412                        type Future = BoxFuture<
13413                            tonic::Response<Self::Response>,
13414                            tonic::Status,
13415                        >;
13416                        fn call(
13417                            &mut self,
13418                            request: tonic::Request<super::GetPeppersRequest>,
13419                        ) -> Self::Future {
13420                            let inner = Arc::clone(&self.0);
13421                            let fut = async move {
13422                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
13423                                    .await
13424                            };
13425                            Box::pin(fut)
13426                        }
13427                    }
13428                    let accept_compression_encodings = self.accept_compression_encodings;
13429                    let send_compression_encodings = self.send_compression_encodings;
13430                    let max_decoding_message_size = self.max_decoding_message_size;
13431                    let max_encoding_message_size = self.max_encoding_message_size;
13432                    let inner = self.inner.clone();
13433                    let fut = async move {
13434                        let method = GetPeppersSvc(inner);
13435                        let codec = tonic_prost::ProstCodec::default();
13436                        let mut grpc = tonic::server::Grpc::new(codec)
13437                            .apply_compression_config(
13438                                accept_compression_encodings,
13439                                send_compression_encodings,
13440                            )
13441                            .apply_max_message_size_config(
13442                                max_decoding_message_size,
13443                                max_encoding_message_size,
13444                            );
13445                        let res = grpc.unary(method, req).await;
13446                        Ok(res)
13447                    };
13448                    Box::pin(fut)
13449                }
13450                _ => {
13451                    Box::pin(async move {
13452                        let mut response = http::Response::new(
13453                            tonic::body::Body::default(),
13454                        );
13455                        let headers = response.headers_mut();
13456                        headers
13457                            .insert(
13458                                tonic::Status::GRPC_STATUS,
13459                                (tonic::Code::Unimplemented as i32).into(),
13460                            );
13461                        headers
13462                            .insert(
13463                                http::header::CONTENT_TYPE,
13464                                tonic::metadata::GRPC_CONTENT_TYPE,
13465                            );
13466                        Ok(response)
13467                    })
13468                }
13469            }
13470        }
13471    }
13472    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
13473        fn clone(&self) -> Self {
13474            let inner = self.inner.clone();
13475            Self {
13476                inner,
13477                accept_compression_encodings: self.accept_compression_encodings,
13478                send_compression_encodings: self.send_compression_encodings,
13479                max_decoding_message_size: self.max_decoding_message_size,
13480                max_encoding_message_size: self.max_encoding_message_size,
13481            }
13482        }
13483    }
13484    /// Generated gRPC service name
13485    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
13486    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
13487        const NAME: &'static str = SERVICE_NAME;
13488    }
13489}
13490/// Generated client implementations.
13491pub mod organization_service_client {
13492    #![allow(
13493        unused_variables,
13494        dead_code,
13495        missing_docs,
13496        clippy::wildcard_imports,
13497        clippy::let_unit_value,
13498    )]
13499    use tonic::codegen::*;
13500    use tonic::codegen::http::Uri;
13501    /** Manages organizations (tenants) in the Pidgr platform.
13502 Most RPCs operate within the caller's org (extracted from JWT).
13503 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
13504*/
13505    #[derive(Debug, Clone)]
13506    pub struct OrganizationServiceClient<T> {
13507        inner: tonic::client::Grpc<T>,
13508    }
13509    impl OrganizationServiceClient<tonic::transport::Channel> {
13510        /// Attempt to create a new client by connecting to a given endpoint.
13511        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13512        where
13513            D: TryInto<tonic::transport::Endpoint>,
13514            D::Error: Into<StdError>,
13515        {
13516            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13517            Ok(Self::new(conn))
13518        }
13519    }
13520    impl<T> OrganizationServiceClient<T>
13521    where
13522        T: tonic::client::GrpcService<tonic::body::Body>,
13523        T::Error: Into<StdError>,
13524        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13525        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13526    {
13527        pub fn new(inner: T) -> Self {
13528            let inner = tonic::client::Grpc::new(inner);
13529            Self { inner }
13530        }
13531        pub fn with_origin(inner: T, origin: Uri) -> Self {
13532            let inner = tonic::client::Grpc::with_origin(inner, origin);
13533            Self { inner }
13534        }
13535        pub fn with_interceptor<F>(
13536            inner: T,
13537            interceptor: F,
13538        ) -> OrganizationServiceClient<InterceptedService<T, F>>
13539        where
13540            F: tonic::service::Interceptor,
13541            T::ResponseBody: Default,
13542            T: tonic::codegen::Service<
13543                http::Request<tonic::body::Body>,
13544                Response = http::Response<
13545                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13546                >,
13547            >,
13548            <T as tonic::codegen::Service<
13549                http::Request<tonic::body::Body>,
13550            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13551        {
13552            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
13553        }
13554        /// Compress requests with the given encoding.
13555        ///
13556        /// This requires the server to support it otherwise it might respond with an
13557        /// error.
13558        #[must_use]
13559        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13560            self.inner = self.inner.send_compressed(encoding);
13561            self
13562        }
13563        /// Enable decompressing responses.
13564        #[must_use]
13565        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13566            self.inner = self.inner.accept_compressed(encoding);
13567            self
13568        }
13569        /// Limits the maximum size of a decoded message.
13570        ///
13571        /// Default: `4MB`
13572        #[must_use]
13573        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13574            self.inner = self.inner.max_decoding_message_size(limit);
13575            self
13576        }
13577        /// Limits the maximum size of an encoded message.
13578        ///
13579        /// Default: `usize::MAX`
13580        #[must_use]
13581        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13582            self.inner = self.inner.max_encoding_message_size(limit);
13583            self
13584        }
13585        /** Create a new organization. JWT auth only — the caller becomes the initial
13586 admin. Add further admins via CreateInviteLink.
13587 Authorization: Authenticated user (no specific permission required).
13588*/
13589        pub async fn create_organization(
13590            &mut self,
13591            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
13592        ) -> std::result::Result<
13593            tonic::Response<super::CreateOrganizationResponse>,
13594            tonic::Status,
13595        > {
13596            self.inner
13597                .ready()
13598                .await
13599                .map_err(|e| {
13600                    tonic::Status::unknown(
13601                        format!("Service was not ready: {}", e.into()),
13602                    )
13603                })?;
13604            let codec = tonic_prost::ProstCodec::default();
13605            let path = http::uri::PathAndQuery::from_static(
13606                "/pidgr.v1.OrganizationService/CreateOrganization",
13607            );
13608            let mut req = request.into_request();
13609            req.extensions_mut()
13610                .insert(
13611                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
13612                );
13613            self.inner.unary(req, path, codec).await
13614        }
13615        /** Retrieve the organization for the authenticated user.
13616 Authorization: Requires PERMISSION_ORG_READ.
13617*/
13618        pub async fn get_organization(
13619            &mut self,
13620            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
13621        ) -> std::result::Result<
13622            tonic::Response<super::GetOrganizationResponse>,
13623            tonic::Status,
13624        > {
13625            self.inner
13626                .ready()
13627                .await
13628                .map_err(|e| {
13629                    tonic::Status::unknown(
13630                        format!("Service was not ready: {}", e.into()),
13631                    )
13632                })?;
13633            let codec = tonic_prost::ProstCodec::default();
13634            let path = http::uri::PathAndQuery::from_static(
13635                "/pidgr.v1.OrganizationService/GetOrganization",
13636            );
13637            let mut req = request.into_request();
13638            req.extensions_mut()
13639                .insert(
13640                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
13641                );
13642            self.inner.unary(req, path, codec).await
13643        }
13644        /** Update organization settings (name, default workflow, industry, company size).
13645 Authorization: Requires PERMISSION_ORG_WRITE.
13646*/
13647        pub async fn update_organization(
13648            &mut self,
13649            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
13650        ) -> std::result::Result<
13651            tonic::Response<super::UpdateOrganizationResponse>,
13652            tonic::Status,
13653        > {
13654            self.inner
13655                .ready()
13656                .await
13657                .map_err(|e| {
13658                    tonic::Status::unknown(
13659                        format!("Service was not ready: {}", e.into()),
13660                    )
13661                })?;
13662            let codec = tonic_prost::ProstCodec::default();
13663            let path = http::uri::PathAndQuery::from_static(
13664                "/pidgr.v1.OrganizationService/UpdateOrganization",
13665            );
13666            let mut req = request.into_request();
13667            req.extensions_mut()
13668                .insert(
13669                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
13670                );
13671            self.inner.unary(req, path, codec).await
13672        }
13673        /** Replace all SSO attribute mappings for the organization.
13674 Authorization: Requires PERMISSION_ORG_WRITE.
13675*/
13676        pub async fn update_sso_attribute_mappings(
13677            &mut self,
13678            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
13679        ) -> std::result::Result<
13680            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
13681            tonic::Status,
13682        > {
13683            self.inner
13684                .ready()
13685                .await
13686                .map_err(|e| {
13687                    tonic::Status::unknown(
13688                        format!("Service was not ready: {}", e.into()),
13689                    )
13690                })?;
13691            let codec = tonic_prost::ProstCodec::default();
13692            let path = http::uri::PathAndQuery::from_static(
13693                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
13694            );
13695            let mut req = request.into_request();
13696            req.extensions_mut()
13697                .insert(
13698                    GrpcMethod::new(
13699                        "pidgr.v1.OrganizationService",
13700                        "UpdateSsoAttributeMappings",
13701                    ),
13702                );
13703            self.inner.unary(req, path, codec).await
13704        }
13705        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
13706 Authorization: Requires PERMISSION_PRIVACY_WRITE.
13707*/
13708        pub async fn rotate_analytics_salt(
13709            &mut self,
13710            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
13711        ) -> std::result::Result<
13712            tonic::Response<super::RotateAnalyticsSaltResponse>,
13713            tonic::Status,
13714        > {
13715            self.inner
13716                .ready()
13717                .await
13718                .map_err(|e| {
13719                    tonic::Status::unknown(
13720                        format!("Service was not ready: {}", e.into()),
13721                    )
13722                })?;
13723            let codec = tonic_prost::ProstCodec::default();
13724            let path = http::uri::PathAndQuery::from_static(
13725                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
13726            );
13727            let mut req = request.into_request();
13728            req.extensions_mut()
13729                .insert(
13730                    GrpcMethod::new(
13731                        "pidgr.v1.OrganizationService",
13732                        "RotateAnalyticsSalt",
13733                    ),
13734                );
13735            self.inner.unary(req, path, codec).await
13736        }
13737        /** Update the differential privacy epsilon parameter.
13738 Authorization: Requires PERMISSION_PRIVACY_WRITE.
13739*/
13740        pub async fn update_analytics_epsilon(
13741            &mut self,
13742            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
13743        ) -> std::result::Result<
13744            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
13745            tonic::Status,
13746        > {
13747            self.inner
13748                .ready()
13749                .await
13750                .map_err(|e| {
13751                    tonic::Status::unknown(
13752                        format!("Service was not ready: {}", e.into()),
13753                    )
13754                })?;
13755            let codec = tonic_prost::ProstCodec::default();
13756            let path = http::uri::PathAndQuery::from_static(
13757                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
13758            );
13759            let mut req = request.into_request();
13760            req.extensions_mut()
13761                .insert(
13762                    GrpcMethod::new(
13763                        "pidgr.v1.OrganizationService",
13764                        "UpdateAnalyticsEpsilon",
13765                    ),
13766                );
13767            self.inner.unary(req, path, codec).await
13768        }
13769        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
13770 analytics, third-party channels) with last-changed-by/at metadata for
13771 the consent-trace UI.
13772 Authorization: Requires PERMISSION_PRIVACY_READ.
13773*/
13774        pub async fn get_org_privacy_settings(
13775            &mut self,
13776            request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
13777        ) -> std::result::Result<
13778            tonic::Response<super::GetOrgPrivacySettingsResponse>,
13779            tonic::Status,
13780        > {
13781            self.inner
13782                .ready()
13783                .await
13784                .map_err(|e| {
13785                    tonic::Status::unknown(
13786                        format!("Service was not ready: {}", e.into()),
13787                    )
13788                })?;
13789            let codec = tonic_prost::ProstCodec::default();
13790            let path = http::uri::PathAndQuery::from_static(
13791                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
13792            );
13793            let mut req = request.into_request();
13794            req.extensions_mut()
13795                .insert(
13796                    GrpcMethod::new(
13797                        "pidgr.v1.OrganizationService",
13798                        "GetOrgPrivacySettings",
13799                    ),
13800                );
13801            self.inner.unary(req, path, codec).await
13802        }
13803        /** Update org-level data-processing toggles. Only provided fields change;
13804 each change is recorded with the acting admin and timestamp.
13805 Authorization: Requires PERMISSION_PRIVACY_WRITE.
13806*/
13807        pub async fn update_org_privacy_settings(
13808            &mut self,
13809            request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
13810        ) -> std::result::Result<
13811            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
13812            tonic::Status,
13813        > {
13814            self.inner
13815                .ready()
13816                .await
13817                .map_err(|e| {
13818                    tonic::Status::unknown(
13819                        format!("Service was not ready: {}", e.into()),
13820                    )
13821                })?;
13822            let codec = tonic_prost::ProstCodec::default();
13823            let path = http::uri::PathAndQuery::from_static(
13824                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
13825            );
13826            let mut req = request.into_request();
13827            req.extensions_mut()
13828                .insert(
13829                    GrpcMethod::new(
13830                        "pidgr.v1.OrganizationService",
13831                        "UpdateOrgPrivacySettings",
13832                    ),
13833                );
13834            self.inner.unary(req, path, codec).await
13835        }
13836        /** Create a sandbox organization for testing configurations.
13837 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
13838 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
13839 per user to prevent abuse.
13840*/
13841        pub async fn create_sandbox_organization(
13842            &mut self,
13843            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
13844        ) -> std::result::Result<
13845            tonic::Response<super::CreateSandboxOrganizationResponse>,
13846            tonic::Status,
13847        > {
13848            self.inner
13849                .ready()
13850                .await
13851                .map_err(|e| {
13852                    tonic::Status::unknown(
13853                        format!("Service was not ready: {}", e.into()),
13854                    )
13855                })?;
13856            let codec = tonic_prost::ProstCodec::default();
13857            let path = http::uri::PathAndQuery::from_static(
13858                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
13859            );
13860            let mut req = request.into_request();
13861            req.extensions_mut()
13862                .insert(
13863                    GrpcMethod::new(
13864                        "pidgr.v1.OrganizationService",
13865                        "CreateSandboxOrganization",
13866                    ),
13867                );
13868            self.inner.unary(req, path, codec).await
13869        }
13870        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
13871 which handles cleanup across DB, Cognito, S3, Temporal, and regional
13872 content stores.
13873 Authorization: Super admin of the target sandbox OR its creator.
13874*/
13875        pub async fn delete_sandbox_organization(
13876            &mut self,
13877            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
13878        ) -> std::result::Result<
13879            tonic::Response<super::DeleteSandboxOrganizationResponse>,
13880            tonic::Status,
13881        > {
13882            self.inner
13883                .ready()
13884                .await
13885                .map_err(|e| {
13886                    tonic::Status::unknown(
13887                        format!("Service was not ready: {}", e.into()),
13888                    )
13889                })?;
13890            let codec = tonic_prost::ProstCodec::default();
13891            let path = http::uri::PathAndQuery::from_static(
13892                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
13893            );
13894            let mut req = request.into_request();
13895            req.extensions_mut()
13896                .insert(
13897                    GrpcMethod::new(
13898                        "pidgr.v1.OrganizationService",
13899                        "DeleteSandboxOrganization",
13900                    ),
13901                );
13902            self.inner.unary(req, path, codec).await
13903        }
13904        /** List bootstrap fixtures available for seeding new organizations. The
13905 catalog is backend-owned; admin UI populates the "seed initial data"
13906 control or dropdown from this response.
13907 Authorization: Any authenticated user.
13908*/
13909        pub async fn list_sandbox_fixtures(
13910            &mut self,
13911            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
13912        ) -> std::result::Result<
13913            tonic::Response<super::ListSandboxFixturesResponse>,
13914            tonic::Status,
13915        > {
13916            self.inner
13917                .ready()
13918                .await
13919                .map_err(|e| {
13920                    tonic::Status::unknown(
13921                        format!("Service was not ready: {}", e.into()),
13922                    )
13923                })?;
13924            let codec = tonic_prost::ProstCodec::default();
13925            let path = http::uri::PathAndQuery::from_static(
13926                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
13927            );
13928            let mut req = request.into_request();
13929            req.extensions_mut()
13930                .insert(
13931                    GrpcMethod::new(
13932                        "pidgr.v1.OrganizationService",
13933                        "ListSandboxFixtures",
13934                    ),
13935                );
13936            self.inner.unary(req, path, codec).await
13937        }
13938        /** List all organizations the authenticated user belongs to.
13939 Org-exempt: callable without org context (only requires valid JWT).
13940 Used by the admin org switcher to discover available orgs.
13941 Excludes expired sandbox organizations.
13942 Authorization: Authenticated user (no specific permission required).
13943*/
13944        pub async fn list_user_organizations(
13945            &mut self,
13946            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
13947        ) -> std::result::Result<
13948            tonic::Response<super::ListUserOrganizationsResponse>,
13949            tonic::Status,
13950        > {
13951            self.inner
13952                .ready()
13953                .await
13954                .map_err(|e| {
13955                    tonic::Status::unknown(
13956                        format!("Service was not ready: {}", e.into()),
13957                    )
13958                })?;
13959            let codec = tonic_prost::ProstCodec::default();
13960            let path = http::uri::PathAndQuery::from_static(
13961                "/pidgr.v1.OrganizationService/ListUserOrganizations",
13962            );
13963            let mut req = request.into_request();
13964            req.extensions_mut()
13965                .insert(
13966                    GrpcMethod::new(
13967                        "pidgr.v1.OrganizationService",
13968                        "ListUserOrganizations",
13969                    ),
13970                );
13971            self.inner.unary(req, path, codec).await
13972        }
13973        /** List only the sandbox organizations the authenticated user belongs to.
13974 Org-exempt: callable without org context. The admin UI's /sandboxes
13975 management page is the primary consumer — it's a user-level surface
13976 rather than org-scoped, so this RPC is user-scoped too.
13977 Excludes already-expired sandboxes (pending cleanup).
13978 Authorization: Authenticated user (no specific permission required).
13979*/
13980        pub async fn list_user_sandboxes(
13981            &mut self,
13982            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
13983        ) -> std::result::Result<
13984            tonic::Response<super::ListUserSandboxesResponse>,
13985            tonic::Status,
13986        > {
13987            self.inner
13988                .ready()
13989                .await
13990                .map_err(|e| {
13991                    tonic::Status::unknown(
13992                        format!("Service was not ready: {}", e.into()),
13993                    )
13994                })?;
13995            let codec = tonic_prost::ProstCodec::default();
13996            let path = http::uri::PathAndQuery::from_static(
13997                "/pidgr.v1.OrganizationService/ListUserSandboxes",
13998            );
13999            let mut req = request.into_request();
14000            req.extensions_mut()
14001                .insert(
14002                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
14003                );
14004            self.inner.unary(req, path, codec).await
14005        }
14006    }
14007}
14008/// Generated server implementations.
14009pub mod organization_service_server {
14010    #![allow(
14011        unused_variables,
14012        dead_code,
14013        missing_docs,
14014        clippy::wildcard_imports,
14015        clippy::let_unit_value,
14016    )]
14017    use tonic::codegen::*;
14018    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
14019    #[async_trait]
14020    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
14021        /** Create a new organization. JWT auth only — the caller becomes the initial
14022 admin. Add further admins via CreateInviteLink.
14023 Authorization: Authenticated user (no specific permission required).
14024*/
14025        async fn create_organization(
14026            &self,
14027            request: tonic::Request<super::CreateOrganizationRequest>,
14028        ) -> std::result::Result<
14029            tonic::Response<super::CreateOrganizationResponse>,
14030            tonic::Status,
14031        >;
14032        /** Retrieve the organization for the authenticated user.
14033 Authorization: Requires PERMISSION_ORG_READ.
14034*/
14035        async fn get_organization(
14036            &self,
14037            request: tonic::Request<super::GetOrganizationRequest>,
14038        ) -> std::result::Result<
14039            tonic::Response<super::GetOrganizationResponse>,
14040            tonic::Status,
14041        >;
14042        /** Update organization settings (name, default workflow, industry, company size).
14043 Authorization: Requires PERMISSION_ORG_WRITE.
14044*/
14045        async fn update_organization(
14046            &self,
14047            request: tonic::Request<super::UpdateOrganizationRequest>,
14048        ) -> std::result::Result<
14049            tonic::Response<super::UpdateOrganizationResponse>,
14050            tonic::Status,
14051        >;
14052        /** Replace all SSO attribute mappings for the organization.
14053 Authorization: Requires PERMISSION_ORG_WRITE.
14054*/
14055        async fn update_sso_attribute_mappings(
14056            &self,
14057            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
14058        ) -> std::result::Result<
14059            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
14060            tonic::Status,
14061        >;
14062        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
14063 Authorization: Requires PERMISSION_PRIVACY_WRITE.
14064*/
14065        async fn rotate_analytics_salt(
14066            &self,
14067            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
14068        ) -> std::result::Result<
14069            tonic::Response<super::RotateAnalyticsSaltResponse>,
14070            tonic::Status,
14071        >;
14072        /** Update the differential privacy epsilon parameter.
14073 Authorization: Requires PERMISSION_PRIVACY_WRITE.
14074*/
14075        async fn update_analytics_epsilon(
14076            &self,
14077            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
14078        ) -> std::result::Result<
14079            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
14080            tonic::Status,
14081        >;
14082        /** Retrieve org-level data-processing toggles (AI clustering, behavioral
14083 analytics, third-party channels) with last-changed-by/at metadata for
14084 the consent-trace UI.
14085 Authorization: Requires PERMISSION_PRIVACY_READ.
14086*/
14087        async fn get_org_privacy_settings(
14088            &self,
14089            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
14090        ) -> std::result::Result<
14091            tonic::Response<super::GetOrgPrivacySettingsResponse>,
14092            tonic::Status,
14093        >;
14094        /** Update org-level data-processing toggles. Only provided fields change;
14095 each change is recorded with the acting admin and timestamp.
14096 Authorization: Requires PERMISSION_PRIVACY_WRITE.
14097*/
14098        async fn update_org_privacy_settings(
14099            &self,
14100            request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
14101        ) -> std::result::Result<
14102            tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
14103            tonic::Status,
14104        >;
14105        /** Create a sandbox organization for testing configurations.
14106 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
14107 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
14108 per user to prevent abuse.
14109*/
14110        async fn create_sandbox_organization(
14111            &self,
14112            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
14113        ) -> std::result::Result<
14114            tonic::Response<super::CreateSandboxOrganizationResponse>,
14115            tonic::Status,
14116        >;
14117        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
14118 which handles cleanup across DB, Cognito, S3, Temporal, and regional
14119 content stores.
14120 Authorization: Super admin of the target sandbox OR its creator.
14121*/
14122        async fn delete_sandbox_organization(
14123            &self,
14124            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
14125        ) -> std::result::Result<
14126            tonic::Response<super::DeleteSandboxOrganizationResponse>,
14127            tonic::Status,
14128        >;
14129        /** List bootstrap fixtures available for seeding new organizations. The
14130 catalog is backend-owned; admin UI populates the "seed initial data"
14131 control or dropdown from this response.
14132 Authorization: Any authenticated user.
14133*/
14134        async fn list_sandbox_fixtures(
14135            &self,
14136            request: tonic::Request<super::ListSandboxFixturesRequest>,
14137        ) -> std::result::Result<
14138            tonic::Response<super::ListSandboxFixturesResponse>,
14139            tonic::Status,
14140        >;
14141        /** List all organizations the authenticated user belongs to.
14142 Org-exempt: callable without org context (only requires valid JWT).
14143 Used by the admin org switcher to discover available orgs.
14144 Excludes expired sandbox organizations.
14145 Authorization: Authenticated user (no specific permission required).
14146*/
14147        async fn list_user_organizations(
14148            &self,
14149            request: tonic::Request<super::ListUserOrganizationsRequest>,
14150        ) -> std::result::Result<
14151            tonic::Response<super::ListUserOrganizationsResponse>,
14152            tonic::Status,
14153        >;
14154        /** List only the sandbox organizations the authenticated user belongs to.
14155 Org-exempt: callable without org context. The admin UI's /sandboxes
14156 management page is the primary consumer — it's a user-level surface
14157 rather than org-scoped, so this RPC is user-scoped too.
14158 Excludes already-expired sandboxes (pending cleanup).
14159 Authorization: Authenticated user (no specific permission required).
14160*/
14161        async fn list_user_sandboxes(
14162            &self,
14163            request: tonic::Request<super::ListUserSandboxesRequest>,
14164        ) -> std::result::Result<
14165            tonic::Response<super::ListUserSandboxesResponse>,
14166            tonic::Status,
14167        >;
14168    }
14169    /** Manages organizations (tenants) in the Pidgr platform.
14170 Most RPCs operate within the caller's org (extracted from JWT).
14171 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
14172*/
14173    #[derive(Debug)]
14174    pub struct OrganizationServiceServer<T> {
14175        inner: Arc<T>,
14176        accept_compression_encodings: EnabledCompressionEncodings,
14177        send_compression_encodings: EnabledCompressionEncodings,
14178        max_decoding_message_size: Option<usize>,
14179        max_encoding_message_size: Option<usize>,
14180    }
14181    impl<T> OrganizationServiceServer<T> {
14182        pub fn new(inner: T) -> Self {
14183            Self::from_arc(Arc::new(inner))
14184        }
14185        pub fn from_arc(inner: Arc<T>) -> Self {
14186            Self {
14187                inner,
14188                accept_compression_encodings: Default::default(),
14189                send_compression_encodings: Default::default(),
14190                max_decoding_message_size: None,
14191                max_encoding_message_size: None,
14192            }
14193        }
14194        pub fn with_interceptor<F>(
14195            inner: T,
14196            interceptor: F,
14197        ) -> InterceptedService<Self, F>
14198        where
14199            F: tonic::service::Interceptor,
14200        {
14201            InterceptedService::new(Self::new(inner), interceptor)
14202        }
14203        /// Enable decompressing requests with the given encoding.
14204        #[must_use]
14205        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14206            self.accept_compression_encodings.enable(encoding);
14207            self
14208        }
14209        /// Compress responses with the given encoding, if the client supports it.
14210        #[must_use]
14211        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14212            self.send_compression_encodings.enable(encoding);
14213            self
14214        }
14215        /// Limits the maximum size of a decoded message.
14216        ///
14217        /// Default: `4MB`
14218        #[must_use]
14219        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14220            self.max_decoding_message_size = Some(limit);
14221            self
14222        }
14223        /// Limits the maximum size of an encoded message.
14224        ///
14225        /// Default: `usize::MAX`
14226        #[must_use]
14227        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14228            self.max_encoding_message_size = Some(limit);
14229            self
14230        }
14231    }
14232    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
14233    where
14234        T: OrganizationService,
14235        B: Body + std::marker::Send + 'static,
14236        B::Error: Into<StdError> + std::marker::Send + 'static,
14237    {
14238        type Response = http::Response<tonic::body::Body>;
14239        type Error = std::convert::Infallible;
14240        type Future = BoxFuture<Self::Response, Self::Error>;
14241        fn poll_ready(
14242            &mut self,
14243            _cx: &mut Context<'_>,
14244        ) -> Poll<std::result::Result<(), Self::Error>> {
14245            Poll::Ready(Ok(()))
14246        }
14247        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14248            match req.uri().path() {
14249                "/pidgr.v1.OrganizationService/CreateOrganization" => {
14250                    #[allow(non_camel_case_types)]
14251                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
14252                    impl<
14253                        T: OrganizationService,
14254                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
14255                    for CreateOrganizationSvc<T> {
14256                        type Response = super::CreateOrganizationResponse;
14257                        type Future = BoxFuture<
14258                            tonic::Response<Self::Response>,
14259                            tonic::Status,
14260                        >;
14261                        fn call(
14262                            &mut self,
14263                            request: tonic::Request<super::CreateOrganizationRequest>,
14264                        ) -> Self::Future {
14265                            let inner = Arc::clone(&self.0);
14266                            let fut = async move {
14267                                <T as OrganizationService>::create_organization(
14268                                        &inner,
14269                                        request,
14270                                    )
14271                                    .await
14272                            };
14273                            Box::pin(fut)
14274                        }
14275                    }
14276                    let accept_compression_encodings = self.accept_compression_encodings;
14277                    let send_compression_encodings = self.send_compression_encodings;
14278                    let max_decoding_message_size = self.max_decoding_message_size;
14279                    let max_encoding_message_size = self.max_encoding_message_size;
14280                    let inner = self.inner.clone();
14281                    let fut = async move {
14282                        let method = CreateOrganizationSvc(inner);
14283                        let codec = tonic_prost::ProstCodec::default();
14284                        let mut grpc = tonic::server::Grpc::new(codec)
14285                            .apply_compression_config(
14286                                accept_compression_encodings,
14287                                send_compression_encodings,
14288                            )
14289                            .apply_max_message_size_config(
14290                                max_decoding_message_size,
14291                                max_encoding_message_size,
14292                            );
14293                        let res = grpc.unary(method, req).await;
14294                        Ok(res)
14295                    };
14296                    Box::pin(fut)
14297                }
14298                "/pidgr.v1.OrganizationService/GetOrganization" => {
14299                    #[allow(non_camel_case_types)]
14300                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
14301                    impl<
14302                        T: OrganizationService,
14303                    > tonic::server::UnaryService<super::GetOrganizationRequest>
14304                    for GetOrganizationSvc<T> {
14305                        type Response = super::GetOrganizationResponse;
14306                        type Future = BoxFuture<
14307                            tonic::Response<Self::Response>,
14308                            tonic::Status,
14309                        >;
14310                        fn call(
14311                            &mut self,
14312                            request: tonic::Request<super::GetOrganizationRequest>,
14313                        ) -> Self::Future {
14314                            let inner = Arc::clone(&self.0);
14315                            let fut = async move {
14316                                <T as OrganizationService>::get_organization(
14317                                        &inner,
14318                                        request,
14319                                    )
14320                                    .await
14321                            };
14322                            Box::pin(fut)
14323                        }
14324                    }
14325                    let accept_compression_encodings = self.accept_compression_encodings;
14326                    let send_compression_encodings = self.send_compression_encodings;
14327                    let max_decoding_message_size = self.max_decoding_message_size;
14328                    let max_encoding_message_size = self.max_encoding_message_size;
14329                    let inner = self.inner.clone();
14330                    let fut = async move {
14331                        let method = GetOrganizationSvc(inner);
14332                        let codec = tonic_prost::ProstCodec::default();
14333                        let mut grpc = tonic::server::Grpc::new(codec)
14334                            .apply_compression_config(
14335                                accept_compression_encodings,
14336                                send_compression_encodings,
14337                            )
14338                            .apply_max_message_size_config(
14339                                max_decoding_message_size,
14340                                max_encoding_message_size,
14341                            );
14342                        let res = grpc.unary(method, req).await;
14343                        Ok(res)
14344                    };
14345                    Box::pin(fut)
14346                }
14347                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
14348                    #[allow(non_camel_case_types)]
14349                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
14350                    impl<
14351                        T: OrganizationService,
14352                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
14353                    for UpdateOrganizationSvc<T> {
14354                        type Response = super::UpdateOrganizationResponse;
14355                        type Future = BoxFuture<
14356                            tonic::Response<Self::Response>,
14357                            tonic::Status,
14358                        >;
14359                        fn call(
14360                            &mut self,
14361                            request: tonic::Request<super::UpdateOrganizationRequest>,
14362                        ) -> Self::Future {
14363                            let inner = Arc::clone(&self.0);
14364                            let fut = async move {
14365                                <T as OrganizationService>::update_organization(
14366                                        &inner,
14367                                        request,
14368                                    )
14369                                    .await
14370                            };
14371                            Box::pin(fut)
14372                        }
14373                    }
14374                    let accept_compression_encodings = self.accept_compression_encodings;
14375                    let send_compression_encodings = self.send_compression_encodings;
14376                    let max_decoding_message_size = self.max_decoding_message_size;
14377                    let max_encoding_message_size = self.max_encoding_message_size;
14378                    let inner = self.inner.clone();
14379                    let fut = async move {
14380                        let method = UpdateOrganizationSvc(inner);
14381                        let codec = tonic_prost::ProstCodec::default();
14382                        let mut grpc = tonic::server::Grpc::new(codec)
14383                            .apply_compression_config(
14384                                accept_compression_encodings,
14385                                send_compression_encodings,
14386                            )
14387                            .apply_max_message_size_config(
14388                                max_decoding_message_size,
14389                                max_encoding_message_size,
14390                            );
14391                        let res = grpc.unary(method, req).await;
14392                        Ok(res)
14393                    };
14394                    Box::pin(fut)
14395                }
14396                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
14397                    #[allow(non_camel_case_types)]
14398                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
14399                        pub Arc<T>,
14400                    );
14401                    impl<
14402                        T: OrganizationService,
14403                    > tonic::server::UnaryService<
14404                        super::UpdateSsoAttributeMappingsRequest,
14405                    > for UpdateSsoAttributeMappingsSvc<T> {
14406                        type Response = super::UpdateSsoAttributeMappingsResponse;
14407                        type Future = BoxFuture<
14408                            tonic::Response<Self::Response>,
14409                            tonic::Status,
14410                        >;
14411                        fn call(
14412                            &mut self,
14413                            request: tonic::Request<
14414                                super::UpdateSsoAttributeMappingsRequest,
14415                            >,
14416                        ) -> Self::Future {
14417                            let inner = Arc::clone(&self.0);
14418                            let fut = async move {
14419                                <T as OrganizationService>::update_sso_attribute_mappings(
14420                                        &inner,
14421                                        request,
14422                                    )
14423                                    .await
14424                            };
14425                            Box::pin(fut)
14426                        }
14427                    }
14428                    let accept_compression_encodings = self.accept_compression_encodings;
14429                    let send_compression_encodings = self.send_compression_encodings;
14430                    let max_decoding_message_size = self.max_decoding_message_size;
14431                    let max_encoding_message_size = self.max_encoding_message_size;
14432                    let inner = self.inner.clone();
14433                    let fut = async move {
14434                        let method = UpdateSsoAttributeMappingsSvc(inner);
14435                        let codec = tonic_prost::ProstCodec::default();
14436                        let mut grpc = tonic::server::Grpc::new(codec)
14437                            .apply_compression_config(
14438                                accept_compression_encodings,
14439                                send_compression_encodings,
14440                            )
14441                            .apply_max_message_size_config(
14442                                max_decoding_message_size,
14443                                max_encoding_message_size,
14444                            );
14445                        let res = grpc.unary(method, req).await;
14446                        Ok(res)
14447                    };
14448                    Box::pin(fut)
14449                }
14450                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
14451                    #[allow(non_camel_case_types)]
14452                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
14453                    impl<
14454                        T: OrganizationService,
14455                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
14456                    for RotateAnalyticsSaltSvc<T> {
14457                        type Response = super::RotateAnalyticsSaltResponse;
14458                        type Future = BoxFuture<
14459                            tonic::Response<Self::Response>,
14460                            tonic::Status,
14461                        >;
14462                        fn call(
14463                            &mut self,
14464                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
14465                        ) -> Self::Future {
14466                            let inner = Arc::clone(&self.0);
14467                            let fut = async move {
14468                                <T as OrganizationService>::rotate_analytics_salt(
14469                                        &inner,
14470                                        request,
14471                                    )
14472                                    .await
14473                            };
14474                            Box::pin(fut)
14475                        }
14476                    }
14477                    let accept_compression_encodings = self.accept_compression_encodings;
14478                    let send_compression_encodings = self.send_compression_encodings;
14479                    let max_decoding_message_size = self.max_decoding_message_size;
14480                    let max_encoding_message_size = self.max_encoding_message_size;
14481                    let inner = self.inner.clone();
14482                    let fut = async move {
14483                        let method = RotateAnalyticsSaltSvc(inner);
14484                        let codec = tonic_prost::ProstCodec::default();
14485                        let mut grpc = tonic::server::Grpc::new(codec)
14486                            .apply_compression_config(
14487                                accept_compression_encodings,
14488                                send_compression_encodings,
14489                            )
14490                            .apply_max_message_size_config(
14491                                max_decoding_message_size,
14492                                max_encoding_message_size,
14493                            );
14494                        let res = grpc.unary(method, req).await;
14495                        Ok(res)
14496                    };
14497                    Box::pin(fut)
14498                }
14499                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
14500                    #[allow(non_camel_case_types)]
14501                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
14502                    impl<
14503                        T: OrganizationService,
14504                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
14505                    for UpdateAnalyticsEpsilonSvc<T> {
14506                        type Response = super::UpdateAnalyticsEpsilonResponse;
14507                        type Future = BoxFuture<
14508                            tonic::Response<Self::Response>,
14509                            tonic::Status,
14510                        >;
14511                        fn call(
14512                            &mut self,
14513                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
14514                        ) -> Self::Future {
14515                            let inner = Arc::clone(&self.0);
14516                            let fut = async move {
14517                                <T as OrganizationService>::update_analytics_epsilon(
14518                                        &inner,
14519                                        request,
14520                                    )
14521                                    .await
14522                            };
14523                            Box::pin(fut)
14524                        }
14525                    }
14526                    let accept_compression_encodings = self.accept_compression_encodings;
14527                    let send_compression_encodings = self.send_compression_encodings;
14528                    let max_decoding_message_size = self.max_decoding_message_size;
14529                    let max_encoding_message_size = self.max_encoding_message_size;
14530                    let inner = self.inner.clone();
14531                    let fut = async move {
14532                        let method = UpdateAnalyticsEpsilonSvc(inner);
14533                        let codec = tonic_prost::ProstCodec::default();
14534                        let mut grpc = tonic::server::Grpc::new(codec)
14535                            .apply_compression_config(
14536                                accept_compression_encodings,
14537                                send_compression_encodings,
14538                            )
14539                            .apply_max_message_size_config(
14540                                max_decoding_message_size,
14541                                max_encoding_message_size,
14542                            );
14543                        let res = grpc.unary(method, req).await;
14544                        Ok(res)
14545                    };
14546                    Box::pin(fut)
14547                }
14548                "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
14549                    #[allow(non_camel_case_types)]
14550                    struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
14551                    impl<
14552                        T: OrganizationService,
14553                    > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
14554                    for GetOrgPrivacySettingsSvc<T> {
14555                        type Response = super::GetOrgPrivacySettingsResponse;
14556                        type Future = BoxFuture<
14557                            tonic::Response<Self::Response>,
14558                            tonic::Status,
14559                        >;
14560                        fn call(
14561                            &mut self,
14562                            request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
14563                        ) -> Self::Future {
14564                            let inner = Arc::clone(&self.0);
14565                            let fut = async move {
14566                                <T as OrganizationService>::get_org_privacy_settings(
14567                                        &inner,
14568                                        request,
14569                                    )
14570                                    .await
14571                            };
14572                            Box::pin(fut)
14573                        }
14574                    }
14575                    let accept_compression_encodings = self.accept_compression_encodings;
14576                    let send_compression_encodings = self.send_compression_encodings;
14577                    let max_decoding_message_size = self.max_decoding_message_size;
14578                    let max_encoding_message_size = self.max_encoding_message_size;
14579                    let inner = self.inner.clone();
14580                    let fut = async move {
14581                        let method = GetOrgPrivacySettingsSvc(inner);
14582                        let codec = tonic_prost::ProstCodec::default();
14583                        let mut grpc = tonic::server::Grpc::new(codec)
14584                            .apply_compression_config(
14585                                accept_compression_encodings,
14586                                send_compression_encodings,
14587                            )
14588                            .apply_max_message_size_config(
14589                                max_decoding_message_size,
14590                                max_encoding_message_size,
14591                            );
14592                        let res = grpc.unary(method, req).await;
14593                        Ok(res)
14594                    };
14595                    Box::pin(fut)
14596                }
14597                "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
14598                    #[allow(non_camel_case_types)]
14599                    struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
14600                        pub Arc<T>,
14601                    );
14602                    impl<
14603                        T: OrganizationService,
14604                    > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
14605                    for UpdateOrgPrivacySettingsSvc<T> {
14606                        type Response = super::UpdateOrgPrivacySettingsResponse;
14607                        type Future = BoxFuture<
14608                            tonic::Response<Self::Response>,
14609                            tonic::Status,
14610                        >;
14611                        fn call(
14612                            &mut self,
14613                            request: tonic::Request<
14614                                super::UpdateOrgPrivacySettingsRequest,
14615                            >,
14616                        ) -> Self::Future {
14617                            let inner = Arc::clone(&self.0);
14618                            let fut = async move {
14619                                <T as OrganizationService>::update_org_privacy_settings(
14620                                        &inner,
14621                                        request,
14622                                    )
14623                                    .await
14624                            };
14625                            Box::pin(fut)
14626                        }
14627                    }
14628                    let accept_compression_encodings = self.accept_compression_encodings;
14629                    let send_compression_encodings = self.send_compression_encodings;
14630                    let max_decoding_message_size = self.max_decoding_message_size;
14631                    let max_encoding_message_size = self.max_encoding_message_size;
14632                    let inner = self.inner.clone();
14633                    let fut = async move {
14634                        let method = UpdateOrgPrivacySettingsSvc(inner);
14635                        let codec = tonic_prost::ProstCodec::default();
14636                        let mut grpc = tonic::server::Grpc::new(codec)
14637                            .apply_compression_config(
14638                                accept_compression_encodings,
14639                                send_compression_encodings,
14640                            )
14641                            .apply_max_message_size_config(
14642                                max_decoding_message_size,
14643                                max_encoding_message_size,
14644                            );
14645                        let res = grpc.unary(method, req).await;
14646                        Ok(res)
14647                    };
14648                    Box::pin(fut)
14649                }
14650                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
14651                    #[allow(non_camel_case_types)]
14652                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
14653                        pub Arc<T>,
14654                    );
14655                    impl<
14656                        T: OrganizationService,
14657                    > tonic::server::UnaryService<
14658                        super::CreateSandboxOrganizationRequest,
14659                    > for CreateSandboxOrganizationSvc<T> {
14660                        type Response = super::CreateSandboxOrganizationResponse;
14661                        type Future = BoxFuture<
14662                            tonic::Response<Self::Response>,
14663                            tonic::Status,
14664                        >;
14665                        fn call(
14666                            &mut self,
14667                            request: tonic::Request<
14668                                super::CreateSandboxOrganizationRequest,
14669                            >,
14670                        ) -> Self::Future {
14671                            let inner = Arc::clone(&self.0);
14672                            let fut = async move {
14673                                <T as OrganizationService>::create_sandbox_organization(
14674                                        &inner,
14675                                        request,
14676                                    )
14677                                    .await
14678                            };
14679                            Box::pin(fut)
14680                        }
14681                    }
14682                    let accept_compression_encodings = self.accept_compression_encodings;
14683                    let send_compression_encodings = self.send_compression_encodings;
14684                    let max_decoding_message_size = self.max_decoding_message_size;
14685                    let max_encoding_message_size = self.max_encoding_message_size;
14686                    let inner = self.inner.clone();
14687                    let fut = async move {
14688                        let method = CreateSandboxOrganizationSvc(inner);
14689                        let codec = tonic_prost::ProstCodec::default();
14690                        let mut grpc = tonic::server::Grpc::new(codec)
14691                            .apply_compression_config(
14692                                accept_compression_encodings,
14693                                send_compression_encodings,
14694                            )
14695                            .apply_max_message_size_config(
14696                                max_decoding_message_size,
14697                                max_encoding_message_size,
14698                            );
14699                        let res = grpc.unary(method, req).await;
14700                        Ok(res)
14701                    };
14702                    Box::pin(fut)
14703                }
14704                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
14705                    #[allow(non_camel_case_types)]
14706                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
14707                        pub Arc<T>,
14708                    );
14709                    impl<
14710                        T: OrganizationService,
14711                    > tonic::server::UnaryService<
14712                        super::DeleteSandboxOrganizationRequest,
14713                    > for DeleteSandboxOrganizationSvc<T> {
14714                        type Response = super::DeleteSandboxOrganizationResponse;
14715                        type Future = BoxFuture<
14716                            tonic::Response<Self::Response>,
14717                            tonic::Status,
14718                        >;
14719                        fn call(
14720                            &mut self,
14721                            request: tonic::Request<
14722                                super::DeleteSandboxOrganizationRequest,
14723                            >,
14724                        ) -> Self::Future {
14725                            let inner = Arc::clone(&self.0);
14726                            let fut = async move {
14727                                <T as OrganizationService>::delete_sandbox_organization(
14728                                        &inner,
14729                                        request,
14730                                    )
14731                                    .await
14732                            };
14733                            Box::pin(fut)
14734                        }
14735                    }
14736                    let accept_compression_encodings = self.accept_compression_encodings;
14737                    let send_compression_encodings = self.send_compression_encodings;
14738                    let max_decoding_message_size = self.max_decoding_message_size;
14739                    let max_encoding_message_size = self.max_encoding_message_size;
14740                    let inner = self.inner.clone();
14741                    let fut = async move {
14742                        let method = DeleteSandboxOrganizationSvc(inner);
14743                        let codec = tonic_prost::ProstCodec::default();
14744                        let mut grpc = tonic::server::Grpc::new(codec)
14745                            .apply_compression_config(
14746                                accept_compression_encodings,
14747                                send_compression_encodings,
14748                            )
14749                            .apply_max_message_size_config(
14750                                max_decoding_message_size,
14751                                max_encoding_message_size,
14752                            );
14753                        let res = grpc.unary(method, req).await;
14754                        Ok(res)
14755                    };
14756                    Box::pin(fut)
14757                }
14758                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
14759                    #[allow(non_camel_case_types)]
14760                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
14761                    impl<
14762                        T: OrganizationService,
14763                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
14764                    for ListSandboxFixturesSvc<T> {
14765                        type Response = super::ListSandboxFixturesResponse;
14766                        type Future = BoxFuture<
14767                            tonic::Response<Self::Response>,
14768                            tonic::Status,
14769                        >;
14770                        fn call(
14771                            &mut self,
14772                            request: tonic::Request<super::ListSandboxFixturesRequest>,
14773                        ) -> Self::Future {
14774                            let inner = Arc::clone(&self.0);
14775                            let fut = async move {
14776                                <T as OrganizationService>::list_sandbox_fixtures(
14777                                        &inner,
14778                                        request,
14779                                    )
14780                                    .await
14781                            };
14782                            Box::pin(fut)
14783                        }
14784                    }
14785                    let accept_compression_encodings = self.accept_compression_encodings;
14786                    let send_compression_encodings = self.send_compression_encodings;
14787                    let max_decoding_message_size = self.max_decoding_message_size;
14788                    let max_encoding_message_size = self.max_encoding_message_size;
14789                    let inner = self.inner.clone();
14790                    let fut = async move {
14791                        let method = ListSandboxFixturesSvc(inner);
14792                        let codec = tonic_prost::ProstCodec::default();
14793                        let mut grpc = tonic::server::Grpc::new(codec)
14794                            .apply_compression_config(
14795                                accept_compression_encodings,
14796                                send_compression_encodings,
14797                            )
14798                            .apply_max_message_size_config(
14799                                max_decoding_message_size,
14800                                max_encoding_message_size,
14801                            );
14802                        let res = grpc.unary(method, req).await;
14803                        Ok(res)
14804                    };
14805                    Box::pin(fut)
14806                }
14807                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
14808                    #[allow(non_camel_case_types)]
14809                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
14810                    impl<
14811                        T: OrganizationService,
14812                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
14813                    for ListUserOrganizationsSvc<T> {
14814                        type Response = super::ListUserOrganizationsResponse;
14815                        type Future = BoxFuture<
14816                            tonic::Response<Self::Response>,
14817                            tonic::Status,
14818                        >;
14819                        fn call(
14820                            &mut self,
14821                            request: tonic::Request<super::ListUserOrganizationsRequest>,
14822                        ) -> Self::Future {
14823                            let inner = Arc::clone(&self.0);
14824                            let fut = async move {
14825                                <T as OrganizationService>::list_user_organizations(
14826                                        &inner,
14827                                        request,
14828                                    )
14829                                    .await
14830                            };
14831                            Box::pin(fut)
14832                        }
14833                    }
14834                    let accept_compression_encodings = self.accept_compression_encodings;
14835                    let send_compression_encodings = self.send_compression_encodings;
14836                    let max_decoding_message_size = self.max_decoding_message_size;
14837                    let max_encoding_message_size = self.max_encoding_message_size;
14838                    let inner = self.inner.clone();
14839                    let fut = async move {
14840                        let method = ListUserOrganizationsSvc(inner);
14841                        let codec = tonic_prost::ProstCodec::default();
14842                        let mut grpc = tonic::server::Grpc::new(codec)
14843                            .apply_compression_config(
14844                                accept_compression_encodings,
14845                                send_compression_encodings,
14846                            )
14847                            .apply_max_message_size_config(
14848                                max_decoding_message_size,
14849                                max_encoding_message_size,
14850                            );
14851                        let res = grpc.unary(method, req).await;
14852                        Ok(res)
14853                    };
14854                    Box::pin(fut)
14855                }
14856                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
14857                    #[allow(non_camel_case_types)]
14858                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
14859                    impl<
14860                        T: OrganizationService,
14861                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
14862                    for ListUserSandboxesSvc<T> {
14863                        type Response = super::ListUserSandboxesResponse;
14864                        type Future = BoxFuture<
14865                            tonic::Response<Self::Response>,
14866                            tonic::Status,
14867                        >;
14868                        fn call(
14869                            &mut self,
14870                            request: tonic::Request<super::ListUserSandboxesRequest>,
14871                        ) -> Self::Future {
14872                            let inner = Arc::clone(&self.0);
14873                            let fut = async move {
14874                                <T as OrganizationService>::list_user_sandboxes(
14875                                        &inner,
14876                                        request,
14877                                    )
14878                                    .await
14879                            };
14880                            Box::pin(fut)
14881                        }
14882                    }
14883                    let accept_compression_encodings = self.accept_compression_encodings;
14884                    let send_compression_encodings = self.send_compression_encodings;
14885                    let max_decoding_message_size = self.max_decoding_message_size;
14886                    let max_encoding_message_size = self.max_encoding_message_size;
14887                    let inner = self.inner.clone();
14888                    let fut = async move {
14889                        let method = ListUserSandboxesSvc(inner);
14890                        let codec = tonic_prost::ProstCodec::default();
14891                        let mut grpc = tonic::server::Grpc::new(codec)
14892                            .apply_compression_config(
14893                                accept_compression_encodings,
14894                                send_compression_encodings,
14895                            )
14896                            .apply_max_message_size_config(
14897                                max_decoding_message_size,
14898                                max_encoding_message_size,
14899                            );
14900                        let res = grpc.unary(method, req).await;
14901                        Ok(res)
14902                    };
14903                    Box::pin(fut)
14904                }
14905                _ => {
14906                    Box::pin(async move {
14907                        let mut response = http::Response::new(
14908                            tonic::body::Body::default(),
14909                        );
14910                        let headers = response.headers_mut();
14911                        headers
14912                            .insert(
14913                                tonic::Status::GRPC_STATUS,
14914                                (tonic::Code::Unimplemented as i32).into(),
14915                            );
14916                        headers
14917                            .insert(
14918                                http::header::CONTENT_TYPE,
14919                                tonic::metadata::GRPC_CONTENT_TYPE,
14920                            );
14921                        Ok(response)
14922                    })
14923                }
14924            }
14925        }
14926    }
14927    impl<T> Clone for OrganizationServiceServer<T> {
14928        fn clone(&self) -> Self {
14929            let inner = self.inner.clone();
14930            Self {
14931                inner,
14932                accept_compression_encodings: self.accept_compression_encodings,
14933                send_compression_encodings: self.send_compression_encodings,
14934                max_decoding_message_size: self.max_decoding_message_size,
14935                max_encoding_message_size: self.max_encoding_message_size,
14936            }
14937        }
14938    }
14939    /// Generated gRPC service name
14940    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
14941    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
14942        const NAME: &'static str = SERVICE_NAME;
14943    }
14944}
14945/// Generated client implementations.
14946pub mod render_service_client {
14947    #![allow(
14948        unused_variables,
14949        dead_code,
14950        missing_docs,
14951        clippy::wildcard_imports,
14952        clippy::let_unit_value,
14953    )]
14954    use tonic::codegen::*;
14955    use tonic::codegen::http::Uri;
14956    /** Internal service for batch template rendering.
14957*/
14958    #[derive(Debug, Clone)]
14959    pub struct RenderServiceClient<T> {
14960        inner: tonic::client::Grpc<T>,
14961    }
14962    impl RenderServiceClient<tonic::transport::Channel> {
14963        /// Attempt to create a new client by connecting to a given endpoint.
14964        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14965        where
14966            D: TryInto<tonic::transport::Endpoint>,
14967            D::Error: Into<StdError>,
14968        {
14969            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14970            Ok(Self::new(conn))
14971        }
14972    }
14973    impl<T> RenderServiceClient<T>
14974    where
14975        T: tonic::client::GrpcService<tonic::body::Body>,
14976        T::Error: Into<StdError>,
14977        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14978        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14979    {
14980        pub fn new(inner: T) -> Self {
14981            let inner = tonic::client::Grpc::new(inner);
14982            Self { inner }
14983        }
14984        pub fn with_origin(inner: T, origin: Uri) -> Self {
14985            let inner = tonic::client::Grpc::with_origin(inner, origin);
14986            Self { inner }
14987        }
14988        pub fn with_interceptor<F>(
14989            inner: T,
14990            interceptor: F,
14991        ) -> RenderServiceClient<InterceptedService<T, F>>
14992        where
14993            F: tonic::service::Interceptor,
14994            T::ResponseBody: Default,
14995            T: tonic::codegen::Service<
14996                http::Request<tonic::body::Body>,
14997                Response = http::Response<
14998                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14999                >,
15000            >,
15001            <T as tonic::codegen::Service<
15002                http::Request<tonic::body::Body>,
15003            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15004        {
15005            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
15006        }
15007        /// Compress requests with the given encoding.
15008        ///
15009        /// This requires the server to support it otherwise it might respond with an
15010        /// error.
15011        #[must_use]
15012        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15013            self.inner = self.inner.send_compressed(encoding);
15014            self
15015        }
15016        /// Enable decompressing responses.
15017        #[must_use]
15018        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15019            self.inner = self.inner.accept_compressed(encoding);
15020            self
15021        }
15022        /// Limits the maximum size of a decoded message.
15023        ///
15024        /// Default: `4MB`
15025        #[must_use]
15026        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15027            self.inner = self.inner.max_decoding_message_size(limit);
15028            self
15029        }
15030        /// Limits the maximum size of an encoded message.
15031        ///
15032        /// Default: `usize::MAX`
15033        #[must_use]
15034        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15035            self.inner = self.inner.max_encoding_message_size(limit);
15036            self
15037        }
15038        /** Render a template for multiple users, streaming results as each completes.
15039 Authorization: Internal server-to-server only. Not exposed to external clients.
15040*/
15041        pub async fn render_batch(
15042            &mut self,
15043            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
15044        ) -> std::result::Result<
15045            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
15046            tonic::Status,
15047        > {
15048            self.inner
15049                .ready()
15050                .await
15051                .map_err(|e| {
15052                    tonic::Status::unknown(
15053                        format!("Service was not ready: {}", e.into()),
15054                    )
15055                })?;
15056            let codec = tonic_prost::ProstCodec::default();
15057            let path = http::uri::PathAndQuery::from_static(
15058                "/pidgr.v1.RenderService/RenderBatch",
15059            );
15060            let mut req = request.into_request();
15061            req.extensions_mut()
15062                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
15063            self.inner.server_streaming(req, path, codec).await
15064        }
15065    }
15066}
15067/// Generated server implementations.
15068pub mod render_service_server {
15069    #![allow(
15070        unused_variables,
15071        dead_code,
15072        missing_docs,
15073        clippy::wildcard_imports,
15074        clippy::let_unit_value,
15075    )]
15076    use tonic::codegen::*;
15077    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
15078    #[async_trait]
15079    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
15080        /// Server streaming response type for the RenderBatch method.
15081        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
15082                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
15083            >
15084            + std::marker::Send
15085            + 'static;
15086        /** Render a template for multiple users, streaming results as each completes.
15087 Authorization: Internal server-to-server only. Not exposed to external clients.
15088*/
15089        async fn render_batch(
15090            &self,
15091            request: tonic::Request<super::RenderBatchRequest>,
15092        ) -> std::result::Result<
15093            tonic::Response<Self::RenderBatchStream>,
15094            tonic::Status,
15095        >;
15096    }
15097    /** Internal service for batch template rendering.
15098*/
15099    #[derive(Debug)]
15100    pub struct RenderServiceServer<T> {
15101        inner: Arc<T>,
15102        accept_compression_encodings: EnabledCompressionEncodings,
15103        send_compression_encodings: EnabledCompressionEncodings,
15104        max_decoding_message_size: Option<usize>,
15105        max_encoding_message_size: Option<usize>,
15106    }
15107    impl<T> RenderServiceServer<T> {
15108        pub fn new(inner: T) -> Self {
15109            Self::from_arc(Arc::new(inner))
15110        }
15111        pub fn from_arc(inner: Arc<T>) -> Self {
15112            Self {
15113                inner,
15114                accept_compression_encodings: Default::default(),
15115                send_compression_encodings: Default::default(),
15116                max_decoding_message_size: None,
15117                max_encoding_message_size: None,
15118            }
15119        }
15120        pub fn with_interceptor<F>(
15121            inner: T,
15122            interceptor: F,
15123        ) -> InterceptedService<Self, F>
15124        where
15125            F: tonic::service::Interceptor,
15126        {
15127            InterceptedService::new(Self::new(inner), interceptor)
15128        }
15129        /// Enable decompressing requests with the given encoding.
15130        #[must_use]
15131        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15132            self.accept_compression_encodings.enable(encoding);
15133            self
15134        }
15135        /// Compress responses with the given encoding, if the client supports it.
15136        #[must_use]
15137        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15138            self.send_compression_encodings.enable(encoding);
15139            self
15140        }
15141        /// Limits the maximum size of a decoded message.
15142        ///
15143        /// Default: `4MB`
15144        #[must_use]
15145        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15146            self.max_decoding_message_size = Some(limit);
15147            self
15148        }
15149        /// Limits the maximum size of an encoded message.
15150        ///
15151        /// Default: `usize::MAX`
15152        #[must_use]
15153        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15154            self.max_encoding_message_size = Some(limit);
15155            self
15156        }
15157    }
15158    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
15159    where
15160        T: RenderService,
15161        B: Body + std::marker::Send + 'static,
15162        B::Error: Into<StdError> + std::marker::Send + 'static,
15163    {
15164        type Response = http::Response<tonic::body::Body>;
15165        type Error = std::convert::Infallible;
15166        type Future = BoxFuture<Self::Response, Self::Error>;
15167        fn poll_ready(
15168            &mut self,
15169            _cx: &mut Context<'_>,
15170        ) -> Poll<std::result::Result<(), Self::Error>> {
15171            Poll::Ready(Ok(()))
15172        }
15173        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15174            match req.uri().path() {
15175                "/pidgr.v1.RenderService/RenderBatch" => {
15176                    #[allow(non_camel_case_types)]
15177                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
15178                    impl<
15179                        T: RenderService,
15180                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
15181                    for RenderBatchSvc<T> {
15182                        type Response = super::RenderBatchResponse;
15183                        type ResponseStream = T::RenderBatchStream;
15184                        type Future = BoxFuture<
15185                            tonic::Response<Self::ResponseStream>,
15186                            tonic::Status,
15187                        >;
15188                        fn call(
15189                            &mut self,
15190                            request: tonic::Request<super::RenderBatchRequest>,
15191                        ) -> Self::Future {
15192                            let inner = Arc::clone(&self.0);
15193                            let fut = async move {
15194                                <T as RenderService>::render_batch(&inner, request).await
15195                            };
15196                            Box::pin(fut)
15197                        }
15198                    }
15199                    let accept_compression_encodings = self.accept_compression_encodings;
15200                    let send_compression_encodings = self.send_compression_encodings;
15201                    let max_decoding_message_size = self.max_decoding_message_size;
15202                    let max_encoding_message_size = self.max_encoding_message_size;
15203                    let inner = self.inner.clone();
15204                    let fut = async move {
15205                        let method = RenderBatchSvc(inner);
15206                        let codec = tonic_prost::ProstCodec::default();
15207                        let mut grpc = tonic::server::Grpc::new(codec)
15208                            .apply_compression_config(
15209                                accept_compression_encodings,
15210                                send_compression_encodings,
15211                            )
15212                            .apply_max_message_size_config(
15213                                max_decoding_message_size,
15214                                max_encoding_message_size,
15215                            );
15216                        let res = grpc.server_streaming(method, req).await;
15217                        Ok(res)
15218                    };
15219                    Box::pin(fut)
15220                }
15221                _ => {
15222                    Box::pin(async move {
15223                        let mut response = http::Response::new(
15224                            tonic::body::Body::default(),
15225                        );
15226                        let headers = response.headers_mut();
15227                        headers
15228                            .insert(
15229                                tonic::Status::GRPC_STATUS,
15230                                (tonic::Code::Unimplemented as i32).into(),
15231                            );
15232                        headers
15233                            .insert(
15234                                http::header::CONTENT_TYPE,
15235                                tonic::metadata::GRPC_CONTENT_TYPE,
15236                            );
15237                        Ok(response)
15238                    })
15239                }
15240            }
15241        }
15242    }
15243    impl<T> Clone for RenderServiceServer<T> {
15244        fn clone(&self) -> Self {
15245            let inner = self.inner.clone();
15246            Self {
15247                inner,
15248                accept_compression_encodings: self.accept_compression_encodings,
15249                send_compression_encodings: self.send_compression_encodings,
15250                max_decoding_message_size: self.max_decoding_message_size,
15251                max_encoding_message_size: self.max_encoding_message_size,
15252            }
15253        }
15254    }
15255    /// Generated gRPC service name
15256    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
15257    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
15258        const NAME: &'static str = SERVICE_NAME;
15259    }
15260}
15261/// Generated client implementations.
15262pub mod replay_service_client {
15263    #![allow(
15264        unused_variables,
15265        dead_code,
15266        missing_docs,
15267        clippy::wildcard_imports,
15268        clippy::let_unit_value,
15269    )]
15270    use tonic::codegen::*;
15271    use tonic::codegen::http::Uri;
15272    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
15273 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
15274*/
15275    #[derive(Debug, Clone)]
15276    pub struct ReplayServiceClient<T> {
15277        inner: tonic::client::Grpc<T>,
15278    }
15279    impl ReplayServiceClient<tonic::transport::Channel> {
15280        /// Attempt to create a new client by connecting to a given endpoint.
15281        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15282        where
15283            D: TryInto<tonic::transport::Endpoint>,
15284            D::Error: Into<StdError>,
15285        {
15286            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15287            Ok(Self::new(conn))
15288        }
15289    }
15290    impl<T> ReplayServiceClient<T>
15291    where
15292        T: tonic::client::GrpcService<tonic::body::Body>,
15293        T::Error: Into<StdError>,
15294        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15295        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15296    {
15297        pub fn new(inner: T) -> Self {
15298            let inner = tonic::client::Grpc::new(inner);
15299            Self { inner }
15300        }
15301        pub fn with_origin(inner: T, origin: Uri) -> Self {
15302            let inner = tonic::client::Grpc::with_origin(inner, origin);
15303            Self { inner }
15304        }
15305        pub fn with_interceptor<F>(
15306            inner: T,
15307            interceptor: F,
15308        ) -> ReplayServiceClient<InterceptedService<T, F>>
15309        where
15310            F: tonic::service::Interceptor,
15311            T::ResponseBody: Default,
15312            T: tonic::codegen::Service<
15313                http::Request<tonic::body::Body>,
15314                Response = http::Response<
15315                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15316                >,
15317            >,
15318            <T as tonic::codegen::Service<
15319                http::Request<tonic::body::Body>,
15320            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15321        {
15322            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
15323        }
15324        /// Compress requests with the given encoding.
15325        ///
15326        /// This requires the server to support it otherwise it might respond with an
15327        /// error.
15328        #[must_use]
15329        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15330            self.inner = self.inner.send_compressed(encoding);
15331            self
15332        }
15333        /// Enable decompressing responses.
15334        #[must_use]
15335        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15336            self.inner = self.inner.accept_compressed(encoding);
15337            self
15338        }
15339        /// Limits the maximum size of a decoded message.
15340        ///
15341        /// Default: `4MB`
15342        #[must_use]
15343        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15344            self.inner = self.inner.max_decoding_message_size(limit);
15345            self
15346        }
15347        /// Limits the maximum size of an encoded message.
15348        ///
15349        /// Default: `usize::MAX`
15350        #[must_use]
15351        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15352            self.inner = self.inner.max_encoding_message_size(limit);
15353            self
15354        }
15355        /** List recent session recordings with optional campaign and time range filters.
15356 Authorization: Requires CAMPAIGNS_READ permission.
15357*/
15358        pub async fn list_session_recordings(
15359            &mut self,
15360            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
15361        ) -> std::result::Result<
15362            tonic::Response<super::ListSessionRecordingsResponse>,
15363            tonic::Status,
15364        > {
15365            self.inner
15366                .ready()
15367                .await
15368                .map_err(|e| {
15369                    tonic::Status::unknown(
15370                        format!("Service was not ready: {}", e.into()),
15371                    )
15372                })?;
15373            let codec = tonic_prost::ProstCodec::default();
15374            let path = http::uri::PathAndQuery::from_static(
15375                "/pidgr.v1.ReplayService/ListSessionRecordings",
15376            );
15377            let mut req = request.into_request();
15378            req.extensions_mut()
15379                .insert(
15380                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
15381                );
15382            self.inner.unary(req, path, codec).await
15383        }
15384        /** Fetch the full rrweb snapshot data for a single recording.
15385 Authorization: Requires CAMPAIGNS_READ permission.
15386*/
15387        pub async fn get_session_snapshots(
15388            &mut self,
15389            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
15390        ) -> std::result::Result<
15391            tonic::Response<super::GetSessionSnapshotsResponse>,
15392            tonic::Status,
15393        > {
15394            self.inner
15395                .ready()
15396                .await
15397                .map_err(|e| {
15398                    tonic::Status::unknown(
15399                        format!("Service was not ready: {}", e.into()),
15400                    )
15401                })?;
15402            let codec = tonic_prost::ProstCodec::default();
15403            let path = http::uri::PathAndQuery::from_static(
15404                "/pidgr.v1.ReplayService/GetSessionSnapshots",
15405            );
15406            let mut req = request.into_request();
15407            req.extensions_mut()
15408                .insert(
15409                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
15410                );
15411            self.inner.unary(req, path, codec).await
15412        }
15413    }
15414}
15415/// Generated server implementations.
15416pub mod replay_service_server {
15417    #![allow(
15418        unused_variables,
15419        dead_code,
15420        missing_docs,
15421        clippy::wildcard_imports,
15422        clippy::let_unit_value,
15423    )]
15424    use tonic::codegen::*;
15425    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
15426    #[async_trait]
15427    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
15428        /** List recent session recordings with optional campaign and time range filters.
15429 Authorization: Requires CAMPAIGNS_READ permission.
15430*/
15431        async fn list_session_recordings(
15432            &self,
15433            request: tonic::Request<super::ListSessionRecordingsRequest>,
15434        ) -> std::result::Result<
15435            tonic::Response<super::ListSessionRecordingsResponse>,
15436            tonic::Status,
15437        >;
15438        /** Fetch the full rrweb snapshot data for a single recording.
15439 Authorization: Requires CAMPAIGNS_READ permission.
15440*/
15441        async fn get_session_snapshots(
15442            &self,
15443            request: tonic::Request<super::GetSessionSnapshotsRequest>,
15444        ) -> std::result::Result<
15445            tonic::Response<super::GetSessionSnapshotsResponse>,
15446            tonic::Status,
15447        >;
15448    }
15449    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
15450 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
15451*/
15452    #[derive(Debug)]
15453    pub struct ReplayServiceServer<T> {
15454        inner: Arc<T>,
15455        accept_compression_encodings: EnabledCompressionEncodings,
15456        send_compression_encodings: EnabledCompressionEncodings,
15457        max_decoding_message_size: Option<usize>,
15458        max_encoding_message_size: Option<usize>,
15459    }
15460    impl<T> ReplayServiceServer<T> {
15461        pub fn new(inner: T) -> Self {
15462            Self::from_arc(Arc::new(inner))
15463        }
15464        pub fn from_arc(inner: Arc<T>) -> Self {
15465            Self {
15466                inner,
15467                accept_compression_encodings: Default::default(),
15468                send_compression_encodings: Default::default(),
15469                max_decoding_message_size: None,
15470                max_encoding_message_size: None,
15471            }
15472        }
15473        pub fn with_interceptor<F>(
15474            inner: T,
15475            interceptor: F,
15476        ) -> InterceptedService<Self, F>
15477        where
15478            F: tonic::service::Interceptor,
15479        {
15480            InterceptedService::new(Self::new(inner), interceptor)
15481        }
15482        /// Enable decompressing requests with the given encoding.
15483        #[must_use]
15484        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15485            self.accept_compression_encodings.enable(encoding);
15486            self
15487        }
15488        /// Compress responses with the given encoding, if the client supports it.
15489        #[must_use]
15490        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15491            self.send_compression_encodings.enable(encoding);
15492            self
15493        }
15494        /// Limits the maximum size of a decoded message.
15495        ///
15496        /// Default: `4MB`
15497        #[must_use]
15498        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15499            self.max_decoding_message_size = Some(limit);
15500            self
15501        }
15502        /// Limits the maximum size of an encoded message.
15503        ///
15504        /// Default: `usize::MAX`
15505        #[must_use]
15506        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15507            self.max_encoding_message_size = Some(limit);
15508            self
15509        }
15510    }
15511    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
15512    where
15513        T: ReplayService,
15514        B: Body + std::marker::Send + 'static,
15515        B::Error: Into<StdError> + std::marker::Send + 'static,
15516    {
15517        type Response = http::Response<tonic::body::Body>;
15518        type Error = std::convert::Infallible;
15519        type Future = BoxFuture<Self::Response, Self::Error>;
15520        fn poll_ready(
15521            &mut self,
15522            _cx: &mut Context<'_>,
15523        ) -> Poll<std::result::Result<(), Self::Error>> {
15524            Poll::Ready(Ok(()))
15525        }
15526        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15527            match req.uri().path() {
15528                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
15529                    #[allow(non_camel_case_types)]
15530                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
15531                    impl<
15532                        T: ReplayService,
15533                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
15534                    for ListSessionRecordingsSvc<T> {
15535                        type Response = super::ListSessionRecordingsResponse;
15536                        type Future = BoxFuture<
15537                            tonic::Response<Self::Response>,
15538                            tonic::Status,
15539                        >;
15540                        fn call(
15541                            &mut self,
15542                            request: tonic::Request<super::ListSessionRecordingsRequest>,
15543                        ) -> Self::Future {
15544                            let inner = Arc::clone(&self.0);
15545                            let fut = async move {
15546                                <T as ReplayService>::list_session_recordings(
15547                                        &inner,
15548                                        request,
15549                                    )
15550                                    .await
15551                            };
15552                            Box::pin(fut)
15553                        }
15554                    }
15555                    let accept_compression_encodings = self.accept_compression_encodings;
15556                    let send_compression_encodings = self.send_compression_encodings;
15557                    let max_decoding_message_size = self.max_decoding_message_size;
15558                    let max_encoding_message_size = self.max_encoding_message_size;
15559                    let inner = self.inner.clone();
15560                    let fut = async move {
15561                        let method = ListSessionRecordingsSvc(inner);
15562                        let codec = tonic_prost::ProstCodec::default();
15563                        let mut grpc = tonic::server::Grpc::new(codec)
15564                            .apply_compression_config(
15565                                accept_compression_encodings,
15566                                send_compression_encodings,
15567                            )
15568                            .apply_max_message_size_config(
15569                                max_decoding_message_size,
15570                                max_encoding_message_size,
15571                            );
15572                        let res = grpc.unary(method, req).await;
15573                        Ok(res)
15574                    };
15575                    Box::pin(fut)
15576                }
15577                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
15578                    #[allow(non_camel_case_types)]
15579                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
15580                    impl<
15581                        T: ReplayService,
15582                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
15583                    for GetSessionSnapshotsSvc<T> {
15584                        type Response = super::GetSessionSnapshotsResponse;
15585                        type Future = BoxFuture<
15586                            tonic::Response<Self::Response>,
15587                            tonic::Status,
15588                        >;
15589                        fn call(
15590                            &mut self,
15591                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
15592                        ) -> Self::Future {
15593                            let inner = Arc::clone(&self.0);
15594                            let fut = async move {
15595                                <T as ReplayService>::get_session_snapshots(&inner, request)
15596                                    .await
15597                            };
15598                            Box::pin(fut)
15599                        }
15600                    }
15601                    let accept_compression_encodings = self.accept_compression_encodings;
15602                    let send_compression_encodings = self.send_compression_encodings;
15603                    let max_decoding_message_size = self.max_decoding_message_size;
15604                    let max_encoding_message_size = self.max_encoding_message_size;
15605                    let inner = self.inner.clone();
15606                    let fut = async move {
15607                        let method = GetSessionSnapshotsSvc(inner);
15608                        let codec = tonic_prost::ProstCodec::default();
15609                        let mut grpc = tonic::server::Grpc::new(codec)
15610                            .apply_compression_config(
15611                                accept_compression_encodings,
15612                                send_compression_encodings,
15613                            )
15614                            .apply_max_message_size_config(
15615                                max_decoding_message_size,
15616                                max_encoding_message_size,
15617                            );
15618                        let res = grpc.unary(method, req).await;
15619                        Ok(res)
15620                    };
15621                    Box::pin(fut)
15622                }
15623                _ => {
15624                    Box::pin(async move {
15625                        let mut response = http::Response::new(
15626                            tonic::body::Body::default(),
15627                        );
15628                        let headers = response.headers_mut();
15629                        headers
15630                            .insert(
15631                                tonic::Status::GRPC_STATUS,
15632                                (tonic::Code::Unimplemented as i32).into(),
15633                            );
15634                        headers
15635                            .insert(
15636                                http::header::CONTENT_TYPE,
15637                                tonic::metadata::GRPC_CONTENT_TYPE,
15638                            );
15639                        Ok(response)
15640                    })
15641                }
15642            }
15643        }
15644    }
15645    impl<T> Clone for ReplayServiceServer<T> {
15646        fn clone(&self) -> Self {
15647            let inner = self.inner.clone();
15648            Self {
15649                inner,
15650                accept_compression_encodings: self.accept_compression_encodings,
15651                send_compression_encodings: self.send_compression_encodings,
15652                max_decoding_message_size: self.max_decoding_message_size,
15653                max_encoding_message_size: self.max_encoding_message_size,
15654            }
15655        }
15656    }
15657    /// Generated gRPC service name
15658    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
15659    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
15660        const NAME: &'static str = SERVICE_NAME;
15661    }
15662}
15663/// Generated client implementations.
15664pub mod role_service_client {
15665    #![allow(
15666        unused_variables,
15667        dead_code,
15668        missing_docs,
15669        clippy::wildcard_imports,
15670        clippy::let_unit_value,
15671    )]
15672    use tonic::codegen::*;
15673    use tonic::codegen::http::Uri;
15674    /** Manages roles and their permissions within an organization.
15675 All RPCs operate within the caller's org (extracted from JWT).
15676*/
15677    #[derive(Debug, Clone)]
15678    pub struct RoleServiceClient<T> {
15679        inner: tonic::client::Grpc<T>,
15680    }
15681    impl RoleServiceClient<tonic::transport::Channel> {
15682        /// Attempt to create a new client by connecting to a given endpoint.
15683        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15684        where
15685            D: TryInto<tonic::transport::Endpoint>,
15686            D::Error: Into<StdError>,
15687        {
15688            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15689            Ok(Self::new(conn))
15690        }
15691    }
15692    impl<T> RoleServiceClient<T>
15693    where
15694        T: tonic::client::GrpcService<tonic::body::Body>,
15695        T::Error: Into<StdError>,
15696        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15697        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15698    {
15699        pub fn new(inner: T) -> Self {
15700            let inner = tonic::client::Grpc::new(inner);
15701            Self { inner }
15702        }
15703        pub fn with_origin(inner: T, origin: Uri) -> Self {
15704            let inner = tonic::client::Grpc::with_origin(inner, origin);
15705            Self { inner }
15706        }
15707        pub fn with_interceptor<F>(
15708            inner: T,
15709            interceptor: F,
15710        ) -> RoleServiceClient<InterceptedService<T, F>>
15711        where
15712            F: tonic::service::Interceptor,
15713            T::ResponseBody: Default,
15714            T: tonic::codegen::Service<
15715                http::Request<tonic::body::Body>,
15716                Response = http::Response<
15717                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15718                >,
15719            >,
15720            <T as tonic::codegen::Service<
15721                http::Request<tonic::body::Body>,
15722            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15723        {
15724            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
15725        }
15726        /// Compress requests with the given encoding.
15727        ///
15728        /// This requires the server to support it otherwise it might respond with an
15729        /// error.
15730        #[must_use]
15731        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15732            self.inner = self.inner.send_compressed(encoding);
15733            self
15734        }
15735        /// Enable decompressing responses.
15736        #[must_use]
15737        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15738            self.inner = self.inner.accept_compressed(encoding);
15739            self
15740        }
15741        /// Limits the maximum size of a decoded message.
15742        ///
15743        /// Default: `4MB`
15744        #[must_use]
15745        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15746            self.inner = self.inner.max_decoding_message_size(limit);
15747            self
15748        }
15749        /// Limits the maximum size of an encoded message.
15750        ///
15751        /// Default: `usize::MAX`
15752        #[must_use]
15753        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15754            self.inner = self.inner.max_encoding_message_size(limit);
15755            self
15756        }
15757        /** List all roles in the organization with their permission sets.
15758 Authorization: Requires PERMISSION_ORG_READ.
15759*/
15760        pub async fn list_roles(
15761            &mut self,
15762            request: impl tonic::IntoRequest<super::ListRolesRequest>,
15763        ) -> std::result::Result<
15764            tonic::Response<super::ListRolesResponse>,
15765            tonic::Status,
15766        > {
15767            self.inner
15768                .ready()
15769                .await
15770                .map_err(|e| {
15771                    tonic::Status::unknown(
15772                        format!("Service was not ready: {}", e.into()),
15773                    )
15774                })?;
15775            let codec = tonic_prost::ProstCodec::default();
15776            let path = http::uri::PathAndQuery::from_static(
15777                "/pidgr.v1.RoleService/ListRoles",
15778            );
15779            let mut req = request.into_request();
15780            req.extensions_mut()
15781                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
15782            self.inner.unary(req, path, codec).await
15783        }
15784        /** Create a new custom role with a name and initial permissions.
15785 Slug is auto-generated from the name and immutable after creation.
15786 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15787*/
15788        pub async fn create_role(
15789            &mut self,
15790            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
15791        ) -> std::result::Result<
15792            tonic::Response<super::CreateRoleResponse>,
15793            tonic::Status,
15794        > {
15795            self.inner
15796                .ready()
15797                .await
15798                .map_err(|e| {
15799                    tonic::Status::unknown(
15800                        format!("Service was not ready: {}", e.into()),
15801                    )
15802                })?;
15803            let codec = tonic_prost::ProstCodec::default();
15804            let path = http::uri::PathAndQuery::from_static(
15805                "/pidgr.v1.RoleService/CreateRole",
15806            );
15807            let mut req = request.into_request();
15808            req.extensions_mut()
15809                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
15810            self.inner.unary(req, path, codec).await
15811        }
15812        /** Update a role's name and/or permissions.
15813 System roles (is_system=true) cannot be updated.
15814 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15815*/
15816        pub async fn update_role(
15817            &mut self,
15818            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
15819        ) -> std::result::Result<
15820            tonic::Response<super::UpdateRoleResponse>,
15821            tonic::Status,
15822        > {
15823            self.inner
15824                .ready()
15825                .await
15826                .map_err(|e| {
15827                    tonic::Status::unknown(
15828                        format!("Service was not ready: {}", e.into()),
15829                    )
15830                })?;
15831            let codec = tonic_prost::ProstCodec::default();
15832            let path = http::uri::PathAndQuery::from_static(
15833                "/pidgr.v1.RoleService/UpdateRole",
15834            );
15835            let mut req = request.into_request();
15836            req.extensions_mut()
15837                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
15838            self.inner.unary(req, path, codec).await
15839        }
15840        /** Delete a role. Fails if any users are assigned to it.
15841 System roles (is_system=true) cannot be deleted.
15842 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15843*/
15844        pub async fn delete_role(
15845            &mut self,
15846            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
15847        ) -> std::result::Result<
15848            tonic::Response<super::DeleteRoleResponse>,
15849            tonic::Status,
15850        > {
15851            self.inner
15852                .ready()
15853                .await
15854                .map_err(|e| {
15855                    tonic::Status::unknown(
15856                        format!("Service was not ready: {}", e.into()),
15857                    )
15858                })?;
15859            let codec = tonic_prost::ProstCodec::default();
15860            let path = http::uri::PathAndQuery::from_static(
15861                "/pidgr.v1.RoleService/DeleteRole",
15862            );
15863            let mut req = request.into_request();
15864            req.extensions_mut()
15865                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
15866            self.inner.unary(req, path, codec).await
15867        }
15868    }
15869}
15870/// Generated server implementations.
15871pub mod role_service_server {
15872    #![allow(
15873        unused_variables,
15874        dead_code,
15875        missing_docs,
15876        clippy::wildcard_imports,
15877        clippy::let_unit_value,
15878    )]
15879    use tonic::codegen::*;
15880    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
15881    #[async_trait]
15882    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
15883        /** List all roles in the organization with their permission sets.
15884 Authorization: Requires PERMISSION_ORG_READ.
15885*/
15886        async fn list_roles(
15887            &self,
15888            request: tonic::Request<super::ListRolesRequest>,
15889        ) -> std::result::Result<
15890            tonic::Response<super::ListRolesResponse>,
15891            tonic::Status,
15892        >;
15893        /** Create a new custom role with a name and initial permissions.
15894 Slug is auto-generated from the name and immutable after creation.
15895 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15896*/
15897        async fn create_role(
15898            &self,
15899            request: tonic::Request<super::CreateRoleRequest>,
15900        ) -> std::result::Result<
15901            tonic::Response<super::CreateRoleResponse>,
15902            tonic::Status,
15903        >;
15904        /** Update a role's name and/or permissions.
15905 System roles (is_system=true) cannot be updated.
15906 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15907*/
15908        async fn update_role(
15909            &self,
15910            request: tonic::Request<super::UpdateRoleRequest>,
15911        ) -> std::result::Result<
15912            tonic::Response<super::UpdateRoleResponse>,
15913            tonic::Status,
15914        >;
15915        /** Delete a role. Fails if any users are assigned to it.
15916 System roles (is_system=true) cannot be deleted.
15917 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
15918*/
15919        async fn delete_role(
15920            &self,
15921            request: tonic::Request<super::DeleteRoleRequest>,
15922        ) -> std::result::Result<
15923            tonic::Response<super::DeleteRoleResponse>,
15924            tonic::Status,
15925        >;
15926    }
15927    /** Manages roles and their permissions within an organization.
15928 All RPCs operate within the caller's org (extracted from JWT).
15929*/
15930    #[derive(Debug)]
15931    pub struct RoleServiceServer<T> {
15932        inner: Arc<T>,
15933        accept_compression_encodings: EnabledCompressionEncodings,
15934        send_compression_encodings: EnabledCompressionEncodings,
15935        max_decoding_message_size: Option<usize>,
15936        max_encoding_message_size: Option<usize>,
15937    }
15938    impl<T> RoleServiceServer<T> {
15939        pub fn new(inner: T) -> Self {
15940            Self::from_arc(Arc::new(inner))
15941        }
15942        pub fn from_arc(inner: Arc<T>) -> Self {
15943            Self {
15944                inner,
15945                accept_compression_encodings: Default::default(),
15946                send_compression_encodings: Default::default(),
15947                max_decoding_message_size: None,
15948                max_encoding_message_size: None,
15949            }
15950        }
15951        pub fn with_interceptor<F>(
15952            inner: T,
15953            interceptor: F,
15954        ) -> InterceptedService<Self, F>
15955        where
15956            F: tonic::service::Interceptor,
15957        {
15958            InterceptedService::new(Self::new(inner), interceptor)
15959        }
15960        /// Enable decompressing requests with the given encoding.
15961        #[must_use]
15962        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15963            self.accept_compression_encodings.enable(encoding);
15964            self
15965        }
15966        /// Compress responses with the given encoding, if the client supports it.
15967        #[must_use]
15968        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15969            self.send_compression_encodings.enable(encoding);
15970            self
15971        }
15972        /// Limits the maximum size of a decoded message.
15973        ///
15974        /// Default: `4MB`
15975        #[must_use]
15976        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15977            self.max_decoding_message_size = Some(limit);
15978            self
15979        }
15980        /// Limits the maximum size of an encoded message.
15981        ///
15982        /// Default: `usize::MAX`
15983        #[must_use]
15984        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15985            self.max_encoding_message_size = Some(limit);
15986            self
15987        }
15988    }
15989    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
15990    where
15991        T: RoleService,
15992        B: Body + std::marker::Send + 'static,
15993        B::Error: Into<StdError> + std::marker::Send + 'static,
15994    {
15995        type Response = http::Response<tonic::body::Body>;
15996        type Error = std::convert::Infallible;
15997        type Future = BoxFuture<Self::Response, Self::Error>;
15998        fn poll_ready(
15999            &mut self,
16000            _cx: &mut Context<'_>,
16001        ) -> Poll<std::result::Result<(), Self::Error>> {
16002            Poll::Ready(Ok(()))
16003        }
16004        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16005            match req.uri().path() {
16006                "/pidgr.v1.RoleService/ListRoles" => {
16007                    #[allow(non_camel_case_types)]
16008                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
16009                    impl<
16010                        T: RoleService,
16011                    > tonic::server::UnaryService<super::ListRolesRequest>
16012                    for ListRolesSvc<T> {
16013                        type Response = super::ListRolesResponse;
16014                        type Future = BoxFuture<
16015                            tonic::Response<Self::Response>,
16016                            tonic::Status,
16017                        >;
16018                        fn call(
16019                            &mut self,
16020                            request: tonic::Request<super::ListRolesRequest>,
16021                        ) -> Self::Future {
16022                            let inner = Arc::clone(&self.0);
16023                            let fut = async move {
16024                                <T as RoleService>::list_roles(&inner, request).await
16025                            };
16026                            Box::pin(fut)
16027                        }
16028                    }
16029                    let accept_compression_encodings = self.accept_compression_encodings;
16030                    let send_compression_encodings = self.send_compression_encodings;
16031                    let max_decoding_message_size = self.max_decoding_message_size;
16032                    let max_encoding_message_size = self.max_encoding_message_size;
16033                    let inner = self.inner.clone();
16034                    let fut = async move {
16035                        let method = ListRolesSvc(inner);
16036                        let codec = tonic_prost::ProstCodec::default();
16037                        let mut grpc = tonic::server::Grpc::new(codec)
16038                            .apply_compression_config(
16039                                accept_compression_encodings,
16040                                send_compression_encodings,
16041                            )
16042                            .apply_max_message_size_config(
16043                                max_decoding_message_size,
16044                                max_encoding_message_size,
16045                            );
16046                        let res = grpc.unary(method, req).await;
16047                        Ok(res)
16048                    };
16049                    Box::pin(fut)
16050                }
16051                "/pidgr.v1.RoleService/CreateRole" => {
16052                    #[allow(non_camel_case_types)]
16053                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
16054                    impl<
16055                        T: RoleService,
16056                    > tonic::server::UnaryService<super::CreateRoleRequest>
16057                    for CreateRoleSvc<T> {
16058                        type Response = super::CreateRoleResponse;
16059                        type Future = BoxFuture<
16060                            tonic::Response<Self::Response>,
16061                            tonic::Status,
16062                        >;
16063                        fn call(
16064                            &mut self,
16065                            request: tonic::Request<super::CreateRoleRequest>,
16066                        ) -> Self::Future {
16067                            let inner = Arc::clone(&self.0);
16068                            let fut = async move {
16069                                <T as RoleService>::create_role(&inner, request).await
16070                            };
16071                            Box::pin(fut)
16072                        }
16073                    }
16074                    let accept_compression_encodings = self.accept_compression_encodings;
16075                    let send_compression_encodings = self.send_compression_encodings;
16076                    let max_decoding_message_size = self.max_decoding_message_size;
16077                    let max_encoding_message_size = self.max_encoding_message_size;
16078                    let inner = self.inner.clone();
16079                    let fut = async move {
16080                        let method = CreateRoleSvc(inner);
16081                        let codec = tonic_prost::ProstCodec::default();
16082                        let mut grpc = tonic::server::Grpc::new(codec)
16083                            .apply_compression_config(
16084                                accept_compression_encodings,
16085                                send_compression_encodings,
16086                            )
16087                            .apply_max_message_size_config(
16088                                max_decoding_message_size,
16089                                max_encoding_message_size,
16090                            );
16091                        let res = grpc.unary(method, req).await;
16092                        Ok(res)
16093                    };
16094                    Box::pin(fut)
16095                }
16096                "/pidgr.v1.RoleService/UpdateRole" => {
16097                    #[allow(non_camel_case_types)]
16098                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
16099                    impl<
16100                        T: RoleService,
16101                    > tonic::server::UnaryService<super::UpdateRoleRequest>
16102                    for UpdateRoleSvc<T> {
16103                        type Response = super::UpdateRoleResponse;
16104                        type Future = BoxFuture<
16105                            tonic::Response<Self::Response>,
16106                            tonic::Status,
16107                        >;
16108                        fn call(
16109                            &mut self,
16110                            request: tonic::Request<super::UpdateRoleRequest>,
16111                        ) -> Self::Future {
16112                            let inner = Arc::clone(&self.0);
16113                            let fut = async move {
16114                                <T as RoleService>::update_role(&inner, request).await
16115                            };
16116                            Box::pin(fut)
16117                        }
16118                    }
16119                    let accept_compression_encodings = self.accept_compression_encodings;
16120                    let send_compression_encodings = self.send_compression_encodings;
16121                    let max_decoding_message_size = self.max_decoding_message_size;
16122                    let max_encoding_message_size = self.max_encoding_message_size;
16123                    let inner = self.inner.clone();
16124                    let fut = async move {
16125                        let method = UpdateRoleSvc(inner);
16126                        let codec = tonic_prost::ProstCodec::default();
16127                        let mut grpc = tonic::server::Grpc::new(codec)
16128                            .apply_compression_config(
16129                                accept_compression_encodings,
16130                                send_compression_encodings,
16131                            )
16132                            .apply_max_message_size_config(
16133                                max_decoding_message_size,
16134                                max_encoding_message_size,
16135                            );
16136                        let res = grpc.unary(method, req).await;
16137                        Ok(res)
16138                    };
16139                    Box::pin(fut)
16140                }
16141                "/pidgr.v1.RoleService/DeleteRole" => {
16142                    #[allow(non_camel_case_types)]
16143                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
16144                    impl<
16145                        T: RoleService,
16146                    > tonic::server::UnaryService<super::DeleteRoleRequest>
16147                    for DeleteRoleSvc<T> {
16148                        type Response = super::DeleteRoleResponse;
16149                        type Future = BoxFuture<
16150                            tonic::Response<Self::Response>,
16151                            tonic::Status,
16152                        >;
16153                        fn call(
16154                            &mut self,
16155                            request: tonic::Request<super::DeleteRoleRequest>,
16156                        ) -> Self::Future {
16157                            let inner = Arc::clone(&self.0);
16158                            let fut = async move {
16159                                <T as RoleService>::delete_role(&inner, request).await
16160                            };
16161                            Box::pin(fut)
16162                        }
16163                    }
16164                    let accept_compression_encodings = self.accept_compression_encodings;
16165                    let send_compression_encodings = self.send_compression_encodings;
16166                    let max_decoding_message_size = self.max_decoding_message_size;
16167                    let max_encoding_message_size = self.max_encoding_message_size;
16168                    let inner = self.inner.clone();
16169                    let fut = async move {
16170                        let method = DeleteRoleSvc(inner);
16171                        let codec = tonic_prost::ProstCodec::default();
16172                        let mut grpc = tonic::server::Grpc::new(codec)
16173                            .apply_compression_config(
16174                                accept_compression_encodings,
16175                                send_compression_encodings,
16176                            )
16177                            .apply_max_message_size_config(
16178                                max_decoding_message_size,
16179                                max_encoding_message_size,
16180                            );
16181                        let res = grpc.unary(method, req).await;
16182                        Ok(res)
16183                    };
16184                    Box::pin(fut)
16185                }
16186                _ => {
16187                    Box::pin(async move {
16188                        let mut response = http::Response::new(
16189                            tonic::body::Body::default(),
16190                        );
16191                        let headers = response.headers_mut();
16192                        headers
16193                            .insert(
16194                                tonic::Status::GRPC_STATUS,
16195                                (tonic::Code::Unimplemented as i32).into(),
16196                            );
16197                        headers
16198                            .insert(
16199                                http::header::CONTENT_TYPE,
16200                                tonic::metadata::GRPC_CONTENT_TYPE,
16201                            );
16202                        Ok(response)
16203                    })
16204                }
16205            }
16206        }
16207    }
16208    impl<T> Clone for RoleServiceServer<T> {
16209        fn clone(&self) -> Self {
16210            let inner = self.inner.clone();
16211            Self {
16212                inner,
16213                accept_compression_encodings: self.accept_compression_encodings,
16214                send_compression_encodings: self.send_compression_encodings,
16215                max_decoding_message_size: self.max_decoding_message_size,
16216                max_encoding_message_size: self.max_encoding_message_size,
16217            }
16218        }
16219    }
16220    /// Generated gRPC service name
16221    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
16222    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
16223        const NAME: &'static str = SERVICE_NAME;
16224    }
16225}
16226/// Generated client implementations.
16227pub mod sso_service_client {
16228    #![allow(
16229        unused_variables,
16230        dead_code,
16231        missing_docs,
16232        clippy::wildcard_imports,
16233        clippy::let_unit_value,
16234    )]
16235    use tonic::codegen::*;
16236    use tonic::codegen::http::Uri;
16237    /** Manages SSO identity provider configuration for organizations.
16238*/
16239    #[derive(Debug, Clone)]
16240    pub struct SsoServiceClient<T> {
16241        inner: tonic::client::Grpc<T>,
16242    }
16243    impl SsoServiceClient<tonic::transport::Channel> {
16244        /// Attempt to create a new client by connecting to a given endpoint.
16245        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16246        where
16247            D: TryInto<tonic::transport::Endpoint>,
16248            D::Error: Into<StdError>,
16249        {
16250            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16251            Ok(Self::new(conn))
16252        }
16253    }
16254    impl<T> SsoServiceClient<T>
16255    where
16256        T: tonic::client::GrpcService<tonic::body::Body>,
16257        T::Error: Into<StdError>,
16258        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16259        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16260    {
16261        pub fn new(inner: T) -> Self {
16262            let inner = tonic::client::Grpc::new(inner);
16263            Self { inner }
16264        }
16265        pub fn with_origin(inner: T, origin: Uri) -> Self {
16266            let inner = tonic::client::Grpc::with_origin(inner, origin);
16267            Self { inner }
16268        }
16269        pub fn with_interceptor<F>(
16270            inner: T,
16271            interceptor: F,
16272        ) -> SsoServiceClient<InterceptedService<T, F>>
16273        where
16274            F: tonic::service::Interceptor,
16275            T::ResponseBody: Default,
16276            T: tonic::codegen::Service<
16277                http::Request<tonic::body::Body>,
16278                Response = http::Response<
16279                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16280                >,
16281            >,
16282            <T as tonic::codegen::Service<
16283                http::Request<tonic::body::Body>,
16284            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16285        {
16286            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
16287        }
16288        /// Compress requests with the given encoding.
16289        ///
16290        /// This requires the server to support it otherwise it might respond with an
16291        /// error.
16292        #[must_use]
16293        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16294            self.inner = self.inner.send_compressed(encoding);
16295            self
16296        }
16297        /// Enable decompressing responses.
16298        #[must_use]
16299        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16300            self.inner = self.inner.accept_compressed(encoding);
16301            self
16302        }
16303        /// Limits the maximum size of a decoded message.
16304        ///
16305        /// Default: `4MB`
16306        #[must_use]
16307        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16308            self.inner = self.inner.max_decoding_message_size(limit);
16309            self
16310        }
16311        /// Limits the maximum size of an encoded message.
16312        ///
16313        /// Default: `usize::MAX`
16314        #[must_use]
16315        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16316            self.inner = self.inner.max_encoding_message_size(limit);
16317            self
16318        }
16319        /** Check if an email domain has SSO configured.
16320 This is a pre-authentication endpoint — no JWT required.
16321 Authorization: None (public).
16322*/
16323        pub async fn check_sso_by_domain(
16324            &mut self,
16325            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
16326        ) -> std::result::Result<
16327            tonic::Response<super::CheckSsoByDomainResponse>,
16328            tonic::Status,
16329        > {
16330            self.inner
16331                .ready()
16332                .await
16333                .map_err(|e| {
16334                    tonic::Status::unknown(
16335                        format!("Service was not ready: {}", e.into()),
16336                    )
16337                })?;
16338            let codec = tonic_prost::ProstCodec::default();
16339            let path = http::uri::PathAndQuery::from_static(
16340                "/pidgr.v1.SSOService/CheckSSOByDomain",
16341            );
16342            let mut req = request.into_request();
16343            req.extensions_mut()
16344                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
16345            self.inner.unary(req, path, codec).await
16346        }
16347        /** Create an SSO provider for the organization.
16348 Validates the metadata URL before saving.
16349 Creates the corresponding identity provider in the auth service.
16350 Authorization: Requires PERMISSION_ORG_WRITE.
16351*/
16352        pub async fn create_sso_provider(
16353            &mut self,
16354            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
16355        ) -> std::result::Result<
16356            tonic::Response<super::CreateSsoProviderResponse>,
16357            tonic::Status,
16358        > {
16359            self.inner
16360                .ready()
16361                .await
16362                .map_err(|e| {
16363                    tonic::Status::unknown(
16364                        format!("Service was not ready: {}", e.into()),
16365                    )
16366                })?;
16367            let codec = tonic_prost::ProstCodec::default();
16368            let path = http::uri::PathAndQuery::from_static(
16369                "/pidgr.v1.SSOService/CreateSSOProvider",
16370            );
16371            let mut req = request.into_request();
16372            req.extensions_mut()
16373                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
16374            self.inner.unary(req, path, codec).await
16375        }
16376        /** Get the organization's SSO provider configuration.
16377 Authorization: Requires PERMISSION_ORG_READ.
16378*/
16379        pub async fn get_sso_provider(
16380            &mut self,
16381            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
16382        ) -> std::result::Result<
16383            tonic::Response<super::GetSsoProviderResponse>,
16384            tonic::Status,
16385        > {
16386            self.inner
16387                .ready()
16388                .await
16389                .map_err(|e| {
16390                    tonic::Status::unknown(
16391                        format!("Service was not ready: {}", e.into()),
16392                    )
16393                })?;
16394            let codec = tonic_prost::ProstCodec::default();
16395            let path = http::uri::PathAndQuery::from_static(
16396                "/pidgr.v1.SSOService/GetSSOProvider",
16397            );
16398            let mut req = request.into_request();
16399            req.extensions_mut()
16400                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
16401            self.inner.unary(req, path, codec).await
16402        }
16403        /** Delete the organization's SSO provider.
16404 Deletes the corresponding identity provider from the auth service.
16405 Users with that domain fall back to passkey/OTP.
16406 Authorization: Requires PERMISSION_ORG_WRITE.
16407*/
16408        pub async fn delete_sso_provider(
16409            &mut self,
16410            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
16411        ) -> std::result::Result<
16412            tonic::Response<super::DeleteSsoProviderResponse>,
16413            tonic::Status,
16414        > {
16415            self.inner
16416                .ready()
16417                .await
16418                .map_err(|e| {
16419                    tonic::Status::unknown(
16420                        format!("Service was not ready: {}", e.into()),
16421                    )
16422                })?;
16423            let codec = tonic_prost::ProstCodec::default();
16424            let path = http::uri::PathAndQuery::from_static(
16425                "/pidgr.v1.SSOService/DeleteSSOProvider",
16426            );
16427            let mut req = request.into_request();
16428            req.extensions_mut()
16429                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
16430            self.inner.unary(req, path, codec).await
16431        }
16432    }
16433}
16434/// Generated server implementations.
16435pub mod sso_service_server {
16436    #![allow(
16437        unused_variables,
16438        dead_code,
16439        missing_docs,
16440        clippy::wildcard_imports,
16441        clippy::let_unit_value,
16442    )]
16443    use tonic::codegen::*;
16444    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
16445    #[async_trait]
16446    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
16447        /** Check if an email domain has SSO configured.
16448 This is a pre-authentication endpoint — no JWT required.
16449 Authorization: None (public).
16450*/
16451        async fn check_sso_by_domain(
16452            &self,
16453            request: tonic::Request<super::CheckSsoByDomainRequest>,
16454        ) -> std::result::Result<
16455            tonic::Response<super::CheckSsoByDomainResponse>,
16456            tonic::Status,
16457        >;
16458        /** Create an SSO provider for the organization.
16459 Validates the metadata URL before saving.
16460 Creates the corresponding identity provider in the auth service.
16461 Authorization: Requires PERMISSION_ORG_WRITE.
16462*/
16463        async fn create_sso_provider(
16464            &self,
16465            request: tonic::Request<super::CreateSsoProviderRequest>,
16466        ) -> std::result::Result<
16467            tonic::Response<super::CreateSsoProviderResponse>,
16468            tonic::Status,
16469        >;
16470        /** Get the organization's SSO provider configuration.
16471 Authorization: Requires PERMISSION_ORG_READ.
16472*/
16473        async fn get_sso_provider(
16474            &self,
16475            request: tonic::Request<super::GetSsoProviderRequest>,
16476        ) -> std::result::Result<
16477            tonic::Response<super::GetSsoProviderResponse>,
16478            tonic::Status,
16479        >;
16480        /** Delete the organization's SSO provider.
16481 Deletes the corresponding identity provider from the auth service.
16482 Users with that domain fall back to passkey/OTP.
16483 Authorization: Requires PERMISSION_ORG_WRITE.
16484*/
16485        async fn delete_sso_provider(
16486            &self,
16487            request: tonic::Request<super::DeleteSsoProviderRequest>,
16488        ) -> std::result::Result<
16489            tonic::Response<super::DeleteSsoProviderResponse>,
16490            tonic::Status,
16491        >;
16492    }
16493    /** Manages SSO identity provider configuration for organizations.
16494*/
16495    #[derive(Debug)]
16496    pub struct SsoServiceServer<T> {
16497        inner: Arc<T>,
16498        accept_compression_encodings: EnabledCompressionEncodings,
16499        send_compression_encodings: EnabledCompressionEncodings,
16500        max_decoding_message_size: Option<usize>,
16501        max_encoding_message_size: Option<usize>,
16502    }
16503    impl<T> SsoServiceServer<T> {
16504        pub fn new(inner: T) -> Self {
16505            Self::from_arc(Arc::new(inner))
16506        }
16507        pub fn from_arc(inner: Arc<T>) -> Self {
16508            Self {
16509                inner,
16510                accept_compression_encodings: Default::default(),
16511                send_compression_encodings: Default::default(),
16512                max_decoding_message_size: None,
16513                max_encoding_message_size: None,
16514            }
16515        }
16516        pub fn with_interceptor<F>(
16517            inner: T,
16518            interceptor: F,
16519        ) -> InterceptedService<Self, F>
16520        where
16521            F: tonic::service::Interceptor,
16522        {
16523            InterceptedService::new(Self::new(inner), interceptor)
16524        }
16525        /// Enable decompressing requests with the given encoding.
16526        #[must_use]
16527        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16528            self.accept_compression_encodings.enable(encoding);
16529            self
16530        }
16531        /// Compress responses with the given encoding, if the client supports it.
16532        #[must_use]
16533        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16534            self.send_compression_encodings.enable(encoding);
16535            self
16536        }
16537        /// Limits the maximum size of a decoded message.
16538        ///
16539        /// Default: `4MB`
16540        #[must_use]
16541        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16542            self.max_decoding_message_size = Some(limit);
16543            self
16544        }
16545        /// Limits the maximum size of an encoded message.
16546        ///
16547        /// Default: `usize::MAX`
16548        #[must_use]
16549        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16550            self.max_encoding_message_size = Some(limit);
16551            self
16552        }
16553    }
16554    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
16555    where
16556        T: SsoService,
16557        B: Body + std::marker::Send + 'static,
16558        B::Error: Into<StdError> + std::marker::Send + 'static,
16559    {
16560        type Response = http::Response<tonic::body::Body>;
16561        type Error = std::convert::Infallible;
16562        type Future = BoxFuture<Self::Response, Self::Error>;
16563        fn poll_ready(
16564            &mut self,
16565            _cx: &mut Context<'_>,
16566        ) -> Poll<std::result::Result<(), Self::Error>> {
16567            Poll::Ready(Ok(()))
16568        }
16569        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16570            match req.uri().path() {
16571                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
16572                    #[allow(non_camel_case_types)]
16573                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
16574                    impl<
16575                        T: SsoService,
16576                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
16577                    for CheckSSOByDomainSvc<T> {
16578                        type Response = super::CheckSsoByDomainResponse;
16579                        type Future = BoxFuture<
16580                            tonic::Response<Self::Response>,
16581                            tonic::Status,
16582                        >;
16583                        fn call(
16584                            &mut self,
16585                            request: tonic::Request<super::CheckSsoByDomainRequest>,
16586                        ) -> Self::Future {
16587                            let inner = Arc::clone(&self.0);
16588                            let fut = async move {
16589                                <T as SsoService>::check_sso_by_domain(&inner, request)
16590                                    .await
16591                            };
16592                            Box::pin(fut)
16593                        }
16594                    }
16595                    let accept_compression_encodings = self.accept_compression_encodings;
16596                    let send_compression_encodings = self.send_compression_encodings;
16597                    let max_decoding_message_size = self.max_decoding_message_size;
16598                    let max_encoding_message_size = self.max_encoding_message_size;
16599                    let inner = self.inner.clone();
16600                    let fut = async move {
16601                        let method = CheckSSOByDomainSvc(inner);
16602                        let codec = tonic_prost::ProstCodec::default();
16603                        let mut grpc = tonic::server::Grpc::new(codec)
16604                            .apply_compression_config(
16605                                accept_compression_encodings,
16606                                send_compression_encodings,
16607                            )
16608                            .apply_max_message_size_config(
16609                                max_decoding_message_size,
16610                                max_encoding_message_size,
16611                            );
16612                        let res = grpc.unary(method, req).await;
16613                        Ok(res)
16614                    };
16615                    Box::pin(fut)
16616                }
16617                "/pidgr.v1.SSOService/CreateSSOProvider" => {
16618                    #[allow(non_camel_case_types)]
16619                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
16620                    impl<
16621                        T: SsoService,
16622                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
16623                    for CreateSSOProviderSvc<T> {
16624                        type Response = super::CreateSsoProviderResponse;
16625                        type Future = BoxFuture<
16626                            tonic::Response<Self::Response>,
16627                            tonic::Status,
16628                        >;
16629                        fn call(
16630                            &mut self,
16631                            request: tonic::Request<super::CreateSsoProviderRequest>,
16632                        ) -> Self::Future {
16633                            let inner = Arc::clone(&self.0);
16634                            let fut = async move {
16635                                <T as SsoService>::create_sso_provider(&inner, request)
16636                                    .await
16637                            };
16638                            Box::pin(fut)
16639                        }
16640                    }
16641                    let accept_compression_encodings = self.accept_compression_encodings;
16642                    let send_compression_encodings = self.send_compression_encodings;
16643                    let max_decoding_message_size = self.max_decoding_message_size;
16644                    let max_encoding_message_size = self.max_encoding_message_size;
16645                    let inner = self.inner.clone();
16646                    let fut = async move {
16647                        let method = CreateSSOProviderSvc(inner);
16648                        let codec = tonic_prost::ProstCodec::default();
16649                        let mut grpc = tonic::server::Grpc::new(codec)
16650                            .apply_compression_config(
16651                                accept_compression_encodings,
16652                                send_compression_encodings,
16653                            )
16654                            .apply_max_message_size_config(
16655                                max_decoding_message_size,
16656                                max_encoding_message_size,
16657                            );
16658                        let res = grpc.unary(method, req).await;
16659                        Ok(res)
16660                    };
16661                    Box::pin(fut)
16662                }
16663                "/pidgr.v1.SSOService/GetSSOProvider" => {
16664                    #[allow(non_camel_case_types)]
16665                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
16666                    impl<
16667                        T: SsoService,
16668                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
16669                    for GetSSOProviderSvc<T> {
16670                        type Response = super::GetSsoProviderResponse;
16671                        type Future = BoxFuture<
16672                            tonic::Response<Self::Response>,
16673                            tonic::Status,
16674                        >;
16675                        fn call(
16676                            &mut self,
16677                            request: tonic::Request<super::GetSsoProviderRequest>,
16678                        ) -> Self::Future {
16679                            let inner = Arc::clone(&self.0);
16680                            let fut = async move {
16681                                <T as SsoService>::get_sso_provider(&inner, request).await
16682                            };
16683                            Box::pin(fut)
16684                        }
16685                    }
16686                    let accept_compression_encodings = self.accept_compression_encodings;
16687                    let send_compression_encodings = self.send_compression_encodings;
16688                    let max_decoding_message_size = self.max_decoding_message_size;
16689                    let max_encoding_message_size = self.max_encoding_message_size;
16690                    let inner = self.inner.clone();
16691                    let fut = async move {
16692                        let method = GetSSOProviderSvc(inner);
16693                        let codec = tonic_prost::ProstCodec::default();
16694                        let mut grpc = tonic::server::Grpc::new(codec)
16695                            .apply_compression_config(
16696                                accept_compression_encodings,
16697                                send_compression_encodings,
16698                            )
16699                            .apply_max_message_size_config(
16700                                max_decoding_message_size,
16701                                max_encoding_message_size,
16702                            );
16703                        let res = grpc.unary(method, req).await;
16704                        Ok(res)
16705                    };
16706                    Box::pin(fut)
16707                }
16708                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
16709                    #[allow(non_camel_case_types)]
16710                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
16711                    impl<
16712                        T: SsoService,
16713                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
16714                    for DeleteSSOProviderSvc<T> {
16715                        type Response = super::DeleteSsoProviderResponse;
16716                        type Future = BoxFuture<
16717                            tonic::Response<Self::Response>,
16718                            tonic::Status,
16719                        >;
16720                        fn call(
16721                            &mut self,
16722                            request: tonic::Request<super::DeleteSsoProviderRequest>,
16723                        ) -> Self::Future {
16724                            let inner = Arc::clone(&self.0);
16725                            let fut = async move {
16726                                <T as SsoService>::delete_sso_provider(&inner, request)
16727                                    .await
16728                            };
16729                            Box::pin(fut)
16730                        }
16731                    }
16732                    let accept_compression_encodings = self.accept_compression_encodings;
16733                    let send_compression_encodings = self.send_compression_encodings;
16734                    let max_decoding_message_size = self.max_decoding_message_size;
16735                    let max_encoding_message_size = self.max_encoding_message_size;
16736                    let inner = self.inner.clone();
16737                    let fut = async move {
16738                        let method = DeleteSSOProviderSvc(inner);
16739                        let codec = tonic_prost::ProstCodec::default();
16740                        let mut grpc = tonic::server::Grpc::new(codec)
16741                            .apply_compression_config(
16742                                accept_compression_encodings,
16743                                send_compression_encodings,
16744                            )
16745                            .apply_max_message_size_config(
16746                                max_decoding_message_size,
16747                                max_encoding_message_size,
16748                            );
16749                        let res = grpc.unary(method, req).await;
16750                        Ok(res)
16751                    };
16752                    Box::pin(fut)
16753                }
16754                _ => {
16755                    Box::pin(async move {
16756                        let mut response = http::Response::new(
16757                            tonic::body::Body::default(),
16758                        );
16759                        let headers = response.headers_mut();
16760                        headers
16761                            .insert(
16762                                tonic::Status::GRPC_STATUS,
16763                                (tonic::Code::Unimplemented as i32).into(),
16764                            );
16765                        headers
16766                            .insert(
16767                                http::header::CONTENT_TYPE,
16768                                tonic::metadata::GRPC_CONTENT_TYPE,
16769                            );
16770                        Ok(response)
16771                    })
16772                }
16773            }
16774        }
16775    }
16776    impl<T> Clone for SsoServiceServer<T> {
16777        fn clone(&self) -> Self {
16778            let inner = self.inner.clone();
16779            Self {
16780                inner,
16781                accept_compression_encodings: self.accept_compression_encodings,
16782                send_compression_encodings: self.send_compression_encodings,
16783                max_decoding_message_size: self.max_decoding_message_size,
16784                max_encoding_message_size: self.max_encoding_message_size,
16785            }
16786        }
16787    }
16788    /// Generated gRPC service name
16789    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
16790    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
16791        const NAME: &'static str = SERVICE_NAME;
16792    }
16793}
16794/// Generated client implementations.
16795pub mod team_service_client {
16796    #![allow(
16797        unused_variables,
16798        dead_code,
16799        missing_docs,
16800        clippy::wildcard_imports,
16801        clippy::let_unit_value,
16802    )]
16803    use tonic::codegen::*;
16804    use tonic::codegen::http::Uri;
16805    /** Manages organizational teams (departments, divisions) within an organization.
16806 Teams represent the organizational structure and can serve as sender identity.
16807 All RPCs operate within the caller's org (extracted from JWT).
16808*/
16809    #[derive(Debug, Clone)]
16810    pub struct TeamServiceClient<T> {
16811        inner: tonic::client::Grpc<T>,
16812    }
16813    impl TeamServiceClient<tonic::transport::Channel> {
16814        /// Attempt to create a new client by connecting to a given endpoint.
16815        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16816        where
16817            D: TryInto<tonic::transport::Endpoint>,
16818            D::Error: Into<StdError>,
16819        {
16820            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16821            Ok(Self::new(conn))
16822        }
16823    }
16824    impl<T> TeamServiceClient<T>
16825    where
16826        T: tonic::client::GrpcService<tonic::body::Body>,
16827        T::Error: Into<StdError>,
16828        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16829        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16830    {
16831        pub fn new(inner: T) -> Self {
16832            let inner = tonic::client::Grpc::new(inner);
16833            Self { inner }
16834        }
16835        pub fn with_origin(inner: T, origin: Uri) -> Self {
16836            let inner = tonic::client::Grpc::with_origin(inner, origin);
16837            Self { inner }
16838        }
16839        pub fn with_interceptor<F>(
16840            inner: T,
16841            interceptor: F,
16842        ) -> TeamServiceClient<InterceptedService<T, F>>
16843        where
16844            F: tonic::service::Interceptor,
16845            T::ResponseBody: Default,
16846            T: tonic::codegen::Service<
16847                http::Request<tonic::body::Body>,
16848                Response = http::Response<
16849                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16850                >,
16851            >,
16852            <T as tonic::codegen::Service<
16853                http::Request<tonic::body::Body>,
16854            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16855        {
16856            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
16857        }
16858        /// Compress requests with the given encoding.
16859        ///
16860        /// This requires the server to support it otherwise it might respond with an
16861        /// error.
16862        #[must_use]
16863        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16864            self.inner = self.inner.send_compressed(encoding);
16865            self
16866        }
16867        /// Enable decompressing responses.
16868        #[must_use]
16869        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16870            self.inner = self.inner.accept_compressed(encoding);
16871            self
16872        }
16873        /// Limits the maximum size of a decoded message.
16874        ///
16875        /// Default: `4MB`
16876        #[must_use]
16877        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16878            self.inner = self.inner.max_decoding_message_size(limit);
16879            self
16880        }
16881        /// Limits the maximum size of an encoded message.
16882        ///
16883        /// Default: `usize::MAX`
16884        #[must_use]
16885        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16886            self.inner = self.inner.max_encoding_message_size(limit);
16887            self
16888        }
16889        /** Create a new team in the organization.
16890 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
16891*/
16892        pub async fn create_team(
16893            &mut self,
16894            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
16895        ) -> std::result::Result<
16896            tonic::Response<super::CreateTeamResponse>,
16897            tonic::Status,
16898        > {
16899            self.inner
16900                .ready()
16901                .await
16902                .map_err(|e| {
16903                    tonic::Status::unknown(
16904                        format!("Service was not ready: {}", e.into()),
16905                    )
16906                })?;
16907            let codec = tonic_prost::ProstCodec::default();
16908            let path = http::uri::PathAndQuery::from_static(
16909                "/pidgr.v1.TeamService/CreateTeam",
16910            );
16911            let mut req = request.into_request();
16912            req.extensions_mut()
16913                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
16914            self.inner.unary(req, path, codec).await
16915        }
16916        /** Retrieve a team by ID.
16917 Authorization: Caller must be a member of the team, or have
16918 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
16919*/
16920        pub async fn get_team(
16921            &mut self,
16922            request: impl tonic::IntoRequest<super::GetTeamRequest>,
16923        ) -> std::result::Result<
16924            tonic::Response<super::GetTeamResponse>,
16925            tonic::Status,
16926        > {
16927            self.inner
16928                .ready()
16929                .await
16930                .map_err(|e| {
16931                    tonic::Status::unknown(
16932                        format!("Service was not ready: {}", e.into()),
16933                    )
16934                })?;
16935            let codec = tonic_prost::ProstCodec::default();
16936            let path = http::uri::PathAndQuery::from_static(
16937                "/pidgr.v1.TeamService/GetTeam",
16938            );
16939            let mut req = request.into_request();
16940            req.extensions_mut()
16941                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
16942            self.inner.unary(req, path, codec).await
16943        }
16944        /** List teams in the organization with pagination.
16945 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
16946*/
16947        pub async fn list_teams(
16948            &mut self,
16949            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
16950        ) -> std::result::Result<
16951            tonic::Response<super::ListTeamsResponse>,
16952            tonic::Status,
16953        > {
16954            self.inner
16955                .ready()
16956                .await
16957                .map_err(|e| {
16958                    tonic::Status::unknown(
16959                        format!("Service was not ready: {}", e.into()),
16960                    )
16961                })?;
16962            let codec = tonic_prost::ProstCodec::default();
16963            let path = http::uri::PathAndQuery::from_static(
16964                "/pidgr.v1.TeamService/ListTeams",
16965            );
16966            let mut req = request.into_request();
16967            req.extensions_mut()
16968                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
16969            self.inner.unary(req, path, codec).await
16970        }
16971        /** Update a team's name and/or description.
16972 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
16973*/
16974        pub async fn update_team(
16975            &mut self,
16976            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
16977        ) -> std::result::Result<
16978            tonic::Response<super::UpdateTeamResponse>,
16979            tonic::Status,
16980        > {
16981            self.inner
16982                .ready()
16983                .await
16984                .map_err(|e| {
16985                    tonic::Status::unknown(
16986                        format!("Service was not ready: {}", e.into()),
16987                    )
16988                })?;
16989            let codec = tonic_prost::ProstCodec::default();
16990            let path = http::uri::PathAndQuery::from_static(
16991                "/pidgr.v1.TeamService/UpdateTeam",
16992            );
16993            let mut req = request.into_request();
16994            req.extensions_mut()
16995                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
16996            self.inner.unary(req, path, codec).await
16997        }
16998        /** Delete a team and all its membership records. Default teams cannot be deleted.
16999 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17000*/
17001        pub async fn delete_team(
17002            &mut self,
17003            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
17004        ) -> std::result::Result<
17005            tonic::Response<super::DeleteTeamResponse>,
17006            tonic::Status,
17007        > {
17008            self.inner
17009                .ready()
17010                .await
17011                .map_err(|e| {
17012                    tonic::Status::unknown(
17013                        format!("Service was not ready: {}", e.into()),
17014                    )
17015                })?;
17016            let codec = tonic_prost::ProstCodec::default();
17017            let path = http::uri::PathAndQuery::from_static(
17018                "/pidgr.v1.TeamService/DeleteTeam",
17019            );
17020            let mut req = request.into_request();
17021            req.extensions_mut()
17022                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
17023            self.inner.unary(req, path, codec).await
17024        }
17025        /** Add one or more users to a team (idempotent).
17026 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17027*/
17028        pub async fn add_team_members(
17029            &mut self,
17030            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
17031        ) -> std::result::Result<
17032            tonic::Response<super::AddTeamMembersResponse>,
17033            tonic::Status,
17034        > {
17035            self.inner
17036                .ready()
17037                .await
17038                .map_err(|e| {
17039                    tonic::Status::unknown(
17040                        format!("Service was not ready: {}", e.into()),
17041                    )
17042                })?;
17043            let codec = tonic_prost::ProstCodec::default();
17044            let path = http::uri::PathAndQuery::from_static(
17045                "/pidgr.v1.TeamService/AddTeamMembers",
17046            );
17047            let mut req = request.into_request();
17048            req.extensions_mut()
17049                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
17050            self.inner.unary(req, path, codec).await
17051        }
17052        /** Remove one or more users from a team (idempotent).
17053 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17054*/
17055        pub async fn remove_team_members(
17056            &mut self,
17057            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
17058        ) -> std::result::Result<
17059            tonic::Response<super::RemoveTeamMembersResponse>,
17060            tonic::Status,
17061        > {
17062            self.inner
17063                .ready()
17064                .await
17065                .map_err(|e| {
17066                    tonic::Status::unknown(
17067                        format!("Service was not ready: {}", e.into()),
17068                    )
17069                })?;
17070            let codec = tonic_prost::ProstCodec::default();
17071            let path = http::uri::PathAndQuery::from_static(
17072                "/pidgr.v1.TeamService/RemoveTeamMembers",
17073            );
17074            let mut req = request.into_request();
17075            req.extensions_mut()
17076                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
17077            self.inner.unary(req, path, codec).await
17078        }
17079        /** List members of a team with pagination.
17080 Authorization: Caller must be a member of the team, or have
17081 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
17082*/
17083        pub async fn list_team_members(
17084            &mut self,
17085            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
17086        ) -> std::result::Result<
17087            tonic::Response<super::ListTeamMembersResponse>,
17088            tonic::Status,
17089        > {
17090            self.inner
17091                .ready()
17092                .await
17093                .map_err(|e| {
17094                    tonic::Status::unknown(
17095                        format!("Service was not ready: {}", e.into()),
17096                    )
17097                })?;
17098            let codec = tonic_prost::ProstCodec::default();
17099            let path = http::uri::PathAndQuery::from_static(
17100                "/pidgr.v1.TeamService/ListTeamMembers",
17101            );
17102            let mut req = request.into_request();
17103            req.extensions_mut()
17104                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
17105            self.inner.unary(req, path, codec).await
17106        }
17107    }
17108}
17109/// Generated server implementations.
17110pub mod team_service_server {
17111    #![allow(
17112        unused_variables,
17113        dead_code,
17114        missing_docs,
17115        clippy::wildcard_imports,
17116        clippy::let_unit_value,
17117    )]
17118    use tonic::codegen::*;
17119    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
17120    #[async_trait]
17121    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
17122        /** Create a new team in the organization.
17123 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
17124*/
17125        async fn create_team(
17126            &self,
17127            request: tonic::Request<super::CreateTeamRequest>,
17128        ) -> std::result::Result<
17129            tonic::Response<super::CreateTeamResponse>,
17130            tonic::Status,
17131        >;
17132        /** Retrieve a team by ID.
17133 Authorization: Caller must be a member of the team, or have
17134 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
17135*/
17136        async fn get_team(
17137            &self,
17138            request: tonic::Request<super::GetTeamRequest>,
17139        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
17140        /** List teams in the organization with pagination.
17141 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
17142*/
17143        async fn list_teams(
17144            &self,
17145            request: tonic::Request<super::ListTeamsRequest>,
17146        ) -> std::result::Result<
17147            tonic::Response<super::ListTeamsResponse>,
17148            tonic::Status,
17149        >;
17150        /** Update a team's name and/or description.
17151 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17152*/
17153        async fn update_team(
17154            &self,
17155            request: tonic::Request<super::UpdateTeamRequest>,
17156        ) -> std::result::Result<
17157            tonic::Response<super::UpdateTeamResponse>,
17158            tonic::Status,
17159        >;
17160        /** Delete a team and all its membership records. Default teams cannot be deleted.
17161 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17162*/
17163        async fn delete_team(
17164            &self,
17165            request: tonic::Request<super::DeleteTeamRequest>,
17166        ) -> std::result::Result<
17167            tonic::Response<super::DeleteTeamResponse>,
17168            tonic::Status,
17169        >;
17170        /** Add one or more users to a team (idempotent).
17171 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17172*/
17173        async fn add_team_members(
17174            &self,
17175            request: tonic::Request<super::AddTeamMembersRequest>,
17176        ) -> std::result::Result<
17177            tonic::Response<super::AddTeamMembersResponse>,
17178            tonic::Status,
17179        >;
17180        /** Remove one or more users from a team (idempotent).
17181 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
17182*/
17183        async fn remove_team_members(
17184            &self,
17185            request: tonic::Request<super::RemoveTeamMembersRequest>,
17186        ) -> std::result::Result<
17187            tonic::Response<super::RemoveTeamMembersResponse>,
17188            tonic::Status,
17189        >;
17190        /** List members of a team with pagination.
17191 Authorization: Caller must be a member of the team, or have
17192 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
17193*/
17194        async fn list_team_members(
17195            &self,
17196            request: tonic::Request<super::ListTeamMembersRequest>,
17197        ) -> std::result::Result<
17198            tonic::Response<super::ListTeamMembersResponse>,
17199            tonic::Status,
17200        >;
17201    }
17202    /** Manages organizational teams (departments, divisions) within an organization.
17203 Teams represent the organizational structure and can serve as sender identity.
17204 All RPCs operate within the caller's org (extracted from JWT).
17205*/
17206    #[derive(Debug)]
17207    pub struct TeamServiceServer<T> {
17208        inner: Arc<T>,
17209        accept_compression_encodings: EnabledCompressionEncodings,
17210        send_compression_encodings: EnabledCompressionEncodings,
17211        max_decoding_message_size: Option<usize>,
17212        max_encoding_message_size: Option<usize>,
17213    }
17214    impl<T> TeamServiceServer<T> {
17215        pub fn new(inner: T) -> Self {
17216            Self::from_arc(Arc::new(inner))
17217        }
17218        pub fn from_arc(inner: Arc<T>) -> Self {
17219            Self {
17220                inner,
17221                accept_compression_encodings: Default::default(),
17222                send_compression_encodings: Default::default(),
17223                max_decoding_message_size: None,
17224                max_encoding_message_size: None,
17225            }
17226        }
17227        pub fn with_interceptor<F>(
17228            inner: T,
17229            interceptor: F,
17230        ) -> InterceptedService<Self, F>
17231        where
17232            F: tonic::service::Interceptor,
17233        {
17234            InterceptedService::new(Self::new(inner), interceptor)
17235        }
17236        /// Enable decompressing requests with the given encoding.
17237        #[must_use]
17238        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17239            self.accept_compression_encodings.enable(encoding);
17240            self
17241        }
17242        /// Compress responses with the given encoding, if the client supports it.
17243        #[must_use]
17244        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17245            self.send_compression_encodings.enable(encoding);
17246            self
17247        }
17248        /// Limits the maximum size of a decoded message.
17249        ///
17250        /// Default: `4MB`
17251        #[must_use]
17252        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17253            self.max_decoding_message_size = Some(limit);
17254            self
17255        }
17256        /// Limits the maximum size of an encoded message.
17257        ///
17258        /// Default: `usize::MAX`
17259        #[must_use]
17260        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17261            self.max_encoding_message_size = Some(limit);
17262            self
17263        }
17264    }
17265    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
17266    where
17267        T: TeamService,
17268        B: Body + std::marker::Send + 'static,
17269        B::Error: Into<StdError> + std::marker::Send + 'static,
17270    {
17271        type Response = http::Response<tonic::body::Body>;
17272        type Error = std::convert::Infallible;
17273        type Future = BoxFuture<Self::Response, Self::Error>;
17274        fn poll_ready(
17275            &mut self,
17276            _cx: &mut Context<'_>,
17277        ) -> Poll<std::result::Result<(), Self::Error>> {
17278            Poll::Ready(Ok(()))
17279        }
17280        fn call(&mut self, req: http::Request<B>) -> Self::Future {
17281            match req.uri().path() {
17282                "/pidgr.v1.TeamService/CreateTeam" => {
17283                    #[allow(non_camel_case_types)]
17284                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
17285                    impl<
17286                        T: TeamService,
17287                    > tonic::server::UnaryService<super::CreateTeamRequest>
17288                    for CreateTeamSvc<T> {
17289                        type Response = super::CreateTeamResponse;
17290                        type Future = BoxFuture<
17291                            tonic::Response<Self::Response>,
17292                            tonic::Status,
17293                        >;
17294                        fn call(
17295                            &mut self,
17296                            request: tonic::Request<super::CreateTeamRequest>,
17297                        ) -> Self::Future {
17298                            let inner = Arc::clone(&self.0);
17299                            let fut = async move {
17300                                <T as TeamService>::create_team(&inner, request).await
17301                            };
17302                            Box::pin(fut)
17303                        }
17304                    }
17305                    let accept_compression_encodings = self.accept_compression_encodings;
17306                    let send_compression_encodings = self.send_compression_encodings;
17307                    let max_decoding_message_size = self.max_decoding_message_size;
17308                    let max_encoding_message_size = self.max_encoding_message_size;
17309                    let inner = self.inner.clone();
17310                    let fut = async move {
17311                        let method = CreateTeamSvc(inner);
17312                        let codec = tonic_prost::ProstCodec::default();
17313                        let mut grpc = tonic::server::Grpc::new(codec)
17314                            .apply_compression_config(
17315                                accept_compression_encodings,
17316                                send_compression_encodings,
17317                            )
17318                            .apply_max_message_size_config(
17319                                max_decoding_message_size,
17320                                max_encoding_message_size,
17321                            );
17322                        let res = grpc.unary(method, req).await;
17323                        Ok(res)
17324                    };
17325                    Box::pin(fut)
17326                }
17327                "/pidgr.v1.TeamService/GetTeam" => {
17328                    #[allow(non_camel_case_types)]
17329                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
17330                    impl<
17331                        T: TeamService,
17332                    > tonic::server::UnaryService<super::GetTeamRequest>
17333                    for GetTeamSvc<T> {
17334                        type Response = super::GetTeamResponse;
17335                        type Future = BoxFuture<
17336                            tonic::Response<Self::Response>,
17337                            tonic::Status,
17338                        >;
17339                        fn call(
17340                            &mut self,
17341                            request: tonic::Request<super::GetTeamRequest>,
17342                        ) -> Self::Future {
17343                            let inner = Arc::clone(&self.0);
17344                            let fut = async move {
17345                                <T as TeamService>::get_team(&inner, request).await
17346                            };
17347                            Box::pin(fut)
17348                        }
17349                    }
17350                    let accept_compression_encodings = self.accept_compression_encodings;
17351                    let send_compression_encodings = self.send_compression_encodings;
17352                    let max_decoding_message_size = self.max_decoding_message_size;
17353                    let max_encoding_message_size = self.max_encoding_message_size;
17354                    let inner = self.inner.clone();
17355                    let fut = async move {
17356                        let method = GetTeamSvc(inner);
17357                        let codec = tonic_prost::ProstCodec::default();
17358                        let mut grpc = tonic::server::Grpc::new(codec)
17359                            .apply_compression_config(
17360                                accept_compression_encodings,
17361                                send_compression_encodings,
17362                            )
17363                            .apply_max_message_size_config(
17364                                max_decoding_message_size,
17365                                max_encoding_message_size,
17366                            );
17367                        let res = grpc.unary(method, req).await;
17368                        Ok(res)
17369                    };
17370                    Box::pin(fut)
17371                }
17372                "/pidgr.v1.TeamService/ListTeams" => {
17373                    #[allow(non_camel_case_types)]
17374                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
17375                    impl<
17376                        T: TeamService,
17377                    > tonic::server::UnaryService<super::ListTeamsRequest>
17378                    for ListTeamsSvc<T> {
17379                        type Response = super::ListTeamsResponse;
17380                        type Future = BoxFuture<
17381                            tonic::Response<Self::Response>,
17382                            tonic::Status,
17383                        >;
17384                        fn call(
17385                            &mut self,
17386                            request: tonic::Request<super::ListTeamsRequest>,
17387                        ) -> Self::Future {
17388                            let inner = Arc::clone(&self.0);
17389                            let fut = async move {
17390                                <T as TeamService>::list_teams(&inner, request).await
17391                            };
17392                            Box::pin(fut)
17393                        }
17394                    }
17395                    let accept_compression_encodings = self.accept_compression_encodings;
17396                    let send_compression_encodings = self.send_compression_encodings;
17397                    let max_decoding_message_size = self.max_decoding_message_size;
17398                    let max_encoding_message_size = self.max_encoding_message_size;
17399                    let inner = self.inner.clone();
17400                    let fut = async move {
17401                        let method = ListTeamsSvc(inner);
17402                        let codec = tonic_prost::ProstCodec::default();
17403                        let mut grpc = tonic::server::Grpc::new(codec)
17404                            .apply_compression_config(
17405                                accept_compression_encodings,
17406                                send_compression_encodings,
17407                            )
17408                            .apply_max_message_size_config(
17409                                max_decoding_message_size,
17410                                max_encoding_message_size,
17411                            );
17412                        let res = grpc.unary(method, req).await;
17413                        Ok(res)
17414                    };
17415                    Box::pin(fut)
17416                }
17417                "/pidgr.v1.TeamService/UpdateTeam" => {
17418                    #[allow(non_camel_case_types)]
17419                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
17420                    impl<
17421                        T: TeamService,
17422                    > tonic::server::UnaryService<super::UpdateTeamRequest>
17423                    for UpdateTeamSvc<T> {
17424                        type Response = super::UpdateTeamResponse;
17425                        type Future = BoxFuture<
17426                            tonic::Response<Self::Response>,
17427                            tonic::Status,
17428                        >;
17429                        fn call(
17430                            &mut self,
17431                            request: tonic::Request<super::UpdateTeamRequest>,
17432                        ) -> Self::Future {
17433                            let inner = Arc::clone(&self.0);
17434                            let fut = async move {
17435                                <T as TeamService>::update_team(&inner, request).await
17436                            };
17437                            Box::pin(fut)
17438                        }
17439                    }
17440                    let accept_compression_encodings = self.accept_compression_encodings;
17441                    let send_compression_encodings = self.send_compression_encodings;
17442                    let max_decoding_message_size = self.max_decoding_message_size;
17443                    let max_encoding_message_size = self.max_encoding_message_size;
17444                    let inner = self.inner.clone();
17445                    let fut = async move {
17446                        let method = UpdateTeamSvc(inner);
17447                        let codec = tonic_prost::ProstCodec::default();
17448                        let mut grpc = tonic::server::Grpc::new(codec)
17449                            .apply_compression_config(
17450                                accept_compression_encodings,
17451                                send_compression_encodings,
17452                            )
17453                            .apply_max_message_size_config(
17454                                max_decoding_message_size,
17455                                max_encoding_message_size,
17456                            );
17457                        let res = grpc.unary(method, req).await;
17458                        Ok(res)
17459                    };
17460                    Box::pin(fut)
17461                }
17462                "/pidgr.v1.TeamService/DeleteTeam" => {
17463                    #[allow(non_camel_case_types)]
17464                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
17465                    impl<
17466                        T: TeamService,
17467                    > tonic::server::UnaryService<super::DeleteTeamRequest>
17468                    for DeleteTeamSvc<T> {
17469                        type Response = super::DeleteTeamResponse;
17470                        type Future = BoxFuture<
17471                            tonic::Response<Self::Response>,
17472                            tonic::Status,
17473                        >;
17474                        fn call(
17475                            &mut self,
17476                            request: tonic::Request<super::DeleteTeamRequest>,
17477                        ) -> Self::Future {
17478                            let inner = Arc::clone(&self.0);
17479                            let fut = async move {
17480                                <T as TeamService>::delete_team(&inner, request).await
17481                            };
17482                            Box::pin(fut)
17483                        }
17484                    }
17485                    let accept_compression_encodings = self.accept_compression_encodings;
17486                    let send_compression_encodings = self.send_compression_encodings;
17487                    let max_decoding_message_size = self.max_decoding_message_size;
17488                    let max_encoding_message_size = self.max_encoding_message_size;
17489                    let inner = self.inner.clone();
17490                    let fut = async move {
17491                        let method = DeleteTeamSvc(inner);
17492                        let codec = tonic_prost::ProstCodec::default();
17493                        let mut grpc = tonic::server::Grpc::new(codec)
17494                            .apply_compression_config(
17495                                accept_compression_encodings,
17496                                send_compression_encodings,
17497                            )
17498                            .apply_max_message_size_config(
17499                                max_decoding_message_size,
17500                                max_encoding_message_size,
17501                            );
17502                        let res = grpc.unary(method, req).await;
17503                        Ok(res)
17504                    };
17505                    Box::pin(fut)
17506                }
17507                "/pidgr.v1.TeamService/AddTeamMembers" => {
17508                    #[allow(non_camel_case_types)]
17509                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
17510                    impl<
17511                        T: TeamService,
17512                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
17513                    for AddTeamMembersSvc<T> {
17514                        type Response = super::AddTeamMembersResponse;
17515                        type Future = BoxFuture<
17516                            tonic::Response<Self::Response>,
17517                            tonic::Status,
17518                        >;
17519                        fn call(
17520                            &mut self,
17521                            request: tonic::Request<super::AddTeamMembersRequest>,
17522                        ) -> Self::Future {
17523                            let inner = Arc::clone(&self.0);
17524                            let fut = async move {
17525                                <T as TeamService>::add_team_members(&inner, request).await
17526                            };
17527                            Box::pin(fut)
17528                        }
17529                    }
17530                    let accept_compression_encodings = self.accept_compression_encodings;
17531                    let send_compression_encodings = self.send_compression_encodings;
17532                    let max_decoding_message_size = self.max_decoding_message_size;
17533                    let max_encoding_message_size = self.max_encoding_message_size;
17534                    let inner = self.inner.clone();
17535                    let fut = async move {
17536                        let method = AddTeamMembersSvc(inner);
17537                        let codec = tonic_prost::ProstCodec::default();
17538                        let mut grpc = tonic::server::Grpc::new(codec)
17539                            .apply_compression_config(
17540                                accept_compression_encodings,
17541                                send_compression_encodings,
17542                            )
17543                            .apply_max_message_size_config(
17544                                max_decoding_message_size,
17545                                max_encoding_message_size,
17546                            );
17547                        let res = grpc.unary(method, req).await;
17548                        Ok(res)
17549                    };
17550                    Box::pin(fut)
17551                }
17552                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
17553                    #[allow(non_camel_case_types)]
17554                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
17555                    impl<
17556                        T: TeamService,
17557                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
17558                    for RemoveTeamMembersSvc<T> {
17559                        type Response = super::RemoveTeamMembersResponse;
17560                        type Future = BoxFuture<
17561                            tonic::Response<Self::Response>,
17562                            tonic::Status,
17563                        >;
17564                        fn call(
17565                            &mut self,
17566                            request: tonic::Request<super::RemoveTeamMembersRequest>,
17567                        ) -> Self::Future {
17568                            let inner = Arc::clone(&self.0);
17569                            let fut = async move {
17570                                <T as TeamService>::remove_team_members(&inner, request)
17571                                    .await
17572                            };
17573                            Box::pin(fut)
17574                        }
17575                    }
17576                    let accept_compression_encodings = self.accept_compression_encodings;
17577                    let send_compression_encodings = self.send_compression_encodings;
17578                    let max_decoding_message_size = self.max_decoding_message_size;
17579                    let max_encoding_message_size = self.max_encoding_message_size;
17580                    let inner = self.inner.clone();
17581                    let fut = async move {
17582                        let method = RemoveTeamMembersSvc(inner);
17583                        let codec = tonic_prost::ProstCodec::default();
17584                        let mut grpc = tonic::server::Grpc::new(codec)
17585                            .apply_compression_config(
17586                                accept_compression_encodings,
17587                                send_compression_encodings,
17588                            )
17589                            .apply_max_message_size_config(
17590                                max_decoding_message_size,
17591                                max_encoding_message_size,
17592                            );
17593                        let res = grpc.unary(method, req).await;
17594                        Ok(res)
17595                    };
17596                    Box::pin(fut)
17597                }
17598                "/pidgr.v1.TeamService/ListTeamMembers" => {
17599                    #[allow(non_camel_case_types)]
17600                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
17601                    impl<
17602                        T: TeamService,
17603                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
17604                    for ListTeamMembersSvc<T> {
17605                        type Response = super::ListTeamMembersResponse;
17606                        type Future = BoxFuture<
17607                            tonic::Response<Self::Response>,
17608                            tonic::Status,
17609                        >;
17610                        fn call(
17611                            &mut self,
17612                            request: tonic::Request<super::ListTeamMembersRequest>,
17613                        ) -> Self::Future {
17614                            let inner = Arc::clone(&self.0);
17615                            let fut = async move {
17616                                <T as TeamService>::list_team_members(&inner, request).await
17617                            };
17618                            Box::pin(fut)
17619                        }
17620                    }
17621                    let accept_compression_encodings = self.accept_compression_encodings;
17622                    let send_compression_encodings = self.send_compression_encodings;
17623                    let max_decoding_message_size = self.max_decoding_message_size;
17624                    let max_encoding_message_size = self.max_encoding_message_size;
17625                    let inner = self.inner.clone();
17626                    let fut = async move {
17627                        let method = ListTeamMembersSvc(inner);
17628                        let codec = tonic_prost::ProstCodec::default();
17629                        let mut grpc = tonic::server::Grpc::new(codec)
17630                            .apply_compression_config(
17631                                accept_compression_encodings,
17632                                send_compression_encodings,
17633                            )
17634                            .apply_max_message_size_config(
17635                                max_decoding_message_size,
17636                                max_encoding_message_size,
17637                            );
17638                        let res = grpc.unary(method, req).await;
17639                        Ok(res)
17640                    };
17641                    Box::pin(fut)
17642                }
17643                _ => {
17644                    Box::pin(async move {
17645                        let mut response = http::Response::new(
17646                            tonic::body::Body::default(),
17647                        );
17648                        let headers = response.headers_mut();
17649                        headers
17650                            .insert(
17651                                tonic::Status::GRPC_STATUS,
17652                                (tonic::Code::Unimplemented as i32).into(),
17653                            );
17654                        headers
17655                            .insert(
17656                                http::header::CONTENT_TYPE,
17657                                tonic::metadata::GRPC_CONTENT_TYPE,
17658                            );
17659                        Ok(response)
17660                    })
17661                }
17662            }
17663        }
17664    }
17665    impl<T> Clone for TeamServiceServer<T> {
17666        fn clone(&self) -> Self {
17667            let inner = self.inner.clone();
17668            Self {
17669                inner,
17670                accept_compression_encodings: self.accept_compression_encodings,
17671                send_compression_encodings: self.send_compression_encodings,
17672                max_decoding_message_size: self.max_decoding_message_size,
17673                max_encoding_message_size: self.max_encoding_message_size,
17674            }
17675        }
17676    }
17677    /// Generated gRPC service name
17678    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
17679    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
17680        const NAME: &'static str = SERVICE_NAME;
17681    }
17682}
17683/// Generated client implementations.
17684pub mod template_service_client {
17685    #![allow(
17686        unused_variables,
17687        dead_code,
17688        missing_docs,
17689        clippy::wildcard_imports,
17690        clippy::let_unit_value,
17691    )]
17692    use tonic::codegen::*;
17693    use tonic::codegen::http::Uri;
17694    /** Manages versioned message templates used by campaigns.
17695 Templates are append-only — updates create new versions while preserving history.
17696*/
17697    #[derive(Debug, Clone)]
17698    pub struct TemplateServiceClient<T> {
17699        inner: tonic::client::Grpc<T>,
17700    }
17701    impl TemplateServiceClient<tonic::transport::Channel> {
17702        /// Attempt to create a new client by connecting to a given endpoint.
17703        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
17704        where
17705            D: TryInto<tonic::transport::Endpoint>,
17706            D::Error: Into<StdError>,
17707        {
17708            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
17709            Ok(Self::new(conn))
17710        }
17711    }
17712    impl<T> TemplateServiceClient<T>
17713    where
17714        T: tonic::client::GrpcService<tonic::body::Body>,
17715        T::Error: Into<StdError>,
17716        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
17717        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
17718    {
17719        pub fn new(inner: T) -> Self {
17720            let inner = tonic::client::Grpc::new(inner);
17721            Self { inner }
17722        }
17723        pub fn with_origin(inner: T, origin: Uri) -> Self {
17724            let inner = tonic::client::Grpc::with_origin(inner, origin);
17725            Self { inner }
17726        }
17727        pub fn with_interceptor<F>(
17728            inner: T,
17729            interceptor: F,
17730        ) -> TemplateServiceClient<InterceptedService<T, F>>
17731        where
17732            F: tonic::service::Interceptor,
17733            T::ResponseBody: Default,
17734            T: tonic::codegen::Service<
17735                http::Request<tonic::body::Body>,
17736                Response = http::Response<
17737                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
17738                >,
17739            >,
17740            <T as tonic::codegen::Service<
17741                http::Request<tonic::body::Body>,
17742            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
17743        {
17744            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
17745        }
17746        /// Compress requests with the given encoding.
17747        ///
17748        /// This requires the server to support it otherwise it might respond with an
17749        /// error.
17750        #[must_use]
17751        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17752            self.inner = self.inner.send_compressed(encoding);
17753            self
17754        }
17755        /// Enable decompressing responses.
17756        #[must_use]
17757        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17758            self.inner = self.inner.accept_compressed(encoding);
17759            self
17760        }
17761        /// Limits the maximum size of a decoded message.
17762        ///
17763        /// Default: `4MB`
17764        #[must_use]
17765        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17766            self.inner = self.inner.max_decoding_message_size(limit);
17767            self
17768        }
17769        /// Limits the maximum size of an encoded message.
17770        ///
17771        /// Default: `usize::MAX`
17772        #[must_use]
17773        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17774            self.inner = self.inner.max_encoding_message_size(limit);
17775            self
17776        }
17777        /** Create a new template with a body and variable definitions.
17778 Authorization: Requires MANAGER+ role.
17779*/
17780        pub async fn create_template(
17781            &mut self,
17782            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
17783        ) -> std::result::Result<
17784            tonic::Response<super::CreateTemplateResponse>,
17785            tonic::Status,
17786        > {
17787            self.inner
17788                .ready()
17789                .await
17790                .map_err(|e| {
17791                    tonic::Status::unknown(
17792                        format!("Service was not ready: {}", e.into()),
17793                    )
17794                })?;
17795            let codec = tonic_prost::ProstCodec::default();
17796            let path = http::uri::PathAndQuery::from_static(
17797                "/pidgr.v1.TemplateService/CreateTemplate",
17798            );
17799            let mut req = request.into_request();
17800            req.extensions_mut()
17801                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
17802            self.inner.unary(req, path, codec).await
17803        }
17804        /** Update an existing template, creating a new version.
17805 Authorization: Requires MANAGER+ role.
17806*/
17807        pub async fn update_template(
17808            &mut self,
17809            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
17810        ) -> std::result::Result<
17811            tonic::Response<super::UpdateTemplateResponse>,
17812            tonic::Status,
17813        > {
17814            self.inner
17815                .ready()
17816                .await
17817                .map_err(|e| {
17818                    tonic::Status::unknown(
17819                        format!("Service was not ready: {}", e.into()),
17820                    )
17821                })?;
17822            let codec = tonic_prost::ProstCodec::default();
17823            let path = http::uri::PathAndQuery::from_static(
17824                "/pidgr.v1.TemplateService/UpdateTemplate",
17825            );
17826            let mut req = request.into_request();
17827            req.extensions_mut()
17828                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
17829            self.inner.unary(req, path, codec).await
17830        }
17831        /** Retrieve a specific template by ID and optional version.
17832 Authorization: Authenticated user within the organization.
17833*/
17834        pub async fn get_template(
17835            &mut self,
17836            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
17837        ) -> std::result::Result<
17838            tonic::Response<super::GetTemplateResponse>,
17839            tonic::Status,
17840        > {
17841            self.inner
17842                .ready()
17843                .await
17844                .map_err(|e| {
17845                    tonic::Status::unknown(
17846                        format!("Service was not ready: {}", e.into()),
17847                    )
17848                })?;
17849            let codec = tonic_prost::ProstCodec::default();
17850            let path = http::uri::PathAndQuery::from_static(
17851                "/pidgr.v1.TemplateService/GetTemplate",
17852            );
17853            let mut req = request.into_request();
17854            req.extensions_mut()
17855                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
17856            self.inner.unary(req, path, codec).await
17857        }
17858        /** List all templates for the organization with pagination.
17859 Authorization: Authenticated user within the organization.
17860*/
17861        pub async fn list_templates(
17862            &mut self,
17863            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
17864        ) -> std::result::Result<
17865            tonic::Response<super::ListTemplatesResponse>,
17866            tonic::Status,
17867        > {
17868            self.inner
17869                .ready()
17870                .await
17871                .map_err(|e| {
17872                    tonic::Status::unknown(
17873                        format!("Service was not ready: {}", e.into()),
17874                    )
17875                })?;
17876            let codec = tonic_prost::ProstCodec::default();
17877            let path = http::uri::PathAndQuery::from_static(
17878                "/pidgr.v1.TemplateService/ListTemplates",
17879            );
17880            let mut req = request.into_request();
17881            req.extensions_mut()
17882                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
17883            self.inner.unary(req, path, codec).await
17884        }
17885        /** Create a locale-specific translation of a template.
17886 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
17887*/
17888        pub async fn create_template_translation(
17889            &mut self,
17890            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
17891        ) -> std::result::Result<
17892            tonic::Response<super::CreateTemplateTranslationResponse>,
17893            tonic::Status,
17894        > {
17895            self.inner
17896                .ready()
17897                .await
17898                .map_err(|e| {
17899                    tonic::Status::unknown(
17900                        format!("Service was not ready: {}", e.into()),
17901                    )
17902                })?;
17903            let codec = tonic_prost::ProstCodec::default();
17904            let path = http::uri::PathAndQuery::from_static(
17905                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
17906            );
17907            let mut req = request.into_request();
17908            req.extensions_mut()
17909                .insert(
17910                    GrpcMethod::new(
17911                        "pidgr.v1.TemplateService",
17912                        "CreateTemplateTranslation",
17913                    ),
17914                );
17915            self.inner.unary(req, path, codec).await
17916        }
17917        /** Update an existing template translation.
17918 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
17919*/
17920        pub async fn update_template_translation(
17921            &mut self,
17922            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
17923        ) -> std::result::Result<
17924            tonic::Response<super::UpdateTemplateTranslationResponse>,
17925            tonic::Status,
17926        > {
17927            self.inner
17928                .ready()
17929                .await
17930                .map_err(|e| {
17931                    tonic::Status::unknown(
17932                        format!("Service was not ready: {}", e.into()),
17933                    )
17934                })?;
17935            let codec = tonic_prost::ProstCodec::default();
17936            let path = http::uri::PathAndQuery::from_static(
17937                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
17938            );
17939            let mut req = request.into_request();
17940            req.extensions_mut()
17941                .insert(
17942                    GrpcMethod::new(
17943                        "pidgr.v1.TemplateService",
17944                        "UpdateTemplateTranslation",
17945                    ),
17946                );
17947            self.inner.unary(req, path, codec).await
17948        }
17949        /** List all translations for a template version.
17950 Authorization: Requires PERMISSION_TEMPLATES_READ.
17951*/
17952        pub async fn list_template_translations(
17953            &mut self,
17954            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
17955        ) -> std::result::Result<
17956            tonic::Response<super::ListTemplateTranslationsResponse>,
17957            tonic::Status,
17958        > {
17959            self.inner
17960                .ready()
17961                .await
17962                .map_err(|e| {
17963                    tonic::Status::unknown(
17964                        format!("Service was not ready: {}", e.into()),
17965                    )
17966                })?;
17967            let codec = tonic_prost::ProstCodec::default();
17968            let path = http::uri::PathAndQuery::from_static(
17969                "/pidgr.v1.TemplateService/ListTemplateTranslations",
17970            );
17971            let mut req = request.into_request();
17972            req.extensions_mut()
17973                .insert(
17974                    GrpcMethod::new(
17975                        "pidgr.v1.TemplateService",
17976                        "ListTemplateTranslations",
17977                    ),
17978                );
17979            self.inner.unary(req, path, codec).await
17980        }
17981        /** Approve a template translation for use in campaigns.
17982 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
17983*/
17984        pub async fn approve_template_translation(
17985            &mut self,
17986            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
17987        ) -> std::result::Result<
17988            tonic::Response<super::ApproveTemplateTranslationResponse>,
17989            tonic::Status,
17990        > {
17991            self.inner
17992                .ready()
17993                .await
17994                .map_err(|e| {
17995                    tonic::Status::unknown(
17996                        format!("Service was not ready: {}", e.into()),
17997                    )
17998                })?;
17999            let codec = tonic_prost::ProstCodec::default();
18000            let path = http::uri::PathAndQuery::from_static(
18001                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
18002            );
18003            let mut req = request.into_request();
18004            req.extensions_mut()
18005                .insert(
18006                    GrpcMethod::new(
18007                        "pidgr.v1.TemplateService",
18008                        "ApproveTemplateTranslation",
18009                    ),
18010                );
18011            self.inner.unary(req, path, codec).await
18012        }
18013    }
18014}
18015/// Generated server implementations.
18016pub mod template_service_server {
18017    #![allow(
18018        unused_variables,
18019        dead_code,
18020        missing_docs,
18021        clippy::wildcard_imports,
18022        clippy::let_unit_value,
18023    )]
18024    use tonic::codegen::*;
18025    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
18026    #[async_trait]
18027    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
18028        /** Create a new template with a body and variable definitions.
18029 Authorization: Requires MANAGER+ role.
18030*/
18031        async fn create_template(
18032            &self,
18033            request: tonic::Request<super::CreateTemplateRequest>,
18034        ) -> std::result::Result<
18035            tonic::Response<super::CreateTemplateResponse>,
18036            tonic::Status,
18037        >;
18038        /** Update an existing template, creating a new version.
18039 Authorization: Requires MANAGER+ role.
18040*/
18041        async fn update_template(
18042            &self,
18043            request: tonic::Request<super::UpdateTemplateRequest>,
18044        ) -> std::result::Result<
18045            tonic::Response<super::UpdateTemplateResponse>,
18046            tonic::Status,
18047        >;
18048        /** Retrieve a specific template by ID and optional version.
18049 Authorization: Authenticated user within the organization.
18050*/
18051        async fn get_template(
18052            &self,
18053            request: tonic::Request<super::GetTemplateRequest>,
18054        ) -> std::result::Result<
18055            tonic::Response<super::GetTemplateResponse>,
18056            tonic::Status,
18057        >;
18058        /** List all templates for the organization with pagination.
18059 Authorization: Authenticated user within the organization.
18060*/
18061        async fn list_templates(
18062            &self,
18063            request: tonic::Request<super::ListTemplatesRequest>,
18064        ) -> std::result::Result<
18065            tonic::Response<super::ListTemplatesResponse>,
18066            tonic::Status,
18067        >;
18068        /** Create a locale-specific translation of a template.
18069 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
18070*/
18071        async fn create_template_translation(
18072            &self,
18073            request: tonic::Request<super::CreateTemplateTranslationRequest>,
18074        ) -> std::result::Result<
18075            tonic::Response<super::CreateTemplateTranslationResponse>,
18076            tonic::Status,
18077        >;
18078        /** Update an existing template translation.
18079 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
18080*/
18081        async fn update_template_translation(
18082            &self,
18083            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
18084        ) -> std::result::Result<
18085            tonic::Response<super::UpdateTemplateTranslationResponse>,
18086            tonic::Status,
18087        >;
18088        /** List all translations for a template version.
18089 Authorization: Requires PERMISSION_TEMPLATES_READ.
18090*/
18091        async fn list_template_translations(
18092            &self,
18093            request: tonic::Request<super::ListTemplateTranslationsRequest>,
18094        ) -> std::result::Result<
18095            tonic::Response<super::ListTemplateTranslationsResponse>,
18096            tonic::Status,
18097        >;
18098        /** Approve a template translation for use in campaigns.
18099 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
18100*/
18101        async fn approve_template_translation(
18102            &self,
18103            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
18104        ) -> std::result::Result<
18105            tonic::Response<super::ApproveTemplateTranslationResponse>,
18106            tonic::Status,
18107        >;
18108    }
18109    /** Manages versioned message templates used by campaigns.
18110 Templates are append-only — updates create new versions while preserving history.
18111*/
18112    #[derive(Debug)]
18113    pub struct TemplateServiceServer<T> {
18114        inner: Arc<T>,
18115        accept_compression_encodings: EnabledCompressionEncodings,
18116        send_compression_encodings: EnabledCompressionEncodings,
18117        max_decoding_message_size: Option<usize>,
18118        max_encoding_message_size: Option<usize>,
18119    }
18120    impl<T> TemplateServiceServer<T> {
18121        pub fn new(inner: T) -> Self {
18122            Self::from_arc(Arc::new(inner))
18123        }
18124        pub fn from_arc(inner: Arc<T>) -> Self {
18125            Self {
18126                inner,
18127                accept_compression_encodings: Default::default(),
18128                send_compression_encodings: Default::default(),
18129                max_decoding_message_size: None,
18130                max_encoding_message_size: None,
18131            }
18132        }
18133        pub fn with_interceptor<F>(
18134            inner: T,
18135            interceptor: F,
18136        ) -> InterceptedService<Self, F>
18137        where
18138            F: tonic::service::Interceptor,
18139        {
18140            InterceptedService::new(Self::new(inner), interceptor)
18141        }
18142        /// Enable decompressing requests with the given encoding.
18143        #[must_use]
18144        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
18145            self.accept_compression_encodings.enable(encoding);
18146            self
18147        }
18148        /// Compress responses with the given encoding, if the client supports it.
18149        #[must_use]
18150        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
18151            self.send_compression_encodings.enable(encoding);
18152            self
18153        }
18154        /// Limits the maximum size of a decoded message.
18155        ///
18156        /// Default: `4MB`
18157        #[must_use]
18158        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
18159            self.max_decoding_message_size = Some(limit);
18160            self
18161        }
18162        /// Limits the maximum size of an encoded message.
18163        ///
18164        /// Default: `usize::MAX`
18165        #[must_use]
18166        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
18167            self.max_encoding_message_size = Some(limit);
18168            self
18169        }
18170    }
18171    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
18172    where
18173        T: TemplateService,
18174        B: Body + std::marker::Send + 'static,
18175        B::Error: Into<StdError> + std::marker::Send + 'static,
18176    {
18177        type Response = http::Response<tonic::body::Body>;
18178        type Error = std::convert::Infallible;
18179        type Future = BoxFuture<Self::Response, Self::Error>;
18180        fn poll_ready(
18181            &mut self,
18182            _cx: &mut Context<'_>,
18183        ) -> Poll<std::result::Result<(), Self::Error>> {
18184            Poll::Ready(Ok(()))
18185        }
18186        fn call(&mut self, req: http::Request<B>) -> Self::Future {
18187            match req.uri().path() {
18188                "/pidgr.v1.TemplateService/CreateTemplate" => {
18189                    #[allow(non_camel_case_types)]
18190                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
18191                    impl<
18192                        T: TemplateService,
18193                    > tonic::server::UnaryService<super::CreateTemplateRequest>
18194                    for CreateTemplateSvc<T> {
18195                        type Response = super::CreateTemplateResponse;
18196                        type Future = BoxFuture<
18197                            tonic::Response<Self::Response>,
18198                            tonic::Status,
18199                        >;
18200                        fn call(
18201                            &mut self,
18202                            request: tonic::Request<super::CreateTemplateRequest>,
18203                        ) -> Self::Future {
18204                            let inner = Arc::clone(&self.0);
18205                            let fut = async move {
18206                                <T as TemplateService>::create_template(&inner, request)
18207                                    .await
18208                            };
18209                            Box::pin(fut)
18210                        }
18211                    }
18212                    let accept_compression_encodings = self.accept_compression_encodings;
18213                    let send_compression_encodings = self.send_compression_encodings;
18214                    let max_decoding_message_size = self.max_decoding_message_size;
18215                    let max_encoding_message_size = self.max_encoding_message_size;
18216                    let inner = self.inner.clone();
18217                    let fut = async move {
18218                        let method = CreateTemplateSvc(inner);
18219                        let codec = tonic_prost::ProstCodec::default();
18220                        let mut grpc = tonic::server::Grpc::new(codec)
18221                            .apply_compression_config(
18222                                accept_compression_encodings,
18223                                send_compression_encodings,
18224                            )
18225                            .apply_max_message_size_config(
18226                                max_decoding_message_size,
18227                                max_encoding_message_size,
18228                            );
18229                        let res = grpc.unary(method, req).await;
18230                        Ok(res)
18231                    };
18232                    Box::pin(fut)
18233                }
18234                "/pidgr.v1.TemplateService/UpdateTemplate" => {
18235                    #[allow(non_camel_case_types)]
18236                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
18237                    impl<
18238                        T: TemplateService,
18239                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
18240                    for UpdateTemplateSvc<T> {
18241                        type Response = super::UpdateTemplateResponse;
18242                        type Future = BoxFuture<
18243                            tonic::Response<Self::Response>,
18244                            tonic::Status,
18245                        >;
18246                        fn call(
18247                            &mut self,
18248                            request: tonic::Request<super::UpdateTemplateRequest>,
18249                        ) -> Self::Future {
18250                            let inner = Arc::clone(&self.0);
18251                            let fut = async move {
18252                                <T as TemplateService>::update_template(&inner, request)
18253                                    .await
18254                            };
18255                            Box::pin(fut)
18256                        }
18257                    }
18258                    let accept_compression_encodings = self.accept_compression_encodings;
18259                    let send_compression_encodings = self.send_compression_encodings;
18260                    let max_decoding_message_size = self.max_decoding_message_size;
18261                    let max_encoding_message_size = self.max_encoding_message_size;
18262                    let inner = self.inner.clone();
18263                    let fut = async move {
18264                        let method = UpdateTemplateSvc(inner);
18265                        let codec = tonic_prost::ProstCodec::default();
18266                        let mut grpc = tonic::server::Grpc::new(codec)
18267                            .apply_compression_config(
18268                                accept_compression_encodings,
18269                                send_compression_encodings,
18270                            )
18271                            .apply_max_message_size_config(
18272                                max_decoding_message_size,
18273                                max_encoding_message_size,
18274                            );
18275                        let res = grpc.unary(method, req).await;
18276                        Ok(res)
18277                    };
18278                    Box::pin(fut)
18279                }
18280                "/pidgr.v1.TemplateService/GetTemplate" => {
18281                    #[allow(non_camel_case_types)]
18282                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
18283                    impl<
18284                        T: TemplateService,
18285                    > tonic::server::UnaryService<super::GetTemplateRequest>
18286                    for GetTemplateSvc<T> {
18287                        type Response = super::GetTemplateResponse;
18288                        type Future = BoxFuture<
18289                            tonic::Response<Self::Response>,
18290                            tonic::Status,
18291                        >;
18292                        fn call(
18293                            &mut self,
18294                            request: tonic::Request<super::GetTemplateRequest>,
18295                        ) -> Self::Future {
18296                            let inner = Arc::clone(&self.0);
18297                            let fut = async move {
18298                                <T as TemplateService>::get_template(&inner, request).await
18299                            };
18300                            Box::pin(fut)
18301                        }
18302                    }
18303                    let accept_compression_encodings = self.accept_compression_encodings;
18304                    let send_compression_encodings = self.send_compression_encodings;
18305                    let max_decoding_message_size = self.max_decoding_message_size;
18306                    let max_encoding_message_size = self.max_encoding_message_size;
18307                    let inner = self.inner.clone();
18308                    let fut = async move {
18309                        let method = GetTemplateSvc(inner);
18310                        let codec = tonic_prost::ProstCodec::default();
18311                        let mut grpc = tonic::server::Grpc::new(codec)
18312                            .apply_compression_config(
18313                                accept_compression_encodings,
18314                                send_compression_encodings,
18315                            )
18316                            .apply_max_message_size_config(
18317                                max_decoding_message_size,
18318                                max_encoding_message_size,
18319                            );
18320                        let res = grpc.unary(method, req).await;
18321                        Ok(res)
18322                    };
18323                    Box::pin(fut)
18324                }
18325                "/pidgr.v1.TemplateService/ListTemplates" => {
18326                    #[allow(non_camel_case_types)]
18327                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
18328                    impl<
18329                        T: TemplateService,
18330                    > tonic::server::UnaryService<super::ListTemplatesRequest>
18331                    for ListTemplatesSvc<T> {
18332                        type Response = super::ListTemplatesResponse;
18333                        type Future = BoxFuture<
18334                            tonic::Response<Self::Response>,
18335                            tonic::Status,
18336                        >;
18337                        fn call(
18338                            &mut self,
18339                            request: tonic::Request<super::ListTemplatesRequest>,
18340                        ) -> Self::Future {
18341                            let inner = Arc::clone(&self.0);
18342                            let fut = async move {
18343                                <T as TemplateService>::list_templates(&inner, request)
18344                                    .await
18345                            };
18346                            Box::pin(fut)
18347                        }
18348                    }
18349                    let accept_compression_encodings = self.accept_compression_encodings;
18350                    let send_compression_encodings = self.send_compression_encodings;
18351                    let max_decoding_message_size = self.max_decoding_message_size;
18352                    let max_encoding_message_size = self.max_encoding_message_size;
18353                    let inner = self.inner.clone();
18354                    let fut = async move {
18355                        let method = ListTemplatesSvc(inner);
18356                        let codec = tonic_prost::ProstCodec::default();
18357                        let mut grpc = tonic::server::Grpc::new(codec)
18358                            .apply_compression_config(
18359                                accept_compression_encodings,
18360                                send_compression_encodings,
18361                            )
18362                            .apply_max_message_size_config(
18363                                max_decoding_message_size,
18364                                max_encoding_message_size,
18365                            );
18366                        let res = grpc.unary(method, req).await;
18367                        Ok(res)
18368                    };
18369                    Box::pin(fut)
18370                }
18371                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
18372                    #[allow(non_camel_case_types)]
18373                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
18374                    impl<
18375                        T: TemplateService,
18376                    > tonic::server::UnaryService<
18377                        super::CreateTemplateTranslationRequest,
18378                    > for CreateTemplateTranslationSvc<T> {
18379                        type Response = super::CreateTemplateTranslationResponse;
18380                        type Future = BoxFuture<
18381                            tonic::Response<Self::Response>,
18382                            tonic::Status,
18383                        >;
18384                        fn call(
18385                            &mut self,
18386                            request: tonic::Request<
18387                                super::CreateTemplateTranslationRequest,
18388                            >,
18389                        ) -> Self::Future {
18390                            let inner = Arc::clone(&self.0);
18391                            let fut = async move {
18392                                <T as TemplateService>::create_template_translation(
18393                                        &inner,
18394                                        request,
18395                                    )
18396                                    .await
18397                            };
18398                            Box::pin(fut)
18399                        }
18400                    }
18401                    let accept_compression_encodings = self.accept_compression_encodings;
18402                    let send_compression_encodings = self.send_compression_encodings;
18403                    let max_decoding_message_size = self.max_decoding_message_size;
18404                    let max_encoding_message_size = self.max_encoding_message_size;
18405                    let inner = self.inner.clone();
18406                    let fut = async move {
18407                        let method = CreateTemplateTranslationSvc(inner);
18408                        let codec = tonic_prost::ProstCodec::default();
18409                        let mut grpc = tonic::server::Grpc::new(codec)
18410                            .apply_compression_config(
18411                                accept_compression_encodings,
18412                                send_compression_encodings,
18413                            )
18414                            .apply_max_message_size_config(
18415                                max_decoding_message_size,
18416                                max_encoding_message_size,
18417                            );
18418                        let res = grpc.unary(method, req).await;
18419                        Ok(res)
18420                    };
18421                    Box::pin(fut)
18422                }
18423                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
18424                    #[allow(non_camel_case_types)]
18425                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
18426                    impl<
18427                        T: TemplateService,
18428                    > tonic::server::UnaryService<
18429                        super::UpdateTemplateTranslationRequest,
18430                    > for UpdateTemplateTranslationSvc<T> {
18431                        type Response = super::UpdateTemplateTranslationResponse;
18432                        type Future = BoxFuture<
18433                            tonic::Response<Self::Response>,
18434                            tonic::Status,
18435                        >;
18436                        fn call(
18437                            &mut self,
18438                            request: tonic::Request<
18439                                super::UpdateTemplateTranslationRequest,
18440                            >,
18441                        ) -> Self::Future {
18442                            let inner = Arc::clone(&self.0);
18443                            let fut = async move {
18444                                <T as TemplateService>::update_template_translation(
18445                                        &inner,
18446                                        request,
18447                                    )
18448                                    .await
18449                            };
18450                            Box::pin(fut)
18451                        }
18452                    }
18453                    let accept_compression_encodings = self.accept_compression_encodings;
18454                    let send_compression_encodings = self.send_compression_encodings;
18455                    let max_decoding_message_size = self.max_decoding_message_size;
18456                    let max_encoding_message_size = self.max_encoding_message_size;
18457                    let inner = self.inner.clone();
18458                    let fut = async move {
18459                        let method = UpdateTemplateTranslationSvc(inner);
18460                        let codec = tonic_prost::ProstCodec::default();
18461                        let mut grpc = tonic::server::Grpc::new(codec)
18462                            .apply_compression_config(
18463                                accept_compression_encodings,
18464                                send_compression_encodings,
18465                            )
18466                            .apply_max_message_size_config(
18467                                max_decoding_message_size,
18468                                max_encoding_message_size,
18469                            );
18470                        let res = grpc.unary(method, req).await;
18471                        Ok(res)
18472                    };
18473                    Box::pin(fut)
18474                }
18475                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
18476                    #[allow(non_camel_case_types)]
18477                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
18478                    impl<
18479                        T: TemplateService,
18480                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
18481                    for ListTemplateTranslationsSvc<T> {
18482                        type Response = super::ListTemplateTranslationsResponse;
18483                        type Future = BoxFuture<
18484                            tonic::Response<Self::Response>,
18485                            tonic::Status,
18486                        >;
18487                        fn call(
18488                            &mut self,
18489                            request: tonic::Request<
18490                                super::ListTemplateTranslationsRequest,
18491                            >,
18492                        ) -> Self::Future {
18493                            let inner = Arc::clone(&self.0);
18494                            let fut = async move {
18495                                <T as TemplateService>::list_template_translations(
18496                                        &inner,
18497                                        request,
18498                                    )
18499                                    .await
18500                            };
18501                            Box::pin(fut)
18502                        }
18503                    }
18504                    let accept_compression_encodings = self.accept_compression_encodings;
18505                    let send_compression_encodings = self.send_compression_encodings;
18506                    let max_decoding_message_size = self.max_decoding_message_size;
18507                    let max_encoding_message_size = self.max_encoding_message_size;
18508                    let inner = self.inner.clone();
18509                    let fut = async move {
18510                        let method = ListTemplateTranslationsSvc(inner);
18511                        let codec = tonic_prost::ProstCodec::default();
18512                        let mut grpc = tonic::server::Grpc::new(codec)
18513                            .apply_compression_config(
18514                                accept_compression_encodings,
18515                                send_compression_encodings,
18516                            )
18517                            .apply_max_message_size_config(
18518                                max_decoding_message_size,
18519                                max_encoding_message_size,
18520                            );
18521                        let res = grpc.unary(method, req).await;
18522                        Ok(res)
18523                    };
18524                    Box::pin(fut)
18525                }
18526                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
18527                    #[allow(non_camel_case_types)]
18528                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
18529                    impl<
18530                        T: TemplateService,
18531                    > tonic::server::UnaryService<
18532                        super::ApproveTemplateTranslationRequest,
18533                    > for ApproveTemplateTranslationSvc<T> {
18534                        type Response = super::ApproveTemplateTranslationResponse;
18535                        type Future = BoxFuture<
18536                            tonic::Response<Self::Response>,
18537                            tonic::Status,
18538                        >;
18539                        fn call(
18540                            &mut self,
18541                            request: tonic::Request<
18542                                super::ApproveTemplateTranslationRequest,
18543                            >,
18544                        ) -> Self::Future {
18545                            let inner = Arc::clone(&self.0);
18546                            let fut = async move {
18547                                <T as TemplateService>::approve_template_translation(
18548                                        &inner,
18549                                        request,
18550                                    )
18551                                    .await
18552                            };
18553                            Box::pin(fut)
18554                        }
18555                    }
18556                    let accept_compression_encodings = self.accept_compression_encodings;
18557                    let send_compression_encodings = self.send_compression_encodings;
18558                    let max_decoding_message_size = self.max_decoding_message_size;
18559                    let max_encoding_message_size = self.max_encoding_message_size;
18560                    let inner = self.inner.clone();
18561                    let fut = async move {
18562                        let method = ApproveTemplateTranslationSvc(inner);
18563                        let codec = tonic_prost::ProstCodec::default();
18564                        let mut grpc = tonic::server::Grpc::new(codec)
18565                            .apply_compression_config(
18566                                accept_compression_encodings,
18567                                send_compression_encodings,
18568                            )
18569                            .apply_max_message_size_config(
18570                                max_decoding_message_size,
18571                                max_encoding_message_size,
18572                            );
18573                        let res = grpc.unary(method, req).await;
18574                        Ok(res)
18575                    };
18576                    Box::pin(fut)
18577                }
18578                _ => {
18579                    Box::pin(async move {
18580                        let mut response = http::Response::new(
18581                            tonic::body::Body::default(),
18582                        );
18583                        let headers = response.headers_mut();
18584                        headers
18585                            .insert(
18586                                tonic::Status::GRPC_STATUS,
18587                                (tonic::Code::Unimplemented as i32).into(),
18588                            );
18589                        headers
18590                            .insert(
18591                                http::header::CONTENT_TYPE,
18592                                tonic::metadata::GRPC_CONTENT_TYPE,
18593                            );
18594                        Ok(response)
18595                    })
18596                }
18597            }
18598        }
18599    }
18600    impl<T> Clone for TemplateServiceServer<T> {
18601        fn clone(&self) -> Self {
18602            let inner = self.inner.clone();
18603            Self {
18604                inner,
18605                accept_compression_encodings: self.accept_compression_encodings,
18606                send_compression_encodings: self.send_compression_encodings,
18607                max_decoding_message_size: self.max_decoding_message_size,
18608                max_encoding_message_size: self.max_encoding_message_size,
18609            }
18610        }
18611    }
18612    /// Generated gRPC service name
18613    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
18614    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
18615        const NAME: &'static str = SERVICE_NAME;
18616    }
18617}
18618/// Generated client implementations.
18619pub mod token_service_client {
18620    #![allow(
18621        unused_variables,
18622        dead_code,
18623        missing_docs,
18624        clippy::wildcard_imports,
18625        clippy::let_unit_value,
18626    )]
18627    use tonic::codegen::*;
18628    use tonic::codegen::http::Uri;
18629    /** HMAC-signed deeplink-token signing and validation.
18630
18631 Deeplink tokens carry the (campaign, recipient, step) tuple that
18632 authorizes a third-party-channel deeplink
18633 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
18634 pidgr-api with a per-org HMAC key managed by the platform's key store;
18635 rotation is automatic with a 7-day overlap window so callers do not
18636 have to coordinate.
18637*/
18638    #[derive(Debug, Clone)]
18639    pub struct TokenServiceClient<T> {
18640        inner: tonic::client::Grpc<T>,
18641    }
18642    impl TokenServiceClient<tonic::transport::Channel> {
18643        /// Attempt to create a new client by connecting to a given endpoint.
18644        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
18645        where
18646            D: TryInto<tonic::transport::Endpoint>,
18647            D::Error: Into<StdError>,
18648        {
18649            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
18650            Ok(Self::new(conn))
18651        }
18652    }
18653    impl<T> TokenServiceClient<T>
18654    where
18655        T: tonic::client::GrpcService<tonic::body::Body>,
18656        T::Error: Into<StdError>,
18657        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
18658        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
18659    {
18660        pub fn new(inner: T) -> Self {
18661            let inner = tonic::client::Grpc::new(inner);
18662            Self { inner }
18663        }
18664        pub fn with_origin(inner: T, origin: Uri) -> Self {
18665            let inner = tonic::client::Grpc::with_origin(inner, origin);
18666            Self { inner }
18667        }
18668        pub fn with_interceptor<F>(
18669            inner: T,
18670            interceptor: F,
18671        ) -> TokenServiceClient<InterceptedService<T, F>>
18672        where
18673            F: tonic::service::Interceptor,
18674            T::ResponseBody: Default,
18675            T: tonic::codegen::Service<
18676                http::Request<tonic::body::Body>,
18677                Response = http::Response<
18678                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
18679                >,
18680            >,
18681            <T as tonic::codegen::Service<
18682                http::Request<tonic::body::Body>,
18683            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
18684        {
18685            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
18686        }
18687        /// Compress requests with the given encoding.
18688        ///
18689        /// This requires the server to support it otherwise it might respond with an
18690        /// error.
18691        #[must_use]
18692        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
18693            self.inner = self.inner.send_compressed(encoding);
18694            self
18695        }
18696        /// Enable decompressing responses.
18697        #[must_use]
18698        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
18699            self.inner = self.inner.accept_compressed(encoding);
18700            self
18701        }
18702        /// Limits the maximum size of a decoded message.
18703        ///
18704        /// Default: `4MB`
18705        #[must_use]
18706        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
18707            self.inner = self.inner.max_decoding_message_size(limit);
18708            self
18709        }
18710        /// Limits the maximum size of an encoded message.
18711        ///
18712        /// Default: `usize::MAX`
18713        #[must_use]
18714        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
18715            self.inner = self.inner.max_encoding_message_size(limit);
18716            self
18717        }
18718        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
18719 the dispatch layer assembling a deeplink during message
18720 composition).
18721*/
18722        pub async fn sign_deeplink_token(
18723            &mut self,
18724            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
18725        ) -> std::result::Result<
18726            tonic::Response<super::SignDeeplinkTokenResponse>,
18727            tonic::Status,
18728        > {
18729            self.inner
18730                .ready()
18731                .await
18732                .map_err(|e| {
18733                    tonic::Status::unknown(
18734                        format!("Service was not ready: {}", e.into()),
18735                    )
18736                })?;
18737            let codec = tonic_prost::ProstCodec::default();
18738            let path = http::uri::PathAndQuery::from_static(
18739                "/pidgr.v1.TokenService/SignDeeplinkToken",
18740            );
18741            let mut req = request.into_request();
18742            req.extensions_mut()
18743                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
18744            self.inner.unary(req, path, codec).await
18745        }
18746        /** Validate a deeplink token. Authorization: unauthenticated (caller
18747 is the native app validating before showing the auth gate). The
18748 token IS the lookup key; valid responses carry the decoded payload.
18749*/
18750        pub async fn validate_deeplink_token(
18751            &mut self,
18752            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
18753        ) -> std::result::Result<
18754            tonic::Response<super::ValidateDeeplinkTokenResponse>,
18755            tonic::Status,
18756        > {
18757            self.inner
18758                .ready()
18759                .await
18760                .map_err(|e| {
18761                    tonic::Status::unknown(
18762                        format!("Service was not ready: {}", e.into()),
18763                    )
18764                })?;
18765            let codec = tonic_prost::ProstCodec::default();
18766            let path = http::uri::PathAndQuery::from_static(
18767                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
18768            );
18769            let mut req = request.into_request();
18770            req.extensions_mut()
18771                .insert(
18772                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
18773                );
18774            self.inner.unary(req, path, codec).await
18775        }
18776    }
18777}
18778/// Generated server implementations.
18779pub mod token_service_server {
18780    #![allow(
18781        unused_variables,
18782        dead_code,
18783        missing_docs,
18784        clippy::wildcard_imports,
18785        clippy::let_unit_value,
18786    )]
18787    use tonic::codegen::*;
18788    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
18789    #[async_trait]
18790    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
18791        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
18792 the dispatch layer assembling a deeplink during message
18793 composition).
18794*/
18795        async fn sign_deeplink_token(
18796            &self,
18797            request: tonic::Request<super::SignDeeplinkTokenRequest>,
18798        ) -> std::result::Result<
18799            tonic::Response<super::SignDeeplinkTokenResponse>,
18800            tonic::Status,
18801        >;
18802        /** Validate a deeplink token. Authorization: unauthenticated (caller
18803 is the native app validating before showing the auth gate). The
18804 token IS the lookup key; valid responses carry the decoded payload.
18805*/
18806        async fn validate_deeplink_token(
18807            &self,
18808            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
18809        ) -> std::result::Result<
18810            tonic::Response<super::ValidateDeeplinkTokenResponse>,
18811            tonic::Status,
18812        >;
18813    }
18814    /** HMAC-signed deeplink-token signing and validation.
18815
18816 Deeplink tokens carry the (campaign, recipient, step) tuple that
18817 authorizes a third-party-channel deeplink
18818 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
18819 pidgr-api with a per-org HMAC key managed by the platform's key store;
18820 rotation is automatic with a 7-day overlap window so callers do not
18821 have to coordinate.
18822*/
18823    #[derive(Debug)]
18824    pub struct TokenServiceServer<T> {
18825        inner: Arc<T>,
18826        accept_compression_encodings: EnabledCompressionEncodings,
18827        send_compression_encodings: EnabledCompressionEncodings,
18828        max_decoding_message_size: Option<usize>,
18829        max_encoding_message_size: Option<usize>,
18830    }
18831    impl<T> TokenServiceServer<T> {
18832        pub fn new(inner: T) -> Self {
18833            Self::from_arc(Arc::new(inner))
18834        }
18835        pub fn from_arc(inner: Arc<T>) -> Self {
18836            Self {
18837                inner,
18838                accept_compression_encodings: Default::default(),
18839                send_compression_encodings: Default::default(),
18840                max_decoding_message_size: None,
18841                max_encoding_message_size: None,
18842            }
18843        }
18844        pub fn with_interceptor<F>(
18845            inner: T,
18846            interceptor: F,
18847        ) -> InterceptedService<Self, F>
18848        where
18849            F: tonic::service::Interceptor,
18850        {
18851            InterceptedService::new(Self::new(inner), interceptor)
18852        }
18853        /// Enable decompressing requests with the given encoding.
18854        #[must_use]
18855        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
18856            self.accept_compression_encodings.enable(encoding);
18857            self
18858        }
18859        /// Compress responses with the given encoding, if the client supports it.
18860        #[must_use]
18861        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
18862            self.send_compression_encodings.enable(encoding);
18863            self
18864        }
18865        /// Limits the maximum size of a decoded message.
18866        ///
18867        /// Default: `4MB`
18868        #[must_use]
18869        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
18870            self.max_decoding_message_size = Some(limit);
18871            self
18872        }
18873        /// Limits the maximum size of an encoded message.
18874        ///
18875        /// Default: `usize::MAX`
18876        #[must_use]
18877        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
18878            self.max_encoding_message_size = Some(limit);
18879            self
18880        }
18881    }
18882    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
18883    where
18884        T: TokenService,
18885        B: Body + std::marker::Send + 'static,
18886        B::Error: Into<StdError> + std::marker::Send + 'static,
18887    {
18888        type Response = http::Response<tonic::body::Body>;
18889        type Error = std::convert::Infallible;
18890        type Future = BoxFuture<Self::Response, Self::Error>;
18891        fn poll_ready(
18892            &mut self,
18893            _cx: &mut Context<'_>,
18894        ) -> Poll<std::result::Result<(), Self::Error>> {
18895            Poll::Ready(Ok(()))
18896        }
18897        fn call(&mut self, req: http::Request<B>) -> Self::Future {
18898            match req.uri().path() {
18899                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
18900                    #[allow(non_camel_case_types)]
18901                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
18902                    impl<
18903                        T: TokenService,
18904                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
18905                    for SignDeeplinkTokenSvc<T> {
18906                        type Response = super::SignDeeplinkTokenResponse;
18907                        type Future = BoxFuture<
18908                            tonic::Response<Self::Response>,
18909                            tonic::Status,
18910                        >;
18911                        fn call(
18912                            &mut self,
18913                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
18914                        ) -> Self::Future {
18915                            let inner = Arc::clone(&self.0);
18916                            let fut = async move {
18917                                <T as TokenService>::sign_deeplink_token(&inner, request)
18918                                    .await
18919                            };
18920                            Box::pin(fut)
18921                        }
18922                    }
18923                    let accept_compression_encodings = self.accept_compression_encodings;
18924                    let send_compression_encodings = self.send_compression_encodings;
18925                    let max_decoding_message_size = self.max_decoding_message_size;
18926                    let max_encoding_message_size = self.max_encoding_message_size;
18927                    let inner = self.inner.clone();
18928                    let fut = async move {
18929                        let method = SignDeeplinkTokenSvc(inner);
18930                        let codec = tonic_prost::ProstCodec::default();
18931                        let mut grpc = tonic::server::Grpc::new(codec)
18932                            .apply_compression_config(
18933                                accept_compression_encodings,
18934                                send_compression_encodings,
18935                            )
18936                            .apply_max_message_size_config(
18937                                max_decoding_message_size,
18938                                max_encoding_message_size,
18939                            );
18940                        let res = grpc.unary(method, req).await;
18941                        Ok(res)
18942                    };
18943                    Box::pin(fut)
18944                }
18945                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
18946                    #[allow(non_camel_case_types)]
18947                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
18948                    impl<
18949                        T: TokenService,
18950                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
18951                    for ValidateDeeplinkTokenSvc<T> {
18952                        type Response = super::ValidateDeeplinkTokenResponse;
18953                        type Future = BoxFuture<
18954                            tonic::Response<Self::Response>,
18955                            tonic::Status,
18956                        >;
18957                        fn call(
18958                            &mut self,
18959                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
18960                        ) -> Self::Future {
18961                            let inner = Arc::clone(&self.0);
18962                            let fut = async move {
18963                                <T as TokenService>::validate_deeplink_token(
18964                                        &inner,
18965                                        request,
18966                                    )
18967                                    .await
18968                            };
18969                            Box::pin(fut)
18970                        }
18971                    }
18972                    let accept_compression_encodings = self.accept_compression_encodings;
18973                    let send_compression_encodings = self.send_compression_encodings;
18974                    let max_decoding_message_size = self.max_decoding_message_size;
18975                    let max_encoding_message_size = self.max_encoding_message_size;
18976                    let inner = self.inner.clone();
18977                    let fut = async move {
18978                        let method = ValidateDeeplinkTokenSvc(inner);
18979                        let codec = tonic_prost::ProstCodec::default();
18980                        let mut grpc = tonic::server::Grpc::new(codec)
18981                            .apply_compression_config(
18982                                accept_compression_encodings,
18983                                send_compression_encodings,
18984                            )
18985                            .apply_max_message_size_config(
18986                                max_decoding_message_size,
18987                                max_encoding_message_size,
18988                            );
18989                        let res = grpc.unary(method, req).await;
18990                        Ok(res)
18991                    };
18992                    Box::pin(fut)
18993                }
18994                _ => {
18995                    Box::pin(async move {
18996                        let mut response = http::Response::new(
18997                            tonic::body::Body::default(),
18998                        );
18999                        let headers = response.headers_mut();
19000                        headers
19001                            .insert(
19002                                tonic::Status::GRPC_STATUS,
19003                                (tonic::Code::Unimplemented as i32).into(),
19004                            );
19005                        headers
19006                            .insert(
19007                                http::header::CONTENT_TYPE,
19008                                tonic::metadata::GRPC_CONTENT_TYPE,
19009                            );
19010                        Ok(response)
19011                    })
19012                }
19013            }
19014        }
19015    }
19016    impl<T> Clone for TokenServiceServer<T> {
19017        fn clone(&self) -> Self {
19018            let inner = self.inner.clone();
19019            Self {
19020                inner,
19021                accept_compression_encodings: self.accept_compression_encodings,
19022                send_compression_encodings: self.send_compression_encodings,
19023                max_decoding_message_size: self.max_decoding_message_size,
19024                max_encoding_message_size: self.max_encoding_message_size,
19025            }
19026        }
19027    }
19028    /// Generated gRPC service name
19029    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
19030    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
19031        const NAME: &'static str = SERVICE_NAME;
19032    }
19033}
19034/// Generated client implementations.
19035pub mod verification_service_client {
19036    #![allow(
19037        unused_variables,
19038        dead_code,
19039        missing_docs,
19040        clippy::wildcard_imports,
19041        clippy::let_unit_value,
19042    )]
19043    use tonic::codegen::*;
19044    use tonic::codegen::http::Uri;
19045    /** Collects evidence that the behaviour a campaign was trying to change
19046 actually changed, and records it against the indicator that describes
19047 it.
19048
19049 A campaign's own response rate says the message was received and
19050 understood. It cannot say the work changed, because the same people
19051 produce both signals. Verification asks somebody else — one question
19052 per organizational unit, some days later — and stores the answer as a
19053 reading of an indicator rather than as a standalone survey result.
19054
19055 Readings are written by the platform from campaign outcomes, never by
19056 a caller: an endpoint that let a client assert an outcome would defeat
19057 the one property that makes verification worth collecting, which is
19058 that the reporter is not the subject. Hand-entered readings for
19059 indicators whose evidence source is manual are deliberately out of
19060 scope here and will arrive with that adapter, which needs its own
19061 provenance and its own authorization.
19062
19063 All RPCs operate within the caller's org (extracted from JWT).
19064*/
19065    #[derive(Debug, Clone)]
19066    pub struct VerificationServiceClient<T> {
19067        inner: tonic::client::Grpc<T>,
19068    }
19069    impl VerificationServiceClient<tonic::transport::Channel> {
19070        /// Attempt to create a new client by connecting to a given endpoint.
19071        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
19072        where
19073            D: TryInto<tonic::transport::Endpoint>,
19074            D::Error: Into<StdError>,
19075        {
19076            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
19077            Ok(Self::new(conn))
19078        }
19079    }
19080    impl<T> VerificationServiceClient<T>
19081    where
19082        T: tonic::client::GrpcService<tonic::body::Body>,
19083        T::Error: Into<StdError>,
19084        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
19085        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
19086    {
19087        pub fn new(inner: T) -> Self {
19088            let inner = tonic::client::Grpc::new(inner);
19089            Self { inner }
19090        }
19091        pub fn with_origin(inner: T, origin: Uri) -> Self {
19092            let inner = tonic::client::Grpc::with_origin(inner, origin);
19093            Self { inner }
19094        }
19095        pub fn with_interceptor<F>(
19096            inner: T,
19097            interceptor: F,
19098        ) -> VerificationServiceClient<InterceptedService<T, F>>
19099        where
19100            F: tonic::service::Interceptor,
19101            T::ResponseBody: Default,
19102            T: tonic::codegen::Service<
19103                http::Request<tonic::body::Body>,
19104                Response = http::Response<
19105                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
19106                >,
19107            >,
19108            <T as tonic::codegen::Service<
19109                http::Request<tonic::body::Body>,
19110            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
19111        {
19112            VerificationServiceClient::new(InterceptedService::new(inner, interceptor))
19113        }
19114        /// Compress requests with the given encoding.
19115        ///
19116        /// This requires the server to support it otherwise it might respond with an
19117        /// error.
19118        #[must_use]
19119        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
19120            self.inner = self.inner.send_compressed(encoding);
19121            self
19122        }
19123        /// Enable decompressing responses.
19124        #[must_use]
19125        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
19126            self.inner = self.inner.accept_compressed(encoding);
19127            self
19128        }
19129        /// Limits the maximum size of a decoded message.
19130        ///
19131        /// Default: `4MB`
19132        #[must_use]
19133        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
19134            self.inner = self.inner.max_decoding_message_size(limit);
19135            self
19136        }
19137        /// Limits the maximum size of an encoded message.
19138        ///
19139        /// Default: `usize::MAX`
19140        #[must_use]
19141        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
19142            self.inner = self.inner.max_encoding_message_size(limit);
19143            self
19144        }
19145        /** Schedule a verification run for a campaign and one of the
19146 indicators it should move. Returns FAILED_PRECONDITION when the
19147 indicator's evidence source is not the verification-campaign kind,
19148 and when the derivation resolves to no verifier at all — a run with
19149 nobody to ask can only ever end without evidence, and saying so at
19150 configuration time is more useful than saying it weeks later.
19151 Authorization: Requires PERMISSION_CAMPAIGNS_START.
19152*/
19153        pub async fn start_verification_run(
19154            &mut self,
19155            request: impl tonic::IntoRequest<super::StartVerificationRunRequest>,
19156        ) -> std::result::Result<
19157            tonic::Response<super::StartVerificationRunResponse>,
19158            tonic::Status,
19159        > {
19160            self.inner
19161                .ready()
19162                .await
19163                .map_err(|e| {
19164                    tonic::Status::unknown(
19165                        format!("Service was not ready: {}", e.into()),
19166                    )
19167                })?;
19168            let codec = tonic_prost::ProstCodec::default();
19169            let path = http::uri::PathAndQuery::from_static(
19170                "/pidgr.v1.VerificationService/StartVerificationRun",
19171            );
19172            let mut req = request.into_request();
19173            req.extensions_mut()
19174                .insert(
19175                    GrpcMethod::new(
19176                        "pidgr.v1.VerificationService",
19177                        "StartVerificationRun",
19178                    ),
19179                );
19180            self.inner.unary(req, path, codec).await
19181        }
19182        /** Retrieve one verification run together with the reading it
19183 produced, if any.
19184 Authorization: Requires PERMISSION_ORG_READ.
19185*/
19186        pub async fn get_verification_run(
19187            &mut self,
19188            request: impl tonic::IntoRequest<super::GetVerificationRunRequest>,
19189        ) -> std::result::Result<
19190            tonic::Response<super::GetVerificationRunResponse>,
19191            tonic::Status,
19192        > {
19193            self.inner
19194                .ready()
19195                .await
19196                .map_err(|e| {
19197                    tonic::Status::unknown(
19198                        format!("Service was not ready: {}", e.into()),
19199                    )
19200                })?;
19201            let codec = tonic_prost::ProstCodec::default();
19202            let path = http::uri::PathAndQuery::from_static(
19203                "/pidgr.v1.VerificationService/GetVerificationRun",
19204            );
19205            let mut req = request.into_request();
19206            req.extensions_mut()
19207                .insert(
19208                    GrpcMethod::new("pidgr.v1.VerificationService", "GetVerificationRun"),
19209                );
19210            self.inner.unary(req, path, codec).await
19211        }
19212        /** List verification runs for one objective, one indicator or one
19213 campaign.
19214 Authorization: Requires PERMISSION_ORG_READ.
19215*/
19216        pub async fn list_verification_runs(
19217            &mut self,
19218            request: impl tonic::IntoRequest<super::ListVerificationRunsRequest>,
19219        ) -> std::result::Result<
19220            tonic::Response<super::ListVerificationRunsResponse>,
19221            tonic::Status,
19222        > {
19223            self.inner
19224                .ready()
19225                .await
19226                .map_err(|e| {
19227                    tonic::Status::unknown(
19228                        format!("Service was not ready: {}", e.into()),
19229                    )
19230                })?;
19231            let codec = tonic_prost::ProstCodec::default();
19232            let path = http::uri::PathAndQuery::from_static(
19233                "/pidgr.v1.VerificationService/ListVerificationRuns",
19234            );
19235            let mut req = request.into_request();
19236            req.extensions_mut()
19237                .insert(
19238                    GrpcMethod::new(
19239                        "pidgr.v1.VerificationService",
19240                        "ListVerificationRuns",
19241                    ),
19242                );
19243            self.inner.unary(req, path, codec).await
19244        }
19245        /** List the readings recorded against one indicator, whatever produced
19246 them.
19247 Authorization: Requires PERMISSION_ORG_READ.
19248*/
19249        pub async fn list_indicator_readings(
19250            &mut self,
19251            request: impl tonic::IntoRequest<super::ListIndicatorReadingsRequest>,
19252        ) -> std::result::Result<
19253            tonic::Response<super::ListIndicatorReadingsResponse>,
19254            tonic::Status,
19255        > {
19256            self.inner
19257                .ready()
19258                .await
19259                .map_err(|e| {
19260                    tonic::Status::unknown(
19261                        format!("Service was not ready: {}", e.into()),
19262                    )
19263                })?;
19264            let codec = tonic_prost::ProstCodec::default();
19265            let path = http::uri::PathAndQuery::from_static(
19266                "/pidgr.v1.VerificationService/ListIndicatorReadings",
19267            );
19268            let mut req = request.into_request();
19269            req.extensions_mut()
19270                .insert(
19271                    GrpcMethod::new(
19272                        "pidgr.v1.VerificationService",
19273                        "ListIndicatorReadings",
19274                    ),
19275                );
19276            self.inner.unary(req, path, codec).await
19277        }
19278    }
19279}
19280/// Generated server implementations.
19281pub mod verification_service_server {
19282    #![allow(
19283        unused_variables,
19284        dead_code,
19285        missing_docs,
19286        clippy::wildcard_imports,
19287        clippy::let_unit_value,
19288    )]
19289    use tonic::codegen::*;
19290    /// Generated trait containing gRPC methods that should be implemented for use with VerificationServiceServer.
19291    #[async_trait]
19292    pub trait VerificationService: std::marker::Send + std::marker::Sync + 'static {
19293        /** Schedule a verification run for a campaign and one of the
19294 indicators it should move. Returns FAILED_PRECONDITION when the
19295 indicator's evidence source is not the verification-campaign kind,
19296 and when the derivation resolves to no verifier at all — a run with
19297 nobody to ask can only ever end without evidence, and saying so at
19298 configuration time is more useful than saying it weeks later.
19299 Authorization: Requires PERMISSION_CAMPAIGNS_START.
19300*/
19301        async fn start_verification_run(
19302            &self,
19303            request: tonic::Request<super::StartVerificationRunRequest>,
19304        ) -> std::result::Result<
19305            tonic::Response<super::StartVerificationRunResponse>,
19306            tonic::Status,
19307        >;
19308        /** Retrieve one verification run together with the reading it
19309 produced, if any.
19310 Authorization: Requires PERMISSION_ORG_READ.
19311*/
19312        async fn get_verification_run(
19313            &self,
19314            request: tonic::Request<super::GetVerificationRunRequest>,
19315        ) -> std::result::Result<
19316            tonic::Response<super::GetVerificationRunResponse>,
19317            tonic::Status,
19318        >;
19319        /** List verification runs for one objective, one indicator or one
19320 campaign.
19321 Authorization: Requires PERMISSION_ORG_READ.
19322*/
19323        async fn list_verification_runs(
19324            &self,
19325            request: tonic::Request<super::ListVerificationRunsRequest>,
19326        ) -> std::result::Result<
19327            tonic::Response<super::ListVerificationRunsResponse>,
19328            tonic::Status,
19329        >;
19330        /** List the readings recorded against one indicator, whatever produced
19331 them.
19332 Authorization: Requires PERMISSION_ORG_READ.
19333*/
19334        async fn list_indicator_readings(
19335            &self,
19336            request: tonic::Request<super::ListIndicatorReadingsRequest>,
19337        ) -> std::result::Result<
19338            tonic::Response<super::ListIndicatorReadingsResponse>,
19339            tonic::Status,
19340        >;
19341    }
19342    /** Collects evidence that the behaviour a campaign was trying to change
19343 actually changed, and records it against the indicator that describes
19344 it.
19345
19346 A campaign's own response rate says the message was received and
19347 understood. It cannot say the work changed, because the same people
19348 produce both signals. Verification asks somebody else — one question
19349 per organizational unit, some days later — and stores the answer as a
19350 reading of an indicator rather than as a standalone survey result.
19351
19352 Readings are written by the platform from campaign outcomes, never by
19353 a caller: an endpoint that let a client assert an outcome would defeat
19354 the one property that makes verification worth collecting, which is
19355 that the reporter is not the subject. Hand-entered readings for
19356 indicators whose evidence source is manual are deliberately out of
19357 scope here and will arrive with that adapter, which needs its own
19358 provenance and its own authorization.
19359
19360 All RPCs operate within the caller's org (extracted from JWT).
19361*/
19362    #[derive(Debug)]
19363    pub struct VerificationServiceServer<T> {
19364        inner: Arc<T>,
19365        accept_compression_encodings: EnabledCompressionEncodings,
19366        send_compression_encodings: EnabledCompressionEncodings,
19367        max_decoding_message_size: Option<usize>,
19368        max_encoding_message_size: Option<usize>,
19369    }
19370    impl<T> VerificationServiceServer<T> {
19371        pub fn new(inner: T) -> Self {
19372            Self::from_arc(Arc::new(inner))
19373        }
19374        pub fn from_arc(inner: Arc<T>) -> Self {
19375            Self {
19376                inner,
19377                accept_compression_encodings: Default::default(),
19378                send_compression_encodings: Default::default(),
19379                max_decoding_message_size: None,
19380                max_encoding_message_size: None,
19381            }
19382        }
19383        pub fn with_interceptor<F>(
19384            inner: T,
19385            interceptor: F,
19386        ) -> InterceptedService<Self, F>
19387        where
19388            F: tonic::service::Interceptor,
19389        {
19390            InterceptedService::new(Self::new(inner), interceptor)
19391        }
19392        /// Enable decompressing requests with the given encoding.
19393        #[must_use]
19394        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
19395            self.accept_compression_encodings.enable(encoding);
19396            self
19397        }
19398        /// Compress responses with the given encoding, if the client supports it.
19399        #[must_use]
19400        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
19401            self.send_compression_encodings.enable(encoding);
19402            self
19403        }
19404        /// Limits the maximum size of a decoded message.
19405        ///
19406        /// Default: `4MB`
19407        #[must_use]
19408        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
19409            self.max_decoding_message_size = Some(limit);
19410            self
19411        }
19412        /// Limits the maximum size of an encoded message.
19413        ///
19414        /// Default: `usize::MAX`
19415        #[must_use]
19416        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
19417            self.max_encoding_message_size = Some(limit);
19418            self
19419        }
19420    }
19421    impl<T, B> tonic::codegen::Service<http::Request<B>> for VerificationServiceServer<T>
19422    where
19423        T: VerificationService,
19424        B: Body + std::marker::Send + 'static,
19425        B::Error: Into<StdError> + std::marker::Send + 'static,
19426    {
19427        type Response = http::Response<tonic::body::Body>;
19428        type Error = std::convert::Infallible;
19429        type Future = BoxFuture<Self::Response, Self::Error>;
19430        fn poll_ready(
19431            &mut self,
19432            _cx: &mut Context<'_>,
19433        ) -> Poll<std::result::Result<(), Self::Error>> {
19434            Poll::Ready(Ok(()))
19435        }
19436        fn call(&mut self, req: http::Request<B>) -> Self::Future {
19437            match req.uri().path() {
19438                "/pidgr.v1.VerificationService/StartVerificationRun" => {
19439                    #[allow(non_camel_case_types)]
19440                    struct StartVerificationRunSvc<T: VerificationService>(pub Arc<T>);
19441                    impl<
19442                        T: VerificationService,
19443                    > tonic::server::UnaryService<super::StartVerificationRunRequest>
19444                    for StartVerificationRunSvc<T> {
19445                        type Response = super::StartVerificationRunResponse;
19446                        type Future = BoxFuture<
19447                            tonic::Response<Self::Response>,
19448                            tonic::Status,
19449                        >;
19450                        fn call(
19451                            &mut self,
19452                            request: tonic::Request<super::StartVerificationRunRequest>,
19453                        ) -> Self::Future {
19454                            let inner = Arc::clone(&self.0);
19455                            let fut = async move {
19456                                <T as VerificationService>::start_verification_run(
19457                                        &inner,
19458                                        request,
19459                                    )
19460                                    .await
19461                            };
19462                            Box::pin(fut)
19463                        }
19464                    }
19465                    let accept_compression_encodings = self.accept_compression_encodings;
19466                    let send_compression_encodings = self.send_compression_encodings;
19467                    let max_decoding_message_size = self.max_decoding_message_size;
19468                    let max_encoding_message_size = self.max_encoding_message_size;
19469                    let inner = self.inner.clone();
19470                    let fut = async move {
19471                        let method = StartVerificationRunSvc(inner);
19472                        let codec = tonic_prost::ProstCodec::default();
19473                        let mut grpc = tonic::server::Grpc::new(codec)
19474                            .apply_compression_config(
19475                                accept_compression_encodings,
19476                                send_compression_encodings,
19477                            )
19478                            .apply_max_message_size_config(
19479                                max_decoding_message_size,
19480                                max_encoding_message_size,
19481                            );
19482                        let res = grpc.unary(method, req).await;
19483                        Ok(res)
19484                    };
19485                    Box::pin(fut)
19486                }
19487                "/pidgr.v1.VerificationService/GetVerificationRun" => {
19488                    #[allow(non_camel_case_types)]
19489                    struct GetVerificationRunSvc<T: VerificationService>(pub Arc<T>);
19490                    impl<
19491                        T: VerificationService,
19492                    > tonic::server::UnaryService<super::GetVerificationRunRequest>
19493                    for GetVerificationRunSvc<T> {
19494                        type Response = super::GetVerificationRunResponse;
19495                        type Future = BoxFuture<
19496                            tonic::Response<Self::Response>,
19497                            tonic::Status,
19498                        >;
19499                        fn call(
19500                            &mut self,
19501                            request: tonic::Request<super::GetVerificationRunRequest>,
19502                        ) -> Self::Future {
19503                            let inner = Arc::clone(&self.0);
19504                            let fut = async move {
19505                                <T as VerificationService>::get_verification_run(
19506                                        &inner,
19507                                        request,
19508                                    )
19509                                    .await
19510                            };
19511                            Box::pin(fut)
19512                        }
19513                    }
19514                    let accept_compression_encodings = self.accept_compression_encodings;
19515                    let send_compression_encodings = self.send_compression_encodings;
19516                    let max_decoding_message_size = self.max_decoding_message_size;
19517                    let max_encoding_message_size = self.max_encoding_message_size;
19518                    let inner = self.inner.clone();
19519                    let fut = async move {
19520                        let method = GetVerificationRunSvc(inner);
19521                        let codec = tonic_prost::ProstCodec::default();
19522                        let mut grpc = tonic::server::Grpc::new(codec)
19523                            .apply_compression_config(
19524                                accept_compression_encodings,
19525                                send_compression_encodings,
19526                            )
19527                            .apply_max_message_size_config(
19528                                max_decoding_message_size,
19529                                max_encoding_message_size,
19530                            );
19531                        let res = grpc.unary(method, req).await;
19532                        Ok(res)
19533                    };
19534                    Box::pin(fut)
19535                }
19536                "/pidgr.v1.VerificationService/ListVerificationRuns" => {
19537                    #[allow(non_camel_case_types)]
19538                    struct ListVerificationRunsSvc<T: VerificationService>(pub Arc<T>);
19539                    impl<
19540                        T: VerificationService,
19541                    > tonic::server::UnaryService<super::ListVerificationRunsRequest>
19542                    for ListVerificationRunsSvc<T> {
19543                        type Response = super::ListVerificationRunsResponse;
19544                        type Future = BoxFuture<
19545                            tonic::Response<Self::Response>,
19546                            tonic::Status,
19547                        >;
19548                        fn call(
19549                            &mut self,
19550                            request: tonic::Request<super::ListVerificationRunsRequest>,
19551                        ) -> Self::Future {
19552                            let inner = Arc::clone(&self.0);
19553                            let fut = async move {
19554                                <T as VerificationService>::list_verification_runs(
19555                                        &inner,
19556                                        request,
19557                                    )
19558                                    .await
19559                            };
19560                            Box::pin(fut)
19561                        }
19562                    }
19563                    let accept_compression_encodings = self.accept_compression_encodings;
19564                    let send_compression_encodings = self.send_compression_encodings;
19565                    let max_decoding_message_size = self.max_decoding_message_size;
19566                    let max_encoding_message_size = self.max_encoding_message_size;
19567                    let inner = self.inner.clone();
19568                    let fut = async move {
19569                        let method = ListVerificationRunsSvc(inner);
19570                        let codec = tonic_prost::ProstCodec::default();
19571                        let mut grpc = tonic::server::Grpc::new(codec)
19572                            .apply_compression_config(
19573                                accept_compression_encodings,
19574                                send_compression_encodings,
19575                            )
19576                            .apply_max_message_size_config(
19577                                max_decoding_message_size,
19578                                max_encoding_message_size,
19579                            );
19580                        let res = grpc.unary(method, req).await;
19581                        Ok(res)
19582                    };
19583                    Box::pin(fut)
19584                }
19585                "/pidgr.v1.VerificationService/ListIndicatorReadings" => {
19586                    #[allow(non_camel_case_types)]
19587                    struct ListIndicatorReadingsSvc<T: VerificationService>(pub Arc<T>);
19588                    impl<
19589                        T: VerificationService,
19590                    > tonic::server::UnaryService<super::ListIndicatorReadingsRequest>
19591                    for ListIndicatorReadingsSvc<T> {
19592                        type Response = super::ListIndicatorReadingsResponse;
19593                        type Future = BoxFuture<
19594                            tonic::Response<Self::Response>,
19595                            tonic::Status,
19596                        >;
19597                        fn call(
19598                            &mut self,
19599                            request: tonic::Request<super::ListIndicatorReadingsRequest>,
19600                        ) -> Self::Future {
19601                            let inner = Arc::clone(&self.0);
19602                            let fut = async move {
19603                                <T as VerificationService>::list_indicator_readings(
19604                                        &inner,
19605                                        request,
19606                                    )
19607                                    .await
19608                            };
19609                            Box::pin(fut)
19610                        }
19611                    }
19612                    let accept_compression_encodings = self.accept_compression_encodings;
19613                    let send_compression_encodings = self.send_compression_encodings;
19614                    let max_decoding_message_size = self.max_decoding_message_size;
19615                    let max_encoding_message_size = self.max_encoding_message_size;
19616                    let inner = self.inner.clone();
19617                    let fut = async move {
19618                        let method = ListIndicatorReadingsSvc(inner);
19619                        let codec = tonic_prost::ProstCodec::default();
19620                        let mut grpc = tonic::server::Grpc::new(codec)
19621                            .apply_compression_config(
19622                                accept_compression_encodings,
19623                                send_compression_encodings,
19624                            )
19625                            .apply_max_message_size_config(
19626                                max_decoding_message_size,
19627                                max_encoding_message_size,
19628                            );
19629                        let res = grpc.unary(method, req).await;
19630                        Ok(res)
19631                    };
19632                    Box::pin(fut)
19633                }
19634                _ => {
19635                    Box::pin(async move {
19636                        let mut response = http::Response::new(
19637                            tonic::body::Body::default(),
19638                        );
19639                        let headers = response.headers_mut();
19640                        headers
19641                            .insert(
19642                                tonic::Status::GRPC_STATUS,
19643                                (tonic::Code::Unimplemented as i32).into(),
19644                            );
19645                        headers
19646                            .insert(
19647                                http::header::CONTENT_TYPE,
19648                                tonic::metadata::GRPC_CONTENT_TYPE,
19649                            );
19650                        Ok(response)
19651                    })
19652                }
19653            }
19654        }
19655    }
19656    impl<T> Clone for VerificationServiceServer<T> {
19657        fn clone(&self) -> Self {
19658            let inner = self.inner.clone();
19659            Self {
19660                inner,
19661                accept_compression_encodings: self.accept_compression_encodings,
19662                send_compression_encodings: self.send_compression_encodings,
19663                max_decoding_message_size: self.max_decoding_message_size,
19664                max_encoding_message_size: self.max_encoding_message_size,
19665            }
19666        }
19667    }
19668    /// Generated gRPC service name
19669    pub const SERVICE_NAME: &str = "pidgr.v1.VerificationService";
19670    impl<T> tonic::server::NamedService for VerificationServiceServer<T> {
19671        const NAME: &'static str = SERVICE_NAME;
19672    }
19673}