Skip to main content

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

1// @generated
2/// Generated client implementations.
3pub mod access_code_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    /** Manages early access codes for organization creation gating.
14 All RPCs require API key authentication (platform-level, not org-scoped).
15*/
16    #[derive(Debug, Clone)]
17    pub struct AccessCodeServiceClient<T> {
18        inner: tonic::client::Grpc<T>,
19    }
20    impl AccessCodeServiceClient<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> AccessCodeServiceClient<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        ) -> AccessCodeServiceClient<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            AccessCodeServiceClient::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        /** Generate one or more access codes with an optional label.
97 Authorization: Requires API key auth (service-level).
98*/
99        pub async fn generate_access_codes(
100            &mut self,
101            request: impl tonic::IntoRequest<super::GenerateAccessCodesRequest>,
102        ) -> std::result::Result<
103            tonic::Response<super::GenerateAccessCodesResponse>,
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.AccessCodeService/GenerateAccessCodes",
117            );
118            let mut req = request.into_request();
119            req.extensions_mut()
120                .insert(
121                    GrpcMethod::new("pidgr.v1.AccessCodeService", "GenerateAccessCodes"),
122                );
123            self.inner.unary(req, path, codec).await
124        }
125        /** List all access codes (active, redeemed, and revoked).
126 Authorization: Requires API key auth (service-level).
127*/
128        pub async fn list_access_codes(
129            &mut self,
130            request: impl tonic::IntoRequest<super::ListAccessCodesRequest>,
131        ) -> std::result::Result<
132            tonic::Response<super::ListAccessCodesResponse>,
133            tonic::Status,
134        > {
135            self.inner
136                .ready()
137                .await
138                .map_err(|e| {
139                    tonic::Status::unknown(
140                        format!("Service was not ready: {}", e.into()),
141                    )
142                })?;
143            let codec = tonic_prost::ProstCodec::default();
144            let path = http::uri::PathAndQuery::from_static(
145                "/pidgr.v1.AccessCodeService/ListAccessCodes",
146            );
147            let mut req = request.into_request();
148            req.extensions_mut()
149                .insert(
150                    GrpcMethod::new("pidgr.v1.AccessCodeService", "ListAccessCodes"),
151                );
152            self.inner.unary(req, path, codec).await
153        }
154        /** Revoke an access code. Revoked codes cannot be used for organization creation.
155 Authorization: Requires API key auth (service-level).
156*/
157        pub async fn revoke_access_code(
158            &mut self,
159            request: impl tonic::IntoRequest<super::RevokeAccessCodeRequest>,
160        ) -> std::result::Result<
161            tonic::Response<super::RevokeAccessCodeResponse>,
162            tonic::Status,
163        > {
164            self.inner
165                .ready()
166                .await
167                .map_err(|e| {
168                    tonic::Status::unknown(
169                        format!("Service was not ready: {}", e.into()),
170                    )
171                })?;
172            let codec = tonic_prost::ProstCodec::default();
173            let path = http::uri::PathAndQuery::from_static(
174                "/pidgr.v1.AccessCodeService/RevokeAccessCode",
175            );
176            let mut req = request.into_request();
177            req.extensions_mut()
178                .insert(
179                    GrpcMethod::new("pidgr.v1.AccessCodeService", "RevokeAccessCode"),
180                );
181            self.inner.unary(req, path, codec).await
182        }
183    }
184}
185/// Generated server implementations.
186pub mod access_code_service_server {
187    #![allow(
188        unused_variables,
189        dead_code,
190        missing_docs,
191        clippy::wildcard_imports,
192        clippy::let_unit_value,
193    )]
194    use tonic::codegen::*;
195    /// Generated trait containing gRPC methods that should be implemented for use with AccessCodeServiceServer.
196    #[async_trait]
197    pub trait AccessCodeService: std::marker::Send + std::marker::Sync + 'static {
198        /** Generate one or more access codes with an optional label.
199 Authorization: Requires API key auth (service-level).
200*/
201        async fn generate_access_codes(
202            &self,
203            request: tonic::Request<super::GenerateAccessCodesRequest>,
204        ) -> std::result::Result<
205            tonic::Response<super::GenerateAccessCodesResponse>,
206            tonic::Status,
207        >;
208        /** List all access codes (active, redeemed, and revoked).
209 Authorization: Requires API key auth (service-level).
210*/
211        async fn list_access_codes(
212            &self,
213            request: tonic::Request<super::ListAccessCodesRequest>,
214        ) -> std::result::Result<
215            tonic::Response<super::ListAccessCodesResponse>,
216            tonic::Status,
217        >;
218        /** Revoke an access code. Revoked codes cannot be used for organization creation.
219 Authorization: Requires API key auth (service-level).
220*/
221        async fn revoke_access_code(
222            &self,
223            request: tonic::Request<super::RevokeAccessCodeRequest>,
224        ) -> std::result::Result<
225            tonic::Response<super::RevokeAccessCodeResponse>,
226            tonic::Status,
227        >;
228    }
229    /** Manages early access codes for organization creation gating.
230 All RPCs require API key authentication (platform-level, not org-scoped).
231*/
232    #[derive(Debug)]
233    pub struct AccessCodeServiceServer<T> {
234        inner: Arc<T>,
235        accept_compression_encodings: EnabledCompressionEncodings,
236        send_compression_encodings: EnabledCompressionEncodings,
237        max_decoding_message_size: Option<usize>,
238        max_encoding_message_size: Option<usize>,
239    }
240    impl<T> AccessCodeServiceServer<T> {
241        pub fn new(inner: T) -> Self {
242            Self::from_arc(Arc::new(inner))
243        }
244        pub fn from_arc(inner: Arc<T>) -> Self {
245            Self {
246                inner,
247                accept_compression_encodings: Default::default(),
248                send_compression_encodings: Default::default(),
249                max_decoding_message_size: None,
250                max_encoding_message_size: None,
251            }
252        }
253        pub fn with_interceptor<F>(
254            inner: T,
255            interceptor: F,
256        ) -> InterceptedService<Self, F>
257        where
258            F: tonic::service::Interceptor,
259        {
260            InterceptedService::new(Self::new(inner), interceptor)
261        }
262        /// Enable decompressing requests with the given encoding.
263        #[must_use]
264        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
265            self.accept_compression_encodings.enable(encoding);
266            self
267        }
268        /// Compress responses with the given encoding, if the client supports it.
269        #[must_use]
270        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
271            self.send_compression_encodings.enable(encoding);
272            self
273        }
274        /// Limits the maximum size of a decoded message.
275        ///
276        /// Default: `4MB`
277        #[must_use]
278        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
279            self.max_decoding_message_size = Some(limit);
280            self
281        }
282        /// Limits the maximum size of an encoded message.
283        ///
284        /// Default: `usize::MAX`
285        #[must_use]
286        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
287            self.max_encoding_message_size = Some(limit);
288            self
289        }
290    }
291    impl<T, B> tonic::codegen::Service<http::Request<B>> for AccessCodeServiceServer<T>
292    where
293        T: AccessCodeService,
294        B: Body + std::marker::Send + 'static,
295        B::Error: Into<StdError> + std::marker::Send + 'static,
296    {
297        type Response = http::Response<tonic::body::Body>;
298        type Error = std::convert::Infallible;
299        type Future = BoxFuture<Self::Response, Self::Error>;
300        fn poll_ready(
301            &mut self,
302            _cx: &mut Context<'_>,
303        ) -> Poll<std::result::Result<(), Self::Error>> {
304            Poll::Ready(Ok(()))
305        }
306        fn call(&mut self, req: http::Request<B>) -> Self::Future {
307            match req.uri().path() {
308                "/pidgr.v1.AccessCodeService/GenerateAccessCodes" => {
309                    #[allow(non_camel_case_types)]
310                    struct GenerateAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
311                    impl<
312                        T: AccessCodeService,
313                    > tonic::server::UnaryService<super::GenerateAccessCodesRequest>
314                    for GenerateAccessCodesSvc<T> {
315                        type Response = super::GenerateAccessCodesResponse;
316                        type Future = BoxFuture<
317                            tonic::Response<Self::Response>,
318                            tonic::Status,
319                        >;
320                        fn call(
321                            &mut self,
322                            request: tonic::Request<super::GenerateAccessCodesRequest>,
323                        ) -> Self::Future {
324                            let inner = Arc::clone(&self.0);
325                            let fut = async move {
326                                <T as AccessCodeService>::generate_access_codes(
327                                        &inner,
328                                        request,
329                                    )
330                                    .await
331                            };
332                            Box::pin(fut)
333                        }
334                    }
335                    let accept_compression_encodings = self.accept_compression_encodings;
336                    let send_compression_encodings = self.send_compression_encodings;
337                    let max_decoding_message_size = self.max_decoding_message_size;
338                    let max_encoding_message_size = self.max_encoding_message_size;
339                    let inner = self.inner.clone();
340                    let fut = async move {
341                        let method = GenerateAccessCodesSvc(inner);
342                        let codec = tonic_prost::ProstCodec::default();
343                        let mut grpc = tonic::server::Grpc::new(codec)
344                            .apply_compression_config(
345                                accept_compression_encodings,
346                                send_compression_encodings,
347                            )
348                            .apply_max_message_size_config(
349                                max_decoding_message_size,
350                                max_encoding_message_size,
351                            );
352                        let res = grpc.unary(method, req).await;
353                        Ok(res)
354                    };
355                    Box::pin(fut)
356                }
357                "/pidgr.v1.AccessCodeService/ListAccessCodes" => {
358                    #[allow(non_camel_case_types)]
359                    struct ListAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
360                    impl<
361                        T: AccessCodeService,
362                    > tonic::server::UnaryService<super::ListAccessCodesRequest>
363                    for ListAccessCodesSvc<T> {
364                        type Response = super::ListAccessCodesResponse;
365                        type Future = BoxFuture<
366                            tonic::Response<Self::Response>,
367                            tonic::Status,
368                        >;
369                        fn call(
370                            &mut self,
371                            request: tonic::Request<super::ListAccessCodesRequest>,
372                        ) -> Self::Future {
373                            let inner = Arc::clone(&self.0);
374                            let fut = async move {
375                                <T as AccessCodeService>::list_access_codes(&inner, request)
376                                    .await
377                            };
378                            Box::pin(fut)
379                        }
380                    }
381                    let accept_compression_encodings = self.accept_compression_encodings;
382                    let send_compression_encodings = self.send_compression_encodings;
383                    let max_decoding_message_size = self.max_decoding_message_size;
384                    let max_encoding_message_size = self.max_encoding_message_size;
385                    let inner = self.inner.clone();
386                    let fut = async move {
387                        let method = ListAccessCodesSvc(inner);
388                        let codec = tonic_prost::ProstCodec::default();
389                        let mut grpc = tonic::server::Grpc::new(codec)
390                            .apply_compression_config(
391                                accept_compression_encodings,
392                                send_compression_encodings,
393                            )
394                            .apply_max_message_size_config(
395                                max_decoding_message_size,
396                                max_encoding_message_size,
397                            );
398                        let res = grpc.unary(method, req).await;
399                        Ok(res)
400                    };
401                    Box::pin(fut)
402                }
403                "/pidgr.v1.AccessCodeService/RevokeAccessCode" => {
404                    #[allow(non_camel_case_types)]
405                    struct RevokeAccessCodeSvc<T: AccessCodeService>(pub Arc<T>);
406                    impl<
407                        T: AccessCodeService,
408                    > tonic::server::UnaryService<super::RevokeAccessCodeRequest>
409                    for RevokeAccessCodeSvc<T> {
410                        type Response = super::RevokeAccessCodeResponse;
411                        type Future = BoxFuture<
412                            tonic::Response<Self::Response>,
413                            tonic::Status,
414                        >;
415                        fn call(
416                            &mut self,
417                            request: tonic::Request<super::RevokeAccessCodeRequest>,
418                        ) -> Self::Future {
419                            let inner = Arc::clone(&self.0);
420                            let fut = async move {
421                                <T as AccessCodeService>::revoke_access_code(
422                                        &inner,
423                                        request,
424                                    )
425                                    .await
426                            };
427                            Box::pin(fut)
428                        }
429                    }
430                    let accept_compression_encodings = self.accept_compression_encodings;
431                    let send_compression_encodings = self.send_compression_encodings;
432                    let max_decoding_message_size = self.max_decoding_message_size;
433                    let max_encoding_message_size = self.max_encoding_message_size;
434                    let inner = self.inner.clone();
435                    let fut = async move {
436                        let method = RevokeAccessCodeSvc(inner);
437                        let codec = tonic_prost::ProstCodec::default();
438                        let mut grpc = tonic::server::Grpc::new(codec)
439                            .apply_compression_config(
440                                accept_compression_encodings,
441                                send_compression_encodings,
442                            )
443                            .apply_max_message_size_config(
444                                max_decoding_message_size,
445                                max_encoding_message_size,
446                            );
447                        let res = grpc.unary(method, req).await;
448                        Ok(res)
449                    };
450                    Box::pin(fut)
451                }
452                _ => {
453                    Box::pin(async move {
454                        let mut response = http::Response::new(
455                            tonic::body::Body::default(),
456                        );
457                        let headers = response.headers_mut();
458                        headers
459                            .insert(
460                                tonic::Status::GRPC_STATUS,
461                                (tonic::Code::Unimplemented as i32).into(),
462                            );
463                        headers
464                            .insert(
465                                http::header::CONTENT_TYPE,
466                                tonic::metadata::GRPC_CONTENT_TYPE,
467                            );
468                        Ok(response)
469                    })
470                }
471            }
472        }
473    }
474    impl<T> Clone for AccessCodeServiceServer<T> {
475        fn clone(&self) -> Self {
476            let inner = self.inner.clone();
477            Self {
478                inner,
479                accept_compression_encodings: self.accept_compression_encodings,
480                send_compression_encodings: self.send_compression_encodings,
481                max_decoding_message_size: self.max_decoding_message_size,
482                max_encoding_message_size: self.max_encoding_message_size,
483            }
484        }
485    }
486    /// Generated gRPC service name
487    pub const SERVICE_NAME: &str = "pidgr.v1.AccessCodeService";
488    impl<T> tonic::server::NamedService for AccessCodeServiceServer<T> {
489        const NAME: &'static str = SERVICE_NAME;
490    }
491}
492/// Generated client implementations.
493pub mod action_service_client {
494    #![allow(
495        unused_variables,
496        dead_code,
497        missing_docs,
498        clippy::wildcard_imports,
499        clippy::let_unit_value,
500    )]
501    use tonic::codegen::*;
502    use tonic::codegen::http::Uri;
503    /** Handles user actions on delivered messages.
504 Actions drive workflow progression (e.g. ACK completes a wait step).
505*/
506    #[derive(Debug, Clone)]
507    pub struct ActionServiceClient<T> {
508        inner: tonic::client::Grpc<T>,
509    }
510    impl ActionServiceClient<tonic::transport::Channel> {
511        /// Attempt to create a new client by connecting to a given endpoint.
512        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
513        where
514            D: TryInto<tonic::transport::Endpoint>,
515            D::Error: Into<StdError>,
516        {
517            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
518            Ok(Self::new(conn))
519        }
520    }
521    impl<T> ActionServiceClient<T>
522    where
523        T: tonic::client::GrpcService<tonic::body::Body>,
524        T::Error: Into<StdError>,
525        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
526        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
527    {
528        pub fn new(inner: T) -> Self {
529            let inner = tonic::client::Grpc::new(inner);
530            Self { inner }
531        }
532        pub fn with_origin(inner: T, origin: Uri) -> Self {
533            let inner = tonic::client::Grpc::with_origin(inner, origin);
534            Self { inner }
535        }
536        pub fn with_interceptor<F>(
537            inner: T,
538            interceptor: F,
539        ) -> ActionServiceClient<InterceptedService<T, F>>
540        where
541            F: tonic::service::Interceptor,
542            T::ResponseBody: Default,
543            T: tonic::codegen::Service<
544                http::Request<tonic::body::Body>,
545                Response = http::Response<
546                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
547                >,
548            >,
549            <T as tonic::codegen::Service<
550                http::Request<tonic::body::Body>,
551            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
552        {
553            ActionServiceClient::new(InterceptedService::new(inner, interceptor))
554        }
555        /// Compress requests with the given encoding.
556        ///
557        /// This requires the server to support it otherwise it might respond with an
558        /// error.
559        #[must_use]
560        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
561            self.inner = self.inner.send_compressed(encoding);
562            self
563        }
564        /// Enable decompressing responses.
565        #[must_use]
566        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
567            self.inner = self.inner.accept_compressed(encoding);
568            self
569        }
570        /// Limits the maximum size of a decoded message.
571        ///
572        /// Default: `4MB`
573        #[must_use]
574        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
575            self.inner = self.inner.max_decoding_message_size(limit);
576            self
577        }
578        /// Limits the maximum size of an encoded message.
579        ///
580        /// Default: `usize::MAX`
581        #[must_use]
582        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
583            self.inner = self.inner.max_encoding_message_size(limit);
584            self
585        }
586        /** Submit an action for a specific delivery, advancing the campaign workflow.
587 Backend MUST verify the authenticated user is the delivery recipient.
588*/
589        pub async fn submit_action(
590            &mut self,
591            request: impl tonic::IntoRequest<super::SubmitActionRequest>,
592        ) -> std::result::Result<
593            tonic::Response<super::SubmitActionResponse>,
594            tonic::Status,
595        > {
596            self.inner
597                .ready()
598                .await
599                .map_err(|e| {
600                    tonic::Status::unknown(
601                        format!("Service was not ready: {}", e.into()),
602                    )
603                })?;
604            let codec = tonic_prost::ProstCodec::default();
605            let path = http::uri::PathAndQuery::from_static(
606                "/pidgr.v1.ActionService/SubmitAction",
607            );
608            let mut req = request.into_request();
609            req.extensions_mut()
610                .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
611            self.inner.unary(req, path, codec).await
612        }
613    }
614}
615/// Generated server implementations.
616pub mod action_service_server {
617    #![allow(
618        unused_variables,
619        dead_code,
620        missing_docs,
621        clippy::wildcard_imports,
622        clippy::let_unit_value,
623    )]
624    use tonic::codegen::*;
625    /// Generated trait containing gRPC methods that should be implemented for use with ActionServiceServer.
626    #[async_trait]
627    pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
628        /** Submit an action for a specific delivery, advancing the campaign workflow.
629 Backend MUST verify the authenticated user is the delivery recipient.
630*/
631        async fn submit_action(
632            &self,
633            request: tonic::Request<super::SubmitActionRequest>,
634        ) -> std::result::Result<
635            tonic::Response<super::SubmitActionResponse>,
636            tonic::Status,
637        >;
638    }
639    /** Handles user actions on delivered messages.
640 Actions drive workflow progression (e.g. ACK completes a wait step).
641*/
642    #[derive(Debug)]
643    pub struct ActionServiceServer<T> {
644        inner: Arc<T>,
645        accept_compression_encodings: EnabledCompressionEncodings,
646        send_compression_encodings: EnabledCompressionEncodings,
647        max_decoding_message_size: Option<usize>,
648        max_encoding_message_size: Option<usize>,
649    }
650    impl<T> ActionServiceServer<T> {
651        pub fn new(inner: T) -> Self {
652            Self::from_arc(Arc::new(inner))
653        }
654        pub fn from_arc(inner: Arc<T>) -> Self {
655            Self {
656                inner,
657                accept_compression_encodings: Default::default(),
658                send_compression_encodings: Default::default(),
659                max_decoding_message_size: None,
660                max_encoding_message_size: None,
661            }
662        }
663        pub fn with_interceptor<F>(
664            inner: T,
665            interceptor: F,
666        ) -> InterceptedService<Self, F>
667        where
668            F: tonic::service::Interceptor,
669        {
670            InterceptedService::new(Self::new(inner), interceptor)
671        }
672        /// Enable decompressing requests with the given encoding.
673        #[must_use]
674        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
675            self.accept_compression_encodings.enable(encoding);
676            self
677        }
678        /// Compress responses with the given encoding, if the client supports it.
679        #[must_use]
680        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
681            self.send_compression_encodings.enable(encoding);
682            self
683        }
684        /// Limits the maximum size of a decoded message.
685        ///
686        /// Default: `4MB`
687        #[must_use]
688        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
689            self.max_decoding_message_size = Some(limit);
690            self
691        }
692        /// Limits the maximum size of an encoded message.
693        ///
694        /// Default: `usize::MAX`
695        #[must_use]
696        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
697            self.max_encoding_message_size = Some(limit);
698            self
699        }
700    }
701    impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
702    where
703        T: ActionService,
704        B: Body + std::marker::Send + 'static,
705        B::Error: Into<StdError> + std::marker::Send + 'static,
706    {
707        type Response = http::Response<tonic::body::Body>;
708        type Error = std::convert::Infallible;
709        type Future = BoxFuture<Self::Response, Self::Error>;
710        fn poll_ready(
711            &mut self,
712            _cx: &mut Context<'_>,
713        ) -> Poll<std::result::Result<(), Self::Error>> {
714            Poll::Ready(Ok(()))
715        }
716        fn call(&mut self, req: http::Request<B>) -> Self::Future {
717            match req.uri().path() {
718                "/pidgr.v1.ActionService/SubmitAction" => {
719                    #[allow(non_camel_case_types)]
720                    struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
721                    impl<
722                        T: ActionService,
723                    > tonic::server::UnaryService<super::SubmitActionRequest>
724                    for SubmitActionSvc<T> {
725                        type Response = super::SubmitActionResponse;
726                        type Future = BoxFuture<
727                            tonic::Response<Self::Response>,
728                            tonic::Status,
729                        >;
730                        fn call(
731                            &mut self,
732                            request: tonic::Request<super::SubmitActionRequest>,
733                        ) -> Self::Future {
734                            let inner = Arc::clone(&self.0);
735                            let fut = async move {
736                                <T as ActionService>::submit_action(&inner, request).await
737                            };
738                            Box::pin(fut)
739                        }
740                    }
741                    let accept_compression_encodings = self.accept_compression_encodings;
742                    let send_compression_encodings = self.send_compression_encodings;
743                    let max_decoding_message_size = self.max_decoding_message_size;
744                    let max_encoding_message_size = self.max_encoding_message_size;
745                    let inner = self.inner.clone();
746                    let fut = async move {
747                        let method = SubmitActionSvc(inner);
748                        let codec = tonic_prost::ProstCodec::default();
749                        let mut grpc = tonic::server::Grpc::new(codec)
750                            .apply_compression_config(
751                                accept_compression_encodings,
752                                send_compression_encodings,
753                            )
754                            .apply_max_message_size_config(
755                                max_decoding_message_size,
756                                max_encoding_message_size,
757                            );
758                        let res = grpc.unary(method, req).await;
759                        Ok(res)
760                    };
761                    Box::pin(fut)
762                }
763                _ => {
764                    Box::pin(async move {
765                        let mut response = http::Response::new(
766                            tonic::body::Body::default(),
767                        );
768                        let headers = response.headers_mut();
769                        headers
770                            .insert(
771                                tonic::Status::GRPC_STATUS,
772                                (tonic::Code::Unimplemented as i32).into(),
773                            );
774                        headers
775                            .insert(
776                                http::header::CONTENT_TYPE,
777                                tonic::metadata::GRPC_CONTENT_TYPE,
778                            );
779                        Ok(response)
780                    })
781                }
782            }
783        }
784    }
785    impl<T> Clone for ActionServiceServer<T> {
786        fn clone(&self) -> Self {
787            let inner = self.inner.clone();
788            Self {
789                inner,
790                accept_compression_encodings: self.accept_compression_encodings,
791                send_compression_encodings: self.send_compression_encodings,
792                max_decoding_message_size: self.max_decoding_message_size,
793                max_encoding_message_size: self.max_encoding_message_size,
794            }
795        }
796    }
797    /// Generated gRPC service name
798    pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
799    impl<T> tonic::server::NamedService for ActionServiceServer<T> {
800        const NAME: &'static str = SERVICE_NAME;
801    }
802}
803/// Generated client implementations.
804pub mod api_key_service_client {
805    #![allow(
806        unused_variables,
807        dead_code,
808        missing_docs,
809        clippy::wildcard_imports,
810        clippy::let_unit_value,
811    )]
812    use tonic::codegen::*;
813    use tonic::codegen::http::Uri;
814    /** Manages scoped API keys for programmatic access.
815 All RPCs operate within the caller's org (extracted from JWT).
816*/
817    #[derive(Debug, Clone)]
818    pub struct ApiKeyServiceClient<T> {
819        inner: tonic::client::Grpc<T>,
820    }
821    impl ApiKeyServiceClient<tonic::transport::Channel> {
822        /// Attempt to create a new client by connecting to a given endpoint.
823        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
824        where
825            D: TryInto<tonic::transport::Endpoint>,
826            D::Error: Into<StdError>,
827        {
828            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
829            Ok(Self::new(conn))
830        }
831    }
832    impl<T> ApiKeyServiceClient<T>
833    where
834        T: tonic::client::GrpcService<tonic::body::Body>,
835        T::Error: Into<StdError>,
836        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
837        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
838    {
839        pub fn new(inner: T) -> Self {
840            let inner = tonic::client::Grpc::new(inner);
841            Self { inner }
842        }
843        pub fn with_origin(inner: T, origin: Uri) -> Self {
844            let inner = tonic::client::Grpc::with_origin(inner, origin);
845            Self { inner }
846        }
847        pub fn with_interceptor<F>(
848            inner: T,
849            interceptor: F,
850        ) -> ApiKeyServiceClient<InterceptedService<T, F>>
851        where
852            F: tonic::service::Interceptor,
853            T::ResponseBody: Default,
854            T: tonic::codegen::Service<
855                http::Request<tonic::body::Body>,
856                Response = http::Response<
857                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
858                >,
859            >,
860            <T as tonic::codegen::Service<
861                http::Request<tonic::body::Body>,
862            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
863        {
864            ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
865        }
866        /// Compress requests with the given encoding.
867        ///
868        /// This requires the server to support it otherwise it might respond with an
869        /// error.
870        #[must_use]
871        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
872            self.inner = self.inner.send_compressed(encoding);
873            self
874        }
875        /// Enable decompressing responses.
876        #[must_use]
877        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
878            self.inner = self.inner.accept_compressed(encoding);
879            self
880        }
881        /// Limits the maximum size of a decoded message.
882        ///
883        /// Default: `4MB`
884        #[must_use]
885        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
886            self.inner = self.inner.max_decoding_message_size(limit);
887            self
888        }
889        /// Limits the maximum size of an encoded message.
890        ///
891        /// Default: `usize::MAX`
892        #[must_use]
893        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
894            self.inner = self.inner.max_encoding_message_size(limit);
895            self
896        }
897        /** Create a new scoped API key with specific permissions.
898 The full secret key is only returned in the response — store it securely.
899 Authorization: Requires PERMISSION_ORG_WRITE.
900*/
901        pub async fn create_api_key(
902            &mut self,
903            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
904        ) -> std::result::Result<
905            tonic::Response<super::CreateApiKeyResponse>,
906            tonic::Status,
907        > {
908            self.inner
909                .ready()
910                .await
911                .map_err(|e| {
912                    tonic::Status::unknown(
913                        format!("Service was not ready: {}", e.into()),
914                    )
915                })?;
916            let codec = tonic_prost::ProstCodec::default();
917            let path = http::uri::PathAndQuery::from_static(
918                "/pidgr.v1.ApiKeyService/CreateApiKey",
919            );
920            let mut req = request.into_request();
921            req.extensions_mut()
922                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
923            self.inner.unary(req, path, codec).await
924        }
925        /** List all active API keys in the organization (metadata only, no secrets).
926 Authorization: Requires PERMISSION_ORG_READ.
927*/
928        pub async fn list_api_keys(
929            &mut self,
930            request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
931        ) -> std::result::Result<
932            tonic::Response<super::ListApiKeysResponse>,
933            tonic::Status,
934        > {
935            self.inner
936                .ready()
937                .await
938                .map_err(|e| {
939                    tonic::Status::unknown(
940                        format!("Service was not ready: {}", e.into()),
941                    )
942                })?;
943            let codec = tonic_prost::ProstCodec::default();
944            let path = http::uri::PathAndQuery::from_static(
945                "/pidgr.v1.ApiKeyService/ListApiKeys",
946            );
947            let mut req = request.into_request();
948            req.extensions_mut()
949                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
950            self.inner.unary(req, path, codec).await
951        }
952        /** Revoke an API key. The key becomes immediately unusable.
953 Authorization: Requires PERMISSION_ORG_WRITE.
954*/
955        pub async fn revoke_api_key(
956            &mut self,
957            request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
958        ) -> std::result::Result<
959            tonic::Response<super::RevokeApiKeyResponse>,
960            tonic::Status,
961        > {
962            self.inner
963                .ready()
964                .await
965                .map_err(|e| {
966                    tonic::Status::unknown(
967                        format!("Service was not ready: {}", e.into()),
968                    )
969                })?;
970            let codec = tonic_prost::ProstCodec::default();
971            let path = http::uri::PathAndQuery::from_static(
972                "/pidgr.v1.ApiKeyService/RevokeApiKey",
973            );
974            let mut req = request.into_request();
975            req.extensions_mut()
976                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
977            self.inner.unary(req, path, codec).await
978        }
979    }
980}
981/// Generated server implementations.
982pub mod api_key_service_server {
983    #![allow(
984        unused_variables,
985        dead_code,
986        missing_docs,
987        clippy::wildcard_imports,
988        clippy::let_unit_value,
989    )]
990    use tonic::codegen::*;
991    /// Generated trait containing gRPC methods that should be implemented for use with ApiKeyServiceServer.
992    #[async_trait]
993    pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
994        /** Create a new scoped API key with specific permissions.
995 The full secret key is only returned in the response — store it securely.
996 Authorization: Requires PERMISSION_ORG_WRITE.
997*/
998        async fn create_api_key(
999            &self,
1000            request: tonic::Request<super::CreateApiKeyRequest>,
1001        ) -> std::result::Result<
1002            tonic::Response<super::CreateApiKeyResponse>,
1003            tonic::Status,
1004        >;
1005        /** List all active API keys in the organization (metadata only, no secrets).
1006 Authorization: Requires PERMISSION_ORG_READ.
1007*/
1008        async fn list_api_keys(
1009            &self,
1010            request: tonic::Request<super::ListApiKeysRequest>,
1011        ) -> std::result::Result<
1012            tonic::Response<super::ListApiKeysResponse>,
1013            tonic::Status,
1014        >;
1015        /** Revoke an API key. The key becomes immediately unusable.
1016 Authorization: Requires PERMISSION_ORG_WRITE.
1017*/
1018        async fn revoke_api_key(
1019            &self,
1020            request: tonic::Request<super::RevokeApiKeyRequest>,
1021        ) -> std::result::Result<
1022            tonic::Response<super::RevokeApiKeyResponse>,
1023            tonic::Status,
1024        >;
1025    }
1026    /** Manages scoped API keys for programmatic access.
1027 All RPCs operate within the caller's org (extracted from JWT).
1028*/
1029    #[derive(Debug)]
1030    pub struct ApiKeyServiceServer<T> {
1031        inner: Arc<T>,
1032        accept_compression_encodings: EnabledCompressionEncodings,
1033        send_compression_encodings: EnabledCompressionEncodings,
1034        max_decoding_message_size: Option<usize>,
1035        max_encoding_message_size: Option<usize>,
1036    }
1037    impl<T> ApiKeyServiceServer<T> {
1038        pub fn new(inner: T) -> Self {
1039            Self::from_arc(Arc::new(inner))
1040        }
1041        pub fn from_arc(inner: Arc<T>) -> Self {
1042            Self {
1043                inner,
1044                accept_compression_encodings: Default::default(),
1045                send_compression_encodings: Default::default(),
1046                max_decoding_message_size: None,
1047                max_encoding_message_size: None,
1048            }
1049        }
1050        pub fn with_interceptor<F>(
1051            inner: T,
1052            interceptor: F,
1053        ) -> InterceptedService<Self, F>
1054        where
1055            F: tonic::service::Interceptor,
1056        {
1057            InterceptedService::new(Self::new(inner), interceptor)
1058        }
1059        /// Enable decompressing requests with the given encoding.
1060        #[must_use]
1061        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1062            self.accept_compression_encodings.enable(encoding);
1063            self
1064        }
1065        /// Compress responses with the given encoding, if the client supports it.
1066        #[must_use]
1067        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1068            self.send_compression_encodings.enable(encoding);
1069            self
1070        }
1071        /// Limits the maximum size of a decoded message.
1072        ///
1073        /// Default: `4MB`
1074        #[must_use]
1075        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1076            self.max_decoding_message_size = Some(limit);
1077            self
1078        }
1079        /// Limits the maximum size of an encoded message.
1080        ///
1081        /// Default: `usize::MAX`
1082        #[must_use]
1083        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1084            self.max_encoding_message_size = Some(limit);
1085            self
1086        }
1087    }
1088    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1089    where
1090        T: ApiKeyService,
1091        B: Body + std::marker::Send + 'static,
1092        B::Error: Into<StdError> + std::marker::Send + 'static,
1093    {
1094        type Response = http::Response<tonic::body::Body>;
1095        type Error = std::convert::Infallible;
1096        type Future = BoxFuture<Self::Response, Self::Error>;
1097        fn poll_ready(
1098            &mut self,
1099            _cx: &mut Context<'_>,
1100        ) -> Poll<std::result::Result<(), Self::Error>> {
1101            Poll::Ready(Ok(()))
1102        }
1103        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1104            match req.uri().path() {
1105                "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1106                    #[allow(non_camel_case_types)]
1107                    struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1108                    impl<
1109                        T: ApiKeyService,
1110                    > tonic::server::UnaryService<super::CreateApiKeyRequest>
1111                    for CreateApiKeySvc<T> {
1112                        type Response = super::CreateApiKeyResponse;
1113                        type Future = BoxFuture<
1114                            tonic::Response<Self::Response>,
1115                            tonic::Status,
1116                        >;
1117                        fn call(
1118                            &mut self,
1119                            request: tonic::Request<super::CreateApiKeyRequest>,
1120                        ) -> Self::Future {
1121                            let inner = Arc::clone(&self.0);
1122                            let fut = async move {
1123                                <T as ApiKeyService>::create_api_key(&inner, request).await
1124                            };
1125                            Box::pin(fut)
1126                        }
1127                    }
1128                    let accept_compression_encodings = self.accept_compression_encodings;
1129                    let send_compression_encodings = self.send_compression_encodings;
1130                    let max_decoding_message_size = self.max_decoding_message_size;
1131                    let max_encoding_message_size = self.max_encoding_message_size;
1132                    let inner = self.inner.clone();
1133                    let fut = async move {
1134                        let method = CreateApiKeySvc(inner);
1135                        let codec = tonic_prost::ProstCodec::default();
1136                        let mut grpc = tonic::server::Grpc::new(codec)
1137                            .apply_compression_config(
1138                                accept_compression_encodings,
1139                                send_compression_encodings,
1140                            )
1141                            .apply_max_message_size_config(
1142                                max_decoding_message_size,
1143                                max_encoding_message_size,
1144                            );
1145                        let res = grpc.unary(method, req).await;
1146                        Ok(res)
1147                    };
1148                    Box::pin(fut)
1149                }
1150                "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1151                    #[allow(non_camel_case_types)]
1152                    struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1153                    impl<
1154                        T: ApiKeyService,
1155                    > tonic::server::UnaryService<super::ListApiKeysRequest>
1156                    for ListApiKeysSvc<T> {
1157                        type Response = super::ListApiKeysResponse;
1158                        type Future = BoxFuture<
1159                            tonic::Response<Self::Response>,
1160                            tonic::Status,
1161                        >;
1162                        fn call(
1163                            &mut self,
1164                            request: tonic::Request<super::ListApiKeysRequest>,
1165                        ) -> Self::Future {
1166                            let inner = Arc::clone(&self.0);
1167                            let fut = async move {
1168                                <T as ApiKeyService>::list_api_keys(&inner, request).await
1169                            };
1170                            Box::pin(fut)
1171                        }
1172                    }
1173                    let accept_compression_encodings = self.accept_compression_encodings;
1174                    let send_compression_encodings = self.send_compression_encodings;
1175                    let max_decoding_message_size = self.max_decoding_message_size;
1176                    let max_encoding_message_size = self.max_encoding_message_size;
1177                    let inner = self.inner.clone();
1178                    let fut = async move {
1179                        let method = ListApiKeysSvc(inner);
1180                        let codec = tonic_prost::ProstCodec::default();
1181                        let mut grpc = tonic::server::Grpc::new(codec)
1182                            .apply_compression_config(
1183                                accept_compression_encodings,
1184                                send_compression_encodings,
1185                            )
1186                            .apply_max_message_size_config(
1187                                max_decoding_message_size,
1188                                max_encoding_message_size,
1189                            );
1190                        let res = grpc.unary(method, req).await;
1191                        Ok(res)
1192                    };
1193                    Box::pin(fut)
1194                }
1195                "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1196                    #[allow(non_camel_case_types)]
1197                    struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1198                    impl<
1199                        T: ApiKeyService,
1200                    > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1201                    for RevokeApiKeySvc<T> {
1202                        type Response = super::RevokeApiKeyResponse;
1203                        type Future = BoxFuture<
1204                            tonic::Response<Self::Response>,
1205                            tonic::Status,
1206                        >;
1207                        fn call(
1208                            &mut self,
1209                            request: tonic::Request<super::RevokeApiKeyRequest>,
1210                        ) -> Self::Future {
1211                            let inner = Arc::clone(&self.0);
1212                            let fut = async move {
1213                                <T as ApiKeyService>::revoke_api_key(&inner, request).await
1214                            };
1215                            Box::pin(fut)
1216                        }
1217                    }
1218                    let accept_compression_encodings = self.accept_compression_encodings;
1219                    let send_compression_encodings = self.send_compression_encodings;
1220                    let max_decoding_message_size = self.max_decoding_message_size;
1221                    let max_encoding_message_size = self.max_encoding_message_size;
1222                    let inner = self.inner.clone();
1223                    let fut = async move {
1224                        let method = RevokeApiKeySvc(inner);
1225                        let codec = tonic_prost::ProstCodec::default();
1226                        let mut grpc = tonic::server::Grpc::new(codec)
1227                            .apply_compression_config(
1228                                accept_compression_encodings,
1229                                send_compression_encodings,
1230                            )
1231                            .apply_max_message_size_config(
1232                                max_decoding_message_size,
1233                                max_encoding_message_size,
1234                            );
1235                        let res = grpc.unary(method, req).await;
1236                        Ok(res)
1237                    };
1238                    Box::pin(fut)
1239                }
1240                _ => {
1241                    Box::pin(async move {
1242                        let mut response = http::Response::new(
1243                            tonic::body::Body::default(),
1244                        );
1245                        let headers = response.headers_mut();
1246                        headers
1247                            .insert(
1248                                tonic::Status::GRPC_STATUS,
1249                                (tonic::Code::Unimplemented as i32).into(),
1250                            );
1251                        headers
1252                            .insert(
1253                                http::header::CONTENT_TYPE,
1254                                tonic::metadata::GRPC_CONTENT_TYPE,
1255                            );
1256                        Ok(response)
1257                    })
1258                }
1259            }
1260        }
1261    }
1262    impl<T> Clone for ApiKeyServiceServer<T> {
1263        fn clone(&self) -> Self {
1264            let inner = self.inner.clone();
1265            Self {
1266                inner,
1267                accept_compression_encodings: self.accept_compression_encodings,
1268                send_compression_encodings: self.send_compression_encodings,
1269                max_decoding_message_size: self.max_decoding_message_size,
1270                max_encoding_message_size: self.max_encoding_message_size,
1271            }
1272        }
1273    }
1274    /// Generated gRPC service name
1275    pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1276    impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1277        const NAME: &'static str = SERVICE_NAME;
1278    }
1279}
1280/// Generated client implementations.
1281pub mod privacy_service_client {
1282    #![allow(
1283        unused_variables,
1284        dead_code,
1285        missing_docs,
1286        clippy::wildcard_imports,
1287        clippy::let_unit_value,
1288    )]
1289    use tonic::codegen::*;
1290    use tonic::codegen::http::Uri;
1291    /** PrivacyService handles GDPR/LGPD data subject rights.
1292 All RPCs extract org_id from the JWT — it is never in request messages.
1293*/
1294    #[derive(Debug, Clone)]
1295    pub struct PrivacyServiceClient<T> {
1296        inner: tonic::client::Grpc<T>,
1297    }
1298    impl PrivacyServiceClient<tonic::transport::Channel> {
1299        /// Attempt to create a new client by connecting to a given endpoint.
1300        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1301        where
1302            D: TryInto<tonic::transport::Endpoint>,
1303            D::Error: Into<StdError>,
1304        {
1305            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1306            Ok(Self::new(conn))
1307        }
1308    }
1309    impl<T> PrivacyServiceClient<T>
1310    where
1311        T: tonic::client::GrpcService<tonic::body::Body>,
1312        T::Error: Into<StdError>,
1313        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1314        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1315    {
1316        pub fn new(inner: T) -> Self {
1317            let inner = tonic::client::Grpc::new(inner);
1318            Self { inner }
1319        }
1320        pub fn with_origin(inner: T, origin: Uri) -> Self {
1321            let inner = tonic::client::Grpc::with_origin(inner, origin);
1322            Self { inner }
1323        }
1324        pub fn with_interceptor<F>(
1325            inner: T,
1326            interceptor: F,
1327        ) -> PrivacyServiceClient<InterceptedService<T, F>>
1328        where
1329            F: tonic::service::Interceptor,
1330            T::ResponseBody: Default,
1331            T: tonic::codegen::Service<
1332                http::Request<tonic::body::Body>,
1333                Response = http::Response<
1334                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1335                >,
1336            >,
1337            <T as tonic::codegen::Service<
1338                http::Request<tonic::body::Body>,
1339            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1340        {
1341            PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1342        }
1343        /// Compress requests with the given encoding.
1344        ///
1345        /// This requires the server to support it otherwise it might respond with an
1346        /// error.
1347        #[must_use]
1348        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1349            self.inner = self.inner.send_compressed(encoding);
1350            self
1351        }
1352        /// Enable decompressing responses.
1353        #[must_use]
1354        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1355            self.inner = self.inner.accept_compressed(encoding);
1356            self
1357        }
1358        /// Limits the maximum size of a decoded message.
1359        ///
1360        /// Default: `4MB`
1361        #[must_use]
1362        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1363            self.inner = self.inner.max_decoding_message_size(limit);
1364            self
1365        }
1366        /// Limits the maximum size of an encoded message.
1367        ///
1368        /// Default: `usize::MAX`
1369        #[must_use]
1370        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1371            self.inner = self.inner.max_encoding_message_size(limit);
1372            self
1373        }
1374        /** Export all personal data associated with a user as a downloadable ZIP.
1375 Async operation — returns immediately with PENDING status, sends push
1376 notification when the export is ready.
1377 Auth: Requires JWT. Callable by the user themselves or an org admin.
1378*/
1379        pub async fn export_user_data(
1380            &mut self,
1381            request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1382        ) -> std::result::Result<
1383            tonic::Response<super::ExportUserDataResponse>,
1384            tonic::Status,
1385        > {
1386            self.inner
1387                .ready()
1388                .await
1389                .map_err(|e| {
1390                    tonic::Status::unknown(
1391                        format!("Service was not ready: {}", e.into()),
1392                    )
1393                })?;
1394            let codec = tonic_prost::ProstCodec::default();
1395            let path = http::uri::PathAndQuery::from_static(
1396                "/pidgr.v1.PrivacyService/ExportUserData",
1397            );
1398            let mut req = request.into_request();
1399            req.extensions_mut()
1400                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1401            self.inner.unary(req, path, codec).await
1402        }
1403        /** Delete or anonymize all personal data associated with a user.
1404 Deletion has a 30-day grace period during which processing is restricted
1405 and the request can be cancelled. After 30 days, deletion is irreversible.
1406 Auth: Requires JWT. Admin only.
1407*/
1408        pub async fn delete_user_data(
1409            &mut self,
1410            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1411        ) -> std::result::Result<
1412            tonic::Response<super::DeleteUserDataResponse>,
1413            tonic::Status,
1414        > {
1415            self.inner
1416                .ready()
1417                .await
1418                .map_err(|e| {
1419                    tonic::Status::unknown(
1420                        format!("Service was not ready: {}", e.into()),
1421                    )
1422                })?;
1423            let codec = tonic_prost::ProstCodec::default();
1424            let path = http::uri::PathAndQuery::from_static(
1425                "/pidgr.v1.PrivacyService/DeleteUserData",
1426            );
1427            let mut req = request.into_request();
1428            req.extensions_mut()
1429                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1430            self.inner.unary(req, path, codec).await
1431        }
1432        /** Correct personal data for a user. Propagates corrections to all stored
1433 locations (profile, delivery records, analytics metadata).
1434 Auth: Requires JWT. Callable by the user themselves or an org admin.
1435*/
1436        pub async fn rectify_user_data(
1437            &mut self,
1438            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1439        ) -> std::result::Result<
1440            tonic::Response<super::RectifyUserDataResponse>,
1441            tonic::Status,
1442        > {
1443            self.inner
1444                .ready()
1445                .await
1446                .map_err(|e| {
1447                    tonic::Status::unknown(
1448                        format!("Service was not ready: {}", e.into()),
1449                    )
1450                })?;
1451            let codec = tonic_prost::ProstCodec::default();
1452            let path = http::uri::PathAndQuery::from_static(
1453                "/pidgr.v1.PrivacyService/RectifyUserData",
1454            );
1455            let mut req = request.into_request();
1456            req.extensions_mut()
1457                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1458            self.inner.unary(req, path, codec).await
1459        }
1460        /** Restrict or unrestrict processing for a user. When restricted, the API
1461 skips this user in campaigns, analytics, and session replay.
1462 Auth: Requires JWT. Admin only.
1463*/
1464        pub async fn restrict_processing(
1465            &mut self,
1466            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1467        ) -> std::result::Result<
1468            tonic::Response<super::RestrictProcessingResponse>,
1469            tonic::Status,
1470        > {
1471            self.inner
1472                .ready()
1473                .await
1474                .map_err(|e| {
1475                    tonic::Status::unknown(
1476                        format!("Service was not ready: {}", e.into()),
1477                    )
1478                })?;
1479            let codec = tonic_prost::ProstCodec::default();
1480            let path = http::uri::PathAndQuery::from_static(
1481                "/pidgr.v1.PrivacyService/RestrictProcessing",
1482            );
1483            let mut req = request.into_request();
1484            req.extensions_mut()
1485                .insert(
1486                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1487                );
1488            self.inner.unary(req, path, codec).await
1489        }
1490        /** Confirm whether personal data exists for a user and list data categories.
1491 LGPD-specific: confirmação de existência (Art. 18, I).
1492 Auth: Requires JWT. Admin only.
1493*/
1494        pub async fn get_data_existence_confirmation(
1495            &mut self,
1496            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1497        ) -> std::result::Result<
1498            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1499            tonic::Status,
1500        > {
1501            self.inner
1502                .ready()
1503                .await
1504                .map_err(|e| {
1505                    tonic::Status::unknown(
1506                        format!("Service was not ready: {}", e.into()),
1507                    )
1508                })?;
1509            let codec = tonic_prost::ProstCodec::default();
1510            let path = http::uri::PathAndQuery::from_static(
1511                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1512            );
1513            let mut req = request.into_request();
1514            req.extensions_mut()
1515                .insert(
1516                    GrpcMethod::new(
1517                        "pidgr.v1.PrivacyService",
1518                        "GetDataExistenceConfirmation",
1519                    ),
1520                );
1521            self.inner.unary(req, path, codec).await
1522        }
1523        /** List privacy requests for the organization, with optional filters.
1524 Used by the admin UI to show scheduled deletions table.
1525 Auth: Requires JWT. Admin only.
1526*/
1527        pub async fn list_privacy_requests(
1528            &mut self,
1529            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1530        ) -> std::result::Result<
1531            tonic::Response<super::ListPrivacyRequestsResponse>,
1532            tonic::Status,
1533        > {
1534            self.inner
1535                .ready()
1536                .await
1537                .map_err(|e| {
1538                    tonic::Status::unknown(
1539                        format!("Service was not ready: {}", e.into()),
1540                    )
1541                })?;
1542            let codec = tonic_prost::ProstCodec::default();
1543            let path = http::uri::PathAndQuery::from_static(
1544                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1545            );
1546            let mut req = request.into_request();
1547            req.extensions_mut()
1548                .insert(
1549                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1550                );
1551            self.inner.unary(req, path, codec).await
1552        }
1553        /** Cancel a pending deletion request. Reactivates the user and aborts
1554 the deletion workflow. Only valid during the 30-day grace period.
1555 Auth: Requires JWT. Admin only.
1556*/
1557        pub async fn cancel_deletion(
1558            &mut self,
1559            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1560        ) -> std::result::Result<
1561            tonic::Response<super::CancelDeletionResponse>,
1562            tonic::Status,
1563        > {
1564            self.inner
1565                .ready()
1566                .await
1567                .map_err(|e| {
1568                    tonic::Status::unknown(
1569                        format!("Service was not ready: {}", e.into()),
1570                    )
1571                })?;
1572            let codec = tonic_prost::ProstCodec::default();
1573            let path = http::uri::PathAndQuery::from_static(
1574                "/pidgr.v1.PrivacyService/CancelDeletion",
1575            );
1576            let mut req = request.into_request();
1577            req.extensions_mut()
1578                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1579            self.inner.unary(req, path, codec).await
1580        }
1581        /** Skip the grace period and delete immediately. Signals the deletion
1582 workflow to proceed without waiting for the 30-day timer.
1583 Auth: Requires JWT. Admin only.
1584*/
1585        pub async fn immediate_delete(
1586            &mut self,
1587            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1588        ) -> std::result::Result<
1589            tonic::Response<super::ImmediateDeleteResponse>,
1590            tonic::Status,
1591        > {
1592            self.inner
1593                .ready()
1594                .await
1595                .map_err(|e| {
1596                    tonic::Status::unknown(
1597                        format!("Service was not ready: {}", e.into()),
1598                    )
1599                })?;
1600            let codec = tonic_prost::ProstCodec::default();
1601            let path = http::uri::PathAndQuery::from_static(
1602                "/pidgr.v1.PrivacyService/ImmediateDelete",
1603            );
1604            let mut req = request.into_request();
1605            req.extensions_mut()
1606                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1607            self.inner.unary(req, path, codec).await
1608        }
1609        /** List the calling user's own privacy requests (export, rectify).
1610 The server extracts user_id from the JWT — no admin permission required.
1611 Auth: Requires JWT. Any authenticated user.
1612*/
1613        pub async fn list_my_privacy_requests(
1614            &mut self,
1615            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1616        ) -> std::result::Result<
1617            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1618            tonic::Status,
1619        > {
1620            self.inner
1621                .ready()
1622                .await
1623                .map_err(|e| {
1624                    tonic::Status::unknown(
1625                        format!("Service was not ready: {}", e.into()),
1626                    )
1627                })?;
1628            let codec = tonic_prost::ProstCodec::default();
1629            let path = http::uri::PathAndQuery::from_static(
1630                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1631            );
1632            let mut req = request.into_request();
1633            req.extensions_mut()
1634                .insert(
1635                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1636                );
1637            self.inner.unary(req, path, codec).await
1638        }
1639    }
1640}
1641/// Generated server implementations.
1642pub mod privacy_service_server {
1643    #![allow(
1644        unused_variables,
1645        dead_code,
1646        missing_docs,
1647        clippy::wildcard_imports,
1648        clippy::let_unit_value,
1649    )]
1650    use tonic::codegen::*;
1651    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
1652    #[async_trait]
1653    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1654        /** Export all personal data associated with a user as a downloadable ZIP.
1655 Async operation — returns immediately with PENDING status, sends push
1656 notification when the export is ready.
1657 Auth: Requires JWT. Callable by the user themselves or an org admin.
1658*/
1659        async fn export_user_data(
1660            &self,
1661            request: tonic::Request<super::ExportUserDataRequest>,
1662        ) -> std::result::Result<
1663            tonic::Response<super::ExportUserDataResponse>,
1664            tonic::Status,
1665        >;
1666        /** Delete or anonymize all personal data associated with a user.
1667 Deletion has a 30-day grace period during which processing is restricted
1668 and the request can be cancelled. After 30 days, deletion is irreversible.
1669 Auth: Requires JWT. Admin only.
1670*/
1671        async fn delete_user_data(
1672            &self,
1673            request: tonic::Request<super::DeleteUserDataRequest>,
1674        ) -> std::result::Result<
1675            tonic::Response<super::DeleteUserDataResponse>,
1676            tonic::Status,
1677        >;
1678        /** Correct personal data for a user. Propagates corrections to all stored
1679 locations (profile, delivery records, analytics metadata).
1680 Auth: Requires JWT. Callable by the user themselves or an org admin.
1681*/
1682        async fn rectify_user_data(
1683            &self,
1684            request: tonic::Request<super::RectifyUserDataRequest>,
1685        ) -> std::result::Result<
1686            tonic::Response<super::RectifyUserDataResponse>,
1687            tonic::Status,
1688        >;
1689        /** Restrict or unrestrict processing for a user. When restricted, the API
1690 skips this user in campaigns, analytics, and session replay.
1691 Auth: Requires JWT. Admin only.
1692*/
1693        async fn restrict_processing(
1694            &self,
1695            request: tonic::Request<super::RestrictProcessingRequest>,
1696        ) -> std::result::Result<
1697            tonic::Response<super::RestrictProcessingResponse>,
1698            tonic::Status,
1699        >;
1700        /** Confirm whether personal data exists for a user and list data categories.
1701 LGPD-specific: confirmação de existência (Art. 18, I).
1702 Auth: Requires JWT. Admin only.
1703*/
1704        async fn get_data_existence_confirmation(
1705            &self,
1706            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1707        ) -> std::result::Result<
1708            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1709            tonic::Status,
1710        >;
1711        /** List privacy requests for the organization, with optional filters.
1712 Used by the admin UI to show scheduled deletions table.
1713 Auth: Requires JWT. Admin only.
1714*/
1715        async fn list_privacy_requests(
1716            &self,
1717            request: tonic::Request<super::ListPrivacyRequestsRequest>,
1718        ) -> std::result::Result<
1719            tonic::Response<super::ListPrivacyRequestsResponse>,
1720            tonic::Status,
1721        >;
1722        /** Cancel a pending deletion request. Reactivates the user and aborts
1723 the deletion workflow. Only valid during the 30-day grace period.
1724 Auth: Requires JWT. Admin only.
1725*/
1726        async fn cancel_deletion(
1727            &self,
1728            request: tonic::Request<super::CancelDeletionRequest>,
1729        ) -> std::result::Result<
1730            tonic::Response<super::CancelDeletionResponse>,
1731            tonic::Status,
1732        >;
1733        /** Skip the grace period and delete immediately. Signals the deletion
1734 workflow to proceed without waiting for the 30-day timer.
1735 Auth: Requires JWT. Admin only.
1736*/
1737        async fn immediate_delete(
1738            &self,
1739            request: tonic::Request<super::ImmediateDeleteRequest>,
1740        ) -> std::result::Result<
1741            tonic::Response<super::ImmediateDeleteResponse>,
1742            tonic::Status,
1743        >;
1744        /** List the calling user's own privacy requests (export, rectify).
1745 The server extracts user_id from the JWT — no admin permission required.
1746 Auth: Requires JWT. Any authenticated user.
1747*/
1748        async fn list_my_privacy_requests(
1749            &self,
1750            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1751        ) -> std::result::Result<
1752            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1753            tonic::Status,
1754        >;
1755    }
1756    /** PrivacyService handles GDPR/LGPD data subject rights.
1757 All RPCs extract org_id from the JWT — it is never in request messages.
1758*/
1759    #[derive(Debug)]
1760    pub struct PrivacyServiceServer<T> {
1761        inner: Arc<T>,
1762        accept_compression_encodings: EnabledCompressionEncodings,
1763        send_compression_encodings: EnabledCompressionEncodings,
1764        max_decoding_message_size: Option<usize>,
1765        max_encoding_message_size: Option<usize>,
1766    }
1767    impl<T> PrivacyServiceServer<T> {
1768        pub fn new(inner: T) -> Self {
1769            Self::from_arc(Arc::new(inner))
1770        }
1771        pub fn from_arc(inner: Arc<T>) -> Self {
1772            Self {
1773                inner,
1774                accept_compression_encodings: Default::default(),
1775                send_compression_encodings: Default::default(),
1776                max_decoding_message_size: None,
1777                max_encoding_message_size: None,
1778            }
1779        }
1780        pub fn with_interceptor<F>(
1781            inner: T,
1782            interceptor: F,
1783        ) -> InterceptedService<Self, F>
1784        where
1785            F: tonic::service::Interceptor,
1786        {
1787            InterceptedService::new(Self::new(inner), interceptor)
1788        }
1789        /// Enable decompressing requests with the given encoding.
1790        #[must_use]
1791        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1792            self.accept_compression_encodings.enable(encoding);
1793            self
1794        }
1795        /// Compress responses with the given encoding, if the client supports it.
1796        #[must_use]
1797        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1798            self.send_compression_encodings.enable(encoding);
1799            self
1800        }
1801        /// Limits the maximum size of a decoded message.
1802        ///
1803        /// Default: `4MB`
1804        #[must_use]
1805        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1806            self.max_decoding_message_size = Some(limit);
1807            self
1808        }
1809        /// Limits the maximum size of an encoded message.
1810        ///
1811        /// Default: `usize::MAX`
1812        #[must_use]
1813        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1814            self.max_encoding_message_size = Some(limit);
1815            self
1816        }
1817    }
1818    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1819    where
1820        T: PrivacyService,
1821        B: Body + std::marker::Send + 'static,
1822        B::Error: Into<StdError> + std::marker::Send + 'static,
1823    {
1824        type Response = http::Response<tonic::body::Body>;
1825        type Error = std::convert::Infallible;
1826        type Future = BoxFuture<Self::Response, Self::Error>;
1827        fn poll_ready(
1828            &mut self,
1829            _cx: &mut Context<'_>,
1830        ) -> Poll<std::result::Result<(), Self::Error>> {
1831            Poll::Ready(Ok(()))
1832        }
1833        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1834            match req.uri().path() {
1835                "/pidgr.v1.PrivacyService/ExportUserData" => {
1836                    #[allow(non_camel_case_types)]
1837                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1838                    impl<
1839                        T: PrivacyService,
1840                    > tonic::server::UnaryService<super::ExportUserDataRequest>
1841                    for ExportUserDataSvc<T> {
1842                        type Response = super::ExportUserDataResponse;
1843                        type Future = BoxFuture<
1844                            tonic::Response<Self::Response>,
1845                            tonic::Status,
1846                        >;
1847                        fn call(
1848                            &mut self,
1849                            request: tonic::Request<super::ExportUserDataRequest>,
1850                        ) -> Self::Future {
1851                            let inner = Arc::clone(&self.0);
1852                            let fut = async move {
1853                                <T as PrivacyService>::export_user_data(&inner, request)
1854                                    .await
1855                            };
1856                            Box::pin(fut)
1857                        }
1858                    }
1859                    let accept_compression_encodings = self.accept_compression_encodings;
1860                    let send_compression_encodings = self.send_compression_encodings;
1861                    let max_decoding_message_size = self.max_decoding_message_size;
1862                    let max_encoding_message_size = self.max_encoding_message_size;
1863                    let inner = self.inner.clone();
1864                    let fut = async move {
1865                        let method = ExportUserDataSvc(inner);
1866                        let codec = tonic_prost::ProstCodec::default();
1867                        let mut grpc = tonic::server::Grpc::new(codec)
1868                            .apply_compression_config(
1869                                accept_compression_encodings,
1870                                send_compression_encodings,
1871                            )
1872                            .apply_max_message_size_config(
1873                                max_decoding_message_size,
1874                                max_encoding_message_size,
1875                            );
1876                        let res = grpc.unary(method, req).await;
1877                        Ok(res)
1878                    };
1879                    Box::pin(fut)
1880                }
1881                "/pidgr.v1.PrivacyService/DeleteUserData" => {
1882                    #[allow(non_camel_case_types)]
1883                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1884                    impl<
1885                        T: PrivacyService,
1886                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
1887                    for DeleteUserDataSvc<T> {
1888                        type Response = super::DeleteUserDataResponse;
1889                        type Future = BoxFuture<
1890                            tonic::Response<Self::Response>,
1891                            tonic::Status,
1892                        >;
1893                        fn call(
1894                            &mut self,
1895                            request: tonic::Request<super::DeleteUserDataRequest>,
1896                        ) -> Self::Future {
1897                            let inner = Arc::clone(&self.0);
1898                            let fut = async move {
1899                                <T as PrivacyService>::delete_user_data(&inner, request)
1900                                    .await
1901                            };
1902                            Box::pin(fut)
1903                        }
1904                    }
1905                    let accept_compression_encodings = self.accept_compression_encodings;
1906                    let send_compression_encodings = self.send_compression_encodings;
1907                    let max_decoding_message_size = self.max_decoding_message_size;
1908                    let max_encoding_message_size = self.max_encoding_message_size;
1909                    let inner = self.inner.clone();
1910                    let fut = async move {
1911                        let method = DeleteUserDataSvc(inner);
1912                        let codec = tonic_prost::ProstCodec::default();
1913                        let mut grpc = tonic::server::Grpc::new(codec)
1914                            .apply_compression_config(
1915                                accept_compression_encodings,
1916                                send_compression_encodings,
1917                            )
1918                            .apply_max_message_size_config(
1919                                max_decoding_message_size,
1920                                max_encoding_message_size,
1921                            );
1922                        let res = grpc.unary(method, req).await;
1923                        Ok(res)
1924                    };
1925                    Box::pin(fut)
1926                }
1927                "/pidgr.v1.PrivacyService/RectifyUserData" => {
1928                    #[allow(non_camel_case_types)]
1929                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1930                    impl<
1931                        T: PrivacyService,
1932                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
1933                    for RectifyUserDataSvc<T> {
1934                        type Response = super::RectifyUserDataResponse;
1935                        type Future = BoxFuture<
1936                            tonic::Response<Self::Response>,
1937                            tonic::Status,
1938                        >;
1939                        fn call(
1940                            &mut self,
1941                            request: tonic::Request<super::RectifyUserDataRequest>,
1942                        ) -> Self::Future {
1943                            let inner = Arc::clone(&self.0);
1944                            let fut = async move {
1945                                <T as PrivacyService>::rectify_user_data(&inner, request)
1946                                    .await
1947                            };
1948                            Box::pin(fut)
1949                        }
1950                    }
1951                    let accept_compression_encodings = self.accept_compression_encodings;
1952                    let send_compression_encodings = self.send_compression_encodings;
1953                    let max_decoding_message_size = self.max_decoding_message_size;
1954                    let max_encoding_message_size = self.max_encoding_message_size;
1955                    let inner = self.inner.clone();
1956                    let fut = async move {
1957                        let method = RectifyUserDataSvc(inner);
1958                        let codec = tonic_prost::ProstCodec::default();
1959                        let mut grpc = tonic::server::Grpc::new(codec)
1960                            .apply_compression_config(
1961                                accept_compression_encodings,
1962                                send_compression_encodings,
1963                            )
1964                            .apply_max_message_size_config(
1965                                max_decoding_message_size,
1966                                max_encoding_message_size,
1967                            );
1968                        let res = grpc.unary(method, req).await;
1969                        Ok(res)
1970                    };
1971                    Box::pin(fut)
1972                }
1973                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
1974                    #[allow(non_camel_case_types)]
1975                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
1976                    impl<
1977                        T: PrivacyService,
1978                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
1979                    for RestrictProcessingSvc<T> {
1980                        type Response = super::RestrictProcessingResponse;
1981                        type Future = BoxFuture<
1982                            tonic::Response<Self::Response>,
1983                            tonic::Status,
1984                        >;
1985                        fn call(
1986                            &mut self,
1987                            request: tonic::Request<super::RestrictProcessingRequest>,
1988                        ) -> Self::Future {
1989                            let inner = Arc::clone(&self.0);
1990                            let fut = async move {
1991                                <T as PrivacyService>::restrict_processing(&inner, request)
1992                                    .await
1993                            };
1994                            Box::pin(fut)
1995                        }
1996                    }
1997                    let accept_compression_encodings = self.accept_compression_encodings;
1998                    let send_compression_encodings = self.send_compression_encodings;
1999                    let max_decoding_message_size = self.max_decoding_message_size;
2000                    let max_encoding_message_size = self.max_encoding_message_size;
2001                    let inner = self.inner.clone();
2002                    let fut = async move {
2003                        let method = RestrictProcessingSvc(inner);
2004                        let codec = tonic_prost::ProstCodec::default();
2005                        let mut grpc = tonic::server::Grpc::new(codec)
2006                            .apply_compression_config(
2007                                accept_compression_encodings,
2008                                send_compression_encodings,
2009                            )
2010                            .apply_max_message_size_config(
2011                                max_decoding_message_size,
2012                                max_encoding_message_size,
2013                            );
2014                        let res = grpc.unary(method, req).await;
2015                        Ok(res)
2016                    };
2017                    Box::pin(fut)
2018                }
2019                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2020                    #[allow(non_camel_case_types)]
2021                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2022                        pub Arc<T>,
2023                    );
2024                    impl<
2025                        T: PrivacyService,
2026                    > tonic::server::UnaryService<
2027                        super::GetDataExistenceConfirmationRequest,
2028                    > for GetDataExistenceConfirmationSvc<T> {
2029                        type Response = super::GetDataExistenceConfirmationResponse;
2030                        type Future = BoxFuture<
2031                            tonic::Response<Self::Response>,
2032                            tonic::Status,
2033                        >;
2034                        fn call(
2035                            &mut self,
2036                            request: tonic::Request<
2037                                super::GetDataExistenceConfirmationRequest,
2038                            >,
2039                        ) -> Self::Future {
2040                            let inner = Arc::clone(&self.0);
2041                            let fut = async move {
2042                                <T as PrivacyService>::get_data_existence_confirmation(
2043                                        &inner,
2044                                        request,
2045                                    )
2046                                    .await
2047                            };
2048                            Box::pin(fut)
2049                        }
2050                    }
2051                    let accept_compression_encodings = self.accept_compression_encodings;
2052                    let send_compression_encodings = self.send_compression_encodings;
2053                    let max_decoding_message_size = self.max_decoding_message_size;
2054                    let max_encoding_message_size = self.max_encoding_message_size;
2055                    let inner = self.inner.clone();
2056                    let fut = async move {
2057                        let method = GetDataExistenceConfirmationSvc(inner);
2058                        let codec = tonic_prost::ProstCodec::default();
2059                        let mut grpc = tonic::server::Grpc::new(codec)
2060                            .apply_compression_config(
2061                                accept_compression_encodings,
2062                                send_compression_encodings,
2063                            )
2064                            .apply_max_message_size_config(
2065                                max_decoding_message_size,
2066                                max_encoding_message_size,
2067                            );
2068                        let res = grpc.unary(method, req).await;
2069                        Ok(res)
2070                    };
2071                    Box::pin(fut)
2072                }
2073                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2074                    #[allow(non_camel_case_types)]
2075                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2076                    impl<
2077                        T: PrivacyService,
2078                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2079                    for ListPrivacyRequestsSvc<T> {
2080                        type Response = super::ListPrivacyRequestsResponse;
2081                        type Future = BoxFuture<
2082                            tonic::Response<Self::Response>,
2083                            tonic::Status,
2084                        >;
2085                        fn call(
2086                            &mut self,
2087                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2088                        ) -> Self::Future {
2089                            let inner = Arc::clone(&self.0);
2090                            let fut = async move {
2091                                <T as PrivacyService>::list_privacy_requests(
2092                                        &inner,
2093                                        request,
2094                                    )
2095                                    .await
2096                            };
2097                            Box::pin(fut)
2098                        }
2099                    }
2100                    let accept_compression_encodings = self.accept_compression_encodings;
2101                    let send_compression_encodings = self.send_compression_encodings;
2102                    let max_decoding_message_size = self.max_decoding_message_size;
2103                    let max_encoding_message_size = self.max_encoding_message_size;
2104                    let inner = self.inner.clone();
2105                    let fut = async move {
2106                        let method = ListPrivacyRequestsSvc(inner);
2107                        let codec = tonic_prost::ProstCodec::default();
2108                        let mut grpc = tonic::server::Grpc::new(codec)
2109                            .apply_compression_config(
2110                                accept_compression_encodings,
2111                                send_compression_encodings,
2112                            )
2113                            .apply_max_message_size_config(
2114                                max_decoding_message_size,
2115                                max_encoding_message_size,
2116                            );
2117                        let res = grpc.unary(method, req).await;
2118                        Ok(res)
2119                    };
2120                    Box::pin(fut)
2121                }
2122                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2123                    #[allow(non_camel_case_types)]
2124                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2125                    impl<
2126                        T: PrivacyService,
2127                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2128                    for CancelDeletionSvc<T> {
2129                        type Response = super::CancelDeletionResponse;
2130                        type Future = BoxFuture<
2131                            tonic::Response<Self::Response>,
2132                            tonic::Status,
2133                        >;
2134                        fn call(
2135                            &mut self,
2136                            request: tonic::Request<super::CancelDeletionRequest>,
2137                        ) -> Self::Future {
2138                            let inner = Arc::clone(&self.0);
2139                            let fut = async move {
2140                                <T as PrivacyService>::cancel_deletion(&inner, request)
2141                                    .await
2142                            };
2143                            Box::pin(fut)
2144                        }
2145                    }
2146                    let accept_compression_encodings = self.accept_compression_encodings;
2147                    let send_compression_encodings = self.send_compression_encodings;
2148                    let max_decoding_message_size = self.max_decoding_message_size;
2149                    let max_encoding_message_size = self.max_encoding_message_size;
2150                    let inner = self.inner.clone();
2151                    let fut = async move {
2152                        let method = CancelDeletionSvc(inner);
2153                        let codec = tonic_prost::ProstCodec::default();
2154                        let mut grpc = tonic::server::Grpc::new(codec)
2155                            .apply_compression_config(
2156                                accept_compression_encodings,
2157                                send_compression_encodings,
2158                            )
2159                            .apply_max_message_size_config(
2160                                max_decoding_message_size,
2161                                max_encoding_message_size,
2162                            );
2163                        let res = grpc.unary(method, req).await;
2164                        Ok(res)
2165                    };
2166                    Box::pin(fut)
2167                }
2168                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2169                    #[allow(non_camel_case_types)]
2170                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2171                    impl<
2172                        T: PrivacyService,
2173                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2174                    for ImmediateDeleteSvc<T> {
2175                        type Response = super::ImmediateDeleteResponse;
2176                        type Future = BoxFuture<
2177                            tonic::Response<Self::Response>,
2178                            tonic::Status,
2179                        >;
2180                        fn call(
2181                            &mut self,
2182                            request: tonic::Request<super::ImmediateDeleteRequest>,
2183                        ) -> Self::Future {
2184                            let inner = Arc::clone(&self.0);
2185                            let fut = async move {
2186                                <T as PrivacyService>::immediate_delete(&inner, request)
2187                                    .await
2188                            };
2189                            Box::pin(fut)
2190                        }
2191                    }
2192                    let accept_compression_encodings = self.accept_compression_encodings;
2193                    let send_compression_encodings = self.send_compression_encodings;
2194                    let max_decoding_message_size = self.max_decoding_message_size;
2195                    let max_encoding_message_size = self.max_encoding_message_size;
2196                    let inner = self.inner.clone();
2197                    let fut = async move {
2198                        let method = ImmediateDeleteSvc(inner);
2199                        let codec = tonic_prost::ProstCodec::default();
2200                        let mut grpc = tonic::server::Grpc::new(codec)
2201                            .apply_compression_config(
2202                                accept_compression_encodings,
2203                                send_compression_encodings,
2204                            )
2205                            .apply_max_message_size_config(
2206                                max_decoding_message_size,
2207                                max_encoding_message_size,
2208                            );
2209                        let res = grpc.unary(method, req).await;
2210                        Ok(res)
2211                    };
2212                    Box::pin(fut)
2213                }
2214                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2215                    #[allow(non_camel_case_types)]
2216                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2217                    impl<
2218                        T: PrivacyService,
2219                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2220                    for ListMyPrivacyRequestsSvc<T> {
2221                        type Response = super::ListMyPrivacyRequestsResponse;
2222                        type Future = BoxFuture<
2223                            tonic::Response<Self::Response>,
2224                            tonic::Status,
2225                        >;
2226                        fn call(
2227                            &mut self,
2228                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2229                        ) -> Self::Future {
2230                            let inner = Arc::clone(&self.0);
2231                            let fut = async move {
2232                                <T as PrivacyService>::list_my_privacy_requests(
2233                                        &inner,
2234                                        request,
2235                                    )
2236                                    .await
2237                            };
2238                            Box::pin(fut)
2239                        }
2240                    }
2241                    let accept_compression_encodings = self.accept_compression_encodings;
2242                    let send_compression_encodings = self.send_compression_encodings;
2243                    let max_decoding_message_size = self.max_decoding_message_size;
2244                    let max_encoding_message_size = self.max_encoding_message_size;
2245                    let inner = self.inner.clone();
2246                    let fut = async move {
2247                        let method = ListMyPrivacyRequestsSvc(inner);
2248                        let codec = tonic_prost::ProstCodec::default();
2249                        let mut grpc = tonic::server::Grpc::new(codec)
2250                            .apply_compression_config(
2251                                accept_compression_encodings,
2252                                send_compression_encodings,
2253                            )
2254                            .apply_max_message_size_config(
2255                                max_decoding_message_size,
2256                                max_encoding_message_size,
2257                            );
2258                        let res = grpc.unary(method, req).await;
2259                        Ok(res)
2260                    };
2261                    Box::pin(fut)
2262                }
2263                _ => {
2264                    Box::pin(async move {
2265                        let mut response = http::Response::new(
2266                            tonic::body::Body::default(),
2267                        );
2268                        let headers = response.headers_mut();
2269                        headers
2270                            .insert(
2271                                tonic::Status::GRPC_STATUS,
2272                                (tonic::Code::Unimplemented as i32).into(),
2273                            );
2274                        headers
2275                            .insert(
2276                                http::header::CONTENT_TYPE,
2277                                tonic::metadata::GRPC_CONTENT_TYPE,
2278                            );
2279                        Ok(response)
2280                    })
2281                }
2282            }
2283        }
2284    }
2285    impl<T> Clone for PrivacyServiceServer<T> {
2286        fn clone(&self) -> Self {
2287            let inner = self.inner.clone();
2288            Self {
2289                inner,
2290                accept_compression_encodings: self.accept_compression_encodings,
2291                send_compression_encodings: self.send_compression_encodings,
2292                max_decoding_message_size: self.max_decoding_message_size,
2293                max_encoding_message_size: self.max_encoding_message_size,
2294            }
2295        }
2296    }
2297    /// Generated gRPC service name
2298    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2299    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2300        const NAME: &'static str = SERVICE_NAME;
2301    }
2302}
2303/// Generated client implementations.
2304pub mod audit_service_client {
2305    #![allow(
2306        unused_variables,
2307        dead_code,
2308        missing_docs,
2309        clippy::wildcard_imports,
2310        clippy::let_unit_value,
2311    )]
2312    use tonic::codegen::*;
2313    use tonic::codegen::http::Uri;
2314    /** AuditService provides read access to the append-only audit trail.
2315 All RPCs extract org_id from the JWT — it is never in request messages.
2316*/
2317    #[derive(Debug, Clone)]
2318    pub struct AuditServiceClient<T> {
2319        inner: tonic::client::Grpc<T>,
2320    }
2321    impl AuditServiceClient<tonic::transport::Channel> {
2322        /// Attempt to create a new client by connecting to a given endpoint.
2323        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2324        where
2325            D: TryInto<tonic::transport::Endpoint>,
2326            D::Error: Into<StdError>,
2327        {
2328            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2329            Ok(Self::new(conn))
2330        }
2331    }
2332    impl<T> AuditServiceClient<T>
2333    where
2334        T: tonic::client::GrpcService<tonic::body::Body>,
2335        T::Error: Into<StdError>,
2336        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2337        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2338    {
2339        pub fn new(inner: T) -> Self {
2340            let inner = tonic::client::Grpc::new(inner);
2341            Self { inner }
2342        }
2343        pub fn with_origin(inner: T, origin: Uri) -> Self {
2344            let inner = tonic::client::Grpc::with_origin(inner, origin);
2345            Self { inner }
2346        }
2347        pub fn with_interceptor<F>(
2348            inner: T,
2349            interceptor: F,
2350        ) -> AuditServiceClient<InterceptedService<T, F>>
2351        where
2352            F: tonic::service::Interceptor,
2353            T::ResponseBody: Default,
2354            T: tonic::codegen::Service<
2355                http::Request<tonic::body::Body>,
2356                Response = http::Response<
2357                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2358                >,
2359            >,
2360            <T as tonic::codegen::Service<
2361                http::Request<tonic::body::Body>,
2362            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2363        {
2364            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2365        }
2366        /// Compress requests with the given encoding.
2367        ///
2368        /// This requires the server to support it otherwise it might respond with an
2369        /// error.
2370        #[must_use]
2371        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2372            self.inner = self.inner.send_compressed(encoding);
2373            self
2374        }
2375        /// Enable decompressing responses.
2376        #[must_use]
2377        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2378            self.inner = self.inner.accept_compressed(encoding);
2379            self
2380        }
2381        /// Limits the maximum size of a decoded message.
2382        ///
2383        /// Default: `4MB`
2384        #[must_use]
2385        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2386            self.inner = self.inner.max_decoding_message_size(limit);
2387            self
2388        }
2389        /// Limits the maximum size of an encoded message.
2390        ///
2391        /// Default: `usize::MAX`
2392        #[must_use]
2393        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2394            self.inner = self.inner.max_encoding_message_size(limit);
2395            self
2396        }
2397        /** List audit events with optional filtering by event type, actor, and date range.
2398 Results are ordered by created_at descending (newest first).
2399 Auth: Requires JWT. Admin only.
2400*/
2401        pub async fn list_audit_events(
2402            &mut self,
2403            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2404        ) -> std::result::Result<
2405            tonic::Response<super::ListAuditEventsResponse>,
2406            tonic::Status,
2407        > {
2408            self.inner
2409                .ready()
2410                .await
2411                .map_err(|e| {
2412                    tonic::Status::unknown(
2413                        format!("Service was not ready: {}", e.into()),
2414                    )
2415                })?;
2416            let codec = tonic_prost::ProstCodec::default();
2417            let path = http::uri::PathAndQuery::from_static(
2418                "/pidgr.v1.AuditService/ListAuditEvents",
2419            );
2420            let mut req = request.into_request();
2421            req.extensions_mut()
2422                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2423            self.inner.unary(req, path, codec).await
2424        }
2425        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2426 Creates a persistent record and starts an async Temporal workflow.
2427 Auth: Requires JWT. Admin only.
2428*/
2429        pub async fn export_audit_trail(
2430            &mut self,
2431            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2432        ) -> std::result::Result<
2433            tonic::Response<super::ExportAuditTrailResponse>,
2434            tonic::Status,
2435        > {
2436            self.inner
2437                .ready()
2438                .await
2439                .map_err(|e| {
2440                    tonic::Status::unknown(
2441                        format!("Service was not ready: {}", e.into()),
2442                    )
2443                })?;
2444            let codec = tonic_prost::ProstCodec::default();
2445            let path = http::uri::PathAndQuery::from_static(
2446                "/pidgr.v1.AuditService/ExportAuditTrail",
2447            );
2448            let mut req = request.into_request();
2449            req.extensions_mut()
2450                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2451            self.inner.unary(req, path, codec).await
2452        }
2453        /** List audit export history for the organization.
2454 Auth: Requires JWT. Admin only.
2455*/
2456        pub async fn list_audit_exports(
2457            &mut self,
2458            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2459        ) -> std::result::Result<
2460            tonic::Response<super::ListAuditExportsResponse>,
2461            tonic::Status,
2462        > {
2463            self.inner
2464                .ready()
2465                .await
2466                .map_err(|e| {
2467                    tonic::Status::unknown(
2468                        format!("Service was not ready: {}", e.into()),
2469                    )
2470                })?;
2471            let codec = tonic_prost::ProstCodec::default();
2472            let path = http::uri::PathAndQuery::from_static(
2473                "/pidgr.v1.AuditService/ListAuditExports",
2474            );
2475            let mut req = request.into_request();
2476            req.extensions_mut()
2477                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2478            self.inner.unary(req, path, codec).await
2479        }
2480    }
2481}
2482/// Generated server implementations.
2483pub mod audit_service_server {
2484    #![allow(
2485        unused_variables,
2486        dead_code,
2487        missing_docs,
2488        clippy::wildcard_imports,
2489        clippy::let_unit_value,
2490    )]
2491    use tonic::codegen::*;
2492    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2493    #[async_trait]
2494    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2495        /** List audit events with optional filtering by event type, actor, and date range.
2496 Results are ordered by created_at descending (newest first).
2497 Auth: Requires JWT. Admin only.
2498*/
2499        async fn list_audit_events(
2500            &self,
2501            request: tonic::Request<super::ListAuditEventsRequest>,
2502        ) -> std::result::Result<
2503            tonic::Response<super::ListAuditEventsResponse>,
2504            tonic::Status,
2505        >;
2506        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2507 Creates a persistent record and starts an async Temporal workflow.
2508 Auth: Requires JWT. Admin only.
2509*/
2510        async fn export_audit_trail(
2511            &self,
2512            request: tonic::Request<super::ExportAuditTrailRequest>,
2513        ) -> std::result::Result<
2514            tonic::Response<super::ExportAuditTrailResponse>,
2515            tonic::Status,
2516        >;
2517        /** List audit export history for the organization.
2518 Auth: Requires JWT. Admin only.
2519*/
2520        async fn list_audit_exports(
2521            &self,
2522            request: tonic::Request<super::ListAuditExportsRequest>,
2523        ) -> std::result::Result<
2524            tonic::Response<super::ListAuditExportsResponse>,
2525            tonic::Status,
2526        >;
2527    }
2528    /** AuditService provides read access to the append-only audit trail.
2529 All RPCs extract org_id from the JWT — it is never in request messages.
2530*/
2531    #[derive(Debug)]
2532    pub struct AuditServiceServer<T> {
2533        inner: Arc<T>,
2534        accept_compression_encodings: EnabledCompressionEncodings,
2535        send_compression_encodings: EnabledCompressionEncodings,
2536        max_decoding_message_size: Option<usize>,
2537        max_encoding_message_size: Option<usize>,
2538    }
2539    impl<T> AuditServiceServer<T> {
2540        pub fn new(inner: T) -> Self {
2541            Self::from_arc(Arc::new(inner))
2542        }
2543        pub fn from_arc(inner: Arc<T>) -> Self {
2544            Self {
2545                inner,
2546                accept_compression_encodings: Default::default(),
2547                send_compression_encodings: Default::default(),
2548                max_decoding_message_size: None,
2549                max_encoding_message_size: None,
2550            }
2551        }
2552        pub fn with_interceptor<F>(
2553            inner: T,
2554            interceptor: F,
2555        ) -> InterceptedService<Self, F>
2556        where
2557            F: tonic::service::Interceptor,
2558        {
2559            InterceptedService::new(Self::new(inner), interceptor)
2560        }
2561        /// Enable decompressing requests with the given encoding.
2562        #[must_use]
2563        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2564            self.accept_compression_encodings.enable(encoding);
2565            self
2566        }
2567        /// Compress responses with the given encoding, if the client supports it.
2568        #[must_use]
2569        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2570            self.send_compression_encodings.enable(encoding);
2571            self
2572        }
2573        /// Limits the maximum size of a decoded message.
2574        ///
2575        /// Default: `4MB`
2576        #[must_use]
2577        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2578            self.max_decoding_message_size = Some(limit);
2579            self
2580        }
2581        /// Limits the maximum size of an encoded message.
2582        ///
2583        /// Default: `usize::MAX`
2584        #[must_use]
2585        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2586            self.max_encoding_message_size = Some(limit);
2587            self
2588        }
2589    }
2590    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2591    where
2592        T: AuditService,
2593        B: Body + std::marker::Send + 'static,
2594        B::Error: Into<StdError> + std::marker::Send + 'static,
2595    {
2596        type Response = http::Response<tonic::body::Body>;
2597        type Error = std::convert::Infallible;
2598        type Future = BoxFuture<Self::Response, Self::Error>;
2599        fn poll_ready(
2600            &mut self,
2601            _cx: &mut Context<'_>,
2602        ) -> Poll<std::result::Result<(), Self::Error>> {
2603            Poll::Ready(Ok(()))
2604        }
2605        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2606            match req.uri().path() {
2607                "/pidgr.v1.AuditService/ListAuditEvents" => {
2608                    #[allow(non_camel_case_types)]
2609                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2610                    impl<
2611                        T: AuditService,
2612                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
2613                    for ListAuditEventsSvc<T> {
2614                        type Response = super::ListAuditEventsResponse;
2615                        type Future = BoxFuture<
2616                            tonic::Response<Self::Response>,
2617                            tonic::Status,
2618                        >;
2619                        fn call(
2620                            &mut self,
2621                            request: tonic::Request<super::ListAuditEventsRequest>,
2622                        ) -> Self::Future {
2623                            let inner = Arc::clone(&self.0);
2624                            let fut = async move {
2625                                <T as AuditService>::list_audit_events(&inner, request)
2626                                    .await
2627                            };
2628                            Box::pin(fut)
2629                        }
2630                    }
2631                    let accept_compression_encodings = self.accept_compression_encodings;
2632                    let send_compression_encodings = self.send_compression_encodings;
2633                    let max_decoding_message_size = self.max_decoding_message_size;
2634                    let max_encoding_message_size = self.max_encoding_message_size;
2635                    let inner = self.inner.clone();
2636                    let fut = async move {
2637                        let method = ListAuditEventsSvc(inner);
2638                        let codec = tonic_prost::ProstCodec::default();
2639                        let mut grpc = tonic::server::Grpc::new(codec)
2640                            .apply_compression_config(
2641                                accept_compression_encodings,
2642                                send_compression_encodings,
2643                            )
2644                            .apply_max_message_size_config(
2645                                max_decoding_message_size,
2646                                max_encoding_message_size,
2647                            );
2648                        let res = grpc.unary(method, req).await;
2649                        Ok(res)
2650                    };
2651                    Box::pin(fut)
2652                }
2653                "/pidgr.v1.AuditService/ExportAuditTrail" => {
2654                    #[allow(non_camel_case_types)]
2655                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2656                    impl<
2657                        T: AuditService,
2658                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2659                    for ExportAuditTrailSvc<T> {
2660                        type Response = super::ExportAuditTrailResponse;
2661                        type Future = BoxFuture<
2662                            tonic::Response<Self::Response>,
2663                            tonic::Status,
2664                        >;
2665                        fn call(
2666                            &mut self,
2667                            request: tonic::Request<super::ExportAuditTrailRequest>,
2668                        ) -> Self::Future {
2669                            let inner = Arc::clone(&self.0);
2670                            let fut = async move {
2671                                <T as AuditService>::export_audit_trail(&inner, request)
2672                                    .await
2673                            };
2674                            Box::pin(fut)
2675                        }
2676                    }
2677                    let accept_compression_encodings = self.accept_compression_encodings;
2678                    let send_compression_encodings = self.send_compression_encodings;
2679                    let max_decoding_message_size = self.max_decoding_message_size;
2680                    let max_encoding_message_size = self.max_encoding_message_size;
2681                    let inner = self.inner.clone();
2682                    let fut = async move {
2683                        let method = ExportAuditTrailSvc(inner);
2684                        let codec = tonic_prost::ProstCodec::default();
2685                        let mut grpc = tonic::server::Grpc::new(codec)
2686                            .apply_compression_config(
2687                                accept_compression_encodings,
2688                                send_compression_encodings,
2689                            )
2690                            .apply_max_message_size_config(
2691                                max_decoding_message_size,
2692                                max_encoding_message_size,
2693                            );
2694                        let res = grpc.unary(method, req).await;
2695                        Ok(res)
2696                    };
2697                    Box::pin(fut)
2698                }
2699                "/pidgr.v1.AuditService/ListAuditExports" => {
2700                    #[allow(non_camel_case_types)]
2701                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2702                    impl<
2703                        T: AuditService,
2704                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
2705                    for ListAuditExportsSvc<T> {
2706                        type Response = super::ListAuditExportsResponse;
2707                        type Future = BoxFuture<
2708                            tonic::Response<Self::Response>,
2709                            tonic::Status,
2710                        >;
2711                        fn call(
2712                            &mut self,
2713                            request: tonic::Request<super::ListAuditExportsRequest>,
2714                        ) -> Self::Future {
2715                            let inner = Arc::clone(&self.0);
2716                            let fut = async move {
2717                                <T as AuditService>::list_audit_exports(&inner, request)
2718                                    .await
2719                            };
2720                            Box::pin(fut)
2721                        }
2722                    }
2723                    let accept_compression_encodings = self.accept_compression_encodings;
2724                    let send_compression_encodings = self.send_compression_encodings;
2725                    let max_decoding_message_size = self.max_decoding_message_size;
2726                    let max_encoding_message_size = self.max_encoding_message_size;
2727                    let inner = self.inner.clone();
2728                    let fut = async move {
2729                        let method = ListAuditExportsSvc(inner);
2730                        let codec = tonic_prost::ProstCodec::default();
2731                        let mut grpc = tonic::server::Grpc::new(codec)
2732                            .apply_compression_config(
2733                                accept_compression_encodings,
2734                                send_compression_encodings,
2735                            )
2736                            .apply_max_message_size_config(
2737                                max_decoding_message_size,
2738                                max_encoding_message_size,
2739                            );
2740                        let res = grpc.unary(method, req).await;
2741                        Ok(res)
2742                    };
2743                    Box::pin(fut)
2744                }
2745                _ => {
2746                    Box::pin(async move {
2747                        let mut response = http::Response::new(
2748                            tonic::body::Body::default(),
2749                        );
2750                        let headers = response.headers_mut();
2751                        headers
2752                            .insert(
2753                                tonic::Status::GRPC_STATUS,
2754                                (tonic::Code::Unimplemented as i32).into(),
2755                            );
2756                        headers
2757                            .insert(
2758                                http::header::CONTENT_TYPE,
2759                                tonic::metadata::GRPC_CONTENT_TYPE,
2760                            );
2761                        Ok(response)
2762                    })
2763                }
2764            }
2765        }
2766    }
2767    impl<T> Clone for AuditServiceServer<T> {
2768        fn clone(&self) -> Self {
2769            let inner = self.inner.clone();
2770            Self {
2771                inner,
2772                accept_compression_encodings: self.accept_compression_encodings,
2773                send_compression_encodings: self.send_compression_encodings,
2774                max_decoding_message_size: self.max_decoding_message_size,
2775                max_encoding_message_size: self.max_encoding_message_size,
2776            }
2777        }
2778    }
2779    /// Generated gRPC service name
2780    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2781    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2782        const NAME: &'static str = SERVICE_NAME;
2783    }
2784}
2785/// Generated client implementations.
2786pub mod campaign_service_client {
2787    #![allow(
2788        unused_variables,
2789        dead_code,
2790        missing_docs,
2791        clippy::wildcard_imports,
2792        clippy::let_unit_value,
2793    )]
2794    use tonic::codegen::*;
2795    use tonic::codegen::http::Uri;
2796    /** Manages the full lifecycle of communication campaigns — creation,
2797 execution, monitoring, and cancellation.
2798*/
2799    #[derive(Debug, Clone)]
2800    pub struct CampaignServiceClient<T> {
2801        inner: tonic::client::Grpc<T>,
2802    }
2803    impl CampaignServiceClient<tonic::transport::Channel> {
2804        /// Attempt to create a new client by connecting to a given endpoint.
2805        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2806        where
2807            D: TryInto<tonic::transport::Endpoint>,
2808            D::Error: Into<StdError>,
2809        {
2810            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2811            Ok(Self::new(conn))
2812        }
2813    }
2814    impl<T> CampaignServiceClient<T>
2815    where
2816        T: tonic::client::GrpcService<tonic::body::Body>,
2817        T::Error: Into<StdError>,
2818        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2819        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2820    {
2821        pub fn new(inner: T) -> Self {
2822            let inner = tonic::client::Grpc::new(inner);
2823            Self { inner }
2824        }
2825        pub fn with_origin(inner: T, origin: Uri) -> Self {
2826            let inner = tonic::client::Grpc::with_origin(inner, origin);
2827            Self { inner }
2828        }
2829        pub fn with_interceptor<F>(
2830            inner: T,
2831            interceptor: F,
2832        ) -> CampaignServiceClient<InterceptedService<T, F>>
2833        where
2834            F: tonic::service::Interceptor,
2835            T::ResponseBody: Default,
2836            T: tonic::codegen::Service<
2837                http::Request<tonic::body::Body>,
2838                Response = http::Response<
2839                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2840                >,
2841            >,
2842            <T as tonic::codegen::Service<
2843                http::Request<tonic::body::Body>,
2844            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2845        {
2846            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
2847        }
2848        /// Compress requests with the given encoding.
2849        ///
2850        /// This requires the server to support it otherwise it might respond with an
2851        /// error.
2852        #[must_use]
2853        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2854            self.inner = self.inner.send_compressed(encoding);
2855            self
2856        }
2857        /// Enable decompressing responses.
2858        #[must_use]
2859        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2860            self.inner = self.inner.accept_compressed(encoding);
2861            self
2862        }
2863        /// Limits the maximum size of a decoded message.
2864        ///
2865        /// Default: `4MB`
2866        #[must_use]
2867        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2868            self.inner = self.inner.max_decoding_message_size(limit);
2869            self
2870        }
2871        /// Limits the maximum size of an encoded message.
2872        ///
2873        /// Default: `usize::MAX`
2874        #[must_use]
2875        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2876            self.inner = self.inner.max_encoding_message_size(limit);
2877            self
2878        }
2879        /** Create a new campaign with a template, audience, and workflow.
2880 Authorization: Requires MANAGER+ role.
2881*/
2882        pub async fn create_campaign(
2883            &mut self,
2884            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
2885        ) -> std::result::Result<
2886            tonic::Response<super::CreateCampaignResponse>,
2887            tonic::Status,
2888        > {
2889            self.inner
2890                .ready()
2891                .await
2892                .map_err(|e| {
2893                    tonic::Status::unknown(
2894                        format!("Service was not ready: {}", e.into()),
2895                    )
2896                })?;
2897            let codec = tonic_prost::ProstCodec::default();
2898            let path = http::uri::PathAndQuery::from_static(
2899                "/pidgr.v1.CampaignService/CreateCampaign",
2900            );
2901            let mut req = request.into_request();
2902            req.extensions_mut()
2903                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
2904            self.inner.unary(req, path, codec).await
2905        }
2906        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
2907 Authorization: Requires MANAGER+ role.
2908*/
2909        pub async fn start_campaign(
2910            &mut self,
2911            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
2912        ) -> std::result::Result<
2913            tonic::Response<super::StartCampaignResponse>,
2914            tonic::Status,
2915        > {
2916            self.inner
2917                .ready()
2918                .await
2919                .map_err(|e| {
2920                    tonic::Status::unknown(
2921                        format!("Service was not ready: {}", e.into()),
2922                    )
2923                })?;
2924            let codec = tonic_prost::ProstCodec::default();
2925            let path = http::uri::PathAndQuery::from_static(
2926                "/pidgr.v1.CampaignService/StartCampaign",
2927            );
2928            let mut req = request.into_request();
2929            req.extensions_mut()
2930                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
2931            self.inner.unary(req, path, codec).await
2932        }
2933        /** Retrieve a single campaign by ID.
2934 Authorization: Authenticated user within the organization.
2935*/
2936        pub async fn get_campaign(
2937            &mut self,
2938            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
2939        ) -> std::result::Result<
2940            tonic::Response<super::GetCampaignResponse>,
2941            tonic::Status,
2942        > {
2943            self.inner
2944                .ready()
2945                .await
2946                .map_err(|e| {
2947                    tonic::Status::unknown(
2948                        format!("Service was not ready: {}", e.into()),
2949                    )
2950                })?;
2951            let codec = tonic_prost::ProstCodec::default();
2952            let path = http::uri::PathAndQuery::from_static(
2953                "/pidgr.v1.CampaignService/GetCampaign",
2954            );
2955            let mut req = request.into_request();
2956            req.extensions_mut()
2957                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
2958            self.inner.unary(req, path, codec).await
2959        }
2960        /** List campaigns for the organization with pagination.
2961 Authorization: Authenticated user within the organization.
2962*/
2963        pub async fn list_campaigns(
2964            &mut self,
2965            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
2966        ) -> std::result::Result<
2967            tonic::Response<super::ListCampaignsResponse>,
2968            tonic::Status,
2969        > {
2970            self.inner
2971                .ready()
2972                .await
2973                .map_err(|e| {
2974                    tonic::Status::unknown(
2975                        format!("Service was not ready: {}", e.into()),
2976                    )
2977                })?;
2978            let codec = tonic_prost::ProstCodec::default();
2979            let path = http::uri::PathAndQuery::from_static(
2980                "/pidgr.v1.CampaignService/ListCampaigns",
2981            );
2982            let mut req = request.into_request();
2983            req.extensions_mut()
2984                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
2985            self.inner.unary(req, path, codec).await
2986        }
2987        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
2988 Authorization: Requires MANAGER+ role.
2989*/
2990        pub async fn update_campaign(
2991            &mut self,
2992            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
2993        ) -> std::result::Result<
2994            tonic::Response<super::UpdateCampaignResponse>,
2995            tonic::Status,
2996        > {
2997            self.inner
2998                .ready()
2999                .await
3000                .map_err(|e| {
3001                    tonic::Status::unknown(
3002                        format!("Service was not ready: {}", e.into()),
3003                    )
3004                })?;
3005            let codec = tonic_prost::ProstCodec::default();
3006            let path = http::uri::PathAndQuery::from_static(
3007                "/pidgr.v1.CampaignService/UpdateCampaign",
3008            );
3009            let mut req = request.into_request();
3010            req.extensions_mut()
3011                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3012            self.inner.unary(req, path, codec).await
3013        }
3014        /** Cancel a running campaign, stopping further deliveries and reminders.
3015 Authorization: Requires MANAGER+ role.
3016*/
3017        pub async fn cancel_campaign(
3018            &mut self,
3019            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3020        ) -> std::result::Result<
3021            tonic::Response<super::CancelCampaignResponse>,
3022            tonic::Status,
3023        > {
3024            self.inner
3025                .ready()
3026                .await
3027                .map_err(|e| {
3028                    tonic::Status::unknown(
3029                        format!("Service was not ready: {}", e.into()),
3030                    )
3031                })?;
3032            let codec = tonic_prost::ProstCodec::default();
3033            let path = http::uri::PathAndQuery::from_static(
3034                "/pidgr.v1.CampaignService/CancelCampaign",
3035            );
3036            let mut req = request.into_request();
3037            req.extensions_mut()
3038                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3039            self.inner.unary(req, path, codec).await
3040        }
3041        /** List delivery records for a campaign, optionally filtered by status.
3042 Authorization: Authenticated user within the organization.
3043*/
3044        pub async fn list_deliveries(
3045            &mut self,
3046            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3047        ) -> std::result::Result<
3048            tonic::Response<super::ListDeliveriesResponse>,
3049            tonic::Status,
3050        > {
3051            self.inner
3052                .ready()
3053                .await
3054                .map_err(|e| {
3055                    tonic::Status::unknown(
3056                        format!("Service was not ready: {}", e.into()),
3057                    )
3058                })?;
3059            let codec = tonic_prost::ProstCodec::default();
3060            let path = http::uri::PathAndQuery::from_static(
3061                "/pidgr.v1.CampaignService/ListDeliveries",
3062            );
3063            let mut req = request.into_request();
3064            req.extensions_mut()
3065                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3066            self.inner.unary(req, path, codec).await
3067        }
3068    }
3069}
3070/// Generated server implementations.
3071pub mod campaign_service_server {
3072    #![allow(
3073        unused_variables,
3074        dead_code,
3075        missing_docs,
3076        clippy::wildcard_imports,
3077        clippy::let_unit_value,
3078    )]
3079    use tonic::codegen::*;
3080    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3081    #[async_trait]
3082    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3083        /** Create a new campaign with a template, audience, and workflow.
3084 Authorization: Requires MANAGER+ role.
3085*/
3086        async fn create_campaign(
3087            &self,
3088            request: tonic::Request<super::CreateCampaignRequest>,
3089        ) -> std::result::Result<
3090            tonic::Response<super::CreateCampaignResponse>,
3091            tonic::Status,
3092        >;
3093        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3094 Authorization: Requires MANAGER+ role.
3095*/
3096        async fn start_campaign(
3097            &self,
3098            request: tonic::Request<super::StartCampaignRequest>,
3099        ) -> std::result::Result<
3100            tonic::Response<super::StartCampaignResponse>,
3101            tonic::Status,
3102        >;
3103        /** Retrieve a single campaign by ID.
3104 Authorization: Authenticated user within the organization.
3105*/
3106        async fn get_campaign(
3107            &self,
3108            request: tonic::Request<super::GetCampaignRequest>,
3109        ) -> std::result::Result<
3110            tonic::Response<super::GetCampaignResponse>,
3111            tonic::Status,
3112        >;
3113        /** List campaigns for the organization with pagination.
3114 Authorization: Authenticated user within the organization.
3115*/
3116        async fn list_campaigns(
3117            &self,
3118            request: tonic::Request<super::ListCampaignsRequest>,
3119        ) -> std::result::Result<
3120            tonic::Response<super::ListCampaignsResponse>,
3121            tonic::Status,
3122        >;
3123        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3124 Authorization: Requires MANAGER+ role.
3125*/
3126        async fn update_campaign(
3127            &self,
3128            request: tonic::Request<super::UpdateCampaignRequest>,
3129        ) -> std::result::Result<
3130            tonic::Response<super::UpdateCampaignResponse>,
3131            tonic::Status,
3132        >;
3133        /** Cancel a running campaign, stopping further deliveries and reminders.
3134 Authorization: Requires MANAGER+ role.
3135*/
3136        async fn cancel_campaign(
3137            &self,
3138            request: tonic::Request<super::CancelCampaignRequest>,
3139        ) -> std::result::Result<
3140            tonic::Response<super::CancelCampaignResponse>,
3141            tonic::Status,
3142        >;
3143        /** List delivery records for a campaign, optionally filtered by status.
3144 Authorization: Authenticated user within the organization.
3145*/
3146        async fn list_deliveries(
3147            &self,
3148            request: tonic::Request<super::ListDeliveriesRequest>,
3149        ) -> std::result::Result<
3150            tonic::Response<super::ListDeliveriesResponse>,
3151            tonic::Status,
3152        >;
3153    }
3154    /** Manages the full lifecycle of communication campaigns — creation,
3155 execution, monitoring, and cancellation.
3156*/
3157    #[derive(Debug)]
3158    pub struct CampaignServiceServer<T> {
3159        inner: Arc<T>,
3160        accept_compression_encodings: EnabledCompressionEncodings,
3161        send_compression_encodings: EnabledCompressionEncodings,
3162        max_decoding_message_size: Option<usize>,
3163        max_encoding_message_size: Option<usize>,
3164    }
3165    impl<T> CampaignServiceServer<T> {
3166        pub fn new(inner: T) -> Self {
3167            Self::from_arc(Arc::new(inner))
3168        }
3169        pub fn from_arc(inner: Arc<T>) -> Self {
3170            Self {
3171                inner,
3172                accept_compression_encodings: Default::default(),
3173                send_compression_encodings: Default::default(),
3174                max_decoding_message_size: None,
3175                max_encoding_message_size: None,
3176            }
3177        }
3178        pub fn with_interceptor<F>(
3179            inner: T,
3180            interceptor: F,
3181        ) -> InterceptedService<Self, F>
3182        where
3183            F: tonic::service::Interceptor,
3184        {
3185            InterceptedService::new(Self::new(inner), interceptor)
3186        }
3187        /// Enable decompressing requests with the given encoding.
3188        #[must_use]
3189        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3190            self.accept_compression_encodings.enable(encoding);
3191            self
3192        }
3193        /// Compress responses with the given encoding, if the client supports it.
3194        #[must_use]
3195        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3196            self.send_compression_encodings.enable(encoding);
3197            self
3198        }
3199        /// Limits the maximum size of a decoded message.
3200        ///
3201        /// Default: `4MB`
3202        #[must_use]
3203        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3204            self.max_decoding_message_size = Some(limit);
3205            self
3206        }
3207        /// Limits the maximum size of an encoded message.
3208        ///
3209        /// Default: `usize::MAX`
3210        #[must_use]
3211        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3212            self.max_encoding_message_size = Some(limit);
3213            self
3214        }
3215    }
3216    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3217    where
3218        T: CampaignService,
3219        B: Body + std::marker::Send + 'static,
3220        B::Error: Into<StdError> + std::marker::Send + 'static,
3221    {
3222        type Response = http::Response<tonic::body::Body>;
3223        type Error = std::convert::Infallible;
3224        type Future = BoxFuture<Self::Response, Self::Error>;
3225        fn poll_ready(
3226            &mut self,
3227            _cx: &mut Context<'_>,
3228        ) -> Poll<std::result::Result<(), Self::Error>> {
3229            Poll::Ready(Ok(()))
3230        }
3231        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3232            match req.uri().path() {
3233                "/pidgr.v1.CampaignService/CreateCampaign" => {
3234                    #[allow(non_camel_case_types)]
3235                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3236                    impl<
3237                        T: CampaignService,
3238                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3239                    for CreateCampaignSvc<T> {
3240                        type Response = super::CreateCampaignResponse;
3241                        type Future = BoxFuture<
3242                            tonic::Response<Self::Response>,
3243                            tonic::Status,
3244                        >;
3245                        fn call(
3246                            &mut self,
3247                            request: tonic::Request<super::CreateCampaignRequest>,
3248                        ) -> Self::Future {
3249                            let inner = Arc::clone(&self.0);
3250                            let fut = async move {
3251                                <T as CampaignService>::create_campaign(&inner, request)
3252                                    .await
3253                            };
3254                            Box::pin(fut)
3255                        }
3256                    }
3257                    let accept_compression_encodings = self.accept_compression_encodings;
3258                    let send_compression_encodings = self.send_compression_encodings;
3259                    let max_decoding_message_size = self.max_decoding_message_size;
3260                    let max_encoding_message_size = self.max_encoding_message_size;
3261                    let inner = self.inner.clone();
3262                    let fut = async move {
3263                        let method = CreateCampaignSvc(inner);
3264                        let codec = tonic_prost::ProstCodec::default();
3265                        let mut grpc = tonic::server::Grpc::new(codec)
3266                            .apply_compression_config(
3267                                accept_compression_encodings,
3268                                send_compression_encodings,
3269                            )
3270                            .apply_max_message_size_config(
3271                                max_decoding_message_size,
3272                                max_encoding_message_size,
3273                            );
3274                        let res = grpc.unary(method, req).await;
3275                        Ok(res)
3276                    };
3277                    Box::pin(fut)
3278                }
3279                "/pidgr.v1.CampaignService/StartCampaign" => {
3280                    #[allow(non_camel_case_types)]
3281                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3282                    impl<
3283                        T: CampaignService,
3284                    > tonic::server::UnaryService<super::StartCampaignRequest>
3285                    for StartCampaignSvc<T> {
3286                        type Response = super::StartCampaignResponse;
3287                        type Future = BoxFuture<
3288                            tonic::Response<Self::Response>,
3289                            tonic::Status,
3290                        >;
3291                        fn call(
3292                            &mut self,
3293                            request: tonic::Request<super::StartCampaignRequest>,
3294                        ) -> Self::Future {
3295                            let inner = Arc::clone(&self.0);
3296                            let fut = async move {
3297                                <T as CampaignService>::start_campaign(&inner, request)
3298                                    .await
3299                            };
3300                            Box::pin(fut)
3301                        }
3302                    }
3303                    let accept_compression_encodings = self.accept_compression_encodings;
3304                    let send_compression_encodings = self.send_compression_encodings;
3305                    let max_decoding_message_size = self.max_decoding_message_size;
3306                    let max_encoding_message_size = self.max_encoding_message_size;
3307                    let inner = self.inner.clone();
3308                    let fut = async move {
3309                        let method = StartCampaignSvc(inner);
3310                        let codec = tonic_prost::ProstCodec::default();
3311                        let mut grpc = tonic::server::Grpc::new(codec)
3312                            .apply_compression_config(
3313                                accept_compression_encodings,
3314                                send_compression_encodings,
3315                            )
3316                            .apply_max_message_size_config(
3317                                max_decoding_message_size,
3318                                max_encoding_message_size,
3319                            );
3320                        let res = grpc.unary(method, req).await;
3321                        Ok(res)
3322                    };
3323                    Box::pin(fut)
3324                }
3325                "/pidgr.v1.CampaignService/GetCampaign" => {
3326                    #[allow(non_camel_case_types)]
3327                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3328                    impl<
3329                        T: CampaignService,
3330                    > tonic::server::UnaryService<super::GetCampaignRequest>
3331                    for GetCampaignSvc<T> {
3332                        type Response = super::GetCampaignResponse;
3333                        type Future = BoxFuture<
3334                            tonic::Response<Self::Response>,
3335                            tonic::Status,
3336                        >;
3337                        fn call(
3338                            &mut self,
3339                            request: tonic::Request<super::GetCampaignRequest>,
3340                        ) -> Self::Future {
3341                            let inner = Arc::clone(&self.0);
3342                            let fut = async move {
3343                                <T as CampaignService>::get_campaign(&inner, request).await
3344                            };
3345                            Box::pin(fut)
3346                        }
3347                    }
3348                    let accept_compression_encodings = self.accept_compression_encodings;
3349                    let send_compression_encodings = self.send_compression_encodings;
3350                    let max_decoding_message_size = self.max_decoding_message_size;
3351                    let max_encoding_message_size = self.max_encoding_message_size;
3352                    let inner = self.inner.clone();
3353                    let fut = async move {
3354                        let method = GetCampaignSvc(inner);
3355                        let codec = tonic_prost::ProstCodec::default();
3356                        let mut grpc = tonic::server::Grpc::new(codec)
3357                            .apply_compression_config(
3358                                accept_compression_encodings,
3359                                send_compression_encodings,
3360                            )
3361                            .apply_max_message_size_config(
3362                                max_decoding_message_size,
3363                                max_encoding_message_size,
3364                            );
3365                        let res = grpc.unary(method, req).await;
3366                        Ok(res)
3367                    };
3368                    Box::pin(fut)
3369                }
3370                "/pidgr.v1.CampaignService/ListCampaigns" => {
3371                    #[allow(non_camel_case_types)]
3372                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3373                    impl<
3374                        T: CampaignService,
3375                    > tonic::server::UnaryService<super::ListCampaignsRequest>
3376                    for ListCampaignsSvc<T> {
3377                        type Response = super::ListCampaignsResponse;
3378                        type Future = BoxFuture<
3379                            tonic::Response<Self::Response>,
3380                            tonic::Status,
3381                        >;
3382                        fn call(
3383                            &mut self,
3384                            request: tonic::Request<super::ListCampaignsRequest>,
3385                        ) -> Self::Future {
3386                            let inner = Arc::clone(&self.0);
3387                            let fut = async move {
3388                                <T as CampaignService>::list_campaigns(&inner, request)
3389                                    .await
3390                            };
3391                            Box::pin(fut)
3392                        }
3393                    }
3394                    let accept_compression_encodings = self.accept_compression_encodings;
3395                    let send_compression_encodings = self.send_compression_encodings;
3396                    let max_decoding_message_size = self.max_decoding_message_size;
3397                    let max_encoding_message_size = self.max_encoding_message_size;
3398                    let inner = self.inner.clone();
3399                    let fut = async move {
3400                        let method = ListCampaignsSvc(inner);
3401                        let codec = tonic_prost::ProstCodec::default();
3402                        let mut grpc = tonic::server::Grpc::new(codec)
3403                            .apply_compression_config(
3404                                accept_compression_encodings,
3405                                send_compression_encodings,
3406                            )
3407                            .apply_max_message_size_config(
3408                                max_decoding_message_size,
3409                                max_encoding_message_size,
3410                            );
3411                        let res = grpc.unary(method, req).await;
3412                        Ok(res)
3413                    };
3414                    Box::pin(fut)
3415                }
3416                "/pidgr.v1.CampaignService/UpdateCampaign" => {
3417                    #[allow(non_camel_case_types)]
3418                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3419                    impl<
3420                        T: CampaignService,
3421                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
3422                    for UpdateCampaignSvc<T> {
3423                        type Response = super::UpdateCampaignResponse;
3424                        type Future = BoxFuture<
3425                            tonic::Response<Self::Response>,
3426                            tonic::Status,
3427                        >;
3428                        fn call(
3429                            &mut self,
3430                            request: tonic::Request<super::UpdateCampaignRequest>,
3431                        ) -> Self::Future {
3432                            let inner = Arc::clone(&self.0);
3433                            let fut = async move {
3434                                <T as CampaignService>::update_campaign(&inner, request)
3435                                    .await
3436                            };
3437                            Box::pin(fut)
3438                        }
3439                    }
3440                    let accept_compression_encodings = self.accept_compression_encodings;
3441                    let send_compression_encodings = self.send_compression_encodings;
3442                    let max_decoding_message_size = self.max_decoding_message_size;
3443                    let max_encoding_message_size = self.max_encoding_message_size;
3444                    let inner = self.inner.clone();
3445                    let fut = async move {
3446                        let method = UpdateCampaignSvc(inner);
3447                        let codec = tonic_prost::ProstCodec::default();
3448                        let mut grpc = tonic::server::Grpc::new(codec)
3449                            .apply_compression_config(
3450                                accept_compression_encodings,
3451                                send_compression_encodings,
3452                            )
3453                            .apply_max_message_size_config(
3454                                max_decoding_message_size,
3455                                max_encoding_message_size,
3456                            );
3457                        let res = grpc.unary(method, req).await;
3458                        Ok(res)
3459                    };
3460                    Box::pin(fut)
3461                }
3462                "/pidgr.v1.CampaignService/CancelCampaign" => {
3463                    #[allow(non_camel_case_types)]
3464                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3465                    impl<
3466                        T: CampaignService,
3467                    > tonic::server::UnaryService<super::CancelCampaignRequest>
3468                    for CancelCampaignSvc<T> {
3469                        type Response = super::CancelCampaignResponse;
3470                        type Future = BoxFuture<
3471                            tonic::Response<Self::Response>,
3472                            tonic::Status,
3473                        >;
3474                        fn call(
3475                            &mut self,
3476                            request: tonic::Request<super::CancelCampaignRequest>,
3477                        ) -> Self::Future {
3478                            let inner = Arc::clone(&self.0);
3479                            let fut = async move {
3480                                <T as CampaignService>::cancel_campaign(&inner, request)
3481                                    .await
3482                            };
3483                            Box::pin(fut)
3484                        }
3485                    }
3486                    let accept_compression_encodings = self.accept_compression_encodings;
3487                    let send_compression_encodings = self.send_compression_encodings;
3488                    let max_decoding_message_size = self.max_decoding_message_size;
3489                    let max_encoding_message_size = self.max_encoding_message_size;
3490                    let inner = self.inner.clone();
3491                    let fut = async move {
3492                        let method = CancelCampaignSvc(inner);
3493                        let codec = tonic_prost::ProstCodec::default();
3494                        let mut grpc = tonic::server::Grpc::new(codec)
3495                            .apply_compression_config(
3496                                accept_compression_encodings,
3497                                send_compression_encodings,
3498                            )
3499                            .apply_max_message_size_config(
3500                                max_decoding_message_size,
3501                                max_encoding_message_size,
3502                            );
3503                        let res = grpc.unary(method, req).await;
3504                        Ok(res)
3505                    };
3506                    Box::pin(fut)
3507                }
3508                "/pidgr.v1.CampaignService/ListDeliveries" => {
3509                    #[allow(non_camel_case_types)]
3510                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3511                    impl<
3512                        T: CampaignService,
3513                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
3514                    for ListDeliveriesSvc<T> {
3515                        type Response = super::ListDeliveriesResponse;
3516                        type Future = BoxFuture<
3517                            tonic::Response<Self::Response>,
3518                            tonic::Status,
3519                        >;
3520                        fn call(
3521                            &mut self,
3522                            request: tonic::Request<super::ListDeliveriesRequest>,
3523                        ) -> Self::Future {
3524                            let inner = Arc::clone(&self.0);
3525                            let fut = async move {
3526                                <T as CampaignService>::list_deliveries(&inner, request)
3527                                    .await
3528                            };
3529                            Box::pin(fut)
3530                        }
3531                    }
3532                    let accept_compression_encodings = self.accept_compression_encodings;
3533                    let send_compression_encodings = self.send_compression_encodings;
3534                    let max_decoding_message_size = self.max_decoding_message_size;
3535                    let max_encoding_message_size = self.max_encoding_message_size;
3536                    let inner = self.inner.clone();
3537                    let fut = async move {
3538                        let method = ListDeliveriesSvc(inner);
3539                        let codec = tonic_prost::ProstCodec::default();
3540                        let mut grpc = tonic::server::Grpc::new(codec)
3541                            .apply_compression_config(
3542                                accept_compression_encodings,
3543                                send_compression_encodings,
3544                            )
3545                            .apply_max_message_size_config(
3546                                max_decoding_message_size,
3547                                max_encoding_message_size,
3548                            );
3549                        let res = grpc.unary(method, req).await;
3550                        Ok(res)
3551                    };
3552                    Box::pin(fut)
3553                }
3554                _ => {
3555                    Box::pin(async move {
3556                        let mut response = http::Response::new(
3557                            tonic::body::Body::default(),
3558                        );
3559                        let headers = response.headers_mut();
3560                        headers
3561                            .insert(
3562                                tonic::Status::GRPC_STATUS,
3563                                (tonic::Code::Unimplemented as i32).into(),
3564                            );
3565                        headers
3566                            .insert(
3567                                http::header::CONTENT_TYPE,
3568                                tonic::metadata::GRPC_CONTENT_TYPE,
3569                            );
3570                        Ok(response)
3571                    })
3572                }
3573            }
3574        }
3575    }
3576    impl<T> Clone for CampaignServiceServer<T> {
3577        fn clone(&self) -> Self {
3578            let inner = self.inner.clone();
3579            Self {
3580                inner,
3581                accept_compression_encodings: self.accept_compression_encodings,
3582                send_compression_encodings: self.send_compression_encodings,
3583                max_decoding_message_size: self.max_decoding_message_size,
3584                max_encoding_message_size: self.max_encoding_message_size,
3585            }
3586        }
3587    }
3588    /// Generated gRPC service name
3589    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
3590    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
3591        const NAME: &'static str = SERVICE_NAME;
3592    }
3593}
3594/// Generated client implementations.
3595pub mod device_service_client {
3596    #![allow(
3597        unused_variables,
3598        dead_code,
3599        missing_docs,
3600        clippy::wildcard_imports,
3601        clippy::let_unit_value,
3602    )]
3603    use tonic::codegen::*;
3604    use tonic::codegen::http::Uri;
3605    /** Manages push notification device registration.
3606 Used by the mobile app to register push tokens and manage device lifecycle.
3607*/
3608    #[derive(Debug, Clone)]
3609    pub struct DeviceServiceClient<T> {
3610        inner: tonic::client::Grpc<T>,
3611    }
3612    impl DeviceServiceClient<tonic::transport::Channel> {
3613        /// Attempt to create a new client by connecting to a given endpoint.
3614        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3615        where
3616            D: TryInto<tonic::transport::Endpoint>,
3617            D::Error: Into<StdError>,
3618        {
3619            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3620            Ok(Self::new(conn))
3621        }
3622    }
3623    impl<T> DeviceServiceClient<T>
3624    where
3625        T: tonic::client::GrpcService<tonic::body::Body>,
3626        T::Error: Into<StdError>,
3627        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3628        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3629    {
3630        pub fn new(inner: T) -> Self {
3631            let inner = tonic::client::Grpc::new(inner);
3632            Self { inner }
3633        }
3634        pub fn with_origin(inner: T, origin: Uri) -> Self {
3635            let inner = tonic::client::Grpc::with_origin(inner, origin);
3636            Self { inner }
3637        }
3638        pub fn with_interceptor<F>(
3639            inner: T,
3640            interceptor: F,
3641        ) -> DeviceServiceClient<InterceptedService<T, F>>
3642        where
3643            F: tonic::service::Interceptor,
3644            T::ResponseBody: Default,
3645            T: tonic::codegen::Service<
3646                http::Request<tonic::body::Body>,
3647                Response = http::Response<
3648                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3649                >,
3650            >,
3651            <T as tonic::codegen::Service<
3652                http::Request<tonic::body::Body>,
3653            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3654        {
3655            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
3656        }
3657        /// Compress requests with the given encoding.
3658        ///
3659        /// This requires the server to support it otherwise it might respond with an
3660        /// error.
3661        #[must_use]
3662        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3663            self.inner = self.inner.send_compressed(encoding);
3664            self
3665        }
3666        /// Enable decompressing responses.
3667        #[must_use]
3668        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3669            self.inner = self.inner.accept_compressed(encoding);
3670            self
3671        }
3672        /// Limits the maximum size of a decoded message.
3673        ///
3674        /// Default: `4MB`
3675        #[must_use]
3676        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3677            self.inner = self.inner.max_decoding_message_size(limit);
3678            self
3679        }
3680        /// Limits the maximum size of an encoded message.
3681        ///
3682        /// Default: `usize::MAX`
3683        #[must_use]
3684        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3685            self.inner = self.inner.max_encoding_message_size(limit);
3686            self
3687        }
3688        /** Register a device with its push token for receiving notifications.
3689 Authorization: Authenticated user (own devices only).
3690*/
3691        pub async fn register(
3692            &mut self,
3693            request: impl tonic::IntoRequest<super::RegisterRequest>,
3694        ) -> std::result::Result<
3695            tonic::Response<super::RegisterResponse>,
3696            tonic::Status,
3697        > {
3698            self.inner
3699                .ready()
3700                .await
3701                .map_err(|e| {
3702                    tonic::Status::unknown(
3703                        format!("Service was not ready: {}", e.into()),
3704                    )
3705                })?;
3706            let codec = tonic_prost::ProstCodec::default();
3707            let path = http::uri::PathAndQuery::from_static(
3708                "/pidgr.v1.DeviceService/Register",
3709            );
3710            let mut req = request.into_request();
3711            req.extensions_mut()
3712                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
3713            self.inner.unary(req, path, codec).await
3714        }
3715        /** Deactivate a device, preventing further push notifications.
3716 Authorization: Authenticated user (own devices only).
3717*/
3718        pub async fn deactivate(
3719            &mut self,
3720            request: impl tonic::IntoRequest<super::DeactivateRequest>,
3721        ) -> std::result::Result<
3722            tonic::Response<super::DeactivateResponse>,
3723            tonic::Status,
3724        > {
3725            self.inner
3726                .ready()
3727                .await
3728                .map_err(|e| {
3729                    tonic::Status::unknown(
3730                        format!("Service was not ready: {}", e.into()),
3731                    )
3732                })?;
3733            let codec = tonic_prost::ProstCodec::default();
3734            let path = http::uri::PathAndQuery::from_static(
3735                "/pidgr.v1.DeviceService/Deactivate",
3736            );
3737            let mut req = request.into_request();
3738            req.extensions_mut()
3739                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
3740            self.inner.unary(req, path, codec).await
3741        }
3742        /** List all devices registered to the authenticated user.
3743 Authorization: Authenticated user (own devices only).
3744*/
3745        pub async fn list_devices(
3746            &mut self,
3747            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
3748        ) -> std::result::Result<
3749            tonic::Response<super::ListDevicesResponse>,
3750            tonic::Status,
3751        > {
3752            self.inner
3753                .ready()
3754                .await
3755                .map_err(|e| {
3756                    tonic::Status::unknown(
3757                        format!("Service was not ready: {}", e.into()),
3758                    )
3759                })?;
3760            let codec = tonic_prost::ProstCodec::default();
3761            let path = http::uri::PathAndQuery::from_static(
3762                "/pidgr.v1.DeviceService/ListDevices",
3763            );
3764            let mut req = request.into_request();
3765            req.extensions_mut()
3766                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
3767            self.inner.unary(req, path, codec).await
3768        }
3769        /** List all devices for a specific organization member.
3770 Authorization: Requires MEMBERS_READ permission.
3771*/
3772        pub async fn list_member_devices(
3773            &mut self,
3774            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
3775        ) -> std::result::Result<
3776            tonic::Response<super::ListMemberDevicesResponse>,
3777            tonic::Status,
3778        > {
3779            self.inner
3780                .ready()
3781                .await
3782                .map_err(|e| {
3783                    tonic::Status::unknown(
3784                        format!("Service was not ready: {}", e.into()),
3785                    )
3786                })?;
3787            let codec = tonic_prost::ProstCodec::default();
3788            let path = http::uri::PathAndQuery::from_static(
3789                "/pidgr.v1.DeviceService/ListMemberDevices",
3790            );
3791            let mut req = request.into_request();
3792            req.extensions_mut()
3793                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
3794            self.inner.unary(req, path, codec).await
3795        }
3796    }
3797}
3798/// Generated server implementations.
3799pub mod device_service_server {
3800    #![allow(
3801        unused_variables,
3802        dead_code,
3803        missing_docs,
3804        clippy::wildcard_imports,
3805        clippy::let_unit_value,
3806    )]
3807    use tonic::codegen::*;
3808    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
3809    #[async_trait]
3810    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
3811        /** Register a device with its push token for receiving notifications.
3812 Authorization: Authenticated user (own devices only).
3813*/
3814        async fn register(
3815            &self,
3816            request: tonic::Request<super::RegisterRequest>,
3817        ) -> std::result::Result<
3818            tonic::Response<super::RegisterResponse>,
3819            tonic::Status,
3820        >;
3821        /** Deactivate a device, preventing further push notifications.
3822 Authorization: Authenticated user (own devices only).
3823*/
3824        async fn deactivate(
3825            &self,
3826            request: tonic::Request<super::DeactivateRequest>,
3827        ) -> std::result::Result<
3828            tonic::Response<super::DeactivateResponse>,
3829            tonic::Status,
3830        >;
3831        /** List all devices registered to the authenticated user.
3832 Authorization: Authenticated user (own devices only).
3833*/
3834        async fn list_devices(
3835            &self,
3836            request: tonic::Request<super::ListDevicesRequest>,
3837        ) -> std::result::Result<
3838            tonic::Response<super::ListDevicesResponse>,
3839            tonic::Status,
3840        >;
3841        /** List all devices for a specific organization member.
3842 Authorization: Requires MEMBERS_READ permission.
3843*/
3844        async fn list_member_devices(
3845            &self,
3846            request: tonic::Request<super::ListMemberDevicesRequest>,
3847        ) -> std::result::Result<
3848            tonic::Response<super::ListMemberDevicesResponse>,
3849            tonic::Status,
3850        >;
3851    }
3852    /** Manages push notification device registration.
3853 Used by the mobile app to register push tokens and manage device lifecycle.
3854*/
3855    #[derive(Debug)]
3856    pub struct DeviceServiceServer<T> {
3857        inner: Arc<T>,
3858        accept_compression_encodings: EnabledCompressionEncodings,
3859        send_compression_encodings: EnabledCompressionEncodings,
3860        max_decoding_message_size: Option<usize>,
3861        max_encoding_message_size: Option<usize>,
3862    }
3863    impl<T> DeviceServiceServer<T> {
3864        pub fn new(inner: T) -> Self {
3865            Self::from_arc(Arc::new(inner))
3866        }
3867        pub fn from_arc(inner: Arc<T>) -> Self {
3868            Self {
3869                inner,
3870                accept_compression_encodings: Default::default(),
3871                send_compression_encodings: Default::default(),
3872                max_decoding_message_size: None,
3873                max_encoding_message_size: None,
3874            }
3875        }
3876        pub fn with_interceptor<F>(
3877            inner: T,
3878            interceptor: F,
3879        ) -> InterceptedService<Self, F>
3880        where
3881            F: tonic::service::Interceptor,
3882        {
3883            InterceptedService::new(Self::new(inner), interceptor)
3884        }
3885        /// Enable decompressing requests with the given encoding.
3886        #[must_use]
3887        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3888            self.accept_compression_encodings.enable(encoding);
3889            self
3890        }
3891        /// Compress responses with the given encoding, if the client supports it.
3892        #[must_use]
3893        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3894            self.send_compression_encodings.enable(encoding);
3895            self
3896        }
3897        /// Limits the maximum size of a decoded message.
3898        ///
3899        /// Default: `4MB`
3900        #[must_use]
3901        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3902            self.max_decoding_message_size = Some(limit);
3903            self
3904        }
3905        /// Limits the maximum size of an encoded message.
3906        ///
3907        /// Default: `usize::MAX`
3908        #[must_use]
3909        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3910            self.max_encoding_message_size = Some(limit);
3911            self
3912        }
3913    }
3914    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
3915    where
3916        T: DeviceService,
3917        B: Body + std::marker::Send + 'static,
3918        B::Error: Into<StdError> + std::marker::Send + 'static,
3919    {
3920        type Response = http::Response<tonic::body::Body>;
3921        type Error = std::convert::Infallible;
3922        type Future = BoxFuture<Self::Response, Self::Error>;
3923        fn poll_ready(
3924            &mut self,
3925            _cx: &mut Context<'_>,
3926        ) -> Poll<std::result::Result<(), Self::Error>> {
3927            Poll::Ready(Ok(()))
3928        }
3929        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3930            match req.uri().path() {
3931                "/pidgr.v1.DeviceService/Register" => {
3932                    #[allow(non_camel_case_types)]
3933                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
3934                    impl<
3935                        T: DeviceService,
3936                    > tonic::server::UnaryService<super::RegisterRequest>
3937                    for RegisterSvc<T> {
3938                        type Response = super::RegisterResponse;
3939                        type Future = BoxFuture<
3940                            tonic::Response<Self::Response>,
3941                            tonic::Status,
3942                        >;
3943                        fn call(
3944                            &mut self,
3945                            request: tonic::Request<super::RegisterRequest>,
3946                        ) -> Self::Future {
3947                            let inner = Arc::clone(&self.0);
3948                            let fut = async move {
3949                                <T as DeviceService>::register(&inner, request).await
3950                            };
3951                            Box::pin(fut)
3952                        }
3953                    }
3954                    let accept_compression_encodings = self.accept_compression_encodings;
3955                    let send_compression_encodings = self.send_compression_encodings;
3956                    let max_decoding_message_size = self.max_decoding_message_size;
3957                    let max_encoding_message_size = self.max_encoding_message_size;
3958                    let inner = self.inner.clone();
3959                    let fut = async move {
3960                        let method = RegisterSvc(inner);
3961                        let codec = tonic_prost::ProstCodec::default();
3962                        let mut grpc = tonic::server::Grpc::new(codec)
3963                            .apply_compression_config(
3964                                accept_compression_encodings,
3965                                send_compression_encodings,
3966                            )
3967                            .apply_max_message_size_config(
3968                                max_decoding_message_size,
3969                                max_encoding_message_size,
3970                            );
3971                        let res = grpc.unary(method, req).await;
3972                        Ok(res)
3973                    };
3974                    Box::pin(fut)
3975                }
3976                "/pidgr.v1.DeviceService/Deactivate" => {
3977                    #[allow(non_camel_case_types)]
3978                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
3979                    impl<
3980                        T: DeviceService,
3981                    > tonic::server::UnaryService<super::DeactivateRequest>
3982                    for DeactivateSvc<T> {
3983                        type Response = super::DeactivateResponse;
3984                        type Future = BoxFuture<
3985                            tonic::Response<Self::Response>,
3986                            tonic::Status,
3987                        >;
3988                        fn call(
3989                            &mut self,
3990                            request: tonic::Request<super::DeactivateRequest>,
3991                        ) -> Self::Future {
3992                            let inner = Arc::clone(&self.0);
3993                            let fut = async move {
3994                                <T as DeviceService>::deactivate(&inner, request).await
3995                            };
3996                            Box::pin(fut)
3997                        }
3998                    }
3999                    let accept_compression_encodings = self.accept_compression_encodings;
4000                    let send_compression_encodings = self.send_compression_encodings;
4001                    let max_decoding_message_size = self.max_decoding_message_size;
4002                    let max_encoding_message_size = self.max_encoding_message_size;
4003                    let inner = self.inner.clone();
4004                    let fut = async move {
4005                        let method = DeactivateSvc(inner);
4006                        let codec = tonic_prost::ProstCodec::default();
4007                        let mut grpc = tonic::server::Grpc::new(codec)
4008                            .apply_compression_config(
4009                                accept_compression_encodings,
4010                                send_compression_encodings,
4011                            )
4012                            .apply_max_message_size_config(
4013                                max_decoding_message_size,
4014                                max_encoding_message_size,
4015                            );
4016                        let res = grpc.unary(method, req).await;
4017                        Ok(res)
4018                    };
4019                    Box::pin(fut)
4020                }
4021                "/pidgr.v1.DeviceService/ListDevices" => {
4022                    #[allow(non_camel_case_types)]
4023                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4024                    impl<
4025                        T: DeviceService,
4026                    > tonic::server::UnaryService<super::ListDevicesRequest>
4027                    for ListDevicesSvc<T> {
4028                        type Response = super::ListDevicesResponse;
4029                        type Future = BoxFuture<
4030                            tonic::Response<Self::Response>,
4031                            tonic::Status,
4032                        >;
4033                        fn call(
4034                            &mut self,
4035                            request: tonic::Request<super::ListDevicesRequest>,
4036                        ) -> Self::Future {
4037                            let inner = Arc::clone(&self.0);
4038                            let fut = async move {
4039                                <T as DeviceService>::list_devices(&inner, request).await
4040                            };
4041                            Box::pin(fut)
4042                        }
4043                    }
4044                    let accept_compression_encodings = self.accept_compression_encodings;
4045                    let send_compression_encodings = self.send_compression_encodings;
4046                    let max_decoding_message_size = self.max_decoding_message_size;
4047                    let max_encoding_message_size = self.max_encoding_message_size;
4048                    let inner = self.inner.clone();
4049                    let fut = async move {
4050                        let method = ListDevicesSvc(inner);
4051                        let codec = tonic_prost::ProstCodec::default();
4052                        let mut grpc = tonic::server::Grpc::new(codec)
4053                            .apply_compression_config(
4054                                accept_compression_encodings,
4055                                send_compression_encodings,
4056                            )
4057                            .apply_max_message_size_config(
4058                                max_decoding_message_size,
4059                                max_encoding_message_size,
4060                            );
4061                        let res = grpc.unary(method, req).await;
4062                        Ok(res)
4063                    };
4064                    Box::pin(fut)
4065                }
4066                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4067                    #[allow(non_camel_case_types)]
4068                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4069                    impl<
4070                        T: DeviceService,
4071                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4072                    for ListMemberDevicesSvc<T> {
4073                        type Response = super::ListMemberDevicesResponse;
4074                        type Future = BoxFuture<
4075                            tonic::Response<Self::Response>,
4076                            tonic::Status,
4077                        >;
4078                        fn call(
4079                            &mut self,
4080                            request: tonic::Request<super::ListMemberDevicesRequest>,
4081                        ) -> Self::Future {
4082                            let inner = Arc::clone(&self.0);
4083                            let fut = async move {
4084                                <T as DeviceService>::list_member_devices(&inner, request)
4085                                    .await
4086                            };
4087                            Box::pin(fut)
4088                        }
4089                    }
4090                    let accept_compression_encodings = self.accept_compression_encodings;
4091                    let send_compression_encodings = self.send_compression_encodings;
4092                    let max_decoding_message_size = self.max_decoding_message_size;
4093                    let max_encoding_message_size = self.max_encoding_message_size;
4094                    let inner = self.inner.clone();
4095                    let fut = async move {
4096                        let method = ListMemberDevicesSvc(inner);
4097                        let codec = tonic_prost::ProstCodec::default();
4098                        let mut grpc = tonic::server::Grpc::new(codec)
4099                            .apply_compression_config(
4100                                accept_compression_encodings,
4101                                send_compression_encodings,
4102                            )
4103                            .apply_max_message_size_config(
4104                                max_decoding_message_size,
4105                                max_encoding_message_size,
4106                            );
4107                        let res = grpc.unary(method, req).await;
4108                        Ok(res)
4109                    };
4110                    Box::pin(fut)
4111                }
4112                _ => {
4113                    Box::pin(async move {
4114                        let mut response = http::Response::new(
4115                            tonic::body::Body::default(),
4116                        );
4117                        let headers = response.headers_mut();
4118                        headers
4119                            .insert(
4120                                tonic::Status::GRPC_STATUS,
4121                                (tonic::Code::Unimplemented as i32).into(),
4122                            );
4123                        headers
4124                            .insert(
4125                                http::header::CONTENT_TYPE,
4126                                tonic::metadata::GRPC_CONTENT_TYPE,
4127                            );
4128                        Ok(response)
4129                    })
4130                }
4131            }
4132        }
4133    }
4134    impl<T> Clone for DeviceServiceServer<T> {
4135        fn clone(&self) -> Self {
4136            let inner = self.inner.clone();
4137            Self {
4138                inner,
4139                accept_compression_encodings: self.accept_compression_encodings,
4140                send_compression_encodings: self.send_compression_encodings,
4141                max_decoding_message_size: self.max_decoding_message_size,
4142                max_encoding_message_size: self.max_encoding_message_size,
4143            }
4144        }
4145    }
4146    /// Generated gRPC service name
4147    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4148    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4149        const NAME: &'static str = SERVICE_NAME;
4150    }
4151}
4152/// Generated client implementations.
4153pub mod group_service_client {
4154    #![allow(
4155        unused_variables,
4156        dead_code,
4157        missing_docs,
4158        clippy::wildcard_imports,
4159        clippy::let_unit_value,
4160    )]
4161    use tonic::codegen::*;
4162    use tonic::codegen::http::Uri;
4163    /** Manages groups and group membership within an organization.
4164 Groups are recipient collections used for campaign audience targeting.
4165 All RPCs operate within the caller's org (extracted from JWT).
4166*/
4167    #[derive(Debug, Clone)]
4168    pub struct GroupServiceClient<T> {
4169        inner: tonic::client::Grpc<T>,
4170    }
4171    impl GroupServiceClient<tonic::transport::Channel> {
4172        /// Attempt to create a new client by connecting to a given endpoint.
4173        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4174        where
4175            D: TryInto<tonic::transport::Endpoint>,
4176            D::Error: Into<StdError>,
4177        {
4178            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4179            Ok(Self::new(conn))
4180        }
4181    }
4182    impl<T> GroupServiceClient<T>
4183    where
4184        T: tonic::client::GrpcService<tonic::body::Body>,
4185        T::Error: Into<StdError>,
4186        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4187        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4188    {
4189        pub fn new(inner: T) -> Self {
4190            let inner = tonic::client::Grpc::new(inner);
4191            Self { inner }
4192        }
4193        pub fn with_origin(inner: T, origin: Uri) -> Self {
4194            let inner = tonic::client::Grpc::with_origin(inner, origin);
4195            Self { inner }
4196        }
4197        pub fn with_interceptor<F>(
4198            inner: T,
4199            interceptor: F,
4200        ) -> GroupServiceClient<InterceptedService<T, F>>
4201        where
4202            F: tonic::service::Interceptor,
4203            T::ResponseBody: Default,
4204            T: tonic::codegen::Service<
4205                http::Request<tonic::body::Body>,
4206                Response = http::Response<
4207                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4208                >,
4209            >,
4210            <T as tonic::codegen::Service<
4211                http::Request<tonic::body::Body>,
4212            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4213        {
4214            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4215        }
4216        /// Compress requests with the given encoding.
4217        ///
4218        /// This requires the server to support it otherwise it might respond with an
4219        /// error.
4220        #[must_use]
4221        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4222            self.inner = self.inner.send_compressed(encoding);
4223            self
4224        }
4225        /// Enable decompressing responses.
4226        #[must_use]
4227        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4228            self.inner = self.inner.accept_compressed(encoding);
4229            self
4230        }
4231        /// Limits the maximum size of a decoded message.
4232        ///
4233        /// Default: `4MB`
4234        #[must_use]
4235        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4236            self.inner = self.inner.max_decoding_message_size(limit);
4237            self
4238        }
4239        /// Limits the maximum size of an encoded message.
4240        ///
4241        /// Default: `usize::MAX`
4242        #[must_use]
4243        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4244            self.inner = self.inner.max_encoding_message_size(limit);
4245            self
4246        }
4247        /** Create a new group in the organization.
4248 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4249*/
4250        pub async fn create_group(
4251            &mut self,
4252            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4253        ) -> std::result::Result<
4254            tonic::Response<super::CreateGroupResponse>,
4255            tonic::Status,
4256        > {
4257            self.inner
4258                .ready()
4259                .await
4260                .map_err(|e| {
4261                    tonic::Status::unknown(
4262                        format!("Service was not ready: {}", e.into()),
4263                    )
4264                })?;
4265            let codec = tonic_prost::ProstCodec::default();
4266            let path = http::uri::PathAndQuery::from_static(
4267                "/pidgr.v1.GroupService/CreateGroup",
4268            );
4269            let mut req = request.into_request();
4270            req.extensions_mut()
4271                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4272            self.inner.unary(req, path, codec).await
4273        }
4274        /** Retrieve a group by ID.
4275 Authorization: Caller must be a member of the group, or have
4276 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4277*/
4278        pub async fn get_group(
4279            &mut self,
4280            request: impl tonic::IntoRequest<super::GetGroupRequest>,
4281        ) -> std::result::Result<
4282            tonic::Response<super::GetGroupResponse>,
4283            tonic::Status,
4284        > {
4285            self.inner
4286                .ready()
4287                .await
4288                .map_err(|e| {
4289                    tonic::Status::unknown(
4290                        format!("Service was not ready: {}", e.into()),
4291                    )
4292                })?;
4293            let codec = tonic_prost::ProstCodec::default();
4294            let path = http::uri::PathAndQuery::from_static(
4295                "/pidgr.v1.GroupService/GetGroup",
4296            );
4297            let mut req = request.into_request();
4298            req.extensions_mut()
4299                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4300            self.inner.unary(req, path, codec).await
4301        }
4302        /** List groups in the organization with pagination.
4303 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4304*/
4305        pub async fn list_groups(
4306            &mut self,
4307            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4308        ) -> std::result::Result<
4309            tonic::Response<super::ListGroupsResponse>,
4310            tonic::Status,
4311        > {
4312            self.inner
4313                .ready()
4314                .await
4315                .map_err(|e| {
4316                    tonic::Status::unknown(
4317                        format!("Service was not ready: {}", e.into()),
4318                    )
4319                })?;
4320            let codec = tonic_prost::ProstCodec::default();
4321            let path = http::uri::PathAndQuery::from_static(
4322                "/pidgr.v1.GroupService/ListGroups",
4323            );
4324            let mut req = request.into_request();
4325            req.extensions_mut()
4326                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4327            self.inner.unary(req, path, codec).await
4328        }
4329        /** Update a group's name and/or description.
4330 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4331*/
4332        pub async fn update_group(
4333            &mut self,
4334            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4335        ) -> std::result::Result<
4336            tonic::Response<super::UpdateGroupResponse>,
4337            tonic::Status,
4338        > {
4339            self.inner
4340                .ready()
4341                .await
4342                .map_err(|e| {
4343                    tonic::Status::unknown(
4344                        format!("Service was not ready: {}", e.into()),
4345                    )
4346                })?;
4347            let codec = tonic_prost::ProstCodec::default();
4348            let path = http::uri::PathAndQuery::from_static(
4349                "/pidgr.v1.GroupService/UpdateGroup",
4350            );
4351            let mut req = request.into_request();
4352            req.extensions_mut()
4353                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4354            self.inner.unary(req, path, codec).await
4355        }
4356        /** Delete a group and all its membership records. Default groups cannot be deleted.
4357 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4358*/
4359        pub async fn delete_group(
4360            &mut self,
4361            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4362        ) -> std::result::Result<
4363            tonic::Response<super::DeleteGroupResponse>,
4364            tonic::Status,
4365        > {
4366            self.inner
4367                .ready()
4368                .await
4369                .map_err(|e| {
4370                    tonic::Status::unknown(
4371                        format!("Service was not ready: {}", e.into()),
4372                    )
4373                })?;
4374            let codec = tonic_prost::ProstCodec::default();
4375            let path = http::uri::PathAndQuery::from_static(
4376                "/pidgr.v1.GroupService/DeleteGroup",
4377            );
4378            let mut req = request.into_request();
4379            req.extensions_mut()
4380                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4381            self.inner.unary(req, path, codec).await
4382        }
4383        /** Add one or more users to a group (idempotent).
4384 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4385*/
4386        pub async fn add_group_members(
4387            &mut self,
4388            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4389        ) -> std::result::Result<
4390            tonic::Response<super::AddGroupMembersResponse>,
4391            tonic::Status,
4392        > {
4393            self.inner
4394                .ready()
4395                .await
4396                .map_err(|e| {
4397                    tonic::Status::unknown(
4398                        format!("Service was not ready: {}", e.into()),
4399                    )
4400                })?;
4401            let codec = tonic_prost::ProstCodec::default();
4402            let path = http::uri::PathAndQuery::from_static(
4403                "/pidgr.v1.GroupService/AddGroupMembers",
4404            );
4405            let mut req = request.into_request();
4406            req.extensions_mut()
4407                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4408            self.inner.unary(req, path, codec).await
4409        }
4410        /** Remove one or more users from a group (idempotent).
4411 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4412*/
4413        pub async fn remove_group_members(
4414            &mut self,
4415            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4416        ) -> std::result::Result<
4417            tonic::Response<super::RemoveGroupMembersResponse>,
4418            tonic::Status,
4419        > {
4420            self.inner
4421                .ready()
4422                .await
4423                .map_err(|e| {
4424                    tonic::Status::unknown(
4425                        format!("Service was not ready: {}", e.into()),
4426                    )
4427                })?;
4428            let codec = tonic_prost::ProstCodec::default();
4429            let path = http::uri::PathAndQuery::from_static(
4430                "/pidgr.v1.GroupService/RemoveGroupMembers",
4431            );
4432            let mut req = request.into_request();
4433            req.extensions_mut()
4434                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4435            self.inner.unary(req, path, codec).await
4436        }
4437        /** List members of a group with pagination.
4438 Authorization: Caller must be a member of the group, or have
4439 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4440*/
4441        pub async fn list_group_members(
4442            &mut self,
4443            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4444        ) -> std::result::Result<
4445            tonic::Response<super::ListGroupMembersResponse>,
4446            tonic::Status,
4447        > {
4448            self.inner
4449                .ready()
4450                .await
4451                .map_err(|e| {
4452                    tonic::Status::unknown(
4453                        format!("Service was not ready: {}", e.into()),
4454                    )
4455                })?;
4456            let codec = tonic_prost::ProstCodec::default();
4457            let path = http::uri::PathAndQuery::from_static(
4458                "/pidgr.v1.GroupService/ListGroupMembers",
4459            );
4460            let mut req = request.into_request();
4461            req.extensions_mut()
4462                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4463            self.inner.unary(req, path, codec).await
4464        }
4465        /** Get group memberships for a batch of users.
4466 Used by campaign audience to show group badges.
4467 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4468*/
4469        pub async fn get_user_group_memberships(
4470            &mut self,
4471            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4472        ) -> std::result::Result<
4473            tonic::Response<super::GetUserGroupMembershipsResponse>,
4474            tonic::Status,
4475        > {
4476            self.inner
4477                .ready()
4478                .await
4479                .map_err(|e| {
4480                    tonic::Status::unknown(
4481                        format!("Service was not ready: {}", e.into()),
4482                    )
4483                })?;
4484            let codec = tonic_prost::ProstCodec::default();
4485            let path = http::uri::PathAndQuery::from_static(
4486                "/pidgr.v1.GroupService/GetUserGroupMemberships",
4487            );
4488            let mut req = request.into_request();
4489            req.extensions_mut()
4490                .insert(
4491                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
4492                );
4493            self.inner.unary(req, path, codec).await
4494        }
4495    }
4496}
4497/// Generated server implementations.
4498pub mod group_service_server {
4499    #![allow(
4500        unused_variables,
4501        dead_code,
4502        missing_docs,
4503        clippy::wildcard_imports,
4504        clippy::let_unit_value,
4505    )]
4506    use tonic::codegen::*;
4507    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
4508    #[async_trait]
4509    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
4510        /** Create a new group in the organization.
4511 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4512*/
4513        async fn create_group(
4514            &self,
4515            request: tonic::Request<super::CreateGroupRequest>,
4516        ) -> std::result::Result<
4517            tonic::Response<super::CreateGroupResponse>,
4518            tonic::Status,
4519        >;
4520        /** Retrieve a group by ID.
4521 Authorization: Caller must be a member of the group, or have
4522 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4523*/
4524        async fn get_group(
4525            &self,
4526            request: tonic::Request<super::GetGroupRequest>,
4527        ) -> std::result::Result<
4528            tonic::Response<super::GetGroupResponse>,
4529            tonic::Status,
4530        >;
4531        /** List groups in the organization with pagination.
4532 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4533*/
4534        async fn list_groups(
4535            &self,
4536            request: tonic::Request<super::ListGroupsRequest>,
4537        ) -> std::result::Result<
4538            tonic::Response<super::ListGroupsResponse>,
4539            tonic::Status,
4540        >;
4541        /** Update a group's name and/or description.
4542 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4543*/
4544        async fn update_group(
4545            &self,
4546            request: tonic::Request<super::UpdateGroupRequest>,
4547        ) -> std::result::Result<
4548            tonic::Response<super::UpdateGroupResponse>,
4549            tonic::Status,
4550        >;
4551        /** Delete a group and all its membership records. Default groups cannot be deleted.
4552 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4553*/
4554        async fn delete_group(
4555            &self,
4556            request: tonic::Request<super::DeleteGroupRequest>,
4557        ) -> std::result::Result<
4558            tonic::Response<super::DeleteGroupResponse>,
4559            tonic::Status,
4560        >;
4561        /** Add one or more users to a group (idempotent).
4562 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4563*/
4564        async fn add_group_members(
4565            &self,
4566            request: tonic::Request<super::AddGroupMembersRequest>,
4567        ) -> std::result::Result<
4568            tonic::Response<super::AddGroupMembersResponse>,
4569            tonic::Status,
4570        >;
4571        /** Remove one or more users from a group (idempotent).
4572 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4573*/
4574        async fn remove_group_members(
4575            &self,
4576            request: tonic::Request<super::RemoveGroupMembersRequest>,
4577        ) -> std::result::Result<
4578            tonic::Response<super::RemoveGroupMembersResponse>,
4579            tonic::Status,
4580        >;
4581        /** List members of a group with pagination.
4582 Authorization: Caller must be a member of the group, or have
4583 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4584*/
4585        async fn list_group_members(
4586            &self,
4587            request: tonic::Request<super::ListGroupMembersRequest>,
4588        ) -> std::result::Result<
4589            tonic::Response<super::ListGroupMembersResponse>,
4590            tonic::Status,
4591        >;
4592        /** Get group memberships for a batch of users.
4593 Used by campaign audience to show group badges.
4594 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4595*/
4596        async fn get_user_group_memberships(
4597            &self,
4598            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
4599        ) -> std::result::Result<
4600            tonic::Response<super::GetUserGroupMembershipsResponse>,
4601            tonic::Status,
4602        >;
4603    }
4604    /** Manages groups and group membership within an organization.
4605 Groups are recipient collections used for campaign audience targeting.
4606 All RPCs operate within the caller's org (extracted from JWT).
4607*/
4608    #[derive(Debug)]
4609    pub struct GroupServiceServer<T> {
4610        inner: Arc<T>,
4611        accept_compression_encodings: EnabledCompressionEncodings,
4612        send_compression_encodings: EnabledCompressionEncodings,
4613        max_decoding_message_size: Option<usize>,
4614        max_encoding_message_size: Option<usize>,
4615    }
4616    impl<T> GroupServiceServer<T> {
4617        pub fn new(inner: T) -> Self {
4618            Self::from_arc(Arc::new(inner))
4619        }
4620        pub fn from_arc(inner: Arc<T>) -> Self {
4621            Self {
4622                inner,
4623                accept_compression_encodings: Default::default(),
4624                send_compression_encodings: Default::default(),
4625                max_decoding_message_size: None,
4626                max_encoding_message_size: None,
4627            }
4628        }
4629        pub fn with_interceptor<F>(
4630            inner: T,
4631            interceptor: F,
4632        ) -> InterceptedService<Self, F>
4633        where
4634            F: tonic::service::Interceptor,
4635        {
4636            InterceptedService::new(Self::new(inner), interceptor)
4637        }
4638        /// Enable decompressing requests with the given encoding.
4639        #[must_use]
4640        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4641            self.accept_compression_encodings.enable(encoding);
4642            self
4643        }
4644        /// Compress responses with the given encoding, if the client supports it.
4645        #[must_use]
4646        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4647            self.send_compression_encodings.enable(encoding);
4648            self
4649        }
4650        /// Limits the maximum size of a decoded message.
4651        ///
4652        /// Default: `4MB`
4653        #[must_use]
4654        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4655            self.max_decoding_message_size = Some(limit);
4656            self
4657        }
4658        /// Limits the maximum size of an encoded message.
4659        ///
4660        /// Default: `usize::MAX`
4661        #[must_use]
4662        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4663            self.max_encoding_message_size = Some(limit);
4664            self
4665        }
4666    }
4667    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
4668    where
4669        T: GroupService,
4670        B: Body + std::marker::Send + 'static,
4671        B::Error: Into<StdError> + std::marker::Send + 'static,
4672    {
4673        type Response = http::Response<tonic::body::Body>;
4674        type Error = std::convert::Infallible;
4675        type Future = BoxFuture<Self::Response, Self::Error>;
4676        fn poll_ready(
4677            &mut self,
4678            _cx: &mut Context<'_>,
4679        ) -> Poll<std::result::Result<(), Self::Error>> {
4680            Poll::Ready(Ok(()))
4681        }
4682        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4683            match req.uri().path() {
4684                "/pidgr.v1.GroupService/CreateGroup" => {
4685                    #[allow(non_camel_case_types)]
4686                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
4687                    impl<
4688                        T: GroupService,
4689                    > tonic::server::UnaryService<super::CreateGroupRequest>
4690                    for CreateGroupSvc<T> {
4691                        type Response = super::CreateGroupResponse;
4692                        type Future = BoxFuture<
4693                            tonic::Response<Self::Response>,
4694                            tonic::Status,
4695                        >;
4696                        fn call(
4697                            &mut self,
4698                            request: tonic::Request<super::CreateGroupRequest>,
4699                        ) -> Self::Future {
4700                            let inner = Arc::clone(&self.0);
4701                            let fut = async move {
4702                                <T as GroupService>::create_group(&inner, request).await
4703                            };
4704                            Box::pin(fut)
4705                        }
4706                    }
4707                    let accept_compression_encodings = self.accept_compression_encodings;
4708                    let send_compression_encodings = self.send_compression_encodings;
4709                    let max_decoding_message_size = self.max_decoding_message_size;
4710                    let max_encoding_message_size = self.max_encoding_message_size;
4711                    let inner = self.inner.clone();
4712                    let fut = async move {
4713                        let method = CreateGroupSvc(inner);
4714                        let codec = tonic_prost::ProstCodec::default();
4715                        let mut grpc = tonic::server::Grpc::new(codec)
4716                            .apply_compression_config(
4717                                accept_compression_encodings,
4718                                send_compression_encodings,
4719                            )
4720                            .apply_max_message_size_config(
4721                                max_decoding_message_size,
4722                                max_encoding_message_size,
4723                            );
4724                        let res = grpc.unary(method, req).await;
4725                        Ok(res)
4726                    };
4727                    Box::pin(fut)
4728                }
4729                "/pidgr.v1.GroupService/GetGroup" => {
4730                    #[allow(non_camel_case_types)]
4731                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
4732                    impl<
4733                        T: GroupService,
4734                    > tonic::server::UnaryService<super::GetGroupRequest>
4735                    for GetGroupSvc<T> {
4736                        type Response = super::GetGroupResponse;
4737                        type Future = BoxFuture<
4738                            tonic::Response<Self::Response>,
4739                            tonic::Status,
4740                        >;
4741                        fn call(
4742                            &mut self,
4743                            request: tonic::Request<super::GetGroupRequest>,
4744                        ) -> Self::Future {
4745                            let inner = Arc::clone(&self.0);
4746                            let fut = async move {
4747                                <T as GroupService>::get_group(&inner, request).await
4748                            };
4749                            Box::pin(fut)
4750                        }
4751                    }
4752                    let accept_compression_encodings = self.accept_compression_encodings;
4753                    let send_compression_encodings = self.send_compression_encodings;
4754                    let max_decoding_message_size = self.max_decoding_message_size;
4755                    let max_encoding_message_size = self.max_encoding_message_size;
4756                    let inner = self.inner.clone();
4757                    let fut = async move {
4758                        let method = GetGroupSvc(inner);
4759                        let codec = tonic_prost::ProstCodec::default();
4760                        let mut grpc = tonic::server::Grpc::new(codec)
4761                            .apply_compression_config(
4762                                accept_compression_encodings,
4763                                send_compression_encodings,
4764                            )
4765                            .apply_max_message_size_config(
4766                                max_decoding_message_size,
4767                                max_encoding_message_size,
4768                            );
4769                        let res = grpc.unary(method, req).await;
4770                        Ok(res)
4771                    };
4772                    Box::pin(fut)
4773                }
4774                "/pidgr.v1.GroupService/ListGroups" => {
4775                    #[allow(non_camel_case_types)]
4776                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
4777                    impl<
4778                        T: GroupService,
4779                    > tonic::server::UnaryService<super::ListGroupsRequest>
4780                    for ListGroupsSvc<T> {
4781                        type Response = super::ListGroupsResponse;
4782                        type Future = BoxFuture<
4783                            tonic::Response<Self::Response>,
4784                            tonic::Status,
4785                        >;
4786                        fn call(
4787                            &mut self,
4788                            request: tonic::Request<super::ListGroupsRequest>,
4789                        ) -> Self::Future {
4790                            let inner = Arc::clone(&self.0);
4791                            let fut = async move {
4792                                <T as GroupService>::list_groups(&inner, request).await
4793                            };
4794                            Box::pin(fut)
4795                        }
4796                    }
4797                    let accept_compression_encodings = self.accept_compression_encodings;
4798                    let send_compression_encodings = self.send_compression_encodings;
4799                    let max_decoding_message_size = self.max_decoding_message_size;
4800                    let max_encoding_message_size = self.max_encoding_message_size;
4801                    let inner = self.inner.clone();
4802                    let fut = async move {
4803                        let method = ListGroupsSvc(inner);
4804                        let codec = tonic_prost::ProstCodec::default();
4805                        let mut grpc = tonic::server::Grpc::new(codec)
4806                            .apply_compression_config(
4807                                accept_compression_encodings,
4808                                send_compression_encodings,
4809                            )
4810                            .apply_max_message_size_config(
4811                                max_decoding_message_size,
4812                                max_encoding_message_size,
4813                            );
4814                        let res = grpc.unary(method, req).await;
4815                        Ok(res)
4816                    };
4817                    Box::pin(fut)
4818                }
4819                "/pidgr.v1.GroupService/UpdateGroup" => {
4820                    #[allow(non_camel_case_types)]
4821                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
4822                    impl<
4823                        T: GroupService,
4824                    > tonic::server::UnaryService<super::UpdateGroupRequest>
4825                    for UpdateGroupSvc<T> {
4826                        type Response = super::UpdateGroupResponse;
4827                        type Future = BoxFuture<
4828                            tonic::Response<Self::Response>,
4829                            tonic::Status,
4830                        >;
4831                        fn call(
4832                            &mut self,
4833                            request: tonic::Request<super::UpdateGroupRequest>,
4834                        ) -> Self::Future {
4835                            let inner = Arc::clone(&self.0);
4836                            let fut = async move {
4837                                <T as GroupService>::update_group(&inner, request).await
4838                            };
4839                            Box::pin(fut)
4840                        }
4841                    }
4842                    let accept_compression_encodings = self.accept_compression_encodings;
4843                    let send_compression_encodings = self.send_compression_encodings;
4844                    let max_decoding_message_size = self.max_decoding_message_size;
4845                    let max_encoding_message_size = self.max_encoding_message_size;
4846                    let inner = self.inner.clone();
4847                    let fut = async move {
4848                        let method = UpdateGroupSvc(inner);
4849                        let codec = tonic_prost::ProstCodec::default();
4850                        let mut grpc = tonic::server::Grpc::new(codec)
4851                            .apply_compression_config(
4852                                accept_compression_encodings,
4853                                send_compression_encodings,
4854                            )
4855                            .apply_max_message_size_config(
4856                                max_decoding_message_size,
4857                                max_encoding_message_size,
4858                            );
4859                        let res = grpc.unary(method, req).await;
4860                        Ok(res)
4861                    };
4862                    Box::pin(fut)
4863                }
4864                "/pidgr.v1.GroupService/DeleteGroup" => {
4865                    #[allow(non_camel_case_types)]
4866                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
4867                    impl<
4868                        T: GroupService,
4869                    > tonic::server::UnaryService<super::DeleteGroupRequest>
4870                    for DeleteGroupSvc<T> {
4871                        type Response = super::DeleteGroupResponse;
4872                        type Future = BoxFuture<
4873                            tonic::Response<Self::Response>,
4874                            tonic::Status,
4875                        >;
4876                        fn call(
4877                            &mut self,
4878                            request: tonic::Request<super::DeleteGroupRequest>,
4879                        ) -> Self::Future {
4880                            let inner = Arc::clone(&self.0);
4881                            let fut = async move {
4882                                <T as GroupService>::delete_group(&inner, request).await
4883                            };
4884                            Box::pin(fut)
4885                        }
4886                    }
4887                    let accept_compression_encodings = self.accept_compression_encodings;
4888                    let send_compression_encodings = self.send_compression_encodings;
4889                    let max_decoding_message_size = self.max_decoding_message_size;
4890                    let max_encoding_message_size = self.max_encoding_message_size;
4891                    let inner = self.inner.clone();
4892                    let fut = async move {
4893                        let method = DeleteGroupSvc(inner);
4894                        let codec = tonic_prost::ProstCodec::default();
4895                        let mut grpc = tonic::server::Grpc::new(codec)
4896                            .apply_compression_config(
4897                                accept_compression_encodings,
4898                                send_compression_encodings,
4899                            )
4900                            .apply_max_message_size_config(
4901                                max_decoding_message_size,
4902                                max_encoding_message_size,
4903                            );
4904                        let res = grpc.unary(method, req).await;
4905                        Ok(res)
4906                    };
4907                    Box::pin(fut)
4908                }
4909                "/pidgr.v1.GroupService/AddGroupMembers" => {
4910                    #[allow(non_camel_case_types)]
4911                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
4912                    impl<
4913                        T: GroupService,
4914                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
4915                    for AddGroupMembersSvc<T> {
4916                        type Response = super::AddGroupMembersResponse;
4917                        type Future = BoxFuture<
4918                            tonic::Response<Self::Response>,
4919                            tonic::Status,
4920                        >;
4921                        fn call(
4922                            &mut self,
4923                            request: tonic::Request<super::AddGroupMembersRequest>,
4924                        ) -> Self::Future {
4925                            let inner = Arc::clone(&self.0);
4926                            let fut = async move {
4927                                <T as GroupService>::add_group_members(&inner, request)
4928                                    .await
4929                            };
4930                            Box::pin(fut)
4931                        }
4932                    }
4933                    let accept_compression_encodings = self.accept_compression_encodings;
4934                    let send_compression_encodings = self.send_compression_encodings;
4935                    let max_decoding_message_size = self.max_decoding_message_size;
4936                    let max_encoding_message_size = self.max_encoding_message_size;
4937                    let inner = self.inner.clone();
4938                    let fut = async move {
4939                        let method = AddGroupMembersSvc(inner);
4940                        let codec = tonic_prost::ProstCodec::default();
4941                        let mut grpc = tonic::server::Grpc::new(codec)
4942                            .apply_compression_config(
4943                                accept_compression_encodings,
4944                                send_compression_encodings,
4945                            )
4946                            .apply_max_message_size_config(
4947                                max_decoding_message_size,
4948                                max_encoding_message_size,
4949                            );
4950                        let res = grpc.unary(method, req).await;
4951                        Ok(res)
4952                    };
4953                    Box::pin(fut)
4954                }
4955                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
4956                    #[allow(non_camel_case_types)]
4957                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
4958                    impl<
4959                        T: GroupService,
4960                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
4961                    for RemoveGroupMembersSvc<T> {
4962                        type Response = super::RemoveGroupMembersResponse;
4963                        type Future = BoxFuture<
4964                            tonic::Response<Self::Response>,
4965                            tonic::Status,
4966                        >;
4967                        fn call(
4968                            &mut self,
4969                            request: tonic::Request<super::RemoveGroupMembersRequest>,
4970                        ) -> Self::Future {
4971                            let inner = Arc::clone(&self.0);
4972                            let fut = async move {
4973                                <T as GroupService>::remove_group_members(&inner, request)
4974                                    .await
4975                            };
4976                            Box::pin(fut)
4977                        }
4978                    }
4979                    let accept_compression_encodings = self.accept_compression_encodings;
4980                    let send_compression_encodings = self.send_compression_encodings;
4981                    let max_decoding_message_size = self.max_decoding_message_size;
4982                    let max_encoding_message_size = self.max_encoding_message_size;
4983                    let inner = self.inner.clone();
4984                    let fut = async move {
4985                        let method = RemoveGroupMembersSvc(inner);
4986                        let codec = tonic_prost::ProstCodec::default();
4987                        let mut grpc = tonic::server::Grpc::new(codec)
4988                            .apply_compression_config(
4989                                accept_compression_encodings,
4990                                send_compression_encodings,
4991                            )
4992                            .apply_max_message_size_config(
4993                                max_decoding_message_size,
4994                                max_encoding_message_size,
4995                            );
4996                        let res = grpc.unary(method, req).await;
4997                        Ok(res)
4998                    };
4999                    Box::pin(fut)
5000                }
5001                "/pidgr.v1.GroupService/ListGroupMembers" => {
5002                    #[allow(non_camel_case_types)]
5003                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5004                    impl<
5005                        T: GroupService,
5006                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5007                    for ListGroupMembersSvc<T> {
5008                        type Response = super::ListGroupMembersResponse;
5009                        type Future = BoxFuture<
5010                            tonic::Response<Self::Response>,
5011                            tonic::Status,
5012                        >;
5013                        fn call(
5014                            &mut self,
5015                            request: tonic::Request<super::ListGroupMembersRequest>,
5016                        ) -> Self::Future {
5017                            let inner = Arc::clone(&self.0);
5018                            let fut = async move {
5019                                <T as GroupService>::list_group_members(&inner, request)
5020                                    .await
5021                            };
5022                            Box::pin(fut)
5023                        }
5024                    }
5025                    let accept_compression_encodings = self.accept_compression_encodings;
5026                    let send_compression_encodings = self.send_compression_encodings;
5027                    let max_decoding_message_size = self.max_decoding_message_size;
5028                    let max_encoding_message_size = self.max_encoding_message_size;
5029                    let inner = self.inner.clone();
5030                    let fut = async move {
5031                        let method = ListGroupMembersSvc(inner);
5032                        let codec = tonic_prost::ProstCodec::default();
5033                        let mut grpc = tonic::server::Grpc::new(codec)
5034                            .apply_compression_config(
5035                                accept_compression_encodings,
5036                                send_compression_encodings,
5037                            )
5038                            .apply_max_message_size_config(
5039                                max_decoding_message_size,
5040                                max_encoding_message_size,
5041                            );
5042                        let res = grpc.unary(method, req).await;
5043                        Ok(res)
5044                    };
5045                    Box::pin(fut)
5046                }
5047                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5048                    #[allow(non_camel_case_types)]
5049                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5050                    impl<
5051                        T: GroupService,
5052                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5053                    for GetUserGroupMembershipsSvc<T> {
5054                        type Response = super::GetUserGroupMembershipsResponse;
5055                        type Future = BoxFuture<
5056                            tonic::Response<Self::Response>,
5057                            tonic::Status,
5058                        >;
5059                        fn call(
5060                            &mut self,
5061                            request: tonic::Request<
5062                                super::GetUserGroupMembershipsRequest,
5063                            >,
5064                        ) -> Self::Future {
5065                            let inner = Arc::clone(&self.0);
5066                            let fut = async move {
5067                                <T as GroupService>::get_user_group_memberships(
5068                                        &inner,
5069                                        request,
5070                                    )
5071                                    .await
5072                            };
5073                            Box::pin(fut)
5074                        }
5075                    }
5076                    let accept_compression_encodings = self.accept_compression_encodings;
5077                    let send_compression_encodings = self.send_compression_encodings;
5078                    let max_decoding_message_size = self.max_decoding_message_size;
5079                    let max_encoding_message_size = self.max_encoding_message_size;
5080                    let inner = self.inner.clone();
5081                    let fut = async move {
5082                        let method = GetUserGroupMembershipsSvc(inner);
5083                        let codec = tonic_prost::ProstCodec::default();
5084                        let mut grpc = tonic::server::Grpc::new(codec)
5085                            .apply_compression_config(
5086                                accept_compression_encodings,
5087                                send_compression_encodings,
5088                            )
5089                            .apply_max_message_size_config(
5090                                max_decoding_message_size,
5091                                max_encoding_message_size,
5092                            );
5093                        let res = grpc.unary(method, req).await;
5094                        Ok(res)
5095                    };
5096                    Box::pin(fut)
5097                }
5098                _ => {
5099                    Box::pin(async move {
5100                        let mut response = http::Response::new(
5101                            tonic::body::Body::default(),
5102                        );
5103                        let headers = response.headers_mut();
5104                        headers
5105                            .insert(
5106                                tonic::Status::GRPC_STATUS,
5107                                (tonic::Code::Unimplemented as i32).into(),
5108                            );
5109                        headers
5110                            .insert(
5111                                http::header::CONTENT_TYPE,
5112                                tonic::metadata::GRPC_CONTENT_TYPE,
5113                            );
5114                        Ok(response)
5115                    })
5116                }
5117            }
5118        }
5119    }
5120    impl<T> Clone for GroupServiceServer<T> {
5121        fn clone(&self) -> Self {
5122            let inner = self.inner.clone();
5123            Self {
5124                inner,
5125                accept_compression_encodings: self.accept_compression_encodings,
5126                send_compression_encodings: self.send_compression_encodings,
5127                max_decoding_message_size: self.max_decoding_message_size,
5128                max_encoding_message_size: self.max_encoding_message_size,
5129            }
5130        }
5131    }
5132    /// Generated gRPC service name
5133    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5134    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5135        const NAME: &'static str = SERVICE_NAME;
5136    }
5137}
5138/// Generated client implementations.
5139pub mod heatmap_service_client {
5140    #![allow(
5141        unused_variables,
5142        dead_code,
5143        missing_docs,
5144        clippy::wildcard_imports,
5145        clippy::let_unit_value,
5146    )]
5147    use tonic::codegen::*;
5148    use tonic::codegen::http::Uri;
5149    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5150 for mobile app interaction analytics.
5151*/
5152    #[derive(Debug, Clone)]
5153    pub struct HeatmapServiceClient<T> {
5154        inner: tonic::client::Grpc<T>,
5155    }
5156    impl HeatmapServiceClient<tonic::transport::Channel> {
5157        /// Attempt to create a new client by connecting to a given endpoint.
5158        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5159        where
5160            D: TryInto<tonic::transport::Endpoint>,
5161            D::Error: Into<StdError>,
5162        {
5163            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5164            Ok(Self::new(conn))
5165        }
5166    }
5167    impl<T> HeatmapServiceClient<T>
5168    where
5169        T: tonic::client::GrpcService<tonic::body::Body>,
5170        T::Error: Into<StdError>,
5171        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5172        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5173    {
5174        pub fn new(inner: T) -> Self {
5175            let inner = tonic::client::Grpc::new(inner);
5176            Self { inner }
5177        }
5178        pub fn with_origin(inner: T, origin: Uri) -> Self {
5179            let inner = tonic::client::Grpc::with_origin(inner, origin);
5180            Self { inner }
5181        }
5182        pub fn with_interceptor<F>(
5183            inner: T,
5184            interceptor: F,
5185        ) -> HeatmapServiceClient<InterceptedService<T, F>>
5186        where
5187            F: tonic::service::Interceptor,
5188            T::ResponseBody: Default,
5189            T: tonic::codegen::Service<
5190                http::Request<tonic::body::Body>,
5191                Response = http::Response<
5192                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5193                >,
5194            >,
5195            <T as tonic::codegen::Service<
5196                http::Request<tonic::body::Body>,
5197            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5198        {
5199            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5200        }
5201        /// Compress requests with the given encoding.
5202        ///
5203        /// This requires the server to support it otherwise it might respond with an
5204        /// error.
5205        #[must_use]
5206        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5207            self.inner = self.inner.send_compressed(encoding);
5208            self
5209        }
5210        /// Enable decompressing responses.
5211        #[must_use]
5212        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5213            self.inner = self.inner.accept_compressed(encoding);
5214            self
5215        }
5216        /// Limits the maximum size of a decoded message.
5217        ///
5218        /// Default: `4MB`
5219        #[must_use]
5220        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5221            self.inner = self.inner.max_decoding_message_size(limit);
5222            self
5223        }
5224        /// Limits the maximum size of an encoded message.
5225        ///
5226        /// Default: `usize::MAX`
5227        #[must_use]
5228        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5229            self.inner = self.inner.max_encoding_message_size(limit);
5230            self
5231        }
5232        /** Ingest a batch of touch events from the mobile app.
5233 Authorization: Authenticated mobile user.
5234*/
5235        pub async fn ingest_touch_events(
5236            &mut self,
5237            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5238        ) -> std::result::Result<
5239            tonic::Response<super::IngestTouchEventsResponse>,
5240            tonic::Status,
5241        > {
5242            self.inner
5243                .ready()
5244                .await
5245                .map_err(|e| {
5246                    tonic::Status::unknown(
5247                        format!("Service was not ready: {}", e.into()),
5248                    )
5249                })?;
5250            let codec = tonic_prost::ProstCodec::default();
5251            let path = http::uri::PathAndQuery::from_static(
5252                "/pidgr.v1.HeatmapService/IngestTouchEvents",
5253            );
5254            let mut req = request.into_request();
5255            req.extensions_mut()
5256                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5257            self.inner.unary(req, path, codec).await
5258        }
5259        /** Query aggregated touch data for heatmap rendering.
5260 Authorization: Requires CAMPAIGNS_READ permission.
5261*/
5262        pub async fn query_heatmap_data(
5263            &mut self,
5264            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5265        ) -> std::result::Result<
5266            tonic::Response<super::QueryHeatmapDataResponse>,
5267            tonic::Status,
5268        > {
5269            self.inner
5270                .ready()
5271                .await
5272                .map_err(|e| {
5273                    tonic::Status::unknown(
5274                        format!("Service was not ready: {}", e.into()),
5275                    )
5276                })?;
5277            let codec = tonic_prost::ProstCodec::default();
5278            let path = http::uri::PathAndQuery::from_static(
5279                "/pidgr.v1.HeatmapService/QueryHeatmapData",
5280            );
5281            let mut req = request.into_request();
5282            req.extensions_mut()
5283                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5284            self.inner.unary(req, path, codec).await
5285        }
5286        /** List available screen screenshots for heatmap backgrounds.
5287 Authorization: Requires CAMPAIGNS_READ permission.
5288*/
5289        pub async fn list_screenshots(
5290            &mut self,
5291            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5292        ) -> std::result::Result<
5293            tonic::Response<super::ListScreenshotsResponse>,
5294            tonic::Status,
5295        > {
5296            self.inner
5297                .ready()
5298                .await
5299                .map_err(|e| {
5300                    tonic::Status::unknown(
5301                        format!("Service was not ready: {}", e.into()),
5302                    )
5303                })?;
5304            let codec = tonic_prost::ProstCodec::default();
5305            let path = http::uri::PathAndQuery::from_static(
5306                "/pidgr.v1.HeatmapService/ListScreenshots",
5307            );
5308            let mut req = request.into_request();
5309            req.extensions_mut()
5310                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5311            self.inner.unary(req, path, codec).await
5312        }
5313        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5314 Authorization: Authenticated mobile user.
5315*/
5316        pub async fn upload_screenshot(
5317            &mut self,
5318            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5319        ) -> std::result::Result<
5320            tonic::Response<super::UploadScreenshotResponse>,
5321            tonic::Status,
5322        > {
5323            self.inner
5324                .ready()
5325                .await
5326                .map_err(|e| {
5327                    tonic::Status::unknown(
5328                        format!("Service was not ready: {}", e.into()),
5329                    )
5330                })?;
5331            let codec = tonic_prost::ProstCodec::default();
5332            let path = http::uri::PathAndQuery::from_static(
5333                "/pidgr.v1.HeatmapService/UploadScreenshot",
5334            );
5335            let mut req = request.into_request();
5336            req.extensions_mut()
5337                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5338            self.inner.unary(req, path, codec).await
5339        }
5340    }
5341}
5342/// Generated server implementations.
5343pub mod heatmap_service_server {
5344    #![allow(
5345        unused_variables,
5346        dead_code,
5347        missing_docs,
5348        clippy::wildcard_imports,
5349        clippy::let_unit_value,
5350    )]
5351    use tonic::codegen::*;
5352    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
5353    #[async_trait]
5354    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5355        /** Ingest a batch of touch events from the mobile app.
5356 Authorization: Authenticated mobile user.
5357*/
5358        async fn ingest_touch_events(
5359            &self,
5360            request: tonic::Request<super::IngestTouchEventsRequest>,
5361        ) -> std::result::Result<
5362            tonic::Response<super::IngestTouchEventsResponse>,
5363            tonic::Status,
5364        >;
5365        /** Query aggregated touch data for heatmap rendering.
5366 Authorization: Requires CAMPAIGNS_READ permission.
5367*/
5368        async fn query_heatmap_data(
5369            &self,
5370            request: tonic::Request<super::QueryHeatmapDataRequest>,
5371        ) -> std::result::Result<
5372            tonic::Response<super::QueryHeatmapDataResponse>,
5373            tonic::Status,
5374        >;
5375        /** List available screen screenshots for heatmap backgrounds.
5376 Authorization: Requires CAMPAIGNS_READ permission.
5377*/
5378        async fn list_screenshots(
5379            &self,
5380            request: tonic::Request<super::ListScreenshotsRequest>,
5381        ) -> std::result::Result<
5382            tonic::Response<super::ListScreenshotsResponse>,
5383            tonic::Status,
5384        >;
5385        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5386 Authorization: Authenticated mobile user.
5387*/
5388        async fn upload_screenshot(
5389            &self,
5390            request: tonic::Request<super::UploadScreenshotRequest>,
5391        ) -> std::result::Result<
5392            tonic::Response<super::UploadScreenshotResponse>,
5393            tonic::Status,
5394        >;
5395    }
5396    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5397 for mobile app interaction analytics.
5398*/
5399    #[derive(Debug)]
5400    pub struct HeatmapServiceServer<T> {
5401        inner: Arc<T>,
5402        accept_compression_encodings: EnabledCompressionEncodings,
5403        send_compression_encodings: EnabledCompressionEncodings,
5404        max_decoding_message_size: Option<usize>,
5405        max_encoding_message_size: Option<usize>,
5406    }
5407    impl<T> HeatmapServiceServer<T> {
5408        pub fn new(inner: T) -> Self {
5409            Self::from_arc(Arc::new(inner))
5410        }
5411        pub fn from_arc(inner: Arc<T>) -> Self {
5412            Self {
5413                inner,
5414                accept_compression_encodings: Default::default(),
5415                send_compression_encodings: Default::default(),
5416                max_decoding_message_size: None,
5417                max_encoding_message_size: None,
5418            }
5419        }
5420        pub fn with_interceptor<F>(
5421            inner: T,
5422            interceptor: F,
5423        ) -> InterceptedService<Self, F>
5424        where
5425            F: tonic::service::Interceptor,
5426        {
5427            InterceptedService::new(Self::new(inner), interceptor)
5428        }
5429        /// Enable decompressing requests with the given encoding.
5430        #[must_use]
5431        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5432            self.accept_compression_encodings.enable(encoding);
5433            self
5434        }
5435        /// Compress responses with the given encoding, if the client supports it.
5436        #[must_use]
5437        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5438            self.send_compression_encodings.enable(encoding);
5439            self
5440        }
5441        /// Limits the maximum size of a decoded message.
5442        ///
5443        /// Default: `4MB`
5444        #[must_use]
5445        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5446            self.max_decoding_message_size = Some(limit);
5447            self
5448        }
5449        /// Limits the maximum size of an encoded message.
5450        ///
5451        /// Default: `usize::MAX`
5452        #[must_use]
5453        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5454            self.max_encoding_message_size = Some(limit);
5455            self
5456        }
5457    }
5458    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5459    where
5460        T: HeatmapService,
5461        B: Body + std::marker::Send + 'static,
5462        B::Error: Into<StdError> + std::marker::Send + 'static,
5463    {
5464        type Response = http::Response<tonic::body::Body>;
5465        type Error = std::convert::Infallible;
5466        type Future = BoxFuture<Self::Response, Self::Error>;
5467        fn poll_ready(
5468            &mut self,
5469            _cx: &mut Context<'_>,
5470        ) -> Poll<std::result::Result<(), Self::Error>> {
5471            Poll::Ready(Ok(()))
5472        }
5473        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5474            match req.uri().path() {
5475                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5476                    #[allow(non_camel_case_types)]
5477                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
5478                    impl<
5479                        T: HeatmapService,
5480                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
5481                    for IngestTouchEventsSvc<T> {
5482                        type Response = super::IngestTouchEventsResponse;
5483                        type Future = BoxFuture<
5484                            tonic::Response<Self::Response>,
5485                            tonic::Status,
5486                        >;
5487                        fn call(
5488                            &mut self,
5489                            request: tonic::Request<super::IngestTouchEventsRequest>,
5490                        ) -> Self::Future {
5491                            let inner = Arc::clone(&self.0);
5492                            let fut = async move {
5493                                <T as HeatmapService>::ingest_touch_events(&inner, request)
5494                                    .await
5495                            };
5496                            Box::pin(fut)
5497                        }
5498                    }
5499                    let accept_compression_encodings = self.accept_compression_encodings;
5500                    let send_compression_encodings = self.send_compression_encodings;
5501                    let max_decoding_message_size = self.max_decoding_message_size;
5502                    let max_encoding_message_size = self.max_encoding_message_size;
5503                    let inner = self.inner.clone();
5504                    let fut = async move {
5505                        let method = IngestTouchEventsSvc(inner);
5506                        let codec = tonic_prost::ProstCodec::default();
5507                        let mut grpc = tonic::server::Grpc::new(codec)
5508                            .apply_compression_config(
5509                                accept_compression_encodings,
5510                                send_compression_encodings,
5511                            )
5512                            .apply_max_message_size_config(
5513                                max_decoding_message_size,
5514                                max_encoding_message_size,
5515                            );
5516                        let res = grpc.unary(method, req).await;
5517                        Ok(res)
5518                    };
5519                    Box::pin(fut)
5520                }
5521                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
5522                    #[allow(non_camel_case_types)]
5523                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
5524                    impl<
5525                        T: HeatmapService,
5526                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
5527                    for QueryHeatmapDataSvc<T> {
5528                        type Response = super::QueryHeatmapDataResponse;
5529                        type Future = BoxFuture<
5530                            tonic::Response<Self::Response>,
5531                            tonic::Status,
5532                        >;
5533                        fn call(
5534                            &mut self,
5535                            request: tonic::Request<super::QueryHeatmapDataRequest>,
5536                        ) -> Self::Future {
5537                            let inner = Arc::clone(&self.0);
5538                            let fut = async move {
5539                                <T as HeatmapService>::query_heatmap_data(&inner, request)
5540                                    .await
5541                            };
5542                            Box::pin(fut)
5543                        }
5544                    }
5545                    let accept_compression_encodings = self.accept_compression_encodings;
5546                    let send_compression_encodings = self.send_compression_encodings;
5547                    let max_decoding_message_size = self.max_decoding_message_size;
5548                    let max_encoding_message_size = self.max_encoding_message_size;
5549                    let inner = self.inner.clone();
5550                    let fut = async move {
5551                        let method = QueryHeatmapDataSvc(inner);
5552                        let codec = tonic_prost::ProstCodec::default();
5553                        let mut grpc = tonic::server::Grpc::new(codec)
5554                            .apply_compression_config(
5555                                accept_compression_encodings,
5556                                send_compression_encodings,
5557                            )
5558                            .apply_max_message_size_config(
5559                                max_decoding_message_size,
5560                                max_encoding_message_size,
5561                            );
5562                        let res = grpc.unary(method, req).await;
5563                        Ok(res)
5564                    };
5565                    Box::pin(fut)
5566                }
5567                "/pidgr.v1.HeatmapService/ListScreenshots" => {
5568                    #[allow(non_camel_case_types)]
5569                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
5570                    impl<
5571                        T: HeatmapService,
5572                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
5573                    for ListScreenshotsSvc<T> {
5574                        type Response = super::ListScreenshotsResponse;
5575                        type Future = BoxFuture<
5576                            tonic::Response<Self::Response>,
5577                            tonic::Status,
5578                        >;
5579                        fn call(
5580                            &mut self,
5581                            request: tonic::Request<super::ListScreenshotsRequest>,
5582                        ) -> Self::Future {
5583                            let inner = Arc::clone(&self.0);
5584                            let fut = async move {
5585                                <T as HeatmapService>::list_screenshots(&inner, request)
5586                                    .await
5587                            };
5588                            Box::pin(fut)
5589                        }
5590                    }
5591                    let accept_compression_encodings = self.accept_compression_encodings;
5592                    let send_compression_encodings = self.send_compression_encodings;
5593                    let max_decoding_message_size = self.max_decoding_message_size;
5594                    let max_encoding_message_size = self.max_encoding_message_size;
5595                    let inner = self.inner.clone();
5596                    let fut = async move {
5597                        let method = ListScreenshotsSvc(inner);
5598                        let codec = tonic_prost::ProstCodec::default();
5599                        let mut grpc = tonic::server::Grpc::new(codec)
5600                            .apply_compression_config(
5601                                accept_compression_encodings,
5602                                send_compression_encodings,
5603                            )
5604                            .apply_max_message_size_config(
5605                                max_decoding_message_size,
5606                                max_encoding_message_size,
5607                            );
5608                        let res = grpc.unary(method, req).await;
5609                        Ok(res)
5610                    };
5611                    Box::pin(fut)
5612                }
5613                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
5614                    #[allow(non_camel_case_types)]
5615                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
5616                    impl<
5617                        T: HeatmapService,
5618                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
5619                    for UploadScreenshotSvc<T> {
5620                        type Response = super::UploadScreenshotResponse;
5621                        type Future = BoxFuture<
5622                            tonic::Response<Self::Response>,
5623                            tonic::Status,
5624                        >;
5625                        fn call(
5626                            &mut self,
5627                            request: tonic::Request<super::UploadScreenshotRequest>,
5628                        ) -> Self::Future {
5629                            let inner = Arc::clone(&self.0);
5630                            let fut = async move {
5631                                <T as HeatmapService>::upload_screenshot(&inner, request)
5632                                    .await
5633                            };
5634                            Box::pin(fut)
5635                        }
5636                    }
5637                    let accept_compression_encodings = self.accept_compression_encodings;
5638                    let send_compression_encodings = self.send_compression_encodings;
5639                    let max_decoding_message_size = self.max_decoding_message_size;
5640                    let max_encoding_message_size = self.max_encoding_message_size;
5641                    let inner = self.inner.clone();
5642                    let fut = async move {
5643                        let method = UploadScreenshotSvc(inner);
5644                        let codec = tonic_prost::ProstCodec::default();
5645                        let mut grpc = tonic::server::Grpc::new(codec)
5646                            .apply_compression_config(
5647                                accept_compression_encodings,
5648                                send_compression_encodings,
5649                            )
5650                            .apply_max_message_size_config(
5651                                max_decoding_message_size,
5652                                max_encoding_message_size,
5653                            );
5654                        let res = grpc.unary(method, req).await;
5655                        Ok(res)
5656                    };
5657                    Box::pin(fut)
5658                }
5659                _ => {
5660                    Box::pin(async move {
5661                        let mut response = http::Response::new(
5662                            tonic::body::Body::default(),
5663                        );
5664                        let headers = response.headers_mut();
5665                        headers
5666                            .insert(
5667                                tonic::Status::GRPC_STATUS,
5668                                (tonic::Code::Unimplemented as i32).into(),
5669                            );
5670                        headers
5671                            .insert(
5672                                http::header::CONTENT_TYPE,
5673                                tonic::metadata::GRPC_CONTENT_TYPE,
5674                            );
5675                        Ok(response)
5676                    })
5677                }
5678            }
5679        }
5680    }
5681    impl<T> Clone for HeatmapServiceServer<T> {
5682        fn clone(&self) -> Self {
5683            let inner = self.inner.clone();
5684            Self {
5685                inner,
5686                accept_compression_encodings: self.accept_compression_encodings,
5687                send_compression_encodings: self.send_compression_encodings,
5688                max_decoding_message_size: self.max_decoding_message_size,
5689                max_encoding_message_size: self.max_encoding_message_size,
5690            }
5691        }
5692    }
5693    /// Generated gRPC service name
5694    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
5695    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
5696        const NAME: &'static str = SERVICE_NAME;
5697    }
5698}
5699/// Generated client implementations.
5700pub mod inbox_service_client {
5701    #![allow(
5702        unused_variables,
5703        dead_code,
5704        missing_docs,
5705        clippy::wildcard_imports,
5706        clippy::let_unit_value,
5707    )]
5708    use tonic::codegen::*;
5709    use tonic::codegen::http::Uri;
5710    /** Provides the mobile app's inbox experience — syncing messages,
5711 tracking read status, and retrieving individual entries.
5712*/
5713    #[derive(Debug, Clone)]
5714    pub struct InboxServiceClient<T> {
5715        inner: tonic::client::Grpc<T>,
5716    }
5717    impl InboxServiceClient<tonic::transport::Channel> {
5718        /// Attempt to create a new client by connecting to a given endpoint.
5719        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5720        where
5721            D: TryInto<tonic::transport::Endpoint>,
5722            D::Error: Into<StdError>,
5723        {
5724            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5725            Ok(Self::new(conn))
5726        }
5727    }
5728    impl<T> InboxServiceClient<T>
5729    where
5730        T: tonic::client::GrpcService<tonic::body::Body>,
5731        T::Error: Into<StdError>,
5732        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5733        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5734    {
5735        pub fn new(inner: T) -> Self {
5736            let inner = tonic::client::Grpc::new(inner);
5737            Self { inner }
5738        }
5739        pub fn with_origin(inner: T, origin: Uri) -> Self {
5740            let inner = tonic::client::Grpc::with_origin(inner, origin);
5741            Self { inner }
5742        }
5743        pub fn with_interceptor<F>(
5744            inner: T,
5745            interceptor: F,
5746        ) -> InboxServiceClient<InterceptedService<T, F>>
5747        where
5748            F: tonic::service::Interceptor,
5749            T::ResponseBody: Default,
5750            T: tonic::codegen::Service<
5751                http::Request<tonic::body::Body>,
5752                Response = http::Response<
5753                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5754                >,
5755            >,
5756            <T as tonic::codegen::Service<
5757                http::Request<tonic::body::Body>,
5758            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5759        {
5760            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
5761        }
5762        /// Compress requests with the given encoding.
5763        ///
5764        /// This requires the server to support it otherwise it might respond with an
5765        /// error.
5766        #[must_use]
5767        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5768            self.inner = self.inner.send_compressed(encoding);
5769            self
5770        }
5771        /// Enable decompressing responses.
5772        #[must_use]
5773        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5774            self.inner = self.inner.accept_compressed(encoding);
5775            self
5776        }
5777        /// Limits the maximum size of a decoded message.
5778        ///
5779        /// Default: `4MB`
5780        #[must_use]
5781        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5782            self.inner = self.inner.max_decoding_message_size(limit);
5783            self
5784        }
5785        /// Limits the maximum size of an encoded message.
5786        ///
5787        /// Default: `usize::MAX`
5788        #[must_use]
5789        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5790            self.inner = self.inner.max_encoding_message_size(limit);
5791            self
5792        }
5793        /** Sync inbox entries since a given timestamp for incremental updates.
5794 Authorization: Authenticated user (own inbox only).
5795*/
5796        pub async fn sync(
5797            &mut self,
5798            request: impl tonic::IntoRequest<super::SyncRequest>,
5799        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
5800            self.inner
5801                .ready()
5802                .await
5803                .map_err(|e| {
5804                    tonic::Status::unknown(
5805                        format!("Service was not ready: {}", e.into()),
5806                    )
5807                })?;
5808            let codec = tonic_prost::ProstCodec::default();
5809            let path = http::uri::PathAndQuery::from_static(
5810                "/pidgr.v1.InboxService/Sync",
5811            );
5812            let mut req = request.into_request();
5813            req.extensions_mut()
5814                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
5815            self.inner.unary(req, path, codec).await
5816        }
5817        /** Mark a delivered message as read (analytics-only, does not affect workflow).
5818 Authorization: Authenticated user (own inbox only).
5819*/
5820        pub async fn mark_read(
5821            &mut self,
5822            request: impl tonic::IntoRequest<super::MarkReadRequest>,
5823        ) -> std::result::Result<
5824            tonic::Response<super::MarkReadResponse>,
5825            tonic::Status,
5826        > {
5827            self.inner
5828                .ready()
5829                .await
5830                .map_err(|e| {
5831                    tonic::Status::unknown(
5832                        format!("Service was not ready: {}", e.into()),
5833                    )
5834                })?;
5835            let codec = tonic_prost::ProstCodec::default();
5836            let path = http::uri::PathAndQuery::from_static(
5837                "/pidgr.v1.InboxService/MarkRead",
5838            );
5839            let mut req = request.into_request();
5840            req.extensions_mut()
5841                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
5842            self.inner.unary(req, path, codec).await
5843        }
5844        /** Retrieve a single inbox entry by delivery ID.
5845 Authorization: Authenticated user (own inbox only).
5846*/
5847        pub async fn get_message(
5848            &mut self,
5849            request: impl tonic::IntoRequest<super::GetMessageRequest>,
5850        ) -> std::result::Result<
5851            tonic::Response<super::GetMessageResponse>,
5852            tonic::Status,
5853        > {
5854            self.inner
5855                .ready()
5856                .await
5857                .map_err(|e| {
5858                    tonic::Status::unknown(
5859                        format!("Service was not ready: {}", e.into()),
5860                    )
5861                })?;
5862            let codec = tonic_prost::ProstCodec::default();
5863            let path = http::uri::PathAndQuery::from_static(
5864                "/pidgr.v1.InboxService/GetMessage",
5865            );
5866            let mut req = request.into_request();
5867            req.extensions_mut()
5868                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
5869            self.inner.unary(req, path, codec).await
5870        }
5871    }
5872}
5873/// Generated server implementations.
5874pub mod inbox_service_server {
5875    #![allow(
5876        unused_variables,
5877        dead_code,
5878        missing_docs,
5879        clippy::wildcard_imports,
5880        clippy::let_unit_value,
5881    )]
5882    use tonic::codegen::*;
5883    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
5884    #[async_trait]
5885    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
5886        /** Sync inbox entries since a given timestamp for incremental updates.
5887 Authorization: Authenticated user (own inbox only).
5888*/
5889        async fn sync(
5890            &self,
5891            request: tonic::Request<super::SyncRequest>,
5892        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
5893        /** Mark a delivered message as read (analytics-only, does not affect workflow).
5894 Authorization: Authenticated user (own inbox only).
5895*/
5896        async fn mark_read(
5897            &self,
5898            request: tonic::Request<super::MarkReadRequest>,
5899        ) -> std::result::Result<
5900            tonic::Response<super::MarkReadResponse>,
5901            tonic::Status,
5902        >;
5903        /** Retrieve a single inbox entry by delivery ID.
5904 Authorization: Authenticated user (own inbox only).
5905*/
5906        async fn get_message(
5907            &self,
5908            request: tonic::Request<super::GetMessageRequest>,
5909        ) -> std::result::Result<
5910            tonic::Response<super::GetMessageResponse>,
5911            tonic::Status,
5912        >;
5913    }
5914    /** Provides the mobile app's inbox experience — syncing messages,
5915 tracking read status, and retrieving individual entries.
5916*/
5917    #[derive(Debug)]
5918    pub struct InboxServiceServer<T> {
5919        inner: Arc<T>,
5920        accept_compression_encodings: EnabledCompressionEncodings,
5921        send_compression_encodings: EnabledCompressionEncodings,
5922        max_decoding_message_size: Option<usize>,
5923        max_encoding_message_size: Option<usize>,
5924    }
5925    impl<T> InboxServiceServer<T> {
5926        pub fn new(inner: T) -> Self {
5927            Self::from_arc(Arc::new(inner))
5928        }
5929        pub fn from_arc(inner: Arc<T>) -> Self {
5930            Self {
5931                inner,
5932                accept_compression_encodings: Default::default(),
5933                send_compression_encodings: Default::default(),
5934                max_decoding_message_size: None,
5935                max_encoding_message_size: None,
5936            }
5937        }
5938        pub fn with_interceptor<F>(
5939            inner: T,
5940            interceptor: F,
5941        ) -> InterceptedService<Self, F>
5942        where
5943            F: tonic::service::Interceptor,
5944        {
5945            InterceptedService::new(Self::new(inner), interceptor)
5946        }
5947        /// Enable decompressing requests with the given encoding.
5948        #[must_use]
5949        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5950            self.accept_compression_encodings.enable(encoding);
5951            self
5952        }
5953        /// Compress responses with the given encoding, if the client supports it.
5954        #[must_use]
5955        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5956            self.send_compression_encodings.enable(encoding);
5957            self
5958        }
5959        /// Limits the maximum size of a decoded message.
5960        ///
5961        /// Default: `4MB`
5962        #[must_use]
5963        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5964            self.max_decoding_message_size = Some(limit);
5965            self
5966        }
5967        /// Limits the maximum size of an encoded message.
5968        ///
5969        /// Default: `usize::MAX`
5970        #[must_use]
5971        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5972            self.max_encoding_message_size = Some(limit);
5973            self
5974        }
5975    }
5976    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
5977    where
5978        T: InboxService,
5979        B: Body + std::marker::Send + 'static,
5980        B::Error: Into<StdError> + std::marker::Send + 'static,
5981    {
5982        type Response = http::Response<tonic::body::Body>;
5983        type Error = std::convert::Infallible;
5984        type Future = BoxFuture<Self::Response, Self::Error>;
5985        fn poll_ready(
5986            &mut self,
5987            _cx: &mut Context<'_>,
5988        ) -> Poll<std::result::Result<(), Self::Error>> {
5989            Poll::Ready(Ok(()))
5990        }
5991        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5992            match req.uri().path() {
5993                "/pidgr.v1.InboxService/Sync" => {
5994                    #[allow(non_camel_case_types)]
5995                    struct SyncSvc<T: InboxService>(pub Arc<T>);
5996                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
5997                    for SyncSvc<T> {
5998                        type Response = super::SyncResponse;
5999                        type Future = BoxFuture<
6000                            tonic::Response<Self::Response>,
6001                            tonic::Status,
6002                        >;
6003                        fn call(
6004                            &mut self,
6005                            request: tonic::Request<super::SyncRequest>,
6006                        ) -> Self::Future {
6007                            let inner = Arc::clone(&self.0);
6008                            let fut = async move {
6009                                <T as InboxService>::sync(&inner, request).await
6010                            };
6011                            Box::pin(fut)
6012                        }
6013                    }
6014                    let accept_compression_encodings = self.accept_compression_encodings;
6015                    let send_compression_encodings = self.send_compression_encodings;
6016                    let max_decoding_message_size = self.max_decoding_message_size;
6017                    let max_encoding_message_size = self.max_encoding_message_size;
6018                    let inner = self.inner.clone();
6019                    let fut = async move {
6020                        let method = SyncSvc(inner);
6021                        let codec = tonic_prost::ProstCodec::default();
6022                        let mut grpc = tonic::server::Grpc::new(codec)
6023                            .apply_compression_config(
6024                                accept_compression_encodings,
6025                                send_compression_encodings,
6026                            )
6027                            .apply_max_message_size_config(
6028                                max_decoding_message_size,
6029                                max_encoding_message_size,
6030                            );
6031                        let res = grpc.unary(method, req).await;
6032                        Ok(res)
6033                    };
6034                    Box::pin(fut)
6035                }
6036                "/pidgr.v1.InboxService/MarkRead" => {
6037                    #[allow(non_camel_case_types)]
6038                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6039                    impl<
6040                        T: InboxService,
6041                    > tonic::server::UnaryService<super::MarkReadRequest>
6042                    for MarkReadSvc<T> {
6043                        type Response = super::MarkReadResponse;
6044                        type Future = BoxFuture<
6045                            tonic::Response<Self::Response>,
6046                            tonic::Status,
6047                        >;
6048                        fn call(
6049                            &mut self,
6050                            request: tonic::Request<super::MarkReadRequest>,
6051                        ) -> Self::Future {
6052                            let inner = Arc::clone(&self.0);
6053                            let fut = async move {
6054                                <T as InboxService>::mark_read(&inner, request).await
6055                            };
6056                            Box::pin(fut)
6057                        }
6058                    }
6059                    let accept_compression_encodings = self.accept_compression_encodings;
6060                    let send_compression_encodings = self.send_compression_encodings;
6061                    let max_decoding_message_size = self.max_decoding_message_size;
6062                    let max_encoding_message_size = self.max_encoding_message_size;
6063                    let inner = self.inner.clone();
6064                    let fut = async move {
6065                        let method = MarkReadSvc(inner);
6066                        let codec = tonic_prost::ProstCodec::default();
6067                        let mut grpc = tonic::server::Grpc::new(codec)
6068                            .apply_compression_config(
6069                                accept_compression_encodings,
6070                                send_compression_encodings,
6071                            )
6072                            .apply_max_message_size_config(
6073                                max_decoding_message_size,
6074                                max_encoding_message_size,
6075                            );
6076                        let res = grpc.unary(method, req).await;
6077                        Ok(res)
6078                    };
6079                    Box::pin(fut)
6080                }
6081                "/pidgr.v1.InboxService/GetMessage" => {
6082                    #[allow(non_camel_case_types)]
6083                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6084                    impl<
6085                        T: InboxService,
6086                    > tonic::server::UnaryService<super::GetMessageRequest>
6087                    for GetMessageSvc<T> {
6088                        type Response = super::GetMessageResponse;
6089                        type Future = BoxFuture<
6090                            tonic::Response<Self::Response>,
6091                            tonic::Status,
6092                        >;
6093                        fn call(
6094                            &mut self,
6095                            request: tonic::Request<super::GetMessageRequest>,
6096                        ) -> Self::Future {
6097                            let inner = Arc::clone(&self.0);
6098                            let fut = async move {
6099                                <T as InboxService>::get_message(&inner, request).await
6100                            };
6101                            Box::pin(fut)
6102                        }
6103                    }
6104                    let accept_compression_encodings = self.accept_compression_encodings;
6105                    let send_compression_encodings = self.send_compression_encodings;
6106                    let max_decoding_message_size = self.max_decoding_message_size;
6107                    let max_encoding_message_size = self.max_encoding_message_size;
6108                    let inner = self.inner.clone();
6109                    let fut = async move {
6110                        let method = GetMessageSvc(inner);
6111                        let codec = tonic_prost::ProstCodec::default();
6112                        let mut grpc = tonic::server::Grpc::new(codec)
6113                            .apply_compression_config(
6114                                accept_compression_encodings,
6115                                send_compression_encodings,
6116                            )
6117                            .apply_max_message_size_config(
6118                                max_decoding_message_size,
6119                                max_encoding_message_size,
6120                            );
6121                        let res = grpc.unary(method, req).await;
6122                        Ok(res)
6123                    };
6124                    Box::pin(fut)
6125                }
6126                _ => {
6127                    Box::pin(async move {
6128                        let mut response = http::Response::new(
6129                            tonic::body::Body::default(),
6130                        );
6131                        let headers = response.headers_mut();
6132                        headers
6133                            .insert(
6134                                tonic::Status::GRPC_STATUS,
6135                                (tonic::Code::Unimplemented as i32).into(),
6136                            );
6137                        headers
6138                            .insert(
6139                                http::header::CONTENT_TYPE,
6140                                tonic::metadata::GRPC_CONTENT_TYPE,
6141                            );
6142                        Ok(response)
6143                    })
6144                }
6145            }
6146        }
6147    }
6148    impl<T> Clone for InboxServiceServer<T> {
6149        fn clone(&self) -> Self {
6150            let inner = self.inner.clone();
6151            Self {
6152                inner,
6153                accept_compression_encodings: self.accept_compression_encodings,
6154                send_compression_encodings: self.send_compression_encodings,
6155                max_decoding_message_size: self.max_decoding_message_size,
6156                max_encoding_message_size: self.max_encoding_message_size,
6157            }
6158        }
6159    }
6160    /// Generated gRPC service name
6161    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6162    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6163        const NAME: &'static str = SERVICE_NAME;
6164    }
6165}
6166/// Generated client implementations.
6167pub mod insights_service_client {
6168    #![allow(
6169        unused_variables,
6170        dead_code,
6171        missing_docs,
6172        clippy::wildcard_imports,
6173        clippy::let_unit_value,
6174    )]
6175    use tonic::codegen::*;
6176    use tonic::codegen::http::Uri;
6177    /** Provides cohort-level AI insights for campaign planning and optimization.
6178 All predictions are aggregate — no individual-level profiling.
6179 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6180 All RPCs operate within the caller's org (extracted from JWT).
6181*/
6182    #[derive(Debug, Clone)]
6183    pub struct InsightsServiceClient<T> {
6184        inner: tonic::client::Grpc<T>,
6185    }
6186    impl InsightsServiceClient<tonic::transport::Channel> {
6187        /// Attempt to create a new client by connecting to a given endpoint.
6188        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6189        where
6190            D: TryInto<tonic::transport::Endpoint>,
6191            D::Error: Into<StdError>,
6192        {
6193            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6194            Ok(Self::new(conn))
6195        }
6196    }
6197    impl<T> InsightsServiceClient<T>
6198    where
6199        T: tonic::client::GrpcService<tonic::body::Body>,
6200        T::Error: Into<StdError>,
6201        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6202        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6203    {
6204        pub fn new(inner: T) -> Self {
6205            let inner = tonic::client::Grpc::new(inner);
6206            Self { inner }
6207        }
6208        pub fn with_origin(inner: T, origin: Uri) -> Self {
6209            let inner = tonic::client::Grpc::with_origin(inner, origin);
6210            Self { inner }
6211        }
6212        pub fn with_interceptor<F>(
6213            inner: T,
6214            interceptor: F,
6215        ) -> InsightsServiceClient<InterceptedService<T, F>>
6216        where
6217            F: tonic::service::Interceptor,
6218            T::ResponseBody: Default,
6219            T: tonic::codegen::Service<
6220                http::Request<tonic::body::Body>,
6221                Response = http::Response<
6222                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6223                >,
6224            >,
6225            <T as tonic::codegen::Service<
6226                http::Request<tonic::body::Body>,
6227            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6228        {
6229            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
6230        }
6231        /// Compress requests with the given encoding.
6232        ///
6233        /// This requires the server to support it otherwise it might respond with an
6234        /// error.
6235        #[must_use]
6236        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6237            self.inner = self.inner.send_compressed(encoding);
6238            self
6239        }
6240        /// Enable decompressing responses.
6241        #[must_use]
6242        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6243            self.inner = self.inner.accept_compressed(encoding);
6244            self
6245        }
6246        /// Limits the maximum size of a decoded message.
6247        ///
6248        /// Default: `4MB`
6249        #[must_use]
6250        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6251            self.inner = self.inner.max_decoding_message_size(limit);
6252            self
6253        }
6254        /// Limits the maximum size of an encoded message.
6255        ///
6256        /// Default: `usize::MAX`
6257        #[must_use]
6258        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6259            self.inner = self.inner.max_encoding_message_size(limit);
6260            self
6261        }
6262        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6263 Returns empty archetypes if insufficient data (cold start).
6264 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6265*/
6266        pub async fn get_group_archetypes(
6267            &mut self,
6268            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
6269        ) -> std::result::Result<
6270            tonic::Response<super::GetGroupArchetypesResponse>,
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.InsightsService/GetGroupArchetypes",
6284            );
6285            let mut req = request.into_request();
6286            req.extensions_mut()
6287                .insert(
6288                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
6289                );
6290            self.inner.unary(req, path, codec).await
6291        }
6292        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6293 Returns a confidence interval that narrows as more campaign data accumulates.
6294 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6295*/
6296        pub async fn predict_campaign_ack(
6297            &mut self,
6298            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
6299        ) -> std::result::Result<
6300            tonic::Response<super::PredictCampaignAckResponse>,
6301            tonic::Status,
6302        > {
6303            self.inner
6304                .ready()
6305                .await
6306                .map_err(|e| {
6307                    tonic::Status::unknown(
6308                        format!("Service was not ready: {}", e.into()),
6309                    )
6310                })?;
6311            let codec = tonic_prost::ProstCodec::default();
6312            let path = http::uri::PathAndQuery::from_static(
6313                "/pidgr.v1.InsightsService/PredictCampaignACK",
6314            );
6315            let mut req = request.into_request();
6316            req.extensions_mut()
6317                .insert(
6318                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
6319                );
6320            self.inner.unary(req, path, codec).await
6321        }
6322        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6323 Advisory is informational only — never drives automated decisions.
6324 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6325*/
6326        pub async fn get_campaign_advisory(
6327            &mut self,
6328            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
6329        ) -> std::result::Result<
6330            tonic::Response<super::GetCampaignAdvisoryResponse>,
6331            tonic::Status,
6332        > {
6333            self.inner
6334                .ready()
6335                .await
6336                .map_err(|e| {
6337                    tonic::Status::unknown(
6338                        format!("Service was not ready: {}", e.into()),
6339                    )
6340                })?;
6341            let codec = tonic_prost::ProstCodec::default();
6342            let path = http::uri::PathAndQuery::from_static(
6343                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
6344            );
6345            let mut req = request.into_request();
6346            req.extensions_mut()
6347                .insert(
6348                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
6349                );
6350            self.inner.unary(req, path, codec).await
6351        }
6352        /** Generate an AI-powered narrative summary of a group's insights.
6353 Combines archetype, prediction, and campaign data into human-readable analysis.
6354 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6355*/
6356        pub async fn get_insight_narrative(
6357            &mut self,
6358            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
6359        ) -> std::result::Result<
6360            tonic::Response<super::GetInsightNarrativeResponse>,
6361            tonic::Status,
6362        > {
6363            self.inner
6364                .ready()
6365                .await
6366                .map_err(|e| {
6367                    tonic::Status::unknown(
6368                        format!("Service was not ready: {}", e.into()),
6369                    )
6370                })?;
6371            let codec = tonic_prost::ProstCodec::default();
6372            let path = http::uri::PathAndQuery::from_static(
6373                "/pidgr.v1.InsightsService/GetInsightNarrative",
6374            );
6375            let mut req = request.into_request();
6376            req.extensions_mut()
6377                .insert(
6378                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
6379                );
6380            self.inner.unary(req, path, codec).await
6381        }
6382    }
6383}
6384/// Generated server implementations.
6385pub mod insights_service_server {
6386    #![allow(
6387        unused_variables,
6388        dead_code,
6389        missing_docs,
6390        clippy::wildcard_imports,
6391        clippy::let_unit_value,
6392    )]
6393    use tonic::codegen::*;
6394    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
6395    #[async_trait]
6396    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
6397        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6398 Returns empty archetypes if insufficient data (cold start).
6399 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6400*/
6401        async fn get_group_archetypes(
6402            &self,
6403            request: tonic::Request<super::GetGroupArchetypesRequest>,
6404        ) -> std::result::Result<
6405            tonic::Response<super::GetGroupArchetypesResponse>,
6406            tonic::Status,
6407        >;
6408        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6409 Returns a confidence interval that narrows as more campaign data accumulates.
6410 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6411*/
6412        async fn predict_campaign_ack(
6413            &self,
6414            request: tonic::Request<super::PredictCampaignAckRequest>,
6415        ) -> std::result::Result<
6416            tonic::Response<super::PredictCampaignAckResponse>,
6417            tonic::Status,
6418        >;
6419        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6420 Advisory is informational only — never drives automated decisions.
6421 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6422*/
6423        async fn get_campaign_advisory(
6424            &self,
6425            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6426        ) -> std::result::Result<
6427            tonic::Response<super::GetCampaignAdvisoryResponse>,
6428            tonic::Status,
6429        >;
6430        /** Generate an AI-powered narrative summary of a group's insights.
6431 Combines archetype, prediction, and campaign data into human-readable analysis.
6432 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6433*/
6434        async fn get_insight_narrative(
6435            &self,
6436            request: tonic::Request<super::GetInsightNarrativeRequest>,
6437        ) -> std::result::Result<
6438            tonic::Response<super::GetInsightNarrativeResponse>,
6439            tonic::Status,
6440        >;
6441    }
6442    /** Provides cohort-level AI insights for campaign planning and optimization.
6443 All predictions are aggregate — no individual-level profiling.
6444 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6445 All RPCs operate within the caller's org (extracted from JWT).
6446*/
6447    #[derive(Debug)]
6448    pub struct InsightsServiceServer<T> {
6449        inner: Arc<T>,
6450        accept_compression_encodings: EnabledCompressionEncodings,
6451        send_compression_encodings: EnabledCompressionEncodings,
6452        max_decoding_message_size: Option<usize>,
6453        max_encoding_message_size: Option<usize>,
6454    }
6455    impl<T> InsightsServiceServer<T> {
6456        pub fn new(inner: T) -> Self {
6457            Self::from_arc(Arc::new(inner))
6458        }
6459        pub fn from_arc(inner: Arc<T>) -> Self {
6460            Self {
6461                inner,
6462                accept_compression_encodings: Default::default(),
6463                send_compression_encodings: Default::default(),
6464                max_decoding_message_size: None,
6465                max_encoding_message_size: None,
6466            }
6467        }
6468        pub fn with_interceptor<F>(
6469            inner: T,
6470            interceptor: F,
6471        ) -> InterceptedService<Self, F>
6472        where
6473            F: tonic::service::Interceptor,
6474        {
6475            InterceptedService::new(Self::new(inner), interceptor)
6476        }
6477        /// Enable decompressing requests with the given encoding.
6478        #[must_use]
6479        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6480            self.accept_compression_encodings.enable(encoding);
6481            self
6482        }
6483        /// Compress responses with the given encoding, if the client supports it.
6484        #[must_use]
6485        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6486            self.send_compression_encodings.enable(encoding);
6487            self
6488        }
6489        /// Limits the maximum size of a decoded message.
6490        ///
6491        /// Default: `4MB`
6492        #[must_use]
6493        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6494            self.max_decoding_message_size = Some(limit);
6495            self
6496        }
6497        /// Limits the maximum size of an encoded message.
6498        ///
6499        /// Default: `usize::MAX`
6500        #[must_use]
6501        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6502            self.max_encoding_message_size = Some(limit);
6503            self
6504        }
6505    }
6506    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
6507    where
6508        T: InsightsService,
6509        B: Body + std::marker::Send + 'static,
6510        B::Error: Into<StdError> + std::marker::Send + 'static,
6511    {
6512        type Response = http::Response<tonic::body::Body>;
6513        type Error = std::convert::Infallible;
6514        type Future = BoxFuture<Self::Response, Self::Error>;
6515        fn poll_ready(
6516            &mut self,
6517            _cx: &mut Context<'_>,
6518        ) -> Poll<std::result::Result<(), Self::Error>> {
6519            Poll::Ready(Ok(()))
6520        }
6521        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6522            match req.uri().path() {
6523                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
6524                    #[allow(non_camel_case_types)]
6525                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
6526                    impl<
6527                        T: InsightsService,
6528                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
6529                    for GetGroupArchetypesSvc<T> {
6530                        type Response = super::GetGroupArchetypesResponse;
6531                        type Future = BoxFuture<
6532                            tonic::Response<Self::Response>,
6533                            tonic::Status,
6534                        >;
6535                        fn call(
6536                            &mut self,
6537                            request: tonic::Request<super::GetGroupArchetypesRequest>,
6538                        ) -> Self::Future {
6539                            let inner = Arc::clone(&self.0);
6540                            let fut = async move {
6541                                <T as InsightsService>::get_group_archetypes(
6542                                        &inner,
6543                                        request,
6544                                    )
6545                                    .await
6546                            };
6547                            Box::pin(fut)
6548                        }
6549                    }
6550                    let accept_compression_encodings = self.accept_compression_encodings;
6551                    let send_compression_encodings = self.send_compression_encodings;
6552                    let max_decoding_message_size = self.max_decoding_message_size;
6553                    let max_encoding_message_size = self.max_encoding_message_size;
6554                    let inner = self.inner.clone();
6555                    let fut = async move {
6556                        let method = GetGroupArchetypesSvc(inner);
6557                        let codec = tonic_prost::ProstCodec::default();
6558                        let mut grpc = tonic::server::Grpc::new(codec)
6559                            .apply_compression_config(
6560                                accept_compression_encodings,
6561                                send_compression_encodings,
6562                            )
6563                            .apply_max_message_size_config(
6564                                max_decoding_message_size,
6565                                max_encoding_message_size,
6566                            );
6567                        let res = grpc.unary(method, req).await;
6568                        Ok(res)
6569                    };
6570                    Box::pin(fut)
6571                }
6572                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
6573                    #[allow(non_camel_case_types)]
6574                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
6575                    impl<
6576                        T: InsightsService,
6577                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
6578                    for PredictCampaignACKSvc<T> {
6579                        type Response = super::PredictCampaignAckResponse;
6580                        type Future = BoxFuture<
6581                            tonic::Response<Self::Response>,
6582                            tonic::Status,
6583                        >;
6584                        fn call(
6585                            &mut self,
6586                            request: tonic::Request<super::PredictCampaignAckRequest>,
6587                        ) -> Self::Future {
6588                            let inner = Arc::clone(&self.0);
6589                            let fut = async move {
6590                                <T as InsightsService>::predict_campaign_ack(
6591                                        &inner,
6592                                        request,
6593                                    )
6594                                    .await
6595                            };
6596                            Box::pin(fut)
6597                        }
6598                    }
6599                    let accept_compression_encodings = self.accept_compression_encodings;
6600                    let send_compression_encodings = self.send_compression_encodings;
6601                    let max_decoding_message_size = self.max_decoding_message_size;
6602                    let max_encoding_message_size = self.max_encoding_message_size;
6603                    let inner = self.inner.clone();
6604                    let fut = async move {
6605                        let method = PredictCampaignACKSvc(inner);
6606                        let codec = tonic_prost::ProstCodec::default();
6607                        let mut grpc = tonic::server::Grpc::new(codec)
6608                            .apply_compression_config(
6609                                accept_compression_encodings,
6610                                send_compression_encodings,
6611                            )
6612                            .apply_max_message_size_config(
6613                                max_decoding_message_size,
6614                                max_encoding_message_size,
6615                            );
6616                        let res = grpc.unary(method, req).await;
6617                        Ok(res)
6618                    };
6619                    Box::pin(fut)
6620                }
6621                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
6622                    #[allow(non_camel_case_types)]
6623                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
6624                    impl<
6625                        T: InsightsService,
6626                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
6627                    for GetCampaignAdvisorySvc<T> {
6628                        type Response = super::GetCampaignAdvisoryResponse;
6629                        type Future = BoxFuture<
6630                            tonic::Response<Self::Response>,
6631                            tonic::Status,
6632                        >;
6633                        fn call(
6634                            &mut self,
6635                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6636                        ) -> Self::Future {
6637                            let inner = Arc::clone(&self.0);
6638                            let fut = async move {
6639                                <T as InsightsService>::get_campaign_advisory(
6640                                        &inner,
6641                                        request,
6642                                    )
6643                                    .await
6644                            };
6645                            Box::pin(fut)
6646                        }
6647                    }
6648                    let accept_compression_encodings = self.accept_compression_encodings;
6649                    let send_compression_encodings = self.send_compression_encodings;
6650                    let max_decoding_message_size = self.max_decoding_message_size;
6651                    let max_encoding_message_size = self.max_encoding_message_size;
6652                    let inner = self.inner.clone();
6653                    let fut = async move {
6654                        let method = GetCampaignAdvisorySvc(inner);
6655                        let codec = tonic_prost::ProstCodec::default();
6656                        let mut grpc = tonic::server::Grpc::new(codec)
6657                            .apply_compression_config(
6658                                accept_compression_encodings,
6659                                send_compression_encodings,
6660                            )
6661                            .apply_max_message_size_config(
6662                                max_decoding_message_size,
6663                                max_encoding_message_size,
6664                            );
6665                        let res = grpc.unary(method, req).await;
6666                        Ok(res)
6667                    };
6668                    Box::pin(fut)
6669                }
6670                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
6671                    #[allow(non_camel_case_types)]
6672                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
6673                    impl<
6674                        T: InsightsService,
6675                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
6676                    for GetInsightNarrativeSvc<T> {
6677                        type Response = super::GetInsightNarrativeResponse;
6678                        type Future = BoxFuture<
6679                            tonic::Response<Self::Response>,
6680                            tonic::Status,
6681                        >;
6682                        fn call(
6683                            &mut self,
6684                            request: tonic::Request<super::GetInsightNarrativeRequest>,
6685                        ) -> Self::Future {
6686                            let inner = Arc::clone(&self.0);
6687                            let fut = async move {
6688                                <T as InsightsService>::get_insight_narrative(
6689                                        &inner,
6690                                        request,
6691                                    )
6692                                    .await
6693                            };
6694                            Box::pin(fut)
6695                        }
6696                    }
6697                    let accept_compression_encodings = self.accept_compression_encodings;
6698                    let send_compression_encodings = self.send_compression_encodings;
6699                    let max_decoding_message_size = self.max_decoding_message_size;
6700                    let max_encoding_message_size = self.max_encoding_message_size;
6701                    let inner = self.inner.clone();
6702                    let fut = async move {
6703                        let method = GetInsightNarrativeSvc(inner);
6704                        let codec = tonic_prost::ProstCodec::default();
6705                        let mut grpc = tonic::server::Grpc::new(codec)
6706                            .apply_compression_config(
6707                                accept_compression_encodings,
6708                                send_compression_encodings,
6709                            )
6710                            .apply_max_message_size_config(
6711                                max_decoding_message_size,
6712                                max_encoding_message_size,
6713                            );
6714                        let res = grpc.unary(method, req).await;
6715                        Ok(res)
6716                    };
6717                    Box::pin(fut)
6718                }
6719                _ => {
6720                    Box::pin(async move {
6721                        let mut response = http::Response::new(
6722                            tonic::body::Body::default(),
6723                        );
6724                        let headers = response.headers_mut();
6725                        headers
6726                            .insert(
6727                                tonic::Status::GRPC_STATUS,
6728                                (tonic::Code::Unimplemented as i32).into(),
6729                            );
6730                        headers
6731                            .insert(
6732                                http::header::CONTENT_TYPE,
6733                                tonic::metadata::GRPC_CONTENT_TYPE,
6734                            );
6735                        Ok(response)
6736                    })
6737                }
6738            }
6739        }
6740    }
6741    impl<T> Clone for InsightsServiceServer<T> {
6742        fn clone(&self) -> Self {
6743            let inner = self.inner.clone();
6744            Self {
6745                inner,
6746                accept_compression_encodings: self.accept_compression_encodings,
6747                send_compression_encodings: self.send_compression_encodings,
6748                max_decoding_message_size: self.max_decoding_message_size,
6749                max_encoding_message_size: self.max_encoding_message_size,
6750            }
6751        }
6752    }
6753    /// Generated gRPC service name
6754    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
6755    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
6756        const NAME: &'static str = SERVICE_NAME;
6757    }
6758}
6759/// Generated client implementations.
6760pub mod invite_link_service_client {
6761    #![allow(
6762        unused_variables,
6763        dead_code,
6764        missing_docs,
6765        clippy::wildcard_imports,
6766        clippy::let_unit_value,
6767    )]
6768    use tonic::codegen::*;
6769    use tonic::codegen::http::Uri;
6770    /** Manages shareable invite links for organization self-join.
6771 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
6772 ValidateInviteLink is unauthenticated — the token IS the authorization.
6773 RedeemInviteLink requires a valid JWT.
6774*/
6775    #[derive(Debug, Clone)]
6776    pub struct InviteLinkServiceClient<T> {
6777        inner: tonic::client::Grpc<T>,
6778    }
6779    impl InviteLinkServiceClient<tonic::transport::Channel> {
6780        /// Attempt to create a new client by connecting to a given endpoint.
6781        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6782        where
6783            D: TryInto<tonic::transport::Endpoint>,
6784            D::Error: Into<StdError>,
6785        {
6786            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6787            Ok(Self::new(conn))
6788        }
6789    }
6790    impl<T> InviteLinkServiceClient<T>
6791    where
6792        T: tonic::client::GrpcService<tonic::body::Body>,
6793        T::Error: Into<StdError>,
6794        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6795        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6796    {
6797        pub fn new(inner: T) -> Self {
6798            let inner = tonic::client::Grpc::new(inner);
6799            Self { inner }
6800        }
6801        pub fn with_origin(inner: T, origin: Uri) -> Self {
6802            let inner = tonic::client::Grpc::with_origin(inner, origin);
6803            Self { inner }
6804        }
6805        pub fn with_interceptor<F>(
6806            inner: T,
6807            interceptor: F,
6808        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
6809        where
6810            F: tonic::service::Interceptor,
6811            T::ResponseBody: Default,
6812            T: tonic::codegen::Service<
6813                http::Request<tonic::body::Body>,
6814                Response = http::Response<
6815                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6816                >,
6817            >,
6818            <T as tonic::codegen::Service<
6819                http::Request<tonic::body::Body>,
6820            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6821        {
6822            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
6823        }
6824        /// Compress requests with the given encoding.
6825        ///
6826        /// This requires the server to support it otherwise it might respond with an
6827        /// error.
6828        #[must_use]
6829        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6830            self.inner = self.inner.send_compressed(encoding);
6831            self
6832        }
6833        /// Enable decompressing responses.
6834        #[must_use]
6835        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6836            self.inner = self.inner.accept_compressed(encoding);
6837            self
6838        }
6839        /// Limits the maximum size of a decoded message.
6840        ///
6841        /// Default: `4MB`
6842        #[must_use]
6843        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6844            self.inner = self.inner.max_decoding_message_size(limit);
6845            self
6846        }
6847        /// Limits the maximum size of an encoded message.
6848        ///
6849        /// Default: `usize::MAX`
6850        #[must_use]
6851        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6852            self.inner = self.inner.max_encoding_message_size(limit);
6853            self
6854        }
6855        /** Create a new shareable invite link for the organization.
6856 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6857*/
6858        pub async fn create_invite_link(
6859            &mut self,
6860            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
6861        ) -> std::result::Result<
6862            tonic::Response<super::CreateInviteLinkResponse>,
6863            tonic::Status,
6864        > {
6865            self.inner
6866                .ready()
6867                .await
6868                .map_err(|e| {
6869                    tonic::Status::unknown(
6870                        format!("Service was not ready: {}", e.into()),
6871                    )
6872                })?;
6873            let codec = tonic_prost::ProstCodec::default();
6874            let path = http::uri::PathAndQuery::from_static(
6875                "/pidgr.v1.InviteLinkService/CreateInviteLink",
6876            );
6877            let mut req = request.into_request();
6878            req.extensions_mut()
6879                .insert(
6880                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
6881                );
6882            self.inner.unary(req, path, codec).await
6883        }
6884        /** List all invite links for the organization.
6885 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6886*/
6887        pub async fn list_invite_links(
6888            &mut self,
6889            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
6890        ) -> std::result::Result<
6891            tonic::Response<super::ListInviteLinksResponse>,
6892            tonic::Status,
6893        > {
6894            self.inner
6895                .ready()
6896                .await
6897                .map_err(|e| {
6898                    tonic::Status::unknown(
6899                        format!("Service was not ready: {}", e.into()),
6900                    )
6901                })?;
6902            let codec = tonic_prost::ProstCodec::default();
6903            let path = http::uri::PathAndQuery::from_static(
6904                "/pidgr.v1.InviteLinkService/ListInviteLinks",
6905            );
6906            let mut req = request.into_request();
6907            req.extensions_mut()
6908                .insert(
6909                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
6910                );
6911            self.inner.unary(req, path, codec).await
6912        }
6913        /** Revoke an invite link, making it immediately unusable. Idempotent.
6914 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6915*/
6916        pub async fn revoke_invite_link(
6917            &mut self,
6918            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
6919        ) -> std::result::Result<
6920            tonic::Response<super::RevokeInviteLinkResponse>,
6921            tonic::Status,
6922        > {
6923            self.inner
6924                .ready()
6925                .await
6926                .map_err(|e| {
6927                    tonic::Status::unknown(
6928                        format!("Service was not ready: {}", e.into()),
6929                    )
6930                })?;
6931            let codec = tonic_prost::ProstCodec::default();
6932            let path = http::uri::PathAndQuery::from_static(
6933                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
6934            );
6935            let mut req = request.into_request();
6936            req.extensions_mut()
6937                .insert(
6938                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
6939                );
6940            self.inner.unary(req, path, codec).await
6941        }
6942        /** Validate an invite link and provision a user account if needed.
6943 This is a pre-authentication endpoint — no JWT required.
6944 Rate limited to 10 requests per minute per IP.
6945 Authorization: None (token-based).
6946*/
6947        pub async fn validate_invite_link(
6948            &mut self,
6949            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
6950        ) -> std::result::Result<
6951            tonic::Response<super::ValidateInviteLinkResponse>,
6952            tonic::Status,
6953        > {
6954            self.inner
6955                .ready()
6956                .await
6957                .map_err(|e| {
6958                    tonic::Status::unknown(
6959                        format!("Service was not ready: {}", e.into()),
6960                    )
6961                })?;
6962            let codec = tonic_prost::ProstCodec::default();
6963            let path = http::uri::PathAndQuery::from_static(
6964                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
6965            );
6966            let mut req = request.into_request();
6967            req.extensions_mut()
6968                .insert(
6969                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
6970                );
6971            self.inner.unary(req, path, codec).await
6972        }
6973        /** Redeem an invite link to join an organization.
6974 Requires a valid JWT — the email is extracted from the token.
6975 Authorization: JWT required.
6976*/
6977        pub async fn redeem_invite_link(
6978            &mut self,
6979            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
6980        ) -> std::result::Result<
6981            tonic::Response<super::RedeemInviteLinkResponse>,
6982            tonic::Status,
6983        > {
6984            self.inner
6985                .ready()
6986                .await
6987                .map_err(|e| {
6988                    tonic::Status::unknown(
6989                        format!("Service was not ready: {}", e.into()),
6990                    )
6991                })?;
6992            let codec = tonic_prost::ProstCodec::default();
6993            let path = http::uri::PathAndQuery::from_static(
6994                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
6995            );
6996            let mut req = request.into_request();
6997            req.extensions_mut()
6998                .insert(
6999                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
7000                );
7001            self.inner.unary(req, path, codec).await
7002        }
7003    }
7004}
7005/// Generated server implementations.
7006pub mod invite_link_service_server {
7007    #![allow(
7008        unused_variables,
7009        dead_code,
7010        missing_docs,
7011        clippy::wildcard_imports,
7012        clippy::let_unit_value,
7013    )]
7014    use tonic::codegen::*;
7015    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
7016    #[async_trait]
7017    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
7018        /** Create a new shareable invite link for the organization.
7019 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7020*/
7021        async fn create_invite_link(
7022            &self,
7023            request: tonic::Request<super::CreateInviteLinkRequest>,
7024        ) -> std::result::Result<
7025            tonic::Response<super::CreateInviteLinkResponse>,
7026            tonic::Status,
7027        >;
7028        /** List all invite links for the organization.
7029 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7030*/
7031        async fn list_invite_links(
7032            &self,
7033            request: tonic::Request<super::ListInviteLinksRequest>,
7034        ) -> std::result::Result<
7035            tonic::Response<super::ListInviteLinksResponse>,
7036            tonic::Status,
7037        >;
7038        /** Revoke an invite link, making it immediately unusable. Idempotent.
7039 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7040*/
7041        async fn revoke_invite_link(
7042            &self,
7043            request: tonic::Request<super::RevokeInviteLinkRequest>,
7044        ) -> std::result::Result<
7045            tonic::Response<super::RevokeInviteLinkResponse>,
7046            tonic::Status,
7047        >;
7048        /** Validate an invite link and provision a user account if needed.
7049 This is a pre-authentication endpoint — no JWT required.
7050 Rate limited to 10 requests per minute per IP.
7051 Authorization: None (token-based).
7052*/
7053        async fn validate_invite_link(
7054            &self,
7055            request: tonic::Request<super::ValidateInviteLinkRequest>,
7056        ) -> std::result::Result<
7057            tonic::Response<super::ValidateInviteLinkResponse>,
7058            tonic::Status,
7059        >;
7060        /** Redeem an invite link to join an organization.
7061 Requires a valid JWT — the email is extracted from the token.
7062 Authorization: JWT required.
7063*/
7064        async fn redeem_invite_link(
7065            &self,
7066            request: tonic::Request<super::RedeemInviteLinkRequest>,
7067        ) -> std::result::Result<
7068            tonic::Response<super::RedeemInviteLinkResponse>,
7069            tonic::Status,
7070        >;
7071    }
7072    /** Manages shareable invite links for organization self-join.
7073 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
7074 ValidateInviteLink is unauthenticated — the token IS the authorization.
7075 RedeemInviteLink requires a valid JWT.
7076*/
7077    #[derive(Debug)]
7078    pub struct InviteLinkServiceServer<T> {
7079        inner: Arc<T>,
7080        accept_compression_encodings: EnabledCompressionEncodings,
7081        send_compression_encodings: EnabledCompressionEncodings,
7082        max_decoding_message_size: Option<usize>,
7083        max_encoding_message_size: Option<usize>,
7084    }
7085    impl<T> InviteLinkServiceServer<T> {
7086        pub fn new(inner: T) -> Self {
7087            Self::from_arc(Arc::new(inner))
7088        }
7089        pub fn from_arc(inner: Arc<T>) -> Self {
7090            Self {
7091                inner,
7092                accept_compression_encodings: Default::default(),
7093                send_compression_encodings: Default::default(),
7094                max_decoding_message_size: None,
7095                max_encoding_message_size: None,
7096            }
7097        }
7098        pub fn with_interceptor<F>(
7099            inner: T,
7100            interceptor: F,
7101        ) -> InterceptedService<Self, F>
7102        where
7103            F: tonic::service::Interceptor,
7104        {
7105            InterceptedService::new(Self::new(inner), interceptor)
7106        }
7107        /// Enable decompressing requests with the given encoding.
7108        #[must_use]
7109        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7110            self.accept_compression_encodings.enable(encoding);
7111            self
7112        }
7113        /// Compress responses with the given encoding, if the client supports it.
7114        #[must_use]
7115        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7116            self.send_compression_encodings.enable(encoding);
7117            self
7118        }
7119        /// Limits the maximum size of a decoded message.
7120        ///
7121        /// Default: `4MB`
7122        #[must_use]
7123        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7124            self.max_decoding_message_size = Some(limit);
7125            self
7126        }
7127        /// Limits the maximum size of an encoded message.
7128        ///
7129        /// Default: `usize::MAX`
7130        #[must_use]
7131        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7132            self.max_encoding_message_size = Some(limit);
7133            self
7134        }
7135    }
7136    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
7137    where
7138        T: InviteLinkService,
7139        B: Body + std::marker::Send + 'static,
7140        B::Error: Into<StdError> + std::marker::Send + 'static,
7141    {
7142        type Response = http::Response<tonic::body::Body>;
7143        type Error = std::convert::Infallible;
7144        type Future = BoxFuture<Self::Response, Self::Error>;
7145        fn poll_ready(
7146            &mut self,
7147            _cx: &mut Context<'_>,
7148        ) -> Poll<std::result::Result<(), Self::Error>> {
7149            Poll::Ready(Ok(()))
7150        }
7151        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7152            match req.uri().path() {
7153                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
7154                    #[allow(non_camel_case_types)]
7155                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7156                    impl<
7157                        T: InviteLinkService,
7158                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
7159                    for CreateInviteLinkSvc<T> {
7160                        type Response = super::CreateInviteLinkResponse;
7161                        type Future = BoxFuture<
7162                            tonic::Response<Self::Response>,
7163                            tonic::Status,
7164                        >;
7165                        fn call(
7166                            &mut self,
7167                            request: tonic::Request<super::CreateInviteLinkRequest>,
7168                        ) -> Self::Future {
7169                            let inner = Arc::clone(&self.0);
7170                            let fut = async move {
7171                                <T as InviteLinkService>::create_invite_link(
7172                                        &inner,
7173                                        request,
7174                                    )
7175                                    .await
7176                            };
7177                            Box::pin(fut)
7178                        }
7179                    }
7180                    let accept_compression_encodings = self.accept_compression_encodings;
7181                    let send_compression_encodings = self.send_compression_encodings;
7182                    let max_decoding_message_size = self.max_decoding_message_size;
7183                    let max_encoding_message_size = self.max_encoding_message_size;
7184                    let inner = self.inner.clone();
7185                    let fut = async move {
7186                        let method = CreateInviteLinkSvc(inner);
7187                        let codec = tonic_prost::ProstCodec::default();
7188                        let mut grpc = tonic::server::Grpc::new(codec)
7189                            .apply_compression_config(
7190                                accept_compression_encodings,
7191                                send_compression_encodings,
7192                            )
7193                            .apply_max_message_size_config(
7194                                max_decoding_message_size,
7195                                max_encoding_message_size,
7196                            );
7197                        let res = grpc.unary(method, req).await;
7198                        Ok(res)
7199                    };
7200                    Box::pin(fut)
7201                }
7202                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
7203                    #[allow(non_camel_case_types)]
7204                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
7205                    impl<
7206                        T: InviteLinkService,
7207                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
7208                    for ListInviteLinksSvc<T> {
7209                        type Response = super::ListInviteLinksResponse;
7210                        type Future = BoxFuture<
7211                            tonic::Response<Self::Response>,
7212                            tonic::Status,
7213                        >;
7214                        fn call(
7215                            &mut self,
7216                            request: tonic::Request<super::ListInviteLinksRequest>,
7217                        ) -> Self::Future {
7218                            let inner = Arc::clone(&self.0);
7219                            let fut = async move {
7220                                <T as InviteLinkService>::list_invite_links(&inner, request)
7221                                    .await
7222                            };
7223                            Box::pin(fut)
7224                        }
7225                    }
7226                    let accept_compression_encodings = self.accept_compression_encodings;
7227                    let send_compression_encodings = self.send_compression_encodings;
7228                    let max_decoding_message_size = self.max_decoding_message_size;
7229                    let max_encoding_message_size = self.max_encoding_message_size;
7230                    let inner = self.inner.clone();
7231                    let fut = async move {
7232                        let method = ListInviteLinksSvc(inner);
7233                        let codec = tonic_prost::ProstCodec::default();
7234                        let mut grpc = tonic::server::Grpc::new(codec)
7235                            .apply_compression_config(
7236                                accept_compression_encodings,
7237                                send_compression_encodings,
7238                            )
7239                            .apply_max_message_size_config(
7240                                max_decoding_message_size,
7241                                max_encoding_message_size,
7242                            );
7243                        let res = grpc.unary(method, req).await;
7244                        Ok(res)
7245                    };
7246                    Box::pin(fut)
7247                }
7248                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
7249                    #[allow(non_camel_case_types)]
7250                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7251                    impl<
7252                        T: InviteLinkService,
7253                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
7254                    for RevokeInviteLinkSvc<T> {
7255                        type Response = super::RevokeInviteLinkResponse;
7256                        type Future = BoxFuture<
7257                            tonic::Response<Self::Response>,
7258                            tonic::Status,
7259                        >;
7260                        fn call(
7261                            &mut self,
7262                            request: tonic::Request<super::RevokeInviteLinkRequest>,
7263                        ) -> Self::Future {
7264                            let inner = Arc::clone(&self.0);
7265                            let fut = async move {
7266                                <T as InviteLinkService>::revoke_invite_link(
7267                                        &inner,
7268                                        request,
7269                                    )
7270                                    .await
7271                            };
7272                            Box::pin(fut)
7273                        }
7274                    }
7275                    let accept_compression_encodings = self.accept_compression_encodings;
7276                    let send_compression_encodings = self.send_compression_encodings;
7277                    let max_decoding_message_size = self.max_decoding_message_size;
7278                    let max_encoding_message_size = self.max_encoding_message_size;
7279                    let inner = self.inner.clone();
7280                    let fut = async move {
7281                        let method = RevokeInviteLinkSvc(inner);
7282                        let codec = tonic_prost::ProstCodec::default();
7283                        let mut grpc = tonic::server::Grpc::new(codec)
7284                            .apply_compression_config(
7285                                accept_compression_encodings,
7286                                send_compression_encodings,
7287                            )
7288                            .apply_max_message_size_config(
7289                                max_decoding_message_size,
7290                                max_encoding_message_size,
7291                            );
7292                        let res = grpc.unary(method, req).await;
7293                        Ok(res)
7294                    };
7295                    Box::pin(fut)
7296                }
7297                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
7298                    #[allow(non_camel_case_types)]
7299                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7300                    impl<
7301                        T: InviteLinkService,
7302                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
7303                    for ValidateInviteLinkSvc<T> {
7304                        type Response = super::ValidateInviteLinkResponse;
7305                        type Future = BoxFuture<
7306                            tonic::Response<Self::Response>,
7307                            tonic::Status,
7308                        >;
7309                        fn call(
7310                            &mut self,
7311                            request: tonic::Request<super::ValidateInviteLinkRequest>,
7312                        ) -> Self::Future {
7313                            let inner = Arc::clone(&self.0);
7314                            let fut = async move {
7315                                <T as InviteLinkService>::validate_invite_link(
7316                                        &inner,
7317                                        request,
7318                                    )
7319                                    .await
7320                            };
7321                            Box::pin(fut)
7322                        }
7323                    }
7324                    let accept_compression_encodings = self.accept_compression_encodings;
7325                    let send_compression_encodings = self.send_compression_encodings;
7326                    let max_decoding_message_size = self.max_decoding_message_size;
7327                    let max_encoding_message_size = self.max_encoding_message_size;
7328                    let inner = self.inner.clone();
7329                    let fut = async move {
7330                        let method = ValidateInviteLinkSvc(inner);
7331                        let codec = tonic_prost::ProstCodec::default();
7332                        let mut grpc = tonic::server::Grpc::new(codec)
7333                            .apply_compression_config(
7334                                accept_compression_encodings,
7335                                send_compression_encodings,
7336                            )
7337                            .apply_max_message_size_config(
7338                                max_decoding_message_size,
7339                                max_encoding_message_size,
7340                            );
7341                        let res = grpc.unary(method, req).await;
7342                        Ok(res)
7343                    };
7344                    Box::pin(fut)
7345                }
7346                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
7347                    #[allow(non_camel_case_types)]
7348                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7349                    impl<
7350                        T: InviteLinkService,
7351                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
7352                    for RedeemInviteLinkSvc<T> {
7353                        type Response = super::RedeemInviteLinkResponse;
7354                        type Future = BoxFuture<
7355                            tonic::Response<Self::Response>,
7356                            tonic::Status,
7357                        >;
7358                        fn call(
7359                            &mut self,
7360                            request: tonic::Request<super::RedeemInviteLinkRequest>,
7361                        ) -> Self::Future {
7362                            let inner = Arc::clone(&self.0);
7363                            let fut = async move {
7364                                <T as InviteLinkService>::redeem_invite_link(
7365                                        &inner,
7366                                        request,
7367                                    )
7368                                    .await
7369                            };
7370                            Box::pin(fut)
7371                        }
7372                    }
7373                    let accept_compression_encodings = self.accept_compression_encodings;
7374                    let send_compression_encodings = self.send_compression_encodings;
7375                    let max_decoding_message_size = self.max_decoding_message_size;
7376                    let max_encoding_message_size = self.max_encoding_message_size;
7377                    let inner = self.inner.clone();
7378                    let fut = async move {
7379                        let method = RedeemInviteLinkSvc(inner);
7380                        let codec = tonic_prost::ProstCodec::default();
7381                        let mut grpc = tonic::server::Grpc::new(codec)
7382                            .apply_compression_config(
7383                                accept_compression_encodings,
7384                                send_compression_encodings,
7385                            )
7386                            .apply_max_message_size_config(
7387                                max_decoding_message_size,
7388                                max_encoding_message_size,
7389                            );
7390                        let res = grpc.unary(method, req).await;
7391                        Ok(res)
7392                    };
7393                    Box::pin(fut)
7394                }
7395                _ => {
7396                    Box::pin(async move {
7397                        let mut response = http::Response::new(
7398                            tonic::body::Body::default(),
7399                        );
7400                        let headers = response.headers_mut();
7401                        headers
7402                            .insert(
7403                                tonic::Status::GRPC_STATUS,
7404                                (tonic::Code::Unimplemented as i32).into(),
7405                            );
7406                        headers
7407                            .insert(
7408                                http::header::CONTENT_TYPE,
7409                                tonic::metadata::GRPC_CONTENT_TYPE,
7410                            );
7411                        Ok(response)
7412                    })
7413                }
7414            }
7415        }
7416    }
7417    impl<T> Clone for InviteLinkServiceServer<T> {
7418        fn clone(&self) -> Self {
7419            let inner = self.inner.clone();
7420            Self {
7421                inner,
7422                accept_compression_encodings: self.accept_compression_encodings,
7423                send_compression_encodings: self.send_compression_encodings,
7424                max_decoding_message_size: self.max_decoding_message_size,
7425                max_encoding_message_size: self.max_encoding_message_size,
7426            }
7427        }
7428    }
7429    /// Generated gRPC service name
7430    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
7431    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
7432        const NAME: &'static str = SERVICE_NAME;
7433    }
7434}
7435/// Generated client implementations.
7436pub mod member_service_client {
7437    #![allow(
7438        unused_variables,
7439        dead_code,
7440        missing_docs,
7441        clippy::wildcard_imports,
7442        clippy::let_unit_value,
7443    )]
7444    use tonic::codegen::*;
7445    use tonic::codegen::http::Uri;
7446    /** Manages members (users) within an organization.
7447 All RPCs operate within the caller's org (extracted from JWT).
7448*/
7449    #[derive(Debug, Clone)]
7450    pub struct MemberServiceClient<T> {
7451        inner: tonic::client::Grpc<T>,
7452    }
7453    impl MemberServiceClient<tonic::transport::Channel> {
7454        /// Attempt to create a new client by connecting to a given endpoint.
7455        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7456        where
7457            D: TryInto<tonic::transport::Endpoint>,
7458            D::Error: Into<StdError>,
7459        {
7460            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7461            Ok(Self::new(conn))
7462        }
7463    }
7464    impl<T> MemberServiceClient<T>
7465    where
7466        T: tonic::client::GrpcService<tonic::body::Body>,
7467        T::Error: Into<StdError>,
7468        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7469        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7470    {
7471        pub fn new(inner: T) -> Self {
7472            let inner = tonic::client::Grpc::new(inner);
7473            Self { inner }
7474        }
7475        pub fn with_origin(inner: T, origin: Uri) -> Self {
7476            let inner = tonic::client::Grpc::with_origin(inner, origin);
7477            Self { inner }
7478        }
7479        pub fn with_interceptor<F>(
7480            inner: T,
7481            interceptor: F,
7482        ) -> MemberServiceClient<InterceptedService<T, F>>
7483        where
7484            F: tonic::service::Interceptor,
7485            T::ResponseBody: Default,
7486            T: tonic::codegen::Service<
7487                http::Request<tonic::body::Body>,
7488                Response = http::Response<
7489                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7490                >,
7491            >,
7492            <T as tonic::codegen::Service<
7493                http::Request<tonic::body::Body>,
7494            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7495        {
7496            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
7497        }
7498        /// Compress requests with the given encoding.
7499        ///
7500        /// This requires the server to support it otherwise it might respond with an
7501        /// error.
7502        #[must_use]
7503        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7504            self.inner = self.inner.send_compressed(encoding);
7505            self
7506        }
7507        /// Enable decompressing responses.
7508        #[must_use]
7509        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7510            self.inner = self.inner.accept_compressed(encoding);
7511            self
7512        }
7513        /// Limits the maximum size of a decoded message.
7514        ///
7515        /// Default: `4MB`
7516        #[must_use]
7517        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7518            self.inner = self.inner.max_decoding_message_size(limit);
7519            self
7520        }
7521        /// Limits the maximum size of an encoded message.
7522        ///
7523        /// Default: `usize::MAX`
7524        #[must_use]
7525        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7526            self.inner = self.inner.max_encoding_message_size(limit);
7527            self
7528        }
7529        /** Invite a new user to the organization via email.
7530 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7531*/
7532        pub async fn invite_user(
7533            &mut self,
7534            request: impl tonic::IntoRequest<super::InviteUserRequest>,
7535        ) -> std::result::Result<
7536            tonic::Response<super::InviteUserResponse>,
7537            tonic::Status,
7538        > {
7539            self.inner
7540                .ready()
7541                .await
7542                .map_err(|e| {
7543                    tonic::Status::unknown(
7544                        format!("Service was not ready: {}", e.into()),
7545                    )
7546                })?;
7547            let codec = tonic_prost::ProstCodec::default();
7548            let path = http::uri::PathAndQuery::from_static(
7549                "/pidgr.v1.MemberService/InviteUser",
7550            );
7551            let mut req = request.into_request();
7552            req.extensions_mut()
7553                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
7554            self.inner.unary(req, path, codec).await
7555        }
7556        /** Retrieve a user by ID within the organization.
7557 Self-lookup (empty user_id) is allowed for any authenticated user.
7558 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
7559*/
7560        pub async fn get_user(
7561            &mut self,
7562            request: impl tonic::IntoRequest<super::GetUserRequest>,
7563        ) -> std::result::Result<
7564            tonic::Response<super::GetUserResponse>,
7565            tonic::Status,
7566        > {
7567            self.inner
7568                .ready()
7569                .await
7570                .map_err(|e| {
7571                    tonic::Status::unknown(
7572                        format!("Service was not ready: {}", e.into()),
7573                    )
7574                })?;
7575            let codec = tonic_prost::ProstCodec::default();
7576            let path = http::uri::PathAndQuery::from_static(
7577                "/pidgr.v1.MemberService/GetUser",
7578            );
7579            let mut req = request.into_request();
7580            req.extensions_mut()
7581                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
7582            self.inner.unary(req, path, codec).await
7583        }
7584        /** List all users in the organization with pagination.
7585 Authorization: Requires PERMISSION_MEMBERS_READ.
7586*/
7587        pub async fn list_users(
7588            &mut self,
7589            request: impl tonic::IntoRequest<super::ListUsersRequest>,
7590        ) -> std::result::Result<
7591            tonic::Response<super::ListUsersResponse>,
7592            tonic::Status,
7593        > {
7594            self.inner
7595                .ready()
7596                .await
7597                .map_err(|e| {
7598                    tonic::Status::unknown(
7599                        format!("Service was not ready: {}", e.into()),
7600                    )
7601                })?;
7602            let codec = tonic_prost::ProstCodec::default();
7603            let path = http::uri::PathAndQuery::from_static(
7604                "/pidgr.v1.MemberService/ListUsers",
7605            );
7606            let mut req = request.into_request();
7607            req.extensions_mut()
7608                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
7609            self.inner.unary(req, path, codec).await
7610        }
7611        /** Change a user's role within the organization.
7612 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7613*/
7614        pub async fn update_user_role(
7615            &mut self,
7616            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
7617        ) -> std::result::Result<
7618            tonic::Response<super::UpdateUserRoleResponse>,
7619            tonic::Status,
7620        > {
7621            self.inner
7622                .ready()
7623                .await
7624                .map_err(|e| {
7625                    tonic::Status::unknown(
7626                        format!("Service was not ready: {}", e.into()),
7627                    )
7628                })?;
7629            let codec = tonic_prost::ProstCodec::default();
7630            let path = http::uri::PathAndQuery::from_static(
7631                "/pidgr.v1.MemberService/UpdateUserRole",
7632            );
7633            let mut req = request.into_request();
7634            req.extensions_mut()
7635                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
7636            self.inner.unary(req, path, codec).await
7637        }
7638        /** Deactivate a user within the organization.
7639 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7640*/
7641        pub async fn deactivate_user(
7642            &mut self,
7643            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
7644        ) -> std::result::Result<
7645            tonic::Response<super::DeactivateUserResponse>,
7646            tonic::Status,
7647        > {
7648            self.inner
7649                .ready()
7650                .await
7651                .map_err(|e| {
7652                    tonic::Status::unknown(
7653                        format!("Service was not ready: {}", e.into()),
7654                    )
7655                })?;
7656            let codec = tonic_prost::ProstCodec::default();
7657            let path = http::uri::PathAndQuery::from_static(
7658                "/pidgr.v1.MemberService/DeactivateUser",
7659            );
7660            let mut req = request.into_request();
7661            req.extensions_mut()
7662                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
7663            self.inner.unary(req, path, codec).await
7664        }
7665        /** Reactivate a deactivated user, restoring their status to INVITED.
7666 The user must complete the invite link flow again to become ACTIVE.
7667 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7668*/
7669        pub async fn reactivate_user(
7670            &mut self,
7671            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
7672        ) -> std::result::Result<
7673            tonic::Response<super::ReactivateUserResponse>,
7674            tonic::Status,
7675        > {
7676            self.inner
7677                .ready()
7678                .await
7679                .map_err(|e| {
7680                    tonic::Status::unknown(
7681                        format!("Service was not ready: {}", e.into()),
7682                    )
7683                })?;
7684            let codec = tonic_prost::ProstCodec::default();
7685            let path = http::uri::PathAndQuery::from_static(
7686                "/pidgr.v1.MemberService/ReactivateUser",
7687            );
7688            let mut req = request.into_request();
7689            req.extensions_mut()
7690                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
7691            self.inner.unary(req, path, codec).await
7692        }
7693        /** Revoke an invitation for a user who has not yet completed registration.
7694 Hard-deletes the user record (INVITED users have no data to preserve).
7695 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7696*/
7697        pub async fn revoke_invite(
7698            &mut self,
7699            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
7700        ) -> std::result::Result<
7701            tonic::Response<super::RevokeInviteResponse>,
7702            tonic::Status,
7703        > {
7704            self.inner
7705                .ready()
7706                .await
7707                .map_err(|e| {
7708                    tonic::Status::unknown(
7709                        format!("Service was not ready: {}", e.into()),
7710                    )
7711                })?;
7712            let codec = tonic_prost::ProstCodec::default();
7713            let path = http::uri::PathAndQuery::from_static(
7714                "/pidgr.v1.MemberService/RevokeInvite",
7715            );
7716            let mut req = request.into_request();
7717            req.extensions_mut()
7718                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
7719            self.inner.unary(req, path, codec).await
7720        }
7721        /** Update a user's profile attributes (department, title, etc.).
7722 Self-update (empty user_id or matching JWT sub) requires no special permission.
7723 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7724*/
7725        pub async fn update_user_profile(
7726            &mut self,
7727            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
7728        ) -> std::result::Result<
7729            tonic::Response<super::UpdateUserProfileResponse>,
7730            tonic::Status,
7731        > {
7732            self.inner
7733                .ready()
7734                .await
7735                .map_err(|e| {
7736                    tonic::Status::unknown(
7737                        format!("Service was not ready: {}", e.into()),
7738                    )
7739                })?;
7740            let codec = tonic_prost::ProstCodec::default();
7741            let path = http::uri::PathAndQuery::from_static(
7742                "/pidgr.v1.MemberService/UpdateUserProfile",
7743            );
7744            let mut req = request.into_request();
7745            req.extensions_mut()
7746                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
7747            self.inner.unary(req, path, codec).await
7748        }
7749        /** Retrieve the caller's platform settings (theme, etc.).
7750 Authorization: Any authenticated user (self-only).
7751*/
7752        pub async fn get_user_settings(
7753            &mut self,
7754            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
7755        ) -> std::result::Result<
7756            tonic::Response<super::GetUserSettingsResponse>,
7757            tonic::Status,
7758        > {
7759            self.inner
7760                .ready()
7761                .await
7762                .map_err(|e| {
7763                    tonic::Status::unknown(
7764                        format!("Service was not ready: {}", e.into()),
7765                    )
7766                })?;
7767            let codec = tonic_prost::ProstCodec::default();
7768            let path = http::uri::PathAndQuery::from_static(
7769                "/pidgr.v1.MemberService/GetUserSettings",
7770            );
7771            let mut req = request.into_request();
7772            req.extensions_mut()
7773                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
7774            self.inner.unary(req, path, codec).await
7775        }
7776        /** Update the caller's platform settings.
7777 Only fields with non-default values are applied; others are left unchanged.
7778 Authorization: Any authenticated user (self-only).
7779*/
7780        pub async fn update_user_settings(
7781            &mut self,
7782            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
7783        ) -> std::result::Result<
7784            tonic::Response<super::UpdateUserSettingsResponse>,
7785            tonic::Status,
7786        > {
7787            self.inner
7788                .ready()
7789                .await
7790                .map_err(|e| {
7791                    tonic::Status::unknown(
7792                        format!("Service was not ready: {}", e.into()),
7793                    )
7794                })?;
7795            let codec = tonic_prost::ProstCodec::default();
7796            let path = http::uri::PathAndQuery::from_static(
7797                "/pidgr.v1.MemberService/UpdateUserSettings",
7798            );
7799            let mut req = request.into_request();
7800            req.extensions_mut()
7801                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
7802            self.inner.unary(req, path, codec).await
7803        }
7804        /** Invite multiple users to the organization in a single call.
7805 Emails are deduplicated. Each email is processed independently — individual
7806 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
7807 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7808*/
7809        pub async fn bulk_invite_users(
7810            &mut self,
7811            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
7812        ) -> std::result::Result<
7813            tonic::Response<super::BulkInviteUsersResponse>,
7814            tonic::Status,
7815        > {
7816            self.inner
7817                .ready()
7818                .await
7819                .map_err(|e| {
7820                    tonic::Status::unknown(
7821                        format!("Service was not ready: {}", e.into()),
7822                    )
7823                })?;
7824            let codec = tonic_prost::ProstCodec::default();
7825            let path = http::uri::PathAndQuery::from_static(
7826                "/pidgr.v1.MemberService/BulkInviteUsers",
7827            );
7828            let mut req = request.into_request();
7829            req.extensions_mut()
7830                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
7831            self.inner.unary(req, path, codec).await
7832        }
7833        /** Confirm passkey enrollment after client-side WebAuthn registration.
7834 Verifies the caller has at least one registered credential server-side,
7835 then marks the user as passkey-enrolled in the identity provider.
7836 Authorization: Any authenticated user (self-only, no permission required).
7837*/
7838        pub async fn confirm_passkey_enrollment(
7839            &mut self,
7840            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
7841        ) -> std::result::Result<
7842            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7843            tonic::Status,
7844        > {
7845            self.inner
7846                .ready()
7847                .await
7848                .map_err(|e| {
7849                    tonic::Status::unknown(
7850                        format!("Service was not ready: {}", e.into()),
7851                    )
7852                })?;
7853            let codec = tonic_prost::ProstCodec::default();
7854            let path = http::uri::PathAndQuery::from_static(
7855                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
7856            );
7857            let mut req = request.into_request();
7858            req.extensions_mut()
7859                .insert(
7860                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
7861                );
7862            self.inner.unary(req, path, codec).await
7863        }
7864        /** Update the data governance region for a user. Triggers a data migration
7865 workflow if the region changed. Admin-only operation.
7866 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7867*/
7868        pub async fn update_user_region(
7869            &mut self,
7870            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
7871        ) -> std::result::Result<
7872            tonic::Response<super::UpdateUserRegionResponse>,
7873            tonic::Status,
7874        > {
7875            self.inner
7876                .ready()
7877                .await
7878                .map_err(|e| {
7879                    tonic::Status::unknown(
7880                        format!("Service was not ready: {}", e.into()),
7881                    )
7882                })?;
7883            let codec = tonic_prost::ProstCodec::default();
7884            let path = http::uri::PathAndQuery::from_static(
7885                "/pidgr.v1.MemberService/UpdateUserRegion",
7886            );
7887            let mut req = request.into_request();
7888            req.extensions_mut()
7889                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
7890            self.inner.unary(req, path, codec).await
7891        }
7892    }
7893}
7894/// Generated server implementations.
7895pub mod member_service_server {
7896    #![allow(
7897        unused_variables,
7898        dead_code,
7899        missing_docs,
7900        clippy::wildcard_imports,
7901        clippy::let_unit_value,
7902    )]
7903    use tonic::codegen::*;
7904    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
7905    #[async_trait]
7906    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
7907        /** Invite a new user to the organization via email.
7908 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7909*/
7910        async fn invite_user(
7911            &self,
7912            request: tonic::Request<super::InviteUserRequest>,
7913        ) -> std::result::Result<
7914            tonic::Response<super::InviteUserResponse>,
7915            tonic::Status,
7916        >;
7917        /** Retrieve a user by ID within the organization.
7918 Self-lookup (empty user_id) is allowed for any authenticated user.
7919 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
7920*/
7921        async fn get_user(
7922            &self,
7923            request: tonic::Request<super::GetUserRequest>,
7924        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
7925        /** List all users in the organization with pagination.
7926 Authorization: Requires PERMISSION_MEMBERS_READ.
7927*/
7928        async fn list_users(
7929            &self,
7930            request: tonic::Request<super::ListUsersRequest>,
7931        ) -> std::result::Result<
7932            tonic::Response<super::ListUsersResponse>,
7933            tonic::Status,
7934        >;
7935        /** Change a user's role within the organization.
7936 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7937*/
7938        async fn update_user_role(
7939            &self,
7940            request: tonic::Request<super::UpdateUserRoleRequest>,
7941        ) -> std::result::Result<
7942            tonic::Response<super::UpdateUserRoleResponse>,
7943            tonic::Status,
7944        >;
7945        /** Deactivate a user within the organization.
7946 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7947*/
7948        async fn deactivate_user(
7949            &self,
7950            request: tonic::Request<super::DeactivateUserRequest>,
7951        ) -> std::result::Result<
7952            tonic::Response<super::DeactivateUserResponse>,
7953            tonic::Status,
7954        >;
7955        /** Reactivate a deactivated user, restoring their status to INVITED.
7956 The user must complete the invite link flow again to become ACTIVE.
7957 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7958*/
7959        async fn reactivate_user(
7960            &self,
7961            request: tonic::Request<super::ReactivateUserRequest>,
7962        ) -> std::result::Result<
7963            tonic::Response<super::ReactivateUserResponse>,
7964            tonic::Status,
7965        >;
7966        /** Revoke an invitation for a user who has not yet completed registration.
7967 Hard-deletes the user record (INVITED users have no data to preserve).
7968 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7969*/
7970        async fn revoke_invite(
7971            &self,
7972            request: tonic::Request<super::RevokeInviteRequest>,
7973        ) -> std::result::Result<
7974            tonic::Response<super::RevokeInviteResponse>,
7975            tonic::Status,
7976        >;
7977        /** Update a user's profile attributes (department, title, etc.).
7978 Self-update (empty user_id or matching JWT sub) requires no special permission.
7979 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7980*/
7981        async fn update_user_profile(
7982            &self,
7983            request: tonic::Request<super::UpdateUserProfileRequest>,
7984        ) -> std::result::Result<
7985            tonic::Response<super::UpdateUserProfileResponse>,
7986            tonic::Status,
7987        >;
7988        /** Retrieve the caller's platform settings (theme, etc.).
7989 Authorization: Any authenticated user (self-only).
7990*/
7991        async fn get_user_settings(
7992            &self,
7993            request: tonic::Request<super::GetUserSettingsRequest>,
7994        ) -> std::result::Result<
7995            tonic::Response<super::GetUserSettingsResponse>,
7996            tonic::Status,
7997        >;
7998        /** Update the caller's platform settings.
7999 Only fields with non-default values are applied; others are left unchanged.
8000 Authorization: Any authenticated user (self-only).
8001*/
8002        async fn update_user_settings(
8003            &self,
8004            request: tonic::Request<super::UpdateUserSettingsRequest>,
8005        ) -> std::result::Result<
8006            tonic::Response<super::UpdateUserSettingsResponse>,
8007            tonic::Status,
8008        >;
8009        /** Invite multiple users to the organization in a single call.
8010 Emails are deduplicated. Each email is processed independently — individual
8011 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
8012 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8013*/
8014        async fn bulk_invite_users(
8015            &self,
8016            request: tonic::Request<super::BulkInviteUsersRequest>,
8017        ) -> std::result::Result<
8018            tonic::Response<super::BulkInviteUsersResponse>,
8019            tonic::Status,
8020        >;
8021        /** Confirm passkey enrollment after client-side WebAuthn registration.
8022 Verifies the caller has at least one registered credential server-side,
8023 then marks the user as passkey-enrolled in the identity provider.
8024 Authorization: Any authenticated user (self-only, no permission required).
8025*/
8026        async fn confirm_passkey_enrollment(
8027            &self,
8028            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
8029        ) -> std::result::Result<
8030            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8031            tonic::Status,
8032        >;
8033        /** Update the data governance region for a user. Triggers a data migration
8034 workflow if the region changed. Admin-only operation.
8035 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8036*/
8037        async fn update_user_region(
8038            &self,
8039            request: tonic::Request<super::UpdateUserRegionRequest>,
8040        ) -> std::result::Result<
8041            tonic::Response<super::UpdateUserRegionResponse>,
8042            tonic::Status,
8043        >;
8044    }
8045    /** Manages members (users) within an organization.
8046 All RPCs operate within the caller's org (extracted from JWT).
8047*/
8048    #[derive(Debug)]
8049    pub struct MemberServiceServer<T> {
8050        inner: Arc<T>,
8051        accept_compression_encodings: EnabledCompressionEncodings,
8052        send_compression_encodings: EnabledCompressionEncodings,
8053        max_decoding_message_size: Option<usize>,
8054        max_encoding_message_size: Option<usize>,
8055    }
8056    impl<T> MemberServiceServer<T> {
8057        pub fn new(inner: T) -> Self {
8058            Self::from_arc(Arc::new(inner))
8059        }
8060        pub fn from_arc(inner: Arc<T>) -> Self {
8061            Self {
8062                inner,
8063                accept_compression_encodings: Default::default(),
8064                send_compression_encodings: Default::default(),
8065                max_decoding_message_size: None,
8066                max_encoding_message_size: None,
8067            }
8068        }
8069        pub fn with_interceptor<F>(
8070            inner: T,
8071            interceptor: F,
8072        ) -> InterceptedService<Self, F>
8073        where
8074            F: tonic::service::Interceptor,
8075        {
8076            InterceptedService::new(Self::new(inner), interceptor)
8077        }
8078        /// Enable decompressing requests with the given encoding.
8079        #[must_use]
8080        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8081            self.accept_compression_encodings.enable(encoding);
8082            self
8083        }
8084        /// Compress responses with the given encoding, if the client supports it.
8085        #[must_use]
8086        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8087            self.send_compression_encodings.enable(encoding);
8088            self
8089        }
8090        /// Limits the maximum size of a decoded message.
8091        ///
8092        /// Default: `4MB`
8093        #[must_use]
8094        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8095            self.max_decoding_message_size = Some(limit);
8096            self
8097        }
8098        /// Limits the maximum size of an encoded message.
8099        ///
8100        /// Default: `usize::MAX`
8101        #[must_use]
8102        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8103            self.max_encoding_message_size = Some(limit);
8104            self
8105        }
8106    }
8107    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
8108    where
8109        T: MemberService,
8110        B: Body + std::marker::Send + 'static,
8111        B::Error: Into<StdError> + std::marker::Send + 'static,
8112    {
8113        type Response = http::Response<tonic::body::Body>;
8114        type Error = std::convert::Infallible;
8115        type Future = BoxFuture<Self::Response, Self::Error>;
8116        fn poll_ready(
8117            &mut self,
8118            _cx: &mut Context<'_>,
8119        ) -> Poll<std::result::Result<(), Self::Error>> {
8120            Poll::Ready(Ok(()))
8121        }
8122        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8123            match req.uri().path() {
8124                "/pidgr.v1.MemberService/InviteUser" => {
8125                    #[allow(non_camel_case_types)]
8126                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
8127                    impl<
8128                        T: MemberService,
8129                    > tonic::server::UnaryService<super::InviteUserRequest>
8130                    for InviteUserSvc<T> {
8131                        type Response = super::InviteUserResponse;
8132                        type Future = BoxFuture<
8133                            tonic::Response<Self::Response>,
8134                            tonic::Status,
8135                        >;
8136                        fn call(
8137                            &mut self,
8138                            request: tonic::Request<super::InviteUserRequest>,
8139                        ) -> Self::Future {
8140                            let inner = Arc::clone(&self.0);
8141                            let fut = async move {
8142                                <T as MemberService>::invite_user(&inner, request).await
8143                            };
8144                            Box::pin(fut)
8145                        }
8146                    }
8147                    let accept_compression_encodings = self.accept_compression_encodings;
8148                    let send_compression_encodings = self.send_compression_encodings;
8149                    let max_decoding_message_size = self.max_decoding_message_size;
8150                    let max_encoding_message_size = self.max_encoding_message_size;
8151                    let inner = self.inner.clone();
8152                    let fut = async move {
8153                        let method = InviteUserSvc(inner);
8154                        let codec = tonic_prost::ProstCodec::default();
8155                        let mut grpc = tonic::server::Grpc::new(codec)
8156                            .apply_compression_config(
8157                                accept_compression_encodings,
8158                                send_compression_encodings,
8159                            )
8160                            .apply_max_message_size_config(
8161                                max_decoding_message_size,
8162                                max_encoding_message_size,
8163                            );
8164                        let res = grpc.unary(method, req).await;
8165                        Ok(res)
8166                    };
8167                    Box::pin(fut)
8168                }
8169                "/pidgr.v1.MemberService/GetUser" => {
8170                    #[allow(non_camel_case_types)]
8171                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
8172                    impl<
8173                        T: MemberService,
8174                    > tonic::server::UnaryService<super::GetUserRequest>
8175                    for GetUserSvc<T> {
8176                        type Response = super::GetUserResponse;
8177                        type Future = BoxFuture<
8178                            tonic::Response<Self::Response>,
8179                            tonic::Status,
8180                        >;
8181                        fn call(
8182                            &mut self,
8183                            request: tonic::Request<super::GetUserRequest>,
8184                        ) -> Self::Future {
8185                            let inner = Arc::clone(&self.0);
8186                            let fut = async move {
8187                                <T as MemberService>::get_user(&inner, request).await
8188                            };
8189                            Box::pin(fut)
8190                        }
8191                    }
8192                    let accept_compression_encodings = self.accept_compression_encodings;
8193                    let send_compression_encodings = self.send_compression_encodings;
8194                    let max_decoding_message_size = self.max_decoding_message_size;
8195                    let max_encoding_message_size = self.max_encoding_message_size;
8196                    let inner = self.inner.clone();
8197                    let fut = async move {
8198                        let method = GetUserSvc(inner);
8199                        let codec = tonic_prost::ProstCodec::default();
8200                        let mut grpc = tonic::server::Grpc::new(codec)
8201                            .apply_compression_config(
8202                                accept_compression_encodings,
8203                                send_compression_encodings,
8204                            )
8205                            .apply_max_message_size_config(
8206                                max_decoding_message_size,
8207                                max_encoding_message_size,
8208                            );
8209                        let res = grpc.unary(method, req).await;
8210                        Ok(res)
8211                    };
8212                    Box::pin(fut)
8213                }
8214                "/pidgr.v1.MemberService/ListUsers" => {
8215                    #[allow(non_camel_case_types)]
8216                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
8217                    impl<
8218                        T: MemberService,
8219                    > tonic::server::UnaryService<super::ListUsersRequest>
8220                    for ListUsersSvc<T> {
8221                        type Response = super::ListUsersResponse;
8222                        type Future = BoxFuture<
8223                            tonic::Response<Self::Response>,
8224                            tonic::Status,
8225                        >;
8226                        fn call(
8227                            &mut self,
8228                            request: tonic::Request<super::ListUsersRequest>,
8229                        ) -> Self::Future {
8230                            let inner = Arc::clone(&self.0);
8231                            let fut = async move {
8232                                <T as MemberService>::list_users(&inner, request).await
8233                            };
8234                            Box::pin(fut)
8235                        }
8236                    }
8237                    let accept_compression_encodings = self.accept_compression_encodings;
8238                    let send_compression_encodings = self.send_compression_encodings;
8239                    let max_decoding_message_size = self.max_decoding_message_size;
8240                    let max_encoding_message_size = self.max_encoding_message_size;
8241                    let inner = self.inner.clone();
8242                    let fut = async move {
8243                        let method = ListUsersSvc(inner);
8244                        let codec = tonic_prost::ProstCodec::default();
8245                        let mut grpc = tonic::server::Grpc::new(codec)
8246                            .apply_compression_config(
8247                                accept_compression_encodings,
8248                                send_compression_encodings,
8249                            )
8250                            .apply_max_message_size_config(
8251                                max_decoding_message_size,
8252                                max_encoding_message_size,
8253                            );
8254                        let res = grpc.unary(method, req).await;
8255                        Ok(res)
8256                    };
8257                    Box::pin(fut)
8258                }
8259                "/pidgr.v1.MemberService/UpdateUserRole" => {
8260                    #[allow(non_camel_case_types)]
8261                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
8262                    impl<
8263                        T: MemberService,
8264                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
8265                    for UpdateUserRoleSvc<T> {
8266                        type Response = super::UpdateUserRoleResponse;
8267                        type Future = BoxFuture<
8268                            tonic::Response<Self::Response>,
8269                            tonic::Status,
8270                        >;
8271                        fn call(
8272                            &mut self,
8273                            request: tonic::Request<super::UpdateUserRoleRequest>,
8274                        ) -> Self::Future {
8275                            let inner = Arc::clone(&self.0);
8276                            let fut = async move {
8277                                <T as MemberService>::update_user_role(&inner, request)
8278                                    .await
8279                            };
8280                            Box::pin(fut)
8281                        }
8282                    }
8283                    let accept_compression_encodings = self.accept_compression_encodings;
8284                    let send_compression_encodings = self.send_compression_encodings;
8285                    let max_decoding_message_size = self.max_decoding_message_size;
8286                    let max_encoding_message_size = self.max_encoding_message_size;
8287                    let inner = self.inner.clone();
8288                    let fut = async move {
8289                        let method = UpdateUserRoleSvc(inner);
8290                        let codec = tonic_prost::ProstCodec::default();
8291                        let mut grpc = tonic::server::Grpc::new(codec)
8292                            .apply_compression_config(
8293                                accept_compression_encodings,
8294                                send_compression_encodings,
8295                            )
8296                            .apply_max_message_size_config(
8297                                max_decoding_message_size,
8298                                max_encoding_message_size,
8299                            );
8300                        let res = grpc.unary(method, req).await;
8301                        Ok(res)
8302                    };
8303                    Box::pin(fut)
8304                }
8305                "/pidgr.v1.MemberService/DeactivateUser" => {
8306                    #[allow(non_camel_case_types)]
8307                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
8308                    impl<
8309                        T: MemberService,
8310                    > tonic::server::UnaryService<super::DeactivateUserRequest>
8311                    for DeactivateUserSvc<T> {
8312                        type Response = super::DeactivateUserResponse;
8313                        type Future = BoxFuture<
8314                            tonic::Response<Self::Response>,
8315                            tonic::Status,
8316                        >;
8317                        fn call(
8318                            &mut self,
8319                            request: tonic::Request<super::DeactivateUserRequest>,
8320                        ) -> Self::Future {
8321                            let inner = Arc::clone(&self.0);
8322                            let fut = async move {
8323                                <T as MemberService>::deactivate_user(&inner, request).await
8324                            };
8325                            Box::pin(fut)
8326                        }
8327                    }
8328                    let accept_compression_encodings = self.accept_compression_encodings;
8329                    let send_compression_encodings = self.send_compression_encodings;
8330                    let max_decoding_message_size = self.max_decoding_message_size;
8331                    let max_encoding_message_size = self.max_encoding_message_size;
8332                    let inner = self.inner.clone();
8333                    let fut = async move {
8334                        let method = DeactivateUserSvc(inner);
8335                        let codec = tonic_prost::ProstCodec::default();
8336                        let mut grpc = tonic::server::Grpc::new(codec)
8337                            .apply_compression_config(
8338                                accept_compression_encodings,
8339                                send_compression_encodings,
8340                            )
8341                            .apply_max_message_size_config(
8342                                max_decoding_message_size,
8343                                max_encoding_message_size,
8344                            );
8345                        let res = grpc.unary(method, req).await;
8346                        Ok(res)
8347                    };
8348                    Box::pin(fut)
8349                }
8350                "/pidgr.v1.MemberService/ReactivateUser" => {
8351                    #[allow(non_camel_case_types)]
8352                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
8353                    impl<
8354                        T: MemberService,
8355                    > tonic::server::UnaryService<super::ReactivateUserRequest>
8356                    for ReactivateUserSvc<T> {
8357                        type Response = super::ReactivateUserResponse;
8358                        type Future = BoxFuture<
8359                            tonic::Response<Self::Response>,
8360                            tonic::Status,
8361                        >;
8362                        fn call(
8363                            &mut self,
8364                            request: tonic::Request<super::ReactivateUserRequest>,
8365                        ) -> Self::Future {
8366                            let inner = Arc::clone(&self.0);
8367                            let fut = async move {
8368                                <T as MemberService>::reactivate_user(&inner, request).await
8369                            };
8370                            Box::pin(fut)
8371                        }
8372                    }
8373                    let accept_compression_encodings = self.accept_compression_encodings;
8374                    let send_compression_encodings = self.send_compression_encodings;
8375                    let max_decoding_message_size = self.max_decoding_message_size;
8376                    let max_encoding_message_size = self.max_encoding_message_size;
8377                    let inner = self.inner.clone();
8378                    let fut = async move {
8379                        let method = ReactivateUserSvc(inner);
8380                        let codec = tonic_prost::ProstCodec::default();
8381                        let mut grpc = tonic::server::Grpc::new(codec)
8382                            .apply_compression_config(
8383                                accept_compression_encodings,
8384                                send_compression_encodings,
8385                            )
8386                            .apply_max_message_size_config(
8387                                max_decoding_message_size,
8388                                max_encoding_message_size,
8389                            );
8390                        let res = grpc.unary(method, req).await;
8391                        Ok(res)
8392                    };
8393                    Box::pin(fut)
8394                }
8395                "/pidgr.v1.MemberService/RevokeInvite" => {
8396                    #[allow(non_camel_case_types)]
8397                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
8398                    impl<
8399                        T: MemberService,
8400                    > tonic::server::UnaryService<super::RevokeInviteRequest>
8401                    for RevokeInviteSvc<T> {
8402                        type Response = super::RevokeInviteResponse;
8403                        type Future = BoxFuture<
8404                            tonic::Response<Self::Response>,
8405                            tonic::Status,
8406                        >;
8407                        fn call(
8408                            &mut self,
8409                            request: tonic::Request<super::RevokeInviteRequest>,
8410                        ) -> Self::Future {
8411                            let inner = Arc::clone(&self.0);
8412                            let fut = async move {
8413                                <T as MemberService>::revoke_invite(&inner, request).await
8414                            };
8415                            Box::pin(fut)
8416                        }
8417                    }
8418                    let accept_compression_encodings = self.accept_compression_encodings;
8419                    let send_compression_encodings = self.send_compression_encodings;
8420                    let max_decoding_message_size = self.max_decoding_message_size;
8421                    let max_encoding_message_size = self.max_encoding_message_size;
8422                    let inner = self.inner.clone();
8423                    let fut = async move {
8424                        let method = RevokeInviteSvc(inner);
8425                        let codec = tonic_prost::ProstCodec::default();
8426                        let mut grpc = tonic::server::Grpc::new(codec)
8427                            .apply_compression_config(
8428                                accept_compression_encodings,
8429                                send_compression_encodings,
8430                            )
8431                            .apply_max_message_size_config(
8432                                max_decoding_message_size,
8433                                max_encoding_message_size,
8434                            );
8435                        let res = grpc.unary(method, req).await;
8436                        Ok(res)
8437                    };
8438                    Box::pin(fut)
8439                }
8440                "/pidgr.v1.MemberService/UpdateUserProfile" => {
8441                    #[allow(non_camel_case_types)]
8442                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
8443                    impl<
8444                        T: MemberService,
8445                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
8446                    for UpdateUserProfileSvc<T> {
8447                        type Response = super::UpdateUserProfileResponse;
8448                        type Future = BoxFuture<
8449                            tonic::Response<Self::Response>,
8450                            tonic::Status,
8451                        >;
8452                        fn call(
8453                            &mut self,
8454                            request: tonic::Request<super::UpdateUserProfileRequest>,
8455                        ) -> Self::Future {
8456                            let inner = Arc::clone(&self.0);
8457                            let fut = async move {
8458                                <T as MemberService>::update_user_profile(&inner, request)
8459                                    .await
8460                            };
8461                            Box::pin(fut)
8462                        }
8463                    }
8464                    let accept_compression_encodings = self.accept_compression_encodings;
8465                    let send_compression_encodings = self.send_compression_encodings;
8466                    let max_decoding_message_size = self.max_decoding_message_size;
8467                    let max_encoding_message_size = self.max_encoding_message_size;
8468                    let inner = self.inner.clone();
8469                    let fut = async move {
8470                        let method = UpdateUserProfileSvc(inner);
8471                        let codec = tonic_prost::ProstCodec::default();
8472                        let mut grpc = tonic::server::Grpc::new(codec)
8473                            .apply_compression_config(
8474                                accept_compression_encodings,
8475                                send_compression_encodings,
8476                            )
8477                            .apply_max_message_size_config(
8478                                max_decoding_message_size,
8479                                max_encoding_message_size,
8480                            );
8481                        let res = grpc.unary(method, req).await;
8482                        Ok(res)
8483                    };
8484                    Box::pin(fut)
8485                }
8486                "/pidgr.v1.MemberService/GetUserSettings" => {
8487                    #[allow(non_camel_case_types)]
8488                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
8489                    impl<
8490                        T: MemberService,
8491                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
8492                    for GetUserSettingsSvc<T> {
8493                        type Response = super::GetUserSettingsResponse;
8494                        type Future = BoxFuture<
8495                            tonic::Response<Self::Response>,
8496                            tonic::Status,
8497                        >;
8498                        fn call(
8499                            &mut self,
8500                            request: tonic::Request<super::GetUserSettingsRequest>,
8501                        ) -> Self::Future {
8502                            let inner = Arc::clone(&self.0);
8503                            let fut = async move {
8504                                <T as MemberService>::get_user_settings(&inner, request)
8505                                    .await
8506                            };
8507                            Box::pin(fut)
8508                        }
8509                    }
8510                    let accept_compression_encodings = self.accept_compression_encodings;
8511                    let send_compression_encodings = self.send_compression_encodings;
8512                    let max_decoding_message_size = self.max_decoding_message_size;
8513                    let max_encoding_message_size = self.max_encoding_message_size;
8514                    let inner = self.inner.clone();
8515                    let fut = async move {
8516                        let method = GetUserSettingsSvc(inner);
8517                        let codec = tonic_prost::ProstCodec::default();
8518                        let mut grpc = tonic::server::Grpc::new(codec)
8519                            .apply_compression_config(
8520                                accept_compression_encodings,
8521                                send_compression_encodings,
8522                            )
8523                            .apply_max_message_size_config(
8524                                max_decoding_message_size,
8525                                max_encoding_message_size,
8526                            );
8527                        let res = grpc.unary(method, req).await;
8528                        Ok(res)
8529                    };
8530                    Box::pin(fut)
8531                }
8532                "/pidgr.v1.MemberService/UpdateUserSettings" => {
8533                    #[allow(non_camel_case_types)]
8534                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
8535                    impl<
8536                        T: MemberService,
8537                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
8538                    for UpdateUserSettingsSvc<T> {
8539                        type Response = super::UpdateUserSettingsResponse;
8540                        type Future = BoxFuture<
8541                            tonic::Response<Self::Response>,
8542                            tonic::Status,
8543                        >;
8544                        fn call(
8545                            &mut self,
8546                            request: tonic::Request<super::UpdateUserSettingsRequest>,
8547                        ) -> Self::Future {
8548                            let inner = Arc::clone(&self.0);
8549                            let fut = async move {
8550                                <T as MemberService>::update_user_settings(&inner, request)
8551                                    .await
8552                            };
8553                            Box::pin(fut)
8554                        }
8555                    }
8556                    let accept_compression_encodings = self.accept_compression_encodings;
8557                    let send_compression_encodings = self.send_compression_encodings;
8558                    let max_decoding_message_size = self.max_decoding_message_size;
8559                    let max_encoding_message_size = self.max_encoding_message_size;
8560                    let inner = self.inner.clone();
8561                    let fut = async move {
8562                        let method = UpdateUserSettingsSvc(inner);
8563                        let codec = tonic_prost::ProstCodec::default();
8564                        let mut grpc = tonic::server::Grpc::new(codec)
8565                            .apply_compression_config(
8566                                accept_compression_encodings,
8567                                send_compression_encodings,
8568                            )
8569                            .apply_max_message_size_config(
8570                                max_decoding_message_size,
8571                                max_encoding_message_size,
8572                            );
8573                        let res = grpc.unary(method, req).await;
8574                        Ok(res)
8575                    };
8576                    Box::pin(fut)
8577                }
8578                "/pidgr.v1.MemberService/BulkInviteUsers" => {
8579                    #[allow(non_camel_case_types)]
8580                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
8581                    impl<
8582                        T: MemberService,
8583                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
8584                    for BulkInviteUsersSvc<T> {
8585                        type Response = super::BulkInviteUsersResponse;
8586                        type Future = BoxFuture<
8587                            tonic::Response<Self::Response>,
8588                            tonic::Status,
8589                        >;
8590                        fn call(
8591                            &mut self,
8592                            request: tonic::Request<super::BulkInviteUsersRequest>,
8593                        ) -> Self::Future {
8594                            let inner = Arc::clone(&self.0);
8595                            let fut = async move {
8596                                <T as MemberService>::bulk_invite_users(&inner, request)
8597                                    .await
8598                            };
8599                            Box::pin(fut)
8600                        }
8601                    }
8602                    let accept_compression_encodings = self.accept_compression_encodings;
8603                    let send_compression_encodings = self.send_compression_encodings;
8604                    let max_decoding_message_size = self.max_decoding_message_size;
8605                    let max_encoding_message_size = self.max_encoding_message_size;
8606                    let inner = self.inner.clone();
8607                    let fut = async move {
8608                        let method = BulkInviteUsersSvc(inner);
8609                        let codec = tonic_prost::ProstCodec::default();
8610                        let mut grpc = tonic::server::Grpc::new(codec)
8611                            .apply_compression_config(
8612                                accept_compression_encodings,
8613                                send_compression_encodings,
8614                            )
8615                            .apply_max_message_size_config(
8616                                max_decoding_message_size,
8617                                max_encoding_message_size,
8618                            );
8619                        let res = grpc.unary(method, req).await;
8620                        Ok(res)
8621                    };
8622                    Box::pin(fut)
8623                }
8624                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
8625                    #[allow(non_camel_case_types)]
8626                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
8627                    impl<
8628                        T: MemberService,
8629                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
8630                    for ConfirmPasskeyEnrollmentSvc<T> {
8631                        type Response = super::ConfirmPasskeyEnrollmentResponse;
8632                        type Future = BoxFuture<
8633                            tonic::Response<Self::Response>,
8634                            tonic::Status,
8635                        >;
8636                        fn call(
8637                            &mut self,
8638                            request: tonic::Request<
8639                                super::ConfirmPasskeyEnrollmentRequest,
8640                            >,
8641                        ) -> Self::Future {
8642                            let inner = Arc::clone(&self.0);
8643                            let fut = async move {
8644                                <T as MemberService>::confirm_passkey_enrollment(
8645                                        &inner,
8646                                        request,
8647                                    )
8648                                    .await
8649                            };
8650                            Box::pin(fut)
8651                        }
8652                    }
8653                    let accept_compression_encodings = self.accept_compression_encodings;
8654                    let send_compression_encodings = self.send_compression_encodings;
8655                    let max_decoding_message_size = self.max_decoding_message_size;
8656                    let max_encoding_message_size = self.max_encoding_message_size;
8657                    let inner = self.inner.clone();
8658                    let fut = async move {
8659                        let method = ConfirmPasskeyEnrollmentSvc(inner);
8660                        let codec = tonic_prost::ProstCodec::default();
8661                        let mut grpc = tonic::server::Grpc::new(codec)
8662                            .apply_compression_config(
8663                                accept_compression_encodings,
8664                                send_compression_encodings,
8665                            )
8666                            .apply_max_message_size_config(
8667                                max_decoding_message_size,
8668                                max_encoding_message_size,
8669                            );
8670                        let res = grpc.unary(method, req).await;
8671                        Ok(res)
8672                    };
8673                    Box::pin(fut)
8674                }
8675                "/pidgr.v1.MemberService/UpdateUserRegion" => {
8676                    #[allow(non_camel_case_types)]
8677                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
8678                    impl<
8679                        T: MemberService,
8680                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
8681                    for UpdateUserRegionSvc<T> {
8682                        type Response = super::UpdateUserRegionResponse;
8683                        type Future = BoxFuture<
8684                            tonic::Response<Self::Response>,
8685                            tonic::Status,
8686                        >;
8687                        fn call(
8688                            &mut self,
8689                            request: tonic::Request<super::UpdateUserRegionRequest>,
8690                        ) -> Self::Future {
8691                            let inner = Arc::clone(&self.0);
8692                            let fut = async move {
8693                                <T as MemberService>::update_user_region(&inner, request)
8694                                    .await
8695                            };
8696                            Box::pin(fut)
8697                        }
8698                    }
8699                    let accept_compression_encodings = self.accept_compression_encodings;
8700                    let send_compression_encodings = self.send_compression_encodings;
8701                    let max_decoding_message_size = self.max_decoding_message_size;
8702                    let max_encoding_message_size = self.max_encoding_message_size;
8703                    let inner = self.inner.clone();
8704                    let fut = async move {
8705                        let method = UpdateUserRegionSvc(inner);
8706                        let codec = tonic_prost::ProstCodec::default();
8707                        let mut grpc = tonic::server::Grpc::new(codec)
8708                            .apply_compression_config(
8709                                accept_compression_encodings,
8710                                send_compression_encodings,
8711                            )
8712                            .apply_max_message_size_config(
8713                                max_decoding_message_size,
8714                                max_encoding_message_size,
8715                            );
8716                        let res = grpc.unary(method, req).await;
8717                        Ok(res)
8718                    };
8719                    Box::pin(fut)
8720                }
8721                _ => {
8722                    Box::pin(async move {
8723                        let mut response = http::Response::new(
8724                            tonic::body::Body::default(),
8725                        );
8726                        let headers = response.headers_mut();
8727                        headers
8728                            .insert(
8729                                tonic::Status::GRPC_STATUS,
8730                                (tonic::Code::Unimplemented as i32).into(),
8731                            );
8732                        headers
8733                            .insert(
8734                                http::header::CONTENT_TYPE,
8735                                tonic::metadata::GRPC_CONTENT_TYPE,
8736                            );
8737                        Ok(response)
8738                    })
8739                }
8740            }
8741        }
8742    }
8743    impl<T> Clone for MemberServiceServer<T> {
8744        fn clone(&self) -> Self {
8745            let inner = self.inner.clone();
8746            Self {
8747                inner,
8748                accept_compression_encodings: self.accept_compression_encodings,
8749                send_compression_encodings: self.send_compression_encodings,
8750                max_decoding_message_size: self.max_decoding_message_size,
8751                max_encoding_message_size: self.max_encoding_message_size,
8752            }
8753        }
8754    }
8755    /// Generated gRPC service name
8756    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
8757    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
8758        const NAME: &'static str = SERVICE_NAME;
8759    }
8760}
8761/// Generated client implementations.
8762pub mod organization_service_client {
8763    #![allow(
8764        unused_variables,
8765        dead_code,
8766        missing_docs,
8767        clippy::wildcard_imports,
8768        clippy::let_unit_value,
8769    )]
8770    use tonic::codegen::*;
8771    use tonic::codegen::http::Uri;
8772    /** Manages organizations (tenants) in the Pidgr platform.
8773 Most RPCs operate within the caller's org (extracted from JWT).
8774 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
8775*/
8776    #[derive(Debug, Clone)]
8777    pub struct OrganizationServiceClient<T> {
8778        inner: tonic::client::Grpc<T>,
8779    }
8780    impl OrganizationServiceClient<tonic::transport::Channel> {
8781        /// Attempt to create a new client by connecting to a given endpoint.
8782        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8783        where
8784            D: TryInto<tonic::transport::Endpoint>,
8785            D::Error: Into<StdError>,
8786        {
8787            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8788            Ok(Self::new(conn))
8789        }
8790    }
8791    impl<T> OrganizationServiceClient<T>
8792    where
8793        T: tonic::client::GrpcService<tonic::body::Body>,
8794        T::Error: Into<StdError>,
8795        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8796        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8797    {
8798        pub fn new(inner: T) -> Self {
8799            let inner = tonic::client::Grpc::new(inner);
8800            Self { inner }
8801        }
8802        pub fn with_origin(inner: T, origin: Uri) -> Self {
8803            let inner = tonic::client::Grpc::with_origin(inner, origin);
8804            Self { inner }
8805        }
8806        pub fn with_interceptor<F>(
8807            inner: T,
8808            interceptor: F,
8809        ) -> OrganizationServiceClient<InterceptedService<T, F>>
8810        where
8811            F: tonic::service::Interceptor,
8812            T::ResponseBody: Default,
8813            T: tonic::codegen::Service<
8814                http::Request<tonic::body::Body>,
8815                Response = http::Response<
8816                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8817                >,
8818            >,
8819            <T as tonic::codegen::Service<
8820                http::Request<tonic::body::Body>,
8821            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8822        {
8823            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
8824        }
8825        /// Compress requests with the given encoding.
8826        ///
8827        /// This requires the server to support it otherwise it might respond with an
8828        /// error.
8829        #[must_use]
8830        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8831            self.inner = self.inner.send_compressed(encoding);
8832            self
8833        }
8834        /// Enable decompressing responses.
8835        #[must_use]
8836        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8837            self.inner = self.inner.accept_compressed(encoding);
8838            self
8839        }
8840        /// Limits the maximum size of a decoded message.
8841        ///
8842        /// Default: `4MB`
8843        #[must_use]
8844        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8845            self.inner = self.inner.max_decoding_message_size(limit);
8846            self
8847        }
8848        /// Limits the maximum size of an encoded message.
8849        ///
8850        /// Default: `usize::MAX`
8851        #[must_use]
8852        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8853            self.inner = self.inner.max_encoding_message_size(limit);
8854            self
8855        }
8856        /** Create a new organization with an initial admin user.
8857 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
8858*/
8859        pub async fn create_organization(
8860            &mut self,
8861            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
8862        ) -> std::result::Result<
8863            tonic::Response<super::CreateOrganizationResponse>,
8864            tonic::Status,
8865        > {
8866            self.inner
8867                .ready()
8868                .await
8869                .map_err(|e| {
8870                    tonic::Status::unknown(
8871                        format!("Service was not ready: {}", e.into()),
8872                    )
8873                })?;
8874            let codec = tonic_prost::ProstCodec::default();
8875            let path = http::uri::PathAndQuery::from_static(
8876                "/pidgr.v1.OrganizationService/CreateOrganization",
8877            );
8878            let mut req = request.into_request();
8879            req.extensions_mut()
8880                .insert(
8881                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
8882                );
8883            self.inner.unary(req, path, codec).await
8884        }
8885        /** Retrieve the organization for the authenticated user.
8886 Authorization: Requires PERMISSION_ORG_READ.
8887*/
8888        pub async fn get_organization(
8889            &mut self,
8890            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
8891        ) -> std::result::Result<
8892            tonic::Response<super::GetOrganizationResponse>,
8893            tonic::Status,
8894        > {
8895            self.inner
8896                .ready()
8897                .await
8898                .map_err(|e| {
8899                    tonic::Status::unknown(
8900                        format!("Service was not ready: {}", e.into()),
8901                    )
8902                })?;
8903            let codec = tonic_prost::ProstCodec::default();
8904            let path = http::uri::PathAndQuery::from_static(
8905                "/pidgr.v1.OrganizationService/GetOrganization",
8906            );
8907            let mut req = request.into_request();
8908            req.extensions_mut()
8909                .insert(
8910                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
8911                );
8912            self.inner.unary(req, path, codec).await
8913        }
8914        /** Update organization settings (name, default workflow, industry, company size).
8915 Authorization: Requires PERMISSION_ORG_WRITE.
8916*/
8917        pub async fn update_organization(
8918            &mut self,
8919            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
8920        ) -> std::result::Result<
8921            tonic::Response<super::UpdateOrganizationResponse>,
8922            tonic::Status,
8923        > {
8924            self.inner
8925                .ready()
8926                .await
8927                .map_err(|e| {
8928                    tonic::Status::unknown(
8929                        format!("Service was not ready: {}", e.into()),
8930                    )
8931                })?;
8932            let codec = tonic_prost::ProstCodec::default();
8933            let path = http::uri::PathAndQuery::from_static(
8934                "/pidgr.v1.OrganizationService/UpdateOrganization",
8935            );
8936            let mut req = request.into_request();
8937            req.extensions_mut()
8938                .insert(
8939                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
8940                );
8941            self.inner.unary(req, path, codec).await
8942        }
8943        /** Replace all SSO attribute mappings for the organization.
8944 Authorization: Requires PERMISSION_ORG_WRITE.
8945*/
8946        pub async fn update_sso_attribute_mappings(
8947            &mut self,
8948            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
8949        ) -> std::result::Result<
8950            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
8951            tonic::Status,
8952        > {
8953            self.inner
8954                .ready()
8955                .await
8956                .map_err(|e| {
8957                    tonic::Status::unknown(
8958                        format!("Service was not ready: {}", e.into()),
8959                    )
8960                })?;
8961            let codec = tonic_prost::ProstCodec::default();
8962            let path = http::uri::PathAndQuery::from_static(
8963                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
8964            );
8965            let mut req = request.into_request();
8966            req.extensions_mut()
8967                .insert(
8968                    GrpcMethod::new(
8969                        "pidgr.v1.OrganizationService",
8970                        "UpdateSsoAttributeMappings",
8971                    ),
8972                );
8973            self.inner.unary(req, path, codec).await
8974        }
8975        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
8976 Authorization: Requires PERMISSION_PRIVACY_WRITE.
8977*/
8978        pub async fn rotate_analytics_salt(
8979            &mut self,
8980            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
8981        ) -> std::result::Result<
8982            tonic::Response<super::RotateAnalyticsSaltResponse>,
8983            tonic::Status,
8984        > {
8985            self.inner
8986                .ready()
8987                .await
8988                .map_err(|e| {
8989                    tonic::Status::unknown(
8990                        format!("Service was not ready: {}", e.into()),
8991                    )
8992                })?;
8993            let codec = tonic_prost::ProstCodec::default();
8994            let path = http::uri::PathAndQuery::from_static(
8995                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
8996            );
8997            let mut req = request.into_request();
8998            req.extensions_mut()
8999                .insert(
9000                    GrpcMethod::new(
9001                        "pidgr.v1.OrganizationService",
9002                        "RotateAnalyticsSalt",
9003                    ),
9004                );
9005            self.inner.unary(req, path, codec).await
9006        }
9007        /** Update the differential privacy epsilon parameter.
9008 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9009*/
9010        pub async fn update_analytics_epsilon(
9011            &mut self,
9012            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
9013        ) -> std::result::Result<
9014            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9015            tonic::Status,
9016        > {
9017            self.inner
9018                .ready()
9019                .await
9020                .map_err(|e| {
9021                    tonic::Status::unknown(
9022                        format!("Service was not ready: {}", e.into()),
9023                    )
9024                })?;
9025            let codec = tonic_prost::ProstCodec::default();
9026            let path = http::uri::PathAndQuery::from_static(
9027                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
9028            );
9029            let mut req = request.into_request();
9030            req.extensions_mut()
9031                .insert(
9032                    GrpcMethod::new(
9033                        "pidgr.v1.OrganizationService",
9034                        "UpdateAnalyticsEpsilon",
9035                    ),
9036                );
9037            self.inner.unary(req, path, codec).await
9038        }
9039        /** Create a sandbox organization for testing configurations.
9040 Sandbox orgs auto-delete after expires_at. SCIM provisioning is allowed
9041 for IdP testing (users created in DB only, not in Cognito).
9042 Authorization: Requires PERMISSION_ORG_WRITE.
9043*/
9044        pub async fn create_sandbox_organization(
9045            &mut self,
9046            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
9047        ) -> std::result::Result<
9048            tonic::Response<super::CreateSandboxOrganizationResponse>,
9049            tonic::Status,
9050        > {
9051            self.inner
9052                .ready()
9053                .await
9054                .map_err(|e| {
9055                    tonic::Status::unknown(
9056                        format!("Service was not ready: {}", e.into()),
9057                    )
9058                })?;
9059            let codec = tonic_prost::ProstCodec::default();
9060            let path = http::uri::PathAndQuery::from_static(
9061                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
9062            );
9063            let mut req = request.into_request();
9064            req.extensions_mut()
9065                .insert(
9066                    GrpcMethod::new(
9067                        "pidgr.v1.OrganizationService",
9068                        "CreateSandboxOrganization",
9069                    ),
9070                );
9071            self.inner.unary(req, path, codec).await
9072        }
9073        /** List all organizations the authenticated user belongs to.
9074 Org-exempt: callable without org context (only requires valid JWT).
9075 Used by the admin org switcher to discover available orgs.
9076 Excludes expired sandbox organizations.
9077 Authorization: Authenticated user (no specific permission required).
9078*/
9079        pub async fn list_user_organizations(
9080            &mut self,
9081            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
9082        ) -> std::result::Result<
9083            tonic::Response<super::ListUserOrganizationsResponse>,
9084            tonic::Status,
9085        > {
9086            self.inner
9087                .ready()
9088                .await
9089                .map_err(|e| {
9090                    tonic::Status::unknown(
9091                        format!("Service was not ready: {}", e.into()),
9092                    )
9093                })?;
9094            let codec = tonic_prost::ProstCodec::default();
9095            let path = http::uri::PathAndQuery::from_static(
9096                "/pidgr.v1.OrganizationService/ListUserOrganizations",
9097            );
9098            let mut req = request.into_request();
9099            req.extensions_mut()
9100                .insert(
9101                    GrpcMethod::new(
9102                        "pidgr.v1.OrganizationService",
9103                        "ListUserOrganizations",
9104                    ),
9105                );
9106            self.inner.unary(req, path, codec).await
9107        }
9108    }
9109}
9110/// Generated server implementations.
9111pub mod organization_service_server {
9112    #![allow(
9113        unused_variables,
9114        dead_code,
9115        missing_docs,
9116        clippy::wildcard_imports,
9117        clippy::let_unit_value,
9118    )]
9119    use tonic::codegen::*;
9120    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
9121    #[async_trait]
9122    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
9123        /** Create a new organization with an initial admin user.
9124 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
9125*/
9126        async fn create_organization(
9127            &self,
9128            request: tonic::Request<super::CreateOrganizationRequest>,
9129        ) -> std::result::Result<
9130            tonic::Response<super::CreateOrganizationResponse>,
9131            tonic::Status,
9132        >;
9133        /** Retrieve the organization for the authenticated user.
9134 Authorization: Requires PERMISSION_ORG_READ.
9135*/
9136        async fn get_organization(
9137            &self,
9138            request: tonic::Request<super::GetOrganizationRequest>,
9139        ) -> std::result::Result<
9140            tonic::Response<super::GetOrganizationResponse>,
9141            tonic::Status,
9142        >;
9143        /** Update organization settings (name, default workflow, industry, company size).
9144 Authorization: Requires PERMISSION_ORG_WRITE.
9145*/
9146        async fn update_organization(
9147            &self,
9148            request: tonic::Request<super::UpdateOrganizationRequest>,
9149        ) -> std::result::Result<
9150            tonic::Response<super::UpdateOrganizationResponse>,
9151            tonic::Status,
9152        >;
9153        /** Replace all SSO attribute mappings for the organization.
9154 Authorization: Requires PERMISSION_ORG_WRITE.
9155*/
9156        async fn update_sso_attribute_mappings(
9157            &self,
9158            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
9159        ) -> std::result::Result<
9160            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9161            tonic::Status,
9162        >;
9163        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9164 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9165*/
9166        async fn rotate_analytics_salt(
9167            &self,
9168            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9169        ) -> std::result::Result<
9170            tonic::Response<super::RotateAnalyticsSaltResponse>,
9171            tonic::Status,
9172        >;
9173        /** Update the differential privacy epsilon parameter.
9174 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9175*/
9176        async fn update_analytics_epsilon(
9177            &self,
9178            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9179        ) -> std::result::Result<
9180            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9181            tonic::Status,
9182        >;
9183        /** Create a sandbox organization for testing configurations.
9184 Sandbox orgs auto-delete after expires_at. SCIM provisioning is allowed
9185 for IdP testing (users created in DB only, not in Cognito).
9186 Authorization: Requires PERMISSION_ORG_WRITE.
9187*/
9188        async fn create_sandbox_organization(
9189            &self,
9190            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
9191        ) -> std::result::Result<
9192            tonic::Response<super::CreateSandboxOrganizationResponse>,
9193            tonic::Status,
9194        >;
9195        /** List all organizations the authenticated user belongs to.
9196 Org-exempt: callable without org context (only requires valid JWT).
9197 Used by the admin org switcher to discover available orgs.
9198 Excludes expired sandbox organizations.
9199 Authorization: Authenticated user (no specific permission required).
9200*/
9201        async fn list_user_organizations(
9202            &self,
9203            request: tonic::Request<super::ListUserOrganizationsRequest>,
9204        ) -> std::result::Result<
9205            tonic::Response<super::ListUserOrganizationsResponse>,
9206            tonic::Status,
9207        >;
9208    }
9209    /** Manages organizations (tenants) in the Pidgr platform.
9210 Most RPCs operate within the caller's org (extracted from JWT).
9211 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
9212*/
9213    #[derive(Debug)]
9214    pub struct OrganizationServiceServer<T> {
9215        inner: Arc<T>,
9216        accept_compression_encodings: EnabledCompressionEncodings,
9217        send_compression_encodings: EnabledCompressionEncodings,
9218        max_decoding_message_size: Option<usize>,
9219        max_encoding_message_size: Option<usize>,
9220    }
9221    impl<T> OrganizationServiceServer<T> {
9222        pub fn new(inner: T) -> Self {
9223            Self::from_arc(Arc::new(inner))
9224        }
9225        pub fn from_arc(inner: Arc<T>) -> Self {
9226            Self {
9227                inner,
9228                accept_compression_encodings: Default::default(),
9229                send_compression_encodings: Default::default(),
9230                max_decoding_message_size: None,
9231                max_encoding_message_size: None,
9232            }
9233        }
9234        pub fn with_interceptor<F>(
9235            inner: T,
9236            interceptor: F,
9237        ) -> InterceptedService<Self, F>
9238        where
9239            F: tonic::service::Interceptor,
9240        {
9241            InterceptedService::new(Self::new(inner), interceptor)
9242        }
9243        /// Enable decompressing requests with the given encoding.
9244        #[must_use]
9245        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9246            self.accept_compression_encodings.enable(encoding);
9247            self
9248        }
9249        /// Compress responses with the given encoding, if the client supports it.
9250        #[must_use]
9251        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9252            self.send_compression_encodings.enable(encoding);
9253            self
9254        }
9255        /// Limits the maximum size of a decoded message.
9256        ///
9257        /// Default: `4MB`
9258        #[must_use]
9259        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9260            self.max_decoding_message_size = Some(limit);
9261            self
9262        }
9263        /// Limits the maximum size of an encoded message.
9264        ///
9265        /// Default: `usize::MAX`
9266        #[must_use]
9267        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9268            self.max_encoding_message_size = Some(limit);
9269            self
9270        }
9271    }
9272    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
9273    where
9274        T: OrganizationService,
9275        B: Body + std::marker::Send + 'static,
9276        B::Error: Into<StdError> + std::marker::Send + 'static,
9277    {
9278        type Response = http::Response<tonic::body::Body>;
9279        type Error = std::convert::Infallible;
9280        type Future = BoxFuture<Self::Response, Self::Error>;
9281        fn poll_ready(
9282            &mut self,
9283            _cx: &mut Context<'_>,
9284        ) -> Poll<std::result::Result<(), Self::Error>> {
9285            Poll::Ready(Ok(()))
9286        }
9287        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9288            match req.uri().path() {
9289                "/pidgr.v1.OrganizationService/CreateOrganization" => {
9290                    #[allow(non_camel_case_types)]
9291                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9292                    impl<
9293                        T: OrganizationService,
9294                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
9295                    for CreateOrganizationSvc<T> {
9296                        type Response = super::CreateOrganizationResponse;
9297                        type Future = BoxFuture<
9298                            tonic::Response<Self::Response>,
9299                            tonic::Status,
9300                        >;
9301                        fn call(
9302                            &mut self,
9303                            request: tonic::Request<super::CreateOrganizationRequest>,
9304                        ) -> Self::Future {
9305                            let inner = Arc::clone(&self.0);
9306                            let fut = async move {
9307                                <T as OrganizationService>::create_organization(
9308                                        &inner,
9309                                        request,
9310                                    )
9311                                    .await
9312                            };
9313                            Box::pin(fut)
9314                        }
9315                    }
9316                    let accept_compression_encodings = self.accept_compression_encodings;
9317                    let send_compression_encodings = self.send_compression_encodings;
9318                    let max_decoding_message_size = self.max_decoding_message_size;
9319                    let max_encoding_message_size = self.max_encoding_message_size;
9320                    let inner = self.inner.clone();
9321                    let fut = async move {
9322                        let method = CreateOrganizationSvc(inner);
9323                        let codec = tonic_prost::ProstCodec::default();
9324                        let mut grpc = tonic::server::Grpc::new(codec)
9325                            .apply_compression_config(
9326                                accept_compression_encodings,
9327                                send_compression_encodings,
9328                            )
9329                            .apply_max_message_size_config(
9330                                max_decoding_message_size,
9331                                max_encoding_message_size,
9332                            );
9333                        let res = grpc.unary(method, req).await;
9334                        Ok(res)
9335                    };
9336                    Box::pin(fut)
9337                }
9338                "/pidgr.v1.OrganizationService/GetOrganization" => {
9339                    #[allow(non_camel_case_types)]
9340                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9341                    impl<
9342                        T: OrganizationService,
9343                    > tonic::server::UnaryService<super::GetOrganizationRequest>
9344                    for GetOrganizationSvc<T> {
9345                        type Response = super::GetOrganizationResponse;
9346                        type Future = BoxFuture<
9347                            tonic::Response<Self::Response>,
9348                            tonic::Status,
9349                        >;
9350                        fn call(
9351                            &mut self,
9352                            request: tonic::Request<super::GetOrganizationRequest>,
9353                        ) -> Self::Future {
9354                            let inner = Arc::clone(&self.0);
9355                            let fut = async move {
9356                                <T as OrganizationService>::get_organization(
9357                                        &inner,
9358                                        request,
9359                                    )
9360                                    .await
9361                            };
9362                            Box::pin(fut)
9363                        }
9364                    }
9365                    let accept_compression_encodings = self.accept_compression_encodings;
9366                    let send_compression_encodings = self.send_compression_encodings;
9367                    let max_decoding_message_size = self.max_decoding_message_size;
9368                    let max_encoding_message_size = self.max_encoding_message_size;
9369                    let inner = self.inner.clone();
9370                    let fut = async move {
9371                        let method = GetOrganizationSvc(inner);
9372                        let codec = tonic_prost::ProstCodec::default();
9373                        let mut grpc = tonic::server::Grpc::new(codec)
9374                            .apply_compression_config(
9375                                accept_compression_encodings,
9376                                send_compression_encodings,
9377                            )
9378                            .apply_max_message_size_config(
9379                                max_decoding_message_size,
9380                                max_encoding_message_size,
9381                            );
9382                        let res = grpc.unary(method, req).await;
9383                        Ok(res)
9384                    };
9385                    Box::pin(fut)
9386                }
9387                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
9388                    #[allow(non_camel_case_types)]
9389                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9390                    impl<
9391                        T: OrganizationService,
9392                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
9393                    for UpdateOrganizationSvc<T> {
9394                        type Response = super::UpdateOrganizationResponse;
9395                        type Future = BoxFuture<
9396                            tonic::Response<Self::Response>,
9397                            tonic::Status,
9398                        >;
9399                        fn call(
9400                            &mut self,
9401                            request: tonic::Request<super::UpdateOrganizationRequest>,
9402                        ) -> Self::Future {
9403                            let inner = Arc::clone(&self.0);
9404                            let fut = async move {
9405                                <T as OrganizationService>::update_organization(
9406                                        &inner,
9407                                        request,
9408                                    )
9409                                    .await
9410                            };
9411                            Box::pin(fut)
9412                        }
9413                    }
9414                    let accept_compression_encodings = self.accept_compression_encodings;
9415                    let send_compression_encodings = self.send_compression_encodings;
9416                    let max_decoding_message_size = self.max_decoding_message_size;
9417                    let max_encoding_message_size = self.max_encoding_message_size;
9418                    let inner = self.inner.clone();
9419                    let fut = async move {
9420                        let method = UpdateOrganizationSvc(inner);
9421                        let codec = tonic_prost::ProstCodec::default();
9422                        let mut grpc = tonic::server::Grpc::new(codec)
9423                            .apply_compression_config(
9424                                accept_compression_encodings,
9425                                send_compression_encodings,
9426                            )
9427                            .apply_max_message_size_config(
9428                                max_decoding_message_size,
9429                                max_encoding_message_size,
9430                            );
9431                        let res = grpc.unary(method, req).await;
9432                        Ok(res)
9433                    };
9434                    Box::pin(fut)
9435                }
9436                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
9437                    #[allow(non_camel_case_types)]
9438                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
9439                        pub Arc<T>,
9440                    );
9441                    impl<
9442                        T: OrganizationService,
9443                    > tonic::server::UnaryService<
9444                        super::UpdateSsoAttributeMappingsRequest,
9445                    > for UpdateSsoAttributeMappingsSvc<T> {
9446                        type Response = super::UpdateSsoAttributeMappingsResponse;
9447                        type Future = BoxFuture<
9448                            tonic::Response<Self::Response>,
9449                            tonic::Status,
9450                        >;
9451                        fn call(
9452                            &mut self,
9453                            request: tonic::Request<
9454                                super::UpdateSsoAttributeMappingsRequest,
9455                            >,
9456                        ) -> Self::Future {
9457                            let inner = Arc::clone(&self.0);
9458                            let fut = async move {
9459                                <T as OrganizationService>::update_sso_attribute_mappings(
9460                                        &inner,
9461                                        request,
9462                                    )
9463                                    .await
9464                            };
9465                            Box::pin(fut)
9466                        }
9467                    }
9468                    let accept_compression_encodings = self.accept_compression_encodings;
9469                    let send_compression_encodings = self.send_compression_encodings;
9470                    let max_decoding_message_size = self.max_decoding_message_size;
9471                    let max_encoding_message_size = self.max_encoding_message_size;
9472                    let inner = self.inner.clone();
9473                    let fut = async move {
9474                        let method = UpdateSsoAttributeMappingsSvc(inner);
9475                        let codec = tonic_prost::ProstCodec::default();
9476                        let mut grpc = tonic::server::Grpc::new(codec)
9477                            .apply_compression_config(
9478                                accept_compression_encodings,
9479                                send_compression_encodings,
9480                            )
9481                            .apply_max_message_size_config(
9482                                max_decoding_message_size,
9483                                max_encoding_message_size,
9484                            );
9485                        let res = grpc.unary(method, req).await;
9486                        Ok(res)
9487                    };
9488                    Box::pin(fut)
9489                }
9490                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
9491                    #[allow(non_camel_case_types)]
9492                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
9493                    impl<
9494                        T: OrganizationService,
9495                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
9496                    for RotateAnalyticsSaltSvc<T> {
9497                        type Response = super::RotateAnalyticsSaltResponse;
9498                        type Future = BoxFuture<
9499                            tonic::Response<Self::Response>,
9500                            tonic::Status,
9501                        >;
9502                        fn call(
9503                            &mut self,
9504                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9505                        ) -> Self::Future {
9506                            let inner = Arc::clone(&self.0);
9507                            let fut = async move {
9508                                <T as OrganizationService>::rotate_analytics_salt(
9509                                        &inner,
9510                                        request,
9511                                    )
9512                                    .await
9513                            };
9514                            Box::pin(fut)
9515                        }
9516                    }
9517                    let accept_compression_encodings = self.accept_compression_encodings;
9518                    let send_compression_encodings = self.send_compression_encodings;
9519                    let max_decoding_message_size = self.max_decoding_message_size;
9520                    let max_encoding_message_size = self.max_encoding_message_size;
9521                    let inner = self.inner.clone();
9522                    let fut = async move {
9523                        let method = RotateAnalyticsSaltSvc(inner);
9524                        let codec = tonic_prost::ProstCodec::default();
9525                        let mut grpc = tonic::server::Grpc::new(codec)
9526                            .apply_compression_config(
9527                                accept_compression_encodings,
9528                                send_compression_encodings,
9529                            )
9530                            .apply_max_message_size_config(
9531                                max_decoding_message_size,
9532                                max_encoding_message_size,
9533                            );
9534                        let res = grpc.unary(method, req).await;
9535                        Ok(res)
9536                    };
9537                    Box::pin(fut)
9538                }
9539                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
9540                    #[allow(non_camel_case_types)]
9541                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
9542                    impl<
9543                        T: OrganizationService,
9544                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
9545                    for UpdateAnalyticsEpsilonSvc<T> {
9546                        type Response = super::UpdateAnalyticsEpsilonResponse;
9547                        type Future = BoxFuture<
9548                            tonic::Response<Self::Response>,
9549                            tonic::Status,
9550                        >;
9551                        fn call(
9552                            &mut self,
9553                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9554                        ) -> Self::Future {
9555                            let inner = Arc::clone(&self.0);
9556                            let fut = async move {
9557                                <T as OrganizationService>::update_analytics_epsilon(
9558                                        &inner,
9559                                        request,
9560                                    )
9561                                    .await
9562                            };
9563                            Box::pin(fut)
9564                        }
9565                    }
9566                    let accept_compression_encodings = self.accept_compression_encodings;
9567                    let send_compression_encodings = self.send_compression_encodings;
9568                    let max_decoding_message_size = self.max_decoding_message_size;
9569                    let max_encoding_message_size = self.max_encoding_message_size;
9570                    let inner = self.inner.clone();
9571                    let fut = async move {
9572                        let method = UpdateAnalyticsEpsilonSvc(inner);
9573                        let codec = tonic_prost::ProstCodec::default();
9574                        let mut grpc = tonic::server::Grpc::new(codec)
9575                            .apply_compression_config(
9576                                accept_compression_encodings,
9577                                send_compression_encodings,
9578                            )
9579                            .apply_max_message_size_config(
9580                                max_decoding_message_size,
9581                                max_encoding_message_size,
9582                            );
9583                        let res = grpc.unary(method, req).await;
9584                        Ok(res)
9585                    };
9586                    Box::pin(fut)
9587                }
9588                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
9589                    #[allow(non_camel_case_types)]
9590                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
9591                        pub Arc<T>,
9592                    );
9593                    impl<
9594                        T: OrganizationService,
9595                    > tonic::server::UnaryService<
9596                        super::CreateSandboxOrganizationRequest,
9597                    > for CreateSandboxOrganizationSvc<T> {
9598                        type Response = super::CreateSandboxOrganizationResponse;
9599                        type Future = BoxFuture<
9600                            tonic::Response<Self::Response>,
9601                            tonic::Status,
9602                        >;
9603                        fn call(
9604                            &mut self,
9605                            request: tonic::Request<
9606                                super::CreateSandboxOrganizationRequest,
9607                            >,
9608                        ) -> Self::Future {
9609                            let inner = Arc::clone(&self.0);
9610                            let fut = async move {
9611                                <T as OrganizationService>::create_sandbox_organization(
9612                                        &inner,
9613                                        request,
9614                                    )
9615                                    .await
9616                            };
9617                            Box::pin(fut)
9618                        }
9619                    }
9620                    let accept_compression_encodings = self.accept_compression_encodings;
9621                    let send_compression_encodings = self.send_compression_encodings;
9622                    let max_decoding_message_size = self.max_decoding_message_size;
9623                    let max_encoding_message_size = self.max_encoding_message_size;
9624                    let inner = self.inner.clone();
9625                    let fut = async move {
9626                        let method = CreateSandboxOrganizationSvc(inner);
9627                        let codec = tonic_prost::ProstCodec::default();
9628                        let mut grpc = tonic::server::Grpc::new(codec)
9629                            .apply_compression_config(
9630                                accept_compression_encodings,
9631                                send_compression_encodings,
9632                            )
9633                            .apply_max_message_size_config(
9634                                max_decoding_message_size,
9635                                max_encoding_message_size,
9636                            );
9637                        let res = grpc.unary(method, req).await;
9638                        Ok(res)
9639                    };
9640                    Box::pin(fut)
9641                }
9642                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
9643                    #[allow(non_camel_case_types)]
9644                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
9645                    impl<
9646                        T: OrganizationService,
9647                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
9648                    for ListUserOrganizationsSvc<T> {
9649                        type Response = super::ListUserOrganizationsResponse;
9650                        type Future = BoxFuture<
9651                            tonic::Response<Self::Response>,
9652                            tonic::Status,
9653                        >;
9654                        fn call(
9655                            &mut self,
9656                            request: tonic::Request<super::ListUserOrganizationsRequest>,
9657                        ) -> Self::Future {
9658                            let inner = Arc::clone(&self.0);
9659                            let fut = async move {
9660                                <T as OrganizationService>::list_user_organizations(
9661                                        &inner,
9662                                        request,
9663                                    )
9664                                    .await
9665                            };
9666                            Box::pin(fut)
9667                        }
9668                    }
9669                    let accept_compression_encodings = self.accept_compression_encodings;
9670                    let send_compression_encodings = self.send_compression_encodings;
9671                    let max_decoding_message_size = self.max_decoding_message_size;
9672                    let max_encoding_message_size = self.max_encoding_message_size;
9673                    let inner = self.inner.clone();
9674                    let fut = async move {
9675                        let method = ListUserOrganizationsSvc(inner);
9676                        let codec = tonic_prost::ProstCodec::default();
9677                        let mut grpc = tonic::server::Grpc::new(codec)
9678                            .apply_compression_config(
9679                                accept_compression_encodings,
9680                                send_compression_encodings,
9681                            )
9682                            .apply_max_message_size_config(
9683                                max_decoding_message_size,
9684                                max_encoding_message_size,
9685                            );
9686                        let res = grpc.unary(method, req).await;
9687                        Ok(res)
9688                    };
9689                    Box::pin(fut)
9690                }
9691                _ => {
9692                    Box::pin(async move {
9693                        let mut response = http::Response::new(
9694                            tonic::body::Body::default(),
9695                        );
9696                        let headers = response.headers_mut();
9697                        headers
9698                            .insert(
9699                                tonic::Status::GRPC_STATUS,
9700                                (tonic::Code::Unimplemented as i32).into(),
9701                            );
9702                        headers
9703                            .insert(
9704                                http::header::CONTENT_TYPE,
9705                                tonic::metadata::GRPC_CONTENT_TYPE,
9706                            );
9707                        Ok(response)
9708                    })
9709                }
9710            }
9711        }
9712    }
9713    impl<T> Clone for OrganizationServiceServer<T> {
9714        fn clone(&self) -> Self {
9715            let inner = self.inner.clone();
9716            Self {
9717                inner,
9718                accept_compression_encodings: self.accept_compression_encodings,
9719                send_compression_encodings: self.send_compression_encodings,
9720                max_decoding_message_size: self.max_decoding_message_size,
9721                max_encoding_message_size: self.max_encoding_message_size,
9722            }
9723        }
9724    }
9725    /// Generated gRPC service name
9726    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
9727    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
9728        const NAME: &'static str = SERVICE_NAME;
9729    }
9730}
9731/// Generated client implementations.
9732pub mod render_service_client {
9733    #![allow(
9734        unused_variables,
9735        dead_code,
9736        missing_docs,
9737        clippy::wildcard_imports,
9738        clippy::let_unit_value,
9739    )]
9740    use tonic::codegen::*;
9741    use tonic::codegen::http::Uri;
9742    /** Internal service for batch template rendering.
9743*/
9744    #[derive(Debug, Clone)]
9745    pub struct RenderServiceClient<T> {
9746        inner: tonic::client::Grpc<T>,
9747    }
9748    impl RenderServiceClient<tonic::transport::Channel> {
9749        /// Attempt to create a new client by connecting to a given endpoint.
9750        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9751        where
9752            D: TryInto<tonic::transport::Endpoint>,
9753            D::Error: Into<StdError>,
9754        {
9755            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9756            Ok(Self::new(conn))
9757        }
9758    }
9759    impl<T> RenderServiceClient<T>
9760    where
9761        T: tonic::client::GrpcService<tonic::body::Body>,
9762        T::Error: Into<StdError>,
9763        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9764        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9765    {
9766        pub fn new(inner: T) -> Self {
9767            let inner = tonic::client::Grpc::new(inner);
9768            Self { inner }
9769        }
9770        pub fn with_origin(inner: T, origin: Uri) -> Self {
9771            let inner = tonic::client::Grpc::with_origin(inner, origin);
9772            Self { inner }
9773        }
9774        pub fn with_interceptor<F>(
9775            inner: T,
9776            interceptor: F,
9777        ) -> RenderServiceClient<InterceptedService<T, F>>
9778        where
9779            F: tonic::service::Interceptor,
9780            T::ResponseBody: Default,
9781            T: tonic::codegen::Service<
9782                http::Request<tonic::body::Body>,
9783                Response = http::Response<
9784                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9785                >,
9786            >,
9787            <T as tonic::codegen::Service<
9788                http::Request<tonic::body::Body>,
9789            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9790        {
9791            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
9792        }
9793        /// Compress requests with the given encoding.
9794        ///
9795        /// This requires the server to support it otherwise it might respond with an
9796        /// error.
9797        #[must_use]
9798        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9799            self.inner = self.inner.send_compressed(encoding);
9800            self
9801        }
9802        /// Enable decompressing responses.
9803        #[must_use]
9804        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9805            self.inner = self.inner.accept_compressed(encoding);
9806            self
9807        }
9808        /// Limits the maximum size of a decoded message.
9809        ///
9810        /// Default: `4MB`
9811        #[must_use]
9812        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9813            self.inner = self.inner.max_decoding_message_size(limit);
9814            self
9815        }
9816        /// Limits the maximum size of an encoded message.
9817        ///
9818        /// Default: `usize::MAX`
9819        #[must_use]
9820        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9821            self.inner = self.inner.max_encoding_message_size(limit);
9822            self
9823        }
9824        /** Render a template for multiple users, streaming results as each completes.
9825 Authorization: Internal server-to-server only. Not exposed to external clients.
9826*/
9827        pub async fn render_batch(
9828            &mut self,
9829            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
9830        ) -> std::result::Result<
9831            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
9832            tonic::Status,
9833        > {
9834            self.inner
9835                .ready()
9836                .await
9837                .map_err(|e| {
9838                    tonic::Status::unknown(
9839                        format!("Service was not ready: {}", e.into()),
9840                    )
9841                })?;
9842            let codec = tonic_prost::ProstCodec::default();
9843            let path = http::uri::PathAndQuery::from_static(
9844                "/pidgr.v1.RenderService/RenderBatch",
9845            );
9846            let mut req = request.into_request();
9847            req.extensions_mut()
9848                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
9849            self.inner.server_streaming(req, path, codec).await
9850        }
9851    }
9852}
9853/// Generated server implementations.
9854pub mod render_service_server {
9855    #![allow(
9856        unused_variables,
9857        dead_code,
9858        missing_docs,
9859        clippy::wildcard_imports,
9860        clippy::let_unit_value,
9861    )]
9862    use tonic::codegen::*;
9863    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
9864    #[async_trait]
9865    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
9866        /// Server streaming response type for the RenderBatch method.
9867        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
9868                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
9869            >
9870            + std::marker::Send
9871            + 'static;
9872        /** Render a template for multiple users, streaming results as each completes.
9873 Authorization: Internal server-to-server only. Not exposed to external clients.
9874*/
9875        async fn render_batch(
9876            &self,
9877            request: tonic::Request<super::RenderBatchRequest>,
9878        ) -> std::result::Result<
9879            tonic::Response<Self::RenderBatchStream>,
9880            tonic::Status,
9881        >;
9882    }
9883    /** Internal service for batch template rendering.
9884*/
9885    #[derive(Debug)]
9886    pub struct RenderServiceServer<T> {
9887        inner: Arc<T>,
9888        accept_compression_encodings: EnabledCompressionEncodings,
9889        send_compression_encodings: EnabledCompressionEncodings,
9890        max_decoding_message_size: Option<usize>,
9891        max_encoding_message_size: Option<usize>,
9892    }
9893    impl<T> RenderServiceServer<T> {
9894        pub fn new(inner: T) -> Self {
9895            Self::from_arc(Arc::new(inner))
9896        }
9897        pub fn from_arc(inner: Arc<T>) -> Self {
9898            Self {
9899                inner,
9900                accept_compression_encodings: Default::default(),
9901                send_compression_encodings: Default::default(),
9902                max_decoding_message_size: None,
9903                max_encoding_message_size: None,
9904            }
9905        }
9906        pub fn with_interceptor<F>(
9907            inner: T,
9908            interceptor: F,
9909        ) -> InterceptedService<Self, F>
9910        where
9911            F: tonic::service::Interceptor,
9912        {
9913            InterceptedService::new(Self::new(inner), interceptor)
9914        }
9915        /// Enable decompressing requests with the given encoding.
9916        #[must_use]
9917        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9918            self.accept_compression_encodings.enable(encoding);
9919            self
9920        }
9921        /// Compress responses with the given encoding, if the client supports it.
9922        #[must_use]
9923        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9924            self.send_compression_encodings.enable(encoding);
9925            self
9926        }
9927        /// Limits the maximum size of a decoded message.
9928        ///
9929        /// Default: `4MB`
9930        #[must_use]
9931        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9932            self.max_decoding_message_size = Some(limit);
9933            self
9934        }
9935        /// Limits the maximum size of an encoded message.
9936        ///
9937        /// Default: `usize::MAX`
9938        #[must_use]
9939        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9940            self.max_encoding_message_size = Some(limit);
9941            self
9942        }
9943    }
9944    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
9945    where
9946        T: RenderService,
9947        B: Body + std::marker::Send + 'static,
9948        B::Error: Into<StdError> + std::marker::Send + 'static,
9949    {
9950        type Response = http::Response<tonic::body::Body>;
9951        type Error = std::convert::Infallible;
9952        type Future = BoxFuture<Self::Response, Self::Error>;
9953        fn poll_ready(
9954            &mut self,
9955            _cx: &mut Context<'_>,
9956        ) -> Poll<std::result::Result<(), Self::Error>> {
9957            Poll::Ready(Ok(()))
9958        }
9959        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9960            match req.uri().path() {
9961                "/pidgr.v1.RenderService/RenderBatch" => {
9962                    #[allow(non_camel_case_types)]
9963                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
9964                    impl<
9965                        T: RenderService,
9966                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
9967                    for RenderBatchSvc<T> {
9968                        type Response = super::RenderBatchResponse;
9969                        type ResponseStream = T::RenderBatchStream;
9970                        type Future = BoxFuture<
9971                            tonic::Response<Self::ResponseStream>,
9972                            tonic::Status,
9973                        >;
9974                        fn call(
9975                            &mut self,
9976                            request: tonic::Request<super::RenderBatchRequest>,
9977                        ) -> Self::Future {
9978                            let inner = Arc::clone(&self.0);
9979                            let fut = async move {
9980                                <T as RenderService>::render_batch(&inner, request).await
9981                            };
9982                            Box::pin(fut)
9983                        }
9984                    }
9985                    let accept_compression_encodings = self.accept_compression_encodings;
9986                    let send_compression_encodings = self.send_compression_encodings;
9987                    let max_decoding_message_size = self.max_decoding_message_size;
9988                    let max_encoding_message_size = self.max_encoding_message_size;
9989                    let inner = self.inner.clone();
9990                    let fut = async move {
9991                        let method = RenderBatchSvc(inner);
9992                        let codec = tonic_prost::ProstCodec::default();
9993                        let mut grpc = tonic::server::Grpc::new(codec)
9994                            .apply_compression_config(
9995                                accept_compression_encodings,
9996                                send_compression_encodings,
9997                            )
9998                            .apply_max_message_size_config(
9999                                max_decoding_message_size,
10000                                max_encoding_message_size,
10001                            );
10002                        let res = grpc.server_streaming(method, req).await;
10003                        Ok(res)
10004                    };
10005                    Box::pin(fut)
10006                }
10007                _ => {
10008                    Box::pin(async move {
10009                        let mut response = http::Response::new(
10010                            tonic::body::Body::default(),
10011                        );
10012                        let headers = response.headers_mut();
10013                        headers
10014                            .insert(
10015                                tonic::Status::GRPC_STATUS,
10016                                (tonic::Code::Unimplemented as i32).into(),
10017                            );
10018                        headers
10019                            .insert(
10020                                http::header::CONTENT_TYPE,
10021                                tonic::metadata::GRPC_CONTENT_TYPE,
10022                            );
10023                        Ok(response)
10024                    })
10025                }
10026            }
10027        }
10028    }
10029    impl<T> Clone for RenderServiceServer<T> {
10030        fn clone(&self) -> Self {
10031            let inner = self.inner.clone();
10032            Self {
10033                inner,
10034                accept_compression_encodings: self.accept_compression_encodings,
10035                send_compression_encodings: self.send_compression_encodings,
10036                max_decoding_message_size: self.max_decoding_message_size,
10037                max_encoding_message_size: self.max_encoding_message_size,
10038            }
10039        }
10040    }
10041    /// Generated gRPC service name
10042    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
10043    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
10044        const NAME: &'static str = SERVICE_NAME;
10045    }
10046}
10047/// Generated client implementations.
10048pub mod replay_service_client {
10049    #![allow(
10050        unused_variables,
10051        dead_code,
10052        missing_docs,
10053        clippy::wildcard_imports,
10054        clippy::let_unit_value,
10055    )]
10056    use tonic::codegen::*;
10057    use tonic::codegen::http::Uri;
10058    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10059 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10060*/
10061    #[derive(Debug, Clone)]
10062    pub struct ReplayServiceClient<T> {
10063        inner: tonic::client::Grpc<T>,
10064    }
10065    impl ReplayServiceClient<tonic::transport::Channel> {
10066        /// Attempt to create a new client by connecting to a given endpoint.
10067        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10068        where
10069            D: TryInto<tonic::transport::Endpoint>,
10070            D::Error: Into<StdError>,
10071        {
10072            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10073            Ok(Self::new(conn))
10074        }
10075    }
10076    impl<T> ReplayServiceClient<T>
10077    where
10078        T: tonic::client::GrpcService<tonic::body::Body>,
10079        T::Error: Into<StdError>,
10080        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10081        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10082    {
10083        pub fn new(inner: T) -> Self {
10084            let inner = tonic::client::Grpc::new(inner);
10085            Self { inner }
10086        }
10087        pub fn with_origin(inner: T, origin: Uri) -> Self {
10088            let inner = tonic::client::Grpc::with_origin(inner, origin);
10089            Self { inner }
10090        }
10091        pub fn with_interceptor<F>(
10092            inner: T,
10093            interceptor: F,
10094        ) -> ReplayServiceClient<InterceptedService<T, F>>
10095        where
10096            F: tonic::service::Interceptor,
10097            T::ResponseBody: Default,
10098            T: tonic::codegen::Service<
10099                http::Request<tonic::body::Body>,
10100                Response = http::Response<
10101                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10102                >,
10103            >,
10104            <T as tonic::codegen::Service<
10105                http::Request<tonic::body::Body>,
10106            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10107        {
10108            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
10109        }
10110        /// Compress requests with the given encoding.
10111        ///
10112        /// This requires the server to support it otherwise it might respond with an
10113        /// error.
10114        #[must_use]
10115        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10116            self.inner = self.inner.send_compressed(encoding);
10117            self
10118        }
10119        /// Enable decompressing responses.
10120        #[must_use]
10121        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10122            self.inner = self.inner.accept_compressed(encoding);
10123            self
10124        }
10125        /// Limits the maximum size of a decoded message.
10126        ///
10127        /// Default: `4MB`
10128        #[must_use]
10129        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10130            self.inner = self.inner.max_decoding_message_size(limit);
10131            self
10132        }
10133        /// Limits the maximum size of an encoded message.
10134        ///
10135        /// Default: `usize::MAX`
10136        #[must_use]
10137        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10138            self.inner = self.inner.max_encoding_message_size(limit);
10139            self
10140        }
10141        /** List recent session recordings with optional campaign and time range filters.
10142 Authorization: Requires CAMPAIGNS_READ permission.
10143*/
10144        pub async fn list_session_recordings(
10145            &mut self,
10146            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
10147        ) -> std::result::Result<
10148            tonic::Response<super::ListSessionRecordingsResponse>,
10149            tonic::Status,
10150        > {
10151            self.inner
10152                .ready()
10153                .await
10154                .map_err(|e| {
10155                    tonic::Status::unknown(
10156                        format!("Service was not ready: {}", e.into()),
10157                    )
10158                })?;
10159            let codec = tonic_prost::ProstCodec::default();
10160            let path = http::uri::PathAndQuery::from_static(
10161                "/pidgr.v1.ReplayService/ListSessionRecordings",
10162            );
10163            let mut req = request.into_request();
10164            req.extensions_mut()
10165                .insert(
10166                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
10167                );
10168            self.inner.unary(req, path, codec).await
10169        }
10170        /** Fetch the full rrweb snapshot data for a single recording.
10171 Authorization: Requires CAMPAIGNS_READ permission.
10172*/
10173        pub async fn get_session_snapshots(
10174            &mut self,
10175            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
10176        ) -> std::result::Result<
10177            tonic::Response<super::GetSessionSnapshotsResponse>,
10178            tonic::Status,
10179        > {
10180            self.inner
10181                .ready()
10182                .await
10183                .map_err(|e| {
10184                    tonic::Status::unknown(
10185                        format!("Service was not ready: {}", e.into()),
10186                    )
10187                })?;
10188            let codec = tonic_prost::ProstCodec::default();
10189            let path = http::uri::PathAndQuery::from_static(
10190                "/pidgr.v1.ReplayService/GetSessionSnapshots",
10191            );
10192            let mut req = request.into_request();
10193            req.extensions_mut()
10194                .insert(
10195                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
10196                );
10197            self.inner.unary(req, path, codec).await
10198        }
10199    }
10200}
10201/// Generated server implementations.
10202pub mod replay_service_server {
10203    #![allow(
10204        unused_variables,
10205        dead_code,
10206        missing_docs,
10207        clippy::wildcard_imports,
10208        clippy::let_unit_value,
10209    )]
10210    use tonic::codegen::*;
10211    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
10212    #[async_trait]
10213    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
10214        /** List recent session recordings with optional campaign and time range filters.
10215 Authorization: Requires CAMPAIGNS_READ permission.
10216*/
10217        async fn list_session_recordings(
10218            &self,
10219            request: tonic::Request<super::ListSessionRecordingsRequest>,
10220        ) -> std::result::Result<
10221            tonic::Response<super::ListSessionRecordingsResponse>,
10222            tonic::Status,
10223        >;
10224        /** Fetch the full rrweb snapshot data for a single recording.
10225 Authorization: Requires CAMPAIGNS_READ permission.
10226*/
10227        async fn get_session_snapshots(
10228            &self,
10229            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10230        ) -> std::result::Result<
10231            tonic::Response<super::GetSessionSnapshotsResponse>,
10232            tonic::Status,
10233        >;
10234    }
10235    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10236 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10237*/
10238    #[derive(Debug)]
10239    pub struct ReplayServiceServer<T> {
10240        inner: Arc<T>,
10241        accept_compression_encodings: EnabledCompressionEncodings,
10242        send_compression_encodings: EnabledCompressionEncodings,
10243        max_decoding_message_size: Option<usize>,
10244        max_encoding_message_size: Option<usize>,
10245    }
10246    impl<T> ReplayServiceServer<T> {
10247        pub fn new(inner: T) -> Self {
10248            Self::from_arc(Arc::new(inner))
10249        }
10250        pub fn from_arc(inner: Arc<T>) -> Self {
10251            Self {
10252                inner,
10253                accept_compression_encodings: Default::default(),
10254                send_compression_encodings: Default::default(),
10255                max_decoding_message_size: None,
10256                max_encoding_message_size: None,
10257            }
10258        }
10259        pub fn with_interceptor<F>(
10260            inner: T,
10261            interceptor: F,
10262        ) -> InterceptedService<Self, F>
10263        where
10264            F: tonic::service::Interceptor,
10265        {
10266            InterceptedService::new(Self::new(inner), interceptor)
10267        }
10268        /// Enable decompressing requests with the given encoding.
10269        #[must_use]
10270        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10271            self.accept_compression_encodings.enable(encoding);
10272            self
10273        }
10274        /// Compress responses with the given encoding, if the client supports it.
10275        #[must_use]
10276        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10277            self.send_compression_encodings.enable(encoding);
10278            self
10279        }
10280        /// Limits the maximum size of a decoded message.
10281        ///
10282        /// Default: `4MB`
10283        #[must_use]
10284        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10285            self.max_decoding_message_size = Some(limit);
10286            self
10287        }
10288        /// Limits the maximum size of an encoded message.
10289        ///
10290        /// Default: `usize::MAX`
10291        #[must_use]
10292        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10293            self.max_encoding_message_size = Some(limit);
10294            self
10295        }
10296    }
10297    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
10298    where
10299        T: ReplayService,
10300        B: Body + std::marker::Send + 'static,
10301        B::Error: Into<StdError> + std::marker::Send + 'static,
10302    {
10303        type Response = http::Response<tonic::body::Body>;
10304        type Error = std::convert::Infallible;
10305        type Future = BoxFuture<Self::Response, Self::Error>;
10306        fn poll_ready(
10307            &mut self,
10308            _cx: &mut Context<'_>,
10309        ) -> Poll<std::result::Result<(), Self::Error>> {
10310            Poll::Ready(Ok(()))
10311        }
10312        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10313            match req.uri().path() {
10314                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
10315                    #[allow(non_camel_case_types)]
10316                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
10317                    impl<
10318                        T: ReplayService,
10319                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
10320                    for ListSessionRecordingsSvc<T> {
10321                        type Response = super::ListSessionRecordingsResponse;
10322                        type Future = BoxFuture<
10323                            tonic::Response<Self::Response>,
10324                            tonic::Status,
10325                        >;
10326                        fn call(
10327                            &mut self,
10328                            request: tonic::Request<super::ListSessionRecordingsRequest>,
10329                        ) -> Self::Future {
10330                            let inner = Arc::clone(&self.0);
10331                            let fut = async move {
10332                                <T as ReplayService>::list_session_recordings(
10333                                        &inner,
10334                                        request,
10335                                    )
10336                                    .await
10337                            };
10338                            Box::pin(fut)
10339                        }
10340                    }
10341                    let accept_compression_encodings = self.accept_compression_encodings;
10342                    let send_compression_encodings = self.send_compression_encodings;
10343                    let max_decoding_message_size = self.max_decoding_message_size;
10344                    let max_encoding_message_size = self.max_encoding_message_size;
10345                    let inner = self.inner.clone();
10346                    let fut = async move {
10347                        let method = ListSessionRecordingsSvc(inner);
10348                        let codec = tonic_prost::ProstCodec::default();
10349                        let mut grpc = tonic::server::Grpc::new(codec)
10350                            .apply_compression_config(
10351                                accept_compression_encodings,
10352                                send_compression_encodings,
10353                            )
10354                            .apply_max_message_size_config(
10355                                max_decoding_message_size,
10356                                max_encoding_message_size,
10357                            );
10358                        let res = grpc.unary(method, req).await;
10359                        Ok(res)
10360                    };
10361                    Box::pin(fut)
10362                }
10363                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
10364                    #[allow(non_camel_case_types)]
10365                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
10366                    impl<
10367                        T: ReplayService,
10368                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
10369                    for GetSessionSnapshotsSvc<T> {
10370                        type Response = super::GetSessionSnapshotsResponse;
10371                        type Future = BoxFuture<
10372                            tonic::Response<Self::Response>,
10373                            tonic::Status,
10374                        >;
10375                        fn call(
10376                            &mut self,
10377                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10378                        ) -> Self::Future {
10379                            let inner = Arc::clone(&self.0);
10380                            let fut = async move {
10381                                <T as ReplayService>::get_session_snapshots(&inner, request)
10382                                    .await
10383                            };
10384                            Box::pin(fut)
10385                        }
10386                    }
10387                    let accept_compression_encodings = self.accept_compression_encodings;
10388                    let send_compression_encodings = self.send_compression_encodings;
10389                    let max_decoding_message_size = self.max_decoding_message_size;
10390                    let max_encoding_message_size = self.max_encoding_message_size;
10391                    let inner = self.inner.clone();
10392                    let fut = async move {
10393                        let method = GetSessionSnapshotsSvc(inner);
10394                        let codec = tonic_prost::ProstCodec::default();
10395                        let mut grpc = tonic::server::Grpc::new(codec)
10396                            .apply_compression_config(
10397                                accept_compression_encodings,
10398                                send_compression_encodings,
10399                            )
10400                            .apply_max_message_size_config(
10401                                max_decoding_message_size,
10402                                max_encoding_message_size,
10403                            );
10404                        let res = grpc.unary(method, req).await;
10405                        Ok(res)
10406                    };
10407                    Box::pin(fut)
10408                }
10409                _ => {
10410                    Box::pin(async move {
10411                        let mut response = http::Response::new(
10412                            tonic::body::Body::default(),
10413                        );
10414                        let headers = response.headers_mut();
10415                        headers
10416                            .insert(
10417                                tonic::Status::GRPC_STATUS,
10418                                (tonic::Code::Unimplemented as i32).into(),
10419                            );
10420                        headers
10421                            .insert(
10422                                http::header::CONTENT_TYPE,
10423                                tonic::metadata::GRPC_CONTENT_TYPE,
10424                            );
10425                        Ok(response)
10426                    })
10427                }
10428            }
10429        }
10430    }
10431    impl<T> Clone for ReplayServiceServer<T> {
10432        fn clone(&self) -> Self {
10433            let inner = self.inner.clone();
10434            Self {
10435                inner,
10436                accept_compression_encodings: self.accept_compression_encodings,
10437                send_compression_encodings: self.send_compression_encodings,
10438                max_decoding_message_size: self.max_decoding_message_size,
10439                max_encoding_message_size: self.max_encoding_message_size,
10440            }
10441        }
10442    }
10443    /// Generated gRPC service name
10444    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
10445    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
10446        const NAME: &'static str = SERVICE_NAME;
10447    }
10448}
10449/// Generated client implementations.
10450pub mod role_service_client {
10451    #![allow(
10452        unused_variables,
10453        dead_code,
10454        missing_docs,
10455        clippy::wildcard_imports,
10456        clippy::let_unit_value,
10457    )]
10458    use tonic::codegen::*;
10459    use tonic::codegen::http::Uri;
10460    /** Manages roles and their permissions within an organization.
10461 All RPCs operate within the caller's org (extracted from JWT).
10462*/
10463    #[derive(Debug, Clone)]
10464    pub struct RoleServiceClient<T> {
10465        inner: tonic::client::Grpc<T>,
10466    }
10467    impl RoleServiceClient<tonic::transport::Channel> {
10468        /// Attempt to create a new client by connecting to a given endpoint.
10469        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10470        where
10471            D: TryInto<tonic::transport::Endpoint>,
10472            D::Error: Into<StdError>,
10473        {
10474            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10475            Ok(Self::new(conn))
10476        }
10477    }
10478    impl<T> RoleServiceClient<T>
10479    where
10480        T: tonic::client::GrpcService<tonic::body::Body>,
10481        T::Error: Into<StdError>,
10482        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10483        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10484    {
10485        pub fn new(inner: T) -> Self {
10486            let inner = tonic::client::Grpc::new(inner);
10487            Self { inner }
10488        }
10489        pub fn with_origin(inner: T, origin: Uri) -> Self {
10490            let inner = tonic::client::Grpc::with_origin(inner, origin);
10491            Self { inner }
10492        }
10493        pub fn with_interceptor<F>(
10494            inner: T,
10495            interceptor: F,
10496        ) -> RoleServiceClient<InterceptedService<T, F>>
10497        where
10498            F: tonic::service::Interceptor,
10499            T::ResponseBody: Default,
10500            T: tonic::codegen::Service<
10501                http::Request<tonic::body::Body>,
10502                Response = http::Response<
10503                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10504                >,
10505            >,
10506            <T as tonic::codegen::Service<
10507                http::Request<tonic::body::Body>,
10508            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10509        {
10510            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
10511        }
10512        /// Compress requests with the given encoding.
10513        ///
10514        /// This requires the server to support it otherwise it might respond with an
10515        /// error.
10516        #[must_use]
10517        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10518            self.inner = self.inner.send_compressed(encoding);
10519            self
10520        }
10521        /// Enable decompressing responses.
10522        #[must_use]
10523        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10524            self.inner = self.inner.accept_compressed(encoding);
10525            self
10526        }
10527        /// Limits the maximum size of a decoded message.
10528        ///
10529        /// Default: `4MB`
10530        #[must_use]
10531        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10532            self.inner = self.inner.max_decoding_message_size(limit);
10533            self
10534        }
10535        /// Limits the maximum size of an encoded message.
10536        ///
10537        /// Default: `usize::MAX`
10538        #[must_use]
10539        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10540            self.inner = self.inner.max_encoding_message_size(limit);
10541            self
10542        }
10543        /** List all roles in the organization with their permission sets.
10544 Authorization: Requires PERMISSION_ORG_READ.
10545*/
10546        pub async fn list_roles(
10547            &mut self,
10548            request: impl tonic::IntoRequest<super::ListRolesRequest>,
10549        ) -> std::result::Result<
10550            tonic::Response<super::ListRolesResponse>,
10551            tonic::Status,
10552        > {
10553            self.inner
10554                .ready()
10555                .await
10556                .map_err(|e| {
10557                    tonic::Status::unknown(
10558                        format!("Service was not ready: {}", e.into()),
10559                    )
10560                })?;
10561            let codec = tonic_prost::ProstCodec::default();
10562            let path = http::uri::PathAndQuery::from_static(
10563                "/pidgr.v1.RoleService/ListRoles",
10564            );
10565            let mut req = request.into_request();
10566            req.extensions_mut()
10567                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
10568            self.inner.unary(req, path, codec).await
10569        }
10570        /** Create a new custom role with a name and initial permissions.
10571 Slug is auto-generated from the name and immutable after creation.
10572 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10573*/
10574        pub async fn create_role(
10575            &mut self,
10576            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
10577        ) -> std::result::Result<
10578            tonic::Response<super::CreateRoleResponse>,
10579            tonic::Status,
10580        > {
10581            self.inner
10582                .ready()
10583                .await
10584                .map_err(|e| {
10585                    tonic::Status::unknown(
10586                        format!("Service was not ready: {}", e.into()),
10587                    )
10588                })?;
10589            let codec = tonic_prost::ProstCodec::default();
10590            let path = http::uri::PathAndQuery::from_static(
10591                "/pidgr.v1.RoleService/CreateRole",
10592            );
10593            let mut req = request.into_request();
10594            req.extensions_mut()
10595                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
10596            self.inner.unary(req, path, codec).await
10597        }
10598        /** Update a role's name and/or permissions.
10599 System roles (is_system=true) cannot be updated.
10600 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10601*/
10602        pub async fn update_role(
10603            &mut self,
10604            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
10605        ) -> std::result::Result<
10606            tonic::Response<super::UpdateRoleResponse>,
10607            tonic::Status,
10608        > {
10609            self.inner
10610                .ready()
10611                .await
10612                .map_err(|e| {
10613                    tonic::Status::unknown(
10614                        format!("Service was not ready: {}", e.into()),
10615                    )
10616                })?;
10617            let codec = tonic_prost::ProstCodec::default();
10618            let path = http::uri::PathAndQuery::from_static(
10619                "/pidgr.v1.RoleService/UpdateRole",
10620            );
10621            let mut req = request.into_request();
10622            req.extensions_mut()
10623                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
10624            self.inner.unary(req, path, codec).await
10625        }
10626        /** Delete a role. Fails if any users are assigned to it.
10627 System roles (is_system=true) cannot be deleted.
10628 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10629*/
10630        pub async fn delete_role(
10631            &mut self,
10632            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
10633        ) -> std::result::Result<
10634            tonic::Response<super::DeleteRoleResponse>,
10635            tonic::Status,
10636        > {
10637            self.inner
10638                .ready()
10639                .await
10640                .map_err(|e| {
10641                    tonic::Status::unknown(
10642                        format!("Service was not ready: {}", e.into()),
10643                    )
10644                })?;
10645            let codec = tonic_prost::ProstCodec::default();
10646            let path = http::uri::PathAndQuery::from_static(
10647                "/pidgr.v1.RoleService/DeleteRole",
10648            );
10649            let mut req = request.into_request();
10650            req.extensions_mut()
10651                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
10652            self.inner.unary(req, path, codec).await
10653        }
10654    }
10655}
10656/// Generated server implementations.
10657pub mod role_service_server {
10658    #![allow(
10659        unused_variables,
10660        dead_code,
10661        missing_docs,
10662        clippy::wildcard_imports,
10663        clippy::let_unit_value,
10664    )]
10665    use tonic::codegen::*;
10666    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
10667    #[async_trait]
10668    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
10669        /** List all roles in the organization with their permission sets.
10670 Authorization: Requires PERMISSION_ORG_READ.
10671*/
10672        async fn list_roles(
10673            &self,
10674            request: tonic::Request<super::ListRolesRequest>,
10675        ) -> std::result::Result<
10676            tonic::Response<super::ListRolesResponse>,
10677            tonic::Status,
10678        >;
10679        /** Create a new custom role with a name and initial permissions.
10680 Slug is auto-generated from the name and immutable after creation.
10681 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10682*/
10683        async fn create_role(
10684            &self,
10685            request: tonic::Request<super::CreateRoleRequest>,
10686        ) -> std::result::Result<
10687            tonic::Response<super::CreateRoleResponse>,
10688            tonic::Status,
10689        >;
10690        /** Update a role's name and/or permissions.
10691 System roles (is_system=true) cannot be updated.
10692 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10693*/
10694        async fn update_role(
10695            &self,
10696            request: tonic::Request<super::UpdateRoleRequest>,
10697        ) -> std::result::Result<
10698            tonic::Response<super::UpdateRoleResponse>,
10699            tonic::Status,
10700        >;
10701        /** Delete a role. Fails if any users are assigned to it.
10702 System roles (is_system=true) cannot be deleted.
10703 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10704*/
10705        async fn delete_role(
10706            &self,
10707            request: tonic::Request<super::DeleteRoleRequest>,
10708        ) -> std::result::Result<
10709            tonic::Response<super::DeleteRoleResponse>,
10710            tonic::Status,
10711        >;
10712    }
10713    /** Manages roles and their permissions within an organization.
10714 All RPCs operate within the caller's org (extracted from JWT).
10715*/
10716    #[derive(Debug)]
10717    pub struct RoleServiceServer<T> {
10718        inner: Arc<T>,
10719        accept_compression_encodings: EnabledCompressionEncodings,
10720        send_compression_encodings: EnabledCompressionEncodings,
10721        max_decoding_message_size: Option<usize>,
10722        max_encoding_message_size: Option<usize>,
10723    }
10724    impl<T> RoleServiceServer<T> {
10725        pub fn new(inner: T) -> Self {
10726            Self::from_arc(Arc::new(inner))
10727        }
10728        pub fn from_arc(inner: Arc<T>) -> Self {
10729            Self {
10730                inner,
10731                accept_compression_encodings: Default::default(),
10732                send_compression_encodings: Default::default(),
10733                max_decoding_message_size: None,
10734                max_encoding_message_size: None,
10735            }
10736        }
10737        pub fn with_interceptor<F>(
10738            inner: T,
10739            interceptor: F,
10740        ) -> InterceptedService<Self, F>
10741        where
10742            F: tonic::service::Interceptor,
10743        {
10744            InterceptedService::new(Self::new(inner), interceptor)
10745        }
10746        /// Enable decompressing requests with the given encoding.
10747        #[must_use]
10748        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10749            self.accept_compression_encodings.enable(encoding);
10750            self
10751        }
10752        /// Compress responses with the given encoding, if the client supports it.
10753        #[must_use]
10754        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10755            self.send_compression_encodings.enable(encoding);
10756            self
10757        }
10758        /// Limits the maximum size of a decoded message.
10759        ///
10760        /// Default: `4MB`
10761        #[must_use]
10762        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10763            self.max_decoding_message_size = Some(limit);
10764            self
10765        }
10766        /// Limits the maximum size of an encoded message.
10767        ///
10768        /// Default: `usize::MAX`
10769        #[must_use]
10770        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10771            self.max_encoding_message_size = Some(limit);
10772            self
10773        }
10774    }
10775    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
10776    where
10777        T: RoleService,
10778        B: Body + std::marker::Send + 'static,
10779        B::Error: Into<StdError> + std::marker::Send + 'static,
10780    {
10781        type Response = http::Response<tonic::body::Body>;
10782        type Error = std::convert::Infallible;
10783        type Future = BoxFuture<Self::Response, Self::Error>;
10784        fn poll_ready(
10785            &mut self,
10786            _cx: &mut Context<'_>,
10787        ) -> Poll<std::result::Result<(), Self::Error>> {
10788            Poll::Ready(Ok(()))
10789        }
10790        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10791            match req.uri().path() {
10792                "/pidgr.v1.RoleService/ListRoles" => {
10793                    #[allow(non_camel_case_types)]
10794                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
10795                    impl<
10796                        T: RoleService,
10797                    > tonic::server::UnaryService<super::ListRolesRequest>
10798                    for ListRolesSvc<T> {
10799                        type Response = super::ListRolesResponse;
10800                        type Future = BoxFuture<
10801                            tonic::Response<Self::Response>,
10802                            tonic::Status,
10803                        >;
10804                        fn call(
10805                            &mut self,
10806                            request: tonic::Request<super::ListRolesRequest>,
10807                        ) -> Self::Future {
10808                            let inner = Arc::clone(&self.0);
10809                            let fut = async move {
10810                                <T as RoleService>::list_roles(&inner, request).await
10811                            };
10812                            Box::pin(fut)
10813                        }
10814                    }
10815                    let accept_compression_encodings = self.accept_compression_encodings;
10816                    let send_compression_encodings = self.send_compression_encodings;
10817                    let max_decoding_message_size = self.max_decoding_message_size;
10818                    let max_encoding_message_size = self.max_encoding_message_size;
10819                    let inner = self.inner.clone();
10820                    let fut = async move {
10821                        let method = ListRolesSvc(inner);
10822                        let codec = tonic_prost::ProstCodec::default();
10823                        let mut grpc = tonic::server::Grpc::new(codec)
10824                            .apply_compression_config(
10825                                accept_compression_encodings,
10826                                send_compression_encodings,
10827                            )
10828                            .apply_max_message_size_config(
10829                                max_decoding_message_size,
10830                                max_encoding_message_size,
10831                            );
10832                        let res = grpc.unary(method, req).await;
10833                        Ok(res)
10834                    };
10835                    Box::pin(fut)
10836                }
10837                "/pidgr.v1.RoleService/CreateRole" => {
10838                    #[allow(non_camel_case_types)]
10839                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
10840                    impl<
10841                        T: RoleService,
10842                    > tonic::server::UnaryService<super::CreateRoleRequest>
10843                    for CreateRoleSvc<T> {
10844                        type Response = super::CreateRoleResponse;
10845                        type Future = BoxFuture<
10846                            tonic::Response<Self::Response>,
10847                            tonic::Status,
10848                        >;
10849                        fn call(
10850                            &mut self,
10851                            request: tonic::Request<super::CreateRoleRequest>,
10852                        ) -> Self::Future {
10853                            let inner = Arc::clone(&self.0);
10854                            let fut = async move {
10855                                <T as RoleService>::create_role(&inner, request).await
10856                            };
10857                            Box::pin(fut)
10858                        }
10859                    }
10860                    let accept_compression_encodings = self.accept_compression_encodings;
10861                    let send_compression_encodings = self.send_compression_encodings;
10862                    let max_decoding_message_size = self.max_decoding_message_size;
10863                    let max_encoding_message_size = self.max_encoding_message_size;
10864                    let inner = self.inner.clone();
10865                    let fut = async move {
10866                        let method = CreateRoleSvc(inner);
10867                        let codec = tonic_prost::ProstCodec::default();
10868                        let mut grpc = tonic::server::Grpc::new(codec)
10869                            .apply_compression_config(
10870                                accept_compression_encodings,
10871                                send_compression_encodings,
10872                            )
10873                            .apply_max_message_size_config(
10874                                max_decoding_message_size,
10875                                max_encoding_message_size,
10876                            );
10877                        let res = grpc.unary(method, req).await;
10878                        Ok(res)
10879                    };
10880                    Box::pin(fut)
10881                }
10882                "/pidgr.v1.RoleService/UpdateRole" => {
10883                    #[allow(non_camel_case_types)]
10884                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
10885                    impl<
10886                        T: RoleService,
10887                    > tonic::server::UnaryService<super::UpdateRoleRequest>
10888                    for UpdateRoleSvc<T> {
10889                        type Response = super::UpdateRoleResponse;
10890                        type Future = BoxFuture<
10891                            tonic::Response<Self::Response>,
10892                            tonic::Status,
10893                        >;
10894                        fn call(
10895                            &mut self,
10896                            request: tonic::Request<super::UpdateRoleRequest>,
10897                        ) -> Self::Future {
10898                            let inner = Arc::clone(&self.0);
10899                            let fut = async move {
10900                                <T as RoleService>::update_role(&inner, request).await
10901                            };
10902                            Box::pin(fut)
10903                        }
10904                    }
10905                    let accept_compression_encodings = self.accept_compression_encodings;
10906                    let send_compression_encodings = self.send_compression_encodings;
10907                    let max_decoding_message_size = self.max_decoding_message_size;
10908                    let max_encoding_message_size = self.max_encoding_message_size;
10909                    let inner = self.inner.clone();
10910                    let fut = async move {
10911                        let method = UpdateRoleSvc(inner);
10912                        let codec = tonic_prost::ProstCodec::default();
10913                        let mut grpc = tonic::server::Grpc::new(codec)
10914                            .apply_compression_config(
10915                                accept_compression_encodings,
10916                                send_compression_encodings,
10917                            )
10918                            .apply_max_message_size_config(
10919                                max_decoding_message_size,
10920                                max_encoding_message_size,
10921                            );
10922                        let res = grpc.unary(method, req).await;
10923                        Ok(res)
10924                    };
10925                    Box::pin(fut)
10926                }
10927                "/pidgr.v1.RoleService/DeleteRole" => {
10928                    #[allow(non_camel_case_types)]
10929                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
10930                    impl<
10931                        T: RoleService,
10932                    > tonic::server::UnaryService<super::DeleteRoleRequest>
10933                    for DeleteRoleSvc<T> {
10934                        type Response = super::DeleteRoleResponse;
10935                        type Future = BoxFuture<
10936                            tonic::Response<Self::Response>,
10937                            tonic::Status,
10938                        >;
10939                        fn call(
10940                            &mut self,
10941                            request: tonic::Request<super::DeleteRoleRequest>,
10942                        ) -> Self::Future {
10943                            let inner = Arc::clone(&self.0);
10944                            let fut = async move {
10945                                <T as RoleService>::delete_role(&inner, request).await
10946                            };
10947                            Box::pin(fut)
10948                        }
10949                    }
10950                    let accept_compression_encodings = self.accept_compression_encodings;
10951                    let send_compression_encodings = self.send_compression_encodings;
10952                    let max_decoding_message_size = self.max_decoding_message_size;
10953                    let max_encoding_message_size = self.max_encoding_message_size;
10954                    let inner = self.inner.clone();
10955                    let fut = async move {
10956                        let method = DeleteRoleSvc(inner);
10957                        let codec = tonic_prost::ProstCodec::default();
10958                        let mut grpc = tonic::server::Grpc::new(codec)
10959                            .apply_compression_config(
10960                                accept_compression_encodings,
10961                                send_compression_encodings,
10962                            )
10963                            .apply_max_message_size_config(
10964                                max_decoding_message_size,
10965                                max_encoding_message_size,
10966                            );
10967                        let res = grpc.unary(method, req).await;
10968                        Ok(res)
10969                    };
10970                    Box::pin(fut)
10971                }
10972                _ => {
10973                    Box::pin(async move {
10974                        let mut response = http::Response::new(
10975                            tonic::body::Body::default(),
10976                        );
10977                        let headers = response.headers_mut();
10978                        headers
10979                            .insert(
10980                                tonic::Status::GRPC_STATUS,
10981                                (tonic::Code::Unimplemented as i32).into(),
10982                            );
10983                        headers
10984                            .insert(
10985                                http::header::CONTENT_TYPE,
10986                                tonic::metadata::GRPC_CONTENT_TYPE,
10987                            );
10988                        Ok(response)
10989                    })
10990                }
10991            }
10992        }
10993    }
10994    impl<T> Clone for RoleServiceServer<T> {
10995        fn clone(&self) -> Self {
10996            let inner = self.inner.clone();
10997            Self {
10998                inner,
10999                accept_compression_encodings: self.accept_compression_encodings,
11000                send_compression_encodings: self.send_compression_encodings,
11001                max_decoding_message_size: self.max_decoding_message_size,
11002                max_encoding_message_size: self.max_encoding_message_size,
11003            }
11004        }
11005    }
11006    /// Generated gRPC service name
11007    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
11008    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
11009        const NAME: &'static str = SERVICE_NAME;
11010    }
11011}
11012/// Generated client implementations.
11013pub mod sso_service_client {
11014    #![allow(
11015        unused_variables,
11016        dead_code,
11017        missing_docs,
11018        clippy::wildcard_imports,
11019        clippy::let_unit_value,
11020    )]
11021    use tonic::codegen::*;
11022    use tonic::codegen::http::Uri;
11023    /** Manages SSO identity provider configuration for organizations.
11024*/
11025    #[derive(Debug, Clone)]
11026    pub struct SsoServiceClient<T> {
11027        inner: tonic::client::Grpc<T>,
11028    }
11029    impl SsoServiceClient<tonic::transport::Channel> {
11030        /// Attempt to create a new client by connecting to a given endpoint.
11031        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11032        where
11033            D: TryInto<tonic::transport::Endpoint>,
11034            D::Error: Into<StdError>,
11035        {
11036            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11037            Ok(Self::new(conn))
11038        }
11039    }
11040    impl<T> SsoServiceClient<T>
11041    where
11042        T: tonic::client::GrpcService<tonic::body::Body>,
11043        T::Error: Into<StdError>,
11044        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11045        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11046    {
11047        pub fn new(inner: T) -> Self {
11048            let inner = tonic::client::Grpc::new(inner);
11049            Self { inner }
11050        }
11051        pub fn with_origin(inner: T, origin: Uri) -> Self {
11052            let inner = tonic::client::Grpc::with_origin(inner, origin);
11053            Self { inner }
11054        }
11055        pub fn with_interceptor<F>(
11056            inner: T,
11057            interceptor: F,
11058        ) -> SsoServiceClient<InterceptedService<T, F>>
11059        where
11060            F: tonic::service::Interceptor,
11061            T::ResponseBody: Default,
11062            T: tonic::codegen::Service<
11063                http::Request<tonic::body::Body>,
11064                Response = http::Response<
11065                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11066                >,
11067            >,
11068            <T as tonic::codegen::Service<
11069                http::Request<tonic::body::Body>,
11070            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11071        {
11072            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
11073        }
11074        /// Compress requests with the given encoding.
11075        ///
11076        /// This requires the server to support it otherwise it might respond with an
11077        /// error.
11078        #[must_use]
11079        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11080            self.inner = self.inner.send_compressed(encoding);
11081            self
11082        }
11083        /// Enable decompressing responses.
11084        #[must_use]
11085        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11086            self.inner = self.inner.accept_compressed(encoding);
11087            self
11088        }
11089        /// Limits the maximum size of a decoded message.
11090        ///
11091        /// Default: `4MB`
11092        #[must_use]
11093        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11094            self.inner = self.inner.max_decoding_message_size(limit);
11095            self
11096        }
11097        /// Limits the maximum size of an encoded message.
11098        ///
11099        /// Default: `usize::MAX`
11100        #[must_use]
11101        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11102            self.inner = self.inner.max_encoding_message_size(limit);
11103            self
11104        }
11105        /** Check if an email domain has SSO configured.
11106 This is a pre-authentication endpoint — no JWT required.
11107 Authorization: None (public).
11108*/
11109        pub async fn check_sso_by_domain(
11110            &mut self,
11111            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
11112        ) -> std::result::Result<
11113            tonic::Response<super::CheckSsoByDomainResponse>,
11114            tonic::Status,
11115        > {
11116            self.inner
11117                .ready()
11118                .await
11119                .map_err(|e| {
11120                    tonic::Status::unknown(
11121                        format!("Service was not ready: {}", e.into()),
11122                    )
11123                })?;
11124            let codec = tonic_prost::ProstCodec::default();
11125            let path = http::uri::PathAndQuery::from_static(
11126                "/pidgr.v1.SSOService/CheckSSOByDomain",
11127            );
11128            let mut req = request.into_request();
11129            req.extensions_mut()
11130                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
11131            self.inner.unary(req, path, codec).await
11132        }
11133        /** Create an SSO provider for the organization.
11134 Validates the metadata URL before saving.
11135 Creates the corresponding identity provider in the auth service.
11136 Authorization: Requires PERMISSION_ORG_WRITE.
11137*/
11138        pub async fn create_sso_provider(
11139            &mut self,
11140            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
11141        ) -> std::result::Result<
11142            tonic::Response<super::CreateSsoProviderResponse>,
11143            tonic::Status,
11144        > {
11145            self.inner
11146                .ready()
11147                .await
11148                .map_err(|e| {
11149                    tonic::Status::unknown(
11150                        format!("Service was not ready: {}", e.into()),
11151                    )
11152                })?;
11153            let codec = tonic_prost::ProstCodec::default();
11154            let path = http::uri::PathAndQuery::from_static(
11155                "/pidgr.v1.SSOService/CreateSSOProvider",
11156            );
11157            let mut req = request.into_request();
11158            req.extensions_mut()
11159                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
11160            self.inner.unary(req, path, codec).await
11161        }
11162        /** Get the organization's SSO provider configuration.
11163 Authorization: Requires PERMISSION_ORG_READ.
11164*/
11165        pub async fn get_sso_provider(
11166            &mut self,
11167            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
11168        ) -> std::result::Result<
11169            tonic::Response<super::GetSsoProviderResponse>,
11170            tonic::Status,
11171        > {
11172            self.inner
11173                .ready()
11174                .await
11175                .map_err(|e| {
11176                    tonic::Status::unknown(
11177                        format!("Service was not ready: {}", e.into()),
11178                    )
11179                })?;
11180            let codec = tonic_prost::ProstCodec::default();
11181            let path = http::uri::PathAndQuery::from_static(
11182                "/pidgr.v1.SSOService/GetSSOProvider",
11183            );
11184            let mut req = request.into_request();
11185            req.extensions_mut()
11186                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
11187            self.inner.unary(req, path, codec).await
11188        }
11189        /** Delete the organization's SSO provider.
11190 Deletes the corresponding identity provider from the auth service.
11191 Users with that domain fall back to passkey/OTP.
11192 Authorization: Requires PERMISSION_ORG_WRITE.
11193*/
11194        pub async fn delete_sso_provider(
11195            &mut self,
11196            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
11197        ) -> std::result::Result<
11198            tonic::Response<super::DeleteSsoProviderResponse>,
11199            tonic::Status,
11200        > {
11201            self.inner
11202                .ready()
11203                .await
11204                .map_err(|e| {
11205                    tonic::Status::unknown(
11206                        format!("Service was not ready: {}", e.into()),
11207                    )
11208                })?;
11209            let codec = tonic_prost::ProstCodec::default();
11210            let path = http::uri::PathAndQuery::from_static(
11211                "/pidgr.v1.SSOService/DeleteSSOProvider",
11212            );
11213            let mut req = request.into_request();
11214            req.extensions_mut()
11215                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
11216            self.inner.unary(req, path, codec).await
11217        }
11218    }
11219}
11220/// Generated server implementations.
11221pub mod sso_service_server {
11222    #![allow(
11223        unused_variables,
11224        dead_code,
11225        missing_docs,
11226        clippy::wildcard_imports,
11227        clippy::let_unit_value,
11228    )]
11229    use tonic::codegen::*;
11230    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
11231    #[async_trait]
11232    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
11233        /** Check if an email domain has SSO configured.
11234 This is a pre-authentication endpoint — no JWT required.
11235 Authorization: None (public).
11236*/
11237        async fn check_sso_by_domain(
11238            &self,
11239            request: tonic::Request<super::CheckSsoByDomainRequest>,
11240        ) -> std::result::Result<
11241            tonic::Response<super::CheckSsoByDomainResponse>,
11242            tonic::Status,
11243        >;
11244        /** Create an SSO provider for the organization.
11245 Validates the metadata URL before saving.
11246 Creates the corresponding identity provider in the auth service.
11247 Authorization: Requires PERMISSION_ORG_WRITE.
11248*/
11249        async fn create_sso_provider(
11250            &self,
11251            request: tonic::Request<super::CreateSsoProviderRequest>,
11252        ) -> std::result::Result<
11253            tonic::Response<super::CreateSsoProviderResponse>,
11254            tonic::Status,
11255        >;
11256        /** Get the organization's SSO provider configuration.
11257 Authorization: Requires PERMISSION_ORG_READ.
11258*/
11259        async fn get_sso_provider(
11260            &self,
11261            request: tonic::Request<super::GetSsoProviderRequest>,
11262        ) -> std::result::Result<
11263            tonic::Response<super::GetSsoProviderResponse>,
11264            tonic::Status,
11265        >;
11266        /** Delete the organization's SSO provider.
11267 Deletes the corresponding identity provider from the auth service.
11268 Users with that domain fall back to passkey/OTP.
11269 Authorization: Requires PERMISSION_ORG_WRITE.
11270*/
11271        async fn delete_sso_provider(
11272            &self,
11273            request: tonic::Request<super::DeleteSsoProviderRequest>,
11274        ) -> std::result::Result<
11275            tonic::Response<super::DeleteSsoProviderResponse>,
11276            tonic::Status,
11277        >;
11278    }
11279    /** Manages SSO identity provider configuration for organizations.
11280*/
11281    #[derive(Debug)]
11282    pub struct SsoServiceServer<T> {
11283        inner: Arc<T>,
11284        accept_compression_encodings: EnabledCompressionEncodings,
11285        send_compression_encodings: EnabledCompressionEncodings,
11286        max_decoding_message_size: Option<usize>,
11287        max_encoding_message_size: Option<usize>,
11288    }
11289    impl<T> SsoServiceServer<T> {
11290        pub fn new(inner: T) -> Self {
11291            Self::from_arc(Arc::new(inner))
11292        }
11293        pub fn from_arc(inner: Arc<T>) -> Self {
11294            Self {
11295                inner,
11296                accept_compression_encodings: Default::default(),
11297                send_compression_encodings: Default::default(),
11298                max_decoding_message_size: None,
11299                max_encoding_message_size: None,
11300            }
11301        }
11302        pub fn with_interceptor<F>(
11303            inner: T,
11304            interceptor: F,
11305        ) -> InterceptedService<Self, F>
11306        where
11307            F: tonic::service::Interceptor,
11308        {
11309            InterceptedService::new(Self::new(inner), interceptor)
11310        }
11311        /// Enable decompressing requests with the given encoding.
11312        #[must_use]
11313        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11314            self.accept_compression_encodings.enable(encoding);
11315            self
11316        }
11317        /// Compress responses with the given encoding, if the client supports it.
11318        #[must_use]
11319        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11320            self.send_compression_encodings.enable(encoding);
11321            self
11322        }
11323        /// Limits the maximum size of a decoded message.
11324        ///
11325        /// Default: `4MB`
11326        #[must_use]
11327        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11328            self.max_decoding_message_size = Some(limit);
11329            self
11330        }
11331        /// Limits the maximum size of an encoded message.
11332        ///
11333        /// Default: `usize::MAX`
11334        #[must_use]
11335        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11336            self.max_encoding_message_size = Some(limit);
11337            self
11338        }
11339    }
11340    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
11341    where
11342        T: SsoService,
11343        B: Body + std::marker::Send + 'static,
11344        B::Error: Into<StdError> + std::marker::Send + 'static,
11345    {
11346        type Response = http::Response<tonic::body::Body>;
11347        type Error = std::convert::Infallible;
11348        type Future = BoxFuture<Self::Response, Self::Error>;
11349        fn poll_ready(
11350            &mut self,
11351            _cx: &mut Context<'_>,
11352        ) -> Poll<std::result::Result<(), Self::Error>> {
11353            Poll::Ready(Ok(()))
11354        }
11355        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11356            match req.uri().path() {
11357                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
11358                    #[allow(non_camel_case_types)]
11359                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
11360                    impl<
11361                        T: SsoService,
11362                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
11363                    for CheckSSOByDomainSvc<T> {
11364                        type Response = super::CheckSsoByDomainResponse;
11365                        type Future = BoxFuture<
11366                            tonic::Response<Self::Response>,
11367                            tonic::Status,
11368                        >;
11369                        fn call(
11370                            &mut self,
11371                            request: tonic::Request<super::CheckSsoByDomainRequest>,
11372                        ) -> Self::Future {
11373                            let inner = Arc::clone(&self.0);
11374                            let fut = async move {
11375                                <T as SsoService>::check_sso_by_domain(&inner, request)
11376                                    .await
11377                            };
11378                            Box::pin(fut)
11379                        }
11380                    }
11381                    let accept_compression_encodings = self.accept_compression_encodings;
11382                    let send_compression_encodings = self.send_compression_encodings;
11383                    let max_decoding_message_size = self.max_decoding_message_size;
11384                    let max_encoding_message_size = self.max_encoding_message_size;
11385                    let inner = self.inner.clone();
11386                    let fut = async move {
11387                        let method = CheckSSOByDomainSvc(inner);
11388                        let codec = tonic_prost::ProstCodec::default();
11389                        let mut grpc = tonic::server::Grpc::new(codec)
11390                            .apply_compression_config(
11391                                accept_compression_encodings,
11392                                send_compression_encodings,
11393                            )
11394                            .apply_max_message_size_config(
11395                                max_decoding_message_size,
11396                                max_encoding_message_size,
11397                            );
11398                        let res = grpc.unary(method, req).await;
11399                        Ok(res)
11400                    };
11401                    Box::pin(fut)
11402                }
11403                "/pidgr.v1.SSOService/CreateSSOProvider" => {
11404                    #[allow(non_camel_case_types)]
11405                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
11406                    impl<
11407                        T: SsoService,
11408                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
11409                    for CreateSSOProviderSvc<T> {
11410                        type Response = super::CreateSsoProviderResponse;
11411                        type Future = BoxFuture<
11412                            tonic::Response<Self::Response>,
11413                            tonic::Status,
11414                        >;
11415                        fn call(
11416                            &mut self,
11417                            request: tonic::Request<super::CreateSsoProviderRequest>,
11418                        ) -> Self::Future {
11419                            let inner = Arc::clone(&self.0);
11420                            let fut = async move {
11421                                <T as SsoService>::create_sso_provider(&inner, request)
11422                                    .await
11423                            };
11424                            Box::pin(fut)
11425                        }
11426                    }
11427                    let accept_compression_encodings = self.accept_compression_encodings;
11428                    let send_compression_encodings = self.send_compression_encodings;
11429                    let max_decoding_message_size = self.max_decoding_message_size;
11430                    let max_encoding_message_size = self.max_encoding_message_size;
11431                    let inner = self.inner.clone();
11432                    let fut = async move {
11433                        let method = CreateSSOProviderSvc(inner);
11434                        let codec = tonic_prost::ProstCodec::default();
11435                        let mut grpc = tonic::server::Grpc::new(codec)
11436                            .apply_compression_config(
11437                                accept_compression_encodings,
11438                                send_compression_encodings,
11439                            )
11440                            .apply_max_message_size_config(
11441                                max_decoding_message_size,
11442                                max_encoding_message_size,
11443                            );
11444                        let res = grpc.unary(method, req).await;
11445                        Ok(res)
11446                    };
11447                    Box::pin(fut)
11448                }
11449                "/pidgr.v1.SSOService/GetSSOProvider" => {
11450                    #[allow(non_camel_case_types)]
11451                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
11452                    impl<
11453                        T: SsoService,
11454                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
11455                    for GetSSOProviderSvc<T> {
11456                        type Response = super::GetSsoProviderResponse;
11457                        type Future = BoxFuture<
11458                            tonic::Response<Self::Response>,
11459                            tonic::Status,
11460                        >;
11461                        fn call(
11462                            &mut self,
11463                            request: tonic::Request<super::GetSsoProviderRequest>,
11464                        ) -> Self::Future {
11465                            let inner = Arc::clone(&self.0);
11466                            let fut = async move {
11467                                <T as SsoService>::get_sso_provider(&inner, request).await
11468                            };
11469                            Box::pin(fut)
11470                        }
11471                    }
11472                    let accept_compression_encodings = self.accept_compression_encodings;
11473                    let send_compression_encodings = self.send_compression_encodings;
11474                    let max_decoding_message_size = self.max_decoding_message_size;
11475                    let max_encoding_message_size = self.max_encoding_message_size;
11476                    let inner = self.inner.clone();
11477                    let fut = async move {
11478                        let method = GetSSOProviderSvc(inner);
11479                        let codec = tonic_prost::ProstCodec::default();
11480                        let mut grpc = tonic::server::Grpc::new(codec)
11481                            .apply_compression_config(
11482                                accept_compression_encodings,
11483                                send_compression_encodings,
11484                            )
11485                            .apply_max_message_size_config(
11486                                max_decoding_message_size,
11487                                max_encoding_message_size,
11488                            );
11489                        let res = grpc.unary(method, req).await;
11490                        Ok(res)
11491                    };
11492                    Box::pin(fut)
11493                }
11494                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
11495                    #[allow(non_camel_case_types)]
11496                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
11497                    impl<
11498                        T: SsoService,
11499                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
11500                    for DeleteSSOProviderSvc<T> {
11501                        type Response = super::DeleteSsoProviderResponse;
11502                        type Future = BoxFuture<
11503                            tonic::Response<Self::Response>,
11504                            tonic::Status,
11505                        >;
11506                        fn call(
11507                            &mut self,
11508                            request: tonic::Request<super::DeleteSsoProviderRequest>,
11509                        ) -> Self::Future {
11510                            let inner = Arc::clone(&self.0);
11511                            let fut = async move {
11512                                <T as SsoService>::delete_sso_provider(&inner, request)
11513                                    .await
11514                            };
11515                            Box::pin(fut)
11516                        }
11517                    }
11518                    let accept_compression_encodings = self.accept_compression_encodings;
11519                    let send_compression_encodings = self.send_compression_encodings;
11520                    let max_decoding_message_size = self.max_decoding_message_size;
11521                    let max_encoding_message_size = self.max_encoding_message_size;
11522                    let inner = self.inner.clone();
11523                    let fut = async move {
11524                        let method = DeleteSSOProviderSvc(inner);
11525                        let codec = tonic_prost::ProstCodec::default();
11526                        let mut grpc = tonic::server::Grpc::new(codec)
11527                            .apply_compression_config(
11528                                accept_compression_encodings,
11529                                send_compression_encodings,
11530                            )
11531                            .apply_max_message_size_config(
11532                                max_decoding_message_size,
11533                                max_encoding_message_size,
11534                            );
11535                        let res = grpc.unary(method, req).await;
11536                        Ok(res)
11537                    };
11538                    Box::pin(fut)
11539                }
11540                _ => {
11541                    Box::pin(async move {
11542                        let mut response = http::Response::new(
11543                            tonic::body::Body::default(),
11544                        );
11545                        let headers = response.headers_mut();
11546                        headers
11547                            .insert(
11548                                tonic::Status::GRPC_STATUS,
11549                                (tonic::Code::Unimplemented as i32).into(),
11550                            );
11551                        headers
11552                            .insert(
11553                                http::header::CONTENT_TYPE,
11554                                tonic::metadata::GRPC_CONTENT_TYPE,
11555                            );
11556                        Ok(response)
11557                    })
11558                }
11559            }
11560        }
11561    }
11562    impl<T> Clone for SsoServiceServer<T> {
11563        fn clone(&self) -> Self {
11564            let inner = self.inner.clone();
11565            Self {
11566                inner,
11567                accept_compression_encodings: self.accept_compression_encodings,
11568                send_compression_encodings: self.send_compression_encodings,
11569                max_decoding_message_size: self.max_decoding_message_size,
11570                max_encoding_message_size: self.max_encoding_message_size,
11571            }
11572        }
11573    }
11574    /// Generated gRPC service name
11575    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
11576    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
11577        const NAME: &'static str = SERVICE_NAME;
11578    }
11579}
11580/// Generated client implementations.
11581pub mod team_service_client {
11582    #![allow(
11583        unused_variables,
11584        dead_code,
11585        missing_docs,
11586        clippy::wildcard_imports,
11587        clippy::let_unit_value,
11588    )]
11589    use tonic::codegen::*;
11590    use tonic::codegen::http::Uri;
11591    /** Manages organizational teams (departments, divisions) within an organization.
11592 Teams represent the organizational structure and can serve as sender identity.
11593 All RPCs operate within the caller's org (extracted from JWT).
11594*/
11595    #[derive(Debug, Clone)]
11596    pub struct TeamServiceClient<T> {
11597        inner: tonic::client::Grpc<T>,
11598    }
11599    impl TeamServiceClient<tonic::transport::Channel> {
11600        /// Attempt to create a new client by connecting to a given endpoint.
11601        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11602        where
11603            D: TryInto<tonic::transport::Endpoint>,
11604            D::Error: Into<StdError>,
11605        {
11606            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11607            Ok(Self::new(conn))
11608        }
11609    }
11610    impl<T> TeamServiceClient<T>
11611    where
11612        T: tonic::client::GrpcService<tonic::body::Body>,
11613        T::Error: Into<StdError>,
11614        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11615        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11616    {
11617        pub fn new(inner: T) -> Self {
11618            let inner = tonic::client::Grpc::new(inner);
11619            Self { inner }
11620        }
11621        pub fn with_origin(inner: T, origin: Uri) -> Self {
11622            let inner = tonic::client::Grpc::with_origin(inner, origin);
11623            Self { inner }
11624        }
11625        pub fn with_interceptor<F>(
11626            inner: T,
11627            interceptor: F,
11628        ) -> TeamServiceClient<InterceptedService<T, F>>
11629        where
11630            F: tonic::service::Interceptor,
11631            T::ResponseBody: Default,
11632            T: tonic::codegen::Service<
11633                http::Request<tonic::body::Body>,
11634                Response = http::Response<
11635                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11636                >,
11637            >,
11638            <T as tonic::codegen::Service<
11639                http::Request<tonic::body::Body>,
11640            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11641        {
11642            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
11643        }
11644        /// Compress requests with the given encoding.
11645        ///
11646        /// This requires the server to support it otherwise it might respond with an
11647        /// error.
11648        #[must_use]
11649        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11650            self.inner = self.inner.send_compressed(encoding);
11651            self
11652        }
11653        /// Enable decompressing responses.
11654        #[must_use]
11655        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11656            self.inner = self.inner.accept_compressed(encoding);
11657            self
11658        }
11659        /// Limits the maximum size of a decoded message.
11660        ///
11661        /// Default: `4MB`
11662        #[must_use]
11663        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11664            self.inner = self.inner.max_decoding_message_size(limit);
11665            self
11666        }
11667        /// Limits the maximum size of an encoded message.
11668        ///
11669        /// Default: `usize::MAX`
11670        #[must_use]
11671        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11672            self.inner = self.inner.max_encoding_message_size(limit);
11673            self
11674        }
11675        /** Create a new team in the organization.
11676 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11677*/
11678        pub async fn create_team(
11679            &mut self,
11680            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
11681        ) -> std::result::Result<
11682            tonic::Response<super::CreateTeamResponse>,
11683            tonic::Status,
11684        > {
11685            self.inner
11686                .ready()
11687                .await
11688                .map_err(|e| {
11689                    tonic::Status::unknown(
11690                        format!("Service was not ready: {}", e.into()),
11691                    )
11692                })?;
11693            let codec = tonic_prost::ProstCodec::default();
11694            let path = http::uri::PathAndQuery::from_static(
11695                "/pidgr.v1.TeamService/CreateTeam",
11696            );
11697            let mut req = request.into_request();
11698            req.extensions_mut()
11699                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
11700            self.inner.unary(req, path, codec).await
11701        }
11702        /** Retrieve a team by ID.
11703 Authorization: Caller must be a member of the team, or have
11704 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11705*/
11706        pub async fn get_team(
11707            &mut self,
11708            request: impl tonic::IntoRequest<super::GetTeamRequest>,
11709        ) -> std::result::Result<
11710            tonic::Response<super::GetTeamResponse>,
11711            tonic::Status,
11712        > {
11713            self.inner
11714                .ready()
11715                .await
11716                .map_err(|e| {
11717                    tonic::Status::unknown(
11718                        format!("Service was not ready: {}", e.into()),
11719                    )
11720                })?;
11721            let codec = tonic_prost::ProstCodec::default();
11722            let path = http::uri::PathAndQuery::from_static(
11723                "/pidgr.v1.TeamService/GetTeam",
11724            );
11725            let mut req = request.into_request();
11726            req.extensions_mut()
11727                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
11728            self.inner.unary(req, path, codec).await
11729        }
11730        /** List teams in the organization with pagination.
11731 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
11732*/
11733        pub async fn list_teams(
11734            &mut self,
11735            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
11736        ) -> std::result::Result<
11737            tonic::Response<super::ListTeamsResponse>,
11738            tonic::Status,
11739        > {
11740            self.inner
11741                .ready()
11742                .await
11743                .map_err(|e| {
11744                    tonic::Status::unknown(
11745                        format!("Service was not ready: {}", e.into()),
11746                    )
11747                })?;
11748            let codec = tonic_prost::ProstCodec::default();
11749            let path = http::uri::PathAndQuery::from_static(
11750                "/pidgr.v1.TeamService/ListTeams",
11751            );
11752            let mut req = request.into_request();
11753            req.extensions_mut()
11754                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
11755            self.inner.unary(req, path, codec).await
11756        }
11757        /** Update a team's name and/or description.
11758 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11759*/
11760        pub async fn update_team(
11761            &mut self,
11762            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
11763        ) -> std::result::Result<
11764            tonic::Response<super::UpdateTeamResponse>,
11765            tonic::Status,
11766        > {
11767            self.inner
11768                .ready()
11769                .await
11770                .map_err(|e| {
11771                    tonic::Status::unknown(
11772                        format!("Service was not ready: {}", e.into()),
11773                    )
11774                })?;
11775            let codec = tonic_prost::ProstCodec::default();
11776            let path = http::uri::PathAndQuery::from_static(
11777                "/pidgr.v1.TeamService/UpdateTeam",
11778            );
11779            let mut req = request.into_request();
11780            req.extensions_mut()
11781                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
11782            self.inner.unary(req, path, codec).await
11783        }
11784        /** Delete a team and all its membership records. Default teams cannot be deleted.
11785 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11786*/
11787        pub async fn delete_team(
11788            &mut self,
11789            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
11790        ) -> std::result::Result<
11791            tonic::Response<super::DeleteTeamResponse>,
11792            tonic::Status,
11793        > {
11794            self.inner
11795                .ready()
11796                .await
11797                .map_err(|e| {
11798                    tonic::Status::unknown(
11799                        format!("Service was not ready: {}", e.into()),
11800                    )
11801                })?;
11802            let codec = tonic_prost::ProstCodec::default();
11803            let path = http::uri::PathAndQuery::from_static(
11804                "/pidgr.v1.TeamService/DeleteTeam",
11805            );
11806            let mut req = request.into_request();
11807            req.extensions_mut()
11808                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
11809            self.inner.unary(req, path, codec).await
11810        }
11811        /** Add one or more users to a team (idempotent).
11812 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11813*/
11814        pub async fn add_team_members(
11815            &mut self,
11816            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
11817        ) -> std::result::Result<
11818            tonic::Response<super::AddTeamMembersResponse>,
11819            tonic::Status,
11820        > {
11821            self.inner
11822                .ready()
11823                .await
11824                .map_err(|e| {
11825                    tonic::Status::unknown(
11826                        format!("Service was not ready: {}", e.into()),
11827                    )
11828                })?;
11829            let codec = tonic_prost::ProstCodec::default();
11830            let path = http::uri::PathAndQuery::from_static(
11831                "/pidgr.v1.TeamService/AddTeamMembers",
11832            );
11833            let mut req = request.into_request();
11834            req.extensions_mut()
11835                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
11836            self.inner.unary(req, path, codec).await
11837        }
11838        /** Remove one or more users from a team (idempotent).
11839 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11840*/
11841        pub async fn remove_team_members(
11842            &mut self,
11843            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
11844        ) -> std::result::Result<
11845            tonic::Response<super::RemoveTeamMembersResponse>,
11846            tonic::Status,
11847        > {
11848            self.inner
11849                .ready()
11850                .await
11851                .map_err(|e| {
11852                    tonic::Status::unknown(
11853                        format!("Service was not ready: {}", e.into()),
11854                    )
11855                })?;
11856            let codec = tonic_prost::ProstCodec::default();
11857            let path = http::uri::PathAndQuery::from_static(
11858                "/pidgr.v1.TeamService/RemoveTeamMembers",
11859            );
11860            let mut req = request.into_request();
11861            req.extensions_mut()
11862                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
11863            self.inner.unary(req, path, codec).await
11864        }
11865        /** List members of a team with pagination.
11866 Authorization: Caller must be a member of the team, or have
11867 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11868*/
11869        pub async fn list_team_members(
11870            &mut self,
11871            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
11872        ) -> std::result::Result<
11873            tonic::Response<super::ListTeamMembersResponse>,
11874            tonic::Status,
11875        > {
11876            self.inner
11877                .ready()
11878                .await
11879                .map_err(|e| {
11880                    tonic::Status::unknown(
11881                        format!("Service was not ready: {}", e.into()),
11882                    )
11883                })?;
11884            let codec = tonic_prost::ProstCodec::default();
11885            let path = http::uri::PathAndQuery::from_static(
11886                "/pidgr.v1.TeamService/ListTeamMembers",
11887            );
11888            let mut req = request.into_request();
11889            req.extensions_mut()
11890                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
11891            self.inner.unary(req, path, codec).await
11892        }
11893    }
11894}
11895/// Generated server implementations.
11896pub mod team_service_server {
11897    #![allow(
11898        unused_variables,
11899        dead_code,
11900        missing_docs,
11901        clippy::wildcard_imports,
11902        clippy::let_unit_value,
11903    )]
11904    use tonic::codegen::*;
11905    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
11906    #[async_trait]
11907    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
11908        /** Create a new team in the organization.
11909 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11910*/
11911        async fn create_team(
11912            &self,
11913            request: tonic::Request<super::CreateTeamRequest>,
11914        ) -> std::result::Result<
11915            tonic::Response<super::CreateTeamResponse>,
11916            tonic::Status,
11917        >;
11918        /** Retrieve a team by ID.
11919 Authorization: Caller must be a member of the team, or have
11920 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11921*/
11922        async fn get_team(
11923            &self,
11924            request: tonic::Request<super::GetTeamRequest>,
11925        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
11926        /** List teams in the organization with pagination.
11927 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
11928*/
11929        async fn list_teams(
11930            &self,
11931            request: tonic::Request<super::ListTeamsRequest>,
11932        ) -> std::result::Result<
11933            tonic::Response<super::ListTeamsResponse>,
11934            tonic::Status,
11935        >;
11936        /** Update a team's name and/or description.
11937 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11938*/
11939        async fn update_team(
11940            &self,
11941            request: tonic::Request<super::UpdateTeamRequest>,
11942        ) -> std::result::Result<
11943            tonic::Response<super::UpdateTeamResponse>,
11944            tonic::Status,
11945        >;
11946        /** Delete a team and all its membership records. Default teams cannot be deleted.
11947 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11948*/
11949        async fn delete_team(
11950            &self,
11951            request: tonic::Request<super::DeleteTeamRequest>,
11952        ) -> std::result::Result<
11953            tonic::Response<super::DeleteTeamResponse>,
11954            tonic::Status,
11955        >;
11956        /** Add one or more users to a team (idempotent).
11957 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11958*/
11959        async fn add_team_members(
11960            &self,
11961            request: tonic::Request<super::AddTeamMembersRequest>,
11962        ) -> std::result::Result<
11963            tonic::Response<super::AddTeamMembersResponse>,
11964            tonic::Status,
11965        >;
11966        /** Remove one or more users from a team (idempotent).
11967 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11968*/
11969        async fn remove_team_members(
11970            &self,
11971            request: tonic::Request<super::RemoveTeamMembersRequest>,
11972        ) -> std::result::Result<
11973            tonic::Response<super::RemoveTeamMembersResponse>,
11974            tonic::Status,
11975        >;
11976        /** List members of a team with pagination.
11977 Authorization: Caller must be a member of the team, or have
11978 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11979*/
11980        async fn list_team_members(
11981            &self,
11982            request: tonic::Request<super::ListTeamMembersRequest>,
11983        ) -> std::result::Result<
11984            tonic::Response<super::ListTeamMembersResponse>,
11985            tonic::Status,
11986        >;
11987    }
11988    /** Manages organizational teams (departments, divisions) within an organization.
11989 Teams represent the organizational structure and can serve as sender identity.
11990 All RPCs operate within the caller's org (extracted from JWT).
11991*/
11992    #[derive(Debug)]
11993    pub struct TeamServiceServer<T> {
11994        inner: Arc<T>,
11995        accept_compression_encodings: EnabledCompressionEncodings,
11996        send_compression_encodings: EnabledCompressionEncodings,
11997        max_decoding_message_size: Option<usize>,
11998        max_encoding_message_size: Option<usize>,
11999    }
12000    impl<T> TeamServiceServer<T> {
12001        pub fn new(inner: T) -> Self {
12002            Self::from_arc(Arc::new(inner))
12003        }
12004        pub fn from_arc(inner: Arc<T>) -> Self {
12005            Self {
12006                inner,
12007                accept_compression_encodings: Default::default(),
12008                send_compression_encodings: Default::default(),
12009                max_decoding_message_size: None,
12010                max_encoding_message_size: None,
12011            }
12012        }
12013        pub fn with_interceptor<F>(
12014            inner: T,
12015            interceptor: F,
12016        ) -> InterceptedService<Self, F>
12017        where
12018            F: tonic::service::Interceptor,
12019        {
12020            InterceptedService::new(Self::new(inner), interceptor)
12021        }
12022        /// Enable decompressing requests with the given encoding.
12023        #[must_use]
12024        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12025            self.accept_compression_encodings.enable(encoding);
12026            self
12027        }
12028        /// Compress responses with the given encoding, if the client supports it.
12029        #[must_use]
12030        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12031            self.send_compression_encodings.enable(encoding);
12032            self
12033        }
12034        /// Limits the maximum size of a decoded message.
12035        ///
12036        /// Default: `4MB`
12037        #[must_use]
12038        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12039            self.max_decoding_message_size = Some(limit);
12040            self
12041        }
12042        /// Limits the maximum size of an encoded message.
12043        ///
12044        /// Default: `usize::MAX`
12045        #[must_use]
12046        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12047            self.max_encoding_message_size = Some(limit);
12048            self
12049        }
12050    }
12051    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
12052    where
12053        T: TeamService,
12054        B: Body + std::marker::Send + 'static,
12055        B::Error: Into<StdError> + std::marker::Send + 'static,
12056    {
12057        type Response = http::Response<tonic::body::Body>;
12058        type Error = std::convert::Infallible;
12059        type Future = BoxFuture<Self::Response, Self::Error>;
12060        fn poll_ready(
12061            &mut self,
12062            _cx: &mut Context<'_>,
12063        ) -> Poll<std::result::Result<(), Self::Error>> {
12064            Poll::Ready(Ok(()))
12065        }
12066        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12067            match req.uri().path() {
12068                "/pidgr.v1.TeamService/CreateTeam" => {
12069                    #[allow(non_camel_case_types)]
12070                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
12071                    impl<
12072                        T: TeamService,
12073                    > tonic::server::UnaryService<super::CreateTeamRequest>
12074                    for CreateTeamSvc<T> {
12075                        type Response = super::CreateTeamResponse;
12076                        type Future = BoxFuture<
12077                            tonic::Response<Self::Response>,
12078                            tonic::Status,
12079                        >;
12080                        fn call(
12081                            &mut self,
12082                            request: tonic::Request<super::CreateTeamRequest>,
12083                        ) -> Self::Future {
12084                            let inner = Arc::clone(&self.0);
12085                            let fut = async move {
12086                                <T as TeamService>::create_team(&inner, request).await
12087                            };
12088                            Box::pin(fut)
12089                        }
12090                    }
12091                    let accept_compression_encodings = self.accept_compression_encodings;
12092                    let send_compression_encodings = self.send_compression_encodings;
12093                    let max_decoding_message_size = self.max_decoding_message_size;
12094                    let max_encoding_message_size = self.max_encoding_message_size;
12095                    let inner = self.inner.clone();
12096                    let fut = async move {
12097                        let method = CreateTeamSvc(inner);
12098                        let codec = tonic_prost::ProstCodec::default();
12099                        let mut grpc = tonic::server::Grpc::new(codec)
12100                            .apply_compression_config(
12101                                accept_compression_encodings,
12102                                send_compression_encodings,
12103                            )
12104                            .apply_max_message_size_config(
12105                                max_decoding_message_size,
12106                                max_encoding_message_size,
12107                            );
12108                        let res = grpc.unary(method, req).await;
12109                        Ok(res)
12110                    };
12111                    Box::pin(fut)
12112                }
12113                "/pidgr.v1.TeamService/GetTeam" => {
12114                    #[allow(non_camel_case_types)]
12115                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
12116                    impl<
12117                        T: TeamService,
12118                    > tonic::server::UnaryService<super::GetTeamRequest>
12119                    for GetTeamSvc<T> {
12120                        type Response = super::GetTeamResponse;
12121                        type Future = BoxFuture<
12122                            tonic::Response<Self::Response>,
12123                            tonic::Status,
12124                        >;
12125                        fn call(
12126                            &mut self,
12127                            request: tonic::Request<super::GetTeamRequest>,
12128                        ) -> Self::Future {
12129                            let inner = Arc::clone(&self.0);
12130                            let fut = async move {
12131                                <T as TeamService>::get_team(&inner, request).await
12132                            };
12133                            Box::pin(fut)
12134                        }
12135                    }
12136                    let accept_compression_encodings = self.accept_compression_encodings;
12137                    let send_compression_encodings = self.send_compression_encodings;
12138                    let max_decoding_message_size = self.max_decoding_message_size;
12139                    let max_encoding_message_size = self.max_encoding_message_size;
12140                    let inner = self.inner.clone();
12141                    let fut = async move {
12142                        let method = GetTeamSvc(inner);
12143                        let codec = tonic_prost::ProstCodec::default();
12144                        let mut grpc = tonic::server::Grpc::new(codec)
12145                            .apply_compression_config(
12146                                accept_compression_encodings,
12147                                send_compression_encodings,
12148                            )
12149                            .apply_max_message_size_config(
12150                                max_decoding_message_size,
12151                                max_encoding_message_size,
12152                            );
12153                        let res = grpc.unary(method, req).await;
12154                        Ok(res)
12155                    };
12156                    Box::pin(fut)
12157                }
12158                "/pidgr.v1.TeamService/ListTeams" => {
12159                    #[allow(non_camel_case_types)]
12160                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
12161                    impl<
12162                        T: TeamService,
12163                    > tonic::server::UnaryService<super::ListTeamsRequest>
12164                    for ListTeamsSvc<T> {
12165                        type Response = super::ListTeamsResponse;
12166                        type Future = BoxFuture<
12167                            tonic::Response<Self::Response>,
12168                            tonic::Status,
12169                        >;
12170                        fn call(
12171                            &mut self,
12172                            request: tonic::Request<super::ListTeamsRequest>,
12173                        ) -> Self::Future {
12174                            let inner = Arc::clone(&self.0);
12175                            let fut = async move {
12176                                <T as TeamService>::list_teams(&inner, request).await
12177                            };
12178                            Box::pin(fut)
12179                        }
12180                    }
12181                    let accept_compression_encodings = self.accept_compression_encodings;
12182                    let send_compression_encodings = self.send_compression_encodings;
12183                    let max_decoding_message_size = self.max_decoding_message_size;
12184                    let max_encoding_message_size = self.max_encoding_message_size;
12185                    let inner = self.inner.clone();
12186                    let fut = async move {
12187                        let method = ListTeamsSvc(inner);
12188                        let codec = tonic_prost::ProstCodec::default();
12189                        let mut grpc = tonic::server::Grpc::new(codec)
12190                            .apply_compression_config(
12191                                accept_compression_encodings,
12192                                send_compression_encodings,
12193                            )
12194                            .apply_max_message_size_config(
12195                                max_decoding_message_size,
12196                                max_encoding_message_size,
12197                            );
12198                        let res = grpc.unary(method, req).await;
12199                        Ok(res)
12200                    };
12201                    Box::pin(fut)
12202                }
12203                "/pidgr.v1.TeamService/UpdateTeam" => {
12204                    #[allow(non_camel_case_types)]
12205                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
12206                    impl<
12207                        T: TeamService,
12208                    > tonic::server::UnaryService<super::UpdateTeamRequest>
12209                    for UpdateTeamSvc<T> {
12210                        type Response = super::UpdateTeamResponse;
12211                        type Future = BoxFuture<
12212                            tonic::Response<Self::Response>,
12213                            tonic::Status,
12214                        >;
12215                        fn call(
12216                            &mut self,
12217                            request: tonic::Request<super::UpdateTeamRequest>,
12218                        ) -> Self::Future {
12219                            let inner = Arc::clone(&self.0);
12220                            let fut = async move {
12221                                <T as TeamService>::update_team(&inner, request).await
12222                            };
12223                            Box::pin(fut)
12224                        }
12225                    }
12226                    let accept_compression_encodings = self.accept_compression_encodings;
12227                    let send_compression_encodings = self.send_compression_encodings;
12228                    let max_decoding_message_size = self.max_decoding_message_size;
12229                    let max_encoding_message_size = self.max_encoding_message_size;
12230                    let inner = self.inner.clone();
12231                    let fut = async move {
12232                        let method = UpdateTeamSvc(inner);
12233                        let codec = tonic_prost::ProstCodec::default();
12234                        let mut grpc = tonic::server::Grpc::new(codec)
12235                            .apply_compression_config(
12236                                accept_compression_encodings,
12237                                send_compression_encodings,
12238                            )
12239                            .apply_max_message_size_config(
12240                                max_decoding_message_size,
12241                                max_encoding_message_size,
12242                            );
12243                        let res = grpc.unary(method, req).await;
12244                        Ok(res)
12245                    };
12246                    Box::pin(fut)
12247                }
12248                "/pidgr.v1.TeamService/DeleteTeam" => {
12249                    #[allow(non_camel_case_types)]
12250                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
12251                    impl<
12252                        T: TeamService,
12253                    > tonic::server::UnaryService<super::DeleteTeamRequest>
12254                    for DeleteTeamSvc<T> {
12255                        type Response = super::DeleteTeamResponse;
12256                        type Future = BoxFuture<
12257                            tonic::Response<Self::Response>,
12258                            tonic::Status,
12259                        >;
12260                        fn call(
12261                            &mut self,
12262                            request: tonic::Request<super::DeleteTeamRequest>,
12263                        ) -> Self::Future {
12264                            let inner = Arc::clone(&self.0);
12265                            let fut = async move {
12266                                <T as TeamService>::delete_team(&inner, request).await
12267                            };
12268                            Box::pin(fut)
12269                        }
12270                    }
12271                    let accept_compression_encodings = self.accept_compression_encodings;
12272                    let send_compression_encodings = self.send_compression_encodings;
12273                    let max_decoding_message_size = self.max_decoding_message_size;
12274                    let max_encoding_message_size = self.max_encoding_message_size;
12275                    let inner = self.inner.clone();
12276                    let fut = async move {
12277                        let method = DeleteTeamSvc(inner);
12278                        let codec = tonic_prost::ProstCodec::default();
12279                        let mut grpc = tonic::server::Grpc::new(codec)
12280                            .apply_compression_config(
12281                                accept_compression_encodings,
12282                                send_compression_encodings,
12283                            )
12284                            .apply_max_message_size_config(
12285                                max_decoding_message_size,
12286                                max_encoding_message_size,
12287                            );
12288                        let res = grpc.unary(method, req).await;
12289                        Ok(res)
12290                    };
12291                    Box::pin(fut)
12292                }
12293                "/pidgr.v1.TeamService/AddTeamMembers" => {
12294                    #[allow(non_camel_case_types)]
12295                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
12296                    impl<
12297                        T: TeamService,
12298                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
12299                    for AddTeamMembersSvc<T> {
12300                        type Response = super::AddTeamMembersResponse;
12301                        type Future = BoxFuture<
12302                            tonic::Response<Self::Response>,
12303                            tonic::Status,
12304                        >;
12305                        fn call(
12306                            &mut self,
12307                            request: tonic::Request<super::AddTeamMembersRequest>,
12308                        ) -> Self::Future {
12309                            let inner = Arc::clone(&self.0);
12310                            let fut = async move {
12311                                <T as TeamService>::add_team_members(&inner, request).await
12312                            };
12313                            Box::pin(fut)
12314                        }
12315                    }
12316                    let accept_compression_encodings = self.accept_compression_encodings;
12317                    let send_compression_encodings = self.send_compression_encodings;
12318                    let max_decoding_message_size = self.max_decoding_message_size;
12319                    let max_encoding_message_size = self.max_encoding_message_size;
12320                    let inner = self.inner.clone();
12321                    let fut = async move {
12322                        let method = AddTeamMembersSvc(inner);
12323                        let codec = tonic_prost::ProstCodec::default();
12324                        let mut grpc = tonic::server::Grpc::new(codec)
12325                            .apply_compression_config(
12326                                accept_compression_encodings,
12327                                send_compression_encodings,
12328                            )
12329                            .apply_max_message_size_config(
12330                                max_decoding_message_size,
12331                                max_encoding_message_size,
12332                            );
12333                        let res = grpc.unary(method, req).await;
12334                        Ok(res)
12335                    };
12336                    Box::pin(fut)
12337                }
12338                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
12339                    #[allow(non_camel_case_types)]
12340                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
12341                    impl<
12342                        T: TeamService,
12343                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
12344                    for RemoveTeamMembersSvc<T> {
12345                        type Response = super::RemoveTeamMembersResponse;
12346                        type Future = BoxFuture<
12347                            tonic::Response<Self::Response>,
12348                            tonic::Status,
12349                        >;
12350                        fn call(
12351                            &mut self,
12352                            request: tonic::Request<super::RemoveTeamMembersRequest>,
12353                        ) -> Self::Future {
12354                            let inner = Arc::clone(&self.0);
12355                            let fut = async move {
12356                                <T as TeamService>::remove_team_members(&inner, request)
12357                                    .await
12358                            };
12359                            Box::pin(fut)
12360                        }
12361                    }
12362                    let accept_compression_encodings = self.accept_compression_encodings;
12363                    let send_compression_encodings = self.send_compression_encodings;
12364                    let max_decoding_message_size = self.max_decoding_message_size;
12365                    let max_encoding_message_size = self.max_encoding_message_size;
12366                    let inner = self.inner.clone();
12367                    let fut = async move {
12368                        let method = RemoveTeamMembersSvc(inner);
12369                        let codec = tonic_prost::ProstCodec::default();
12370                        let mut grpc = tonic::server::Grpc::new(codec)
12371                            .apply_compression_config(
12372                                accept_compression_encodings,
12373                                send_compression_encodings,
12374                            )
12375                            .apply_max_message_size_config(
12376                                max_decoding_message_size,
12377                                max_encoding_message_size,
12378                            );
12379                        let res = grpc.unary(method, req).await;
12380                        Ok(res)
12381                    };
12382                    Box::pin(fut)
12383                }
12384                "/pidgr.v1.TeamService/ListTeamMembers" => {
12385                    #[allow(non_camel_case_types)]
12386                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
12387                    impl<
12388                        T: TeamService,
12389                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
12390                    for ListTeamMembersSvc<T> {
12391                        type Response = super::ListTeamMembersResponse;
12392                        type Future = BoxFuture<
12393                            tonic::Response<Self::Response>,
12394                            tonic::Status,
12395                        >;
12396                        fn call(
12397                            &mut self,
12398                            request: tonic::Request<super::ListTeamMembersRequest>,
12399                        ) -> Self::Future {
12400                            let inner = Arc::clone(&self.0);
12401                            let fut = async move {
12402                                <T as TeamService>::list_team_members(&inner, request).await
12403                            };
12404                            Box::pin(fut)
12405                        }
12406                    }
12407                    let accept_compression_encodings = self.accept_compression_encodings;
12408                    let send_compression_encodings = self.send_compression_encodings;
12409                    let max_decoding_message_size = self.max_decoding_message_size;
12410                    let max_encoding_message_size = self.max_encoding_message_size;
12411                    let inner = self.inner.clone();
12412                    let fut = async move {
12413                        let method = ListTeamMembersSvc(inner);
12414                        let codec = tonic_prost::ProstCodec::default();
12415                        let mut grpc = tonic::server::Grpc::new(codec)
12416                            .apply_compression_config(
12417                                accept_compression_encodings,
12418                                send_compression_encodings,
12419                            )
12420                            .apply_max_message_size_config(
12421                                max_decoding_message_size,
12422                                max_encoding_message_size,
12423                            );
12424                        let res = grpc.unary(method, req).await;
12425                        Ok(res)
12426                    };
12427                    Box::pin(fut)
12428                }
12429                _ => {
12430                    Box::pin(async move {
12431                        let mut response = http::Response::new(
12432                            tonic::body::Body::default(),
12433                        );
12434                        let headers = response.headers_mut();
12435                        headers
12436                            .insert(
12437                                tonic::Status::GRPC_STATUS,
12438                                (tonic::Code::Unimplemented as i32).into(),
12439                            );
12440                        headers
12441                            .insert(
12442                                http::header::CONTENT_TYPE,
12443                                tonic::metadata::GRPC_CONTENT_TYPE,
12444                            );
12445                        Ok(response)
12446                    })
12447                }
12448            }
12449        }
12450    }
12451    impl<T> Clone for TeamServiceServer<T> {
12452        fn clone(&self) -> Self {
12453            let inner = self.inner.clone();
12454            Self {
12455                inner,
12456                accept_compression_encodings: self.accept_compression_encodings,
12457                send_compression_encodings: self.send_compression_encodings,
12458                max_decoding_message_size: self.max_decoding_message_size,
12459                max_encoding_message_size: self.max_encoding_message_size,
12460            }
12461        }
12462    }
12463    /// Generated gRPC service name
12464    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
12465    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
12466        const NAME: &'static str = SERVICE_NAME;
12467    }
12468}
12469/// Generated client implementations.
12470pub mod template_service_client {
12471    #![allow(
12472        unused_variables,
12473        dead_code,
12474        missing_docs,
12475        clippy::wildcard_imports,
12476        clippy::let_unit_value,
12477    )]
12478    use tonic::codegen::*;
12479    use tonic::codegen::http::Uri;
12480    /** Manages versioned message templates used by campaigns.
12481 Templates are append-only — updates create new versions while preserving history.
12482*/
12483    #[derive(Debug, Clone)]
12484    pub struct TemplateServiceClient<T> {
12485        inner: tonic::client::Grpc<T>,
12486    }
12487    impl TemplateServiceClient<tonic::transport::Channel> {
12488        /// Attempt to create a new client by connecting to a given endpoint.
12489        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12490        where
12491            D: TryInto<tonic::transport::Endpoint>,
12492            D::Error: Into<StdError>,
12493        {
12494            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12495            Ok(Self::new(conn))
12496        }
12497    }
12498    impl<T> TemplateServiceClient<T>
12499    where
12500        T: tonic::client::GrpcService<tonic::body::Body>,
12501        T::Error: Into<StdError>,
12502        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12503        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12504    {
12505        pub fn new(inner: T) -> Self {
12506            let inner = tonic::client::Grpc::new(inner);
12507            Self { inner }
12508        }
12509        pub fn with_origin(inner: T, origin: Uri) -> Self {
12510            let inner = tonic::client::Grpc::with_origin(inner, origin);
12511            Self { inner }
12512        }
12513        pub fn with_interceptor<F>(
12514            inner: T,
12515            interceptor: F,
12516        ) -> TemplateServiceClient<InterceptedService<T, F>>
12517        where
12518            F: tonic::service::Interceptor,
12519            T::ResponseBody: Default,
12520            T: tonic::codegen::Service<
12521                http::Request<tonic::body::Body>,
12522                Response = http::Response<
12523                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12524                >,
12525            >,
12526            <T as tonic::codegen::Service<
12527                http::Request<tonic::body::Body>,
12528            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12529        {
12530            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
12531        }
12532        /// Compress requests with the given encoding.
12533        ///
12534        /// This requires the server to support it otherwise it might respond with an
12535        /// error.
12536        #[must_use]
12537        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12538            self.inner = self.inner.send_compressed(encoding);
12539            self
12540        }
12541        /// Enable decompressing responses.
12542        #[must_use]
12543        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12544            self.inner = self.inner.accept_compressed(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.inner = self.inner.max_decoding_message_size(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.inner = self.inner.max_encoding_message_size(limit);
12561            self
12562        }
12563        /** Create a new template with a body and variable definitions.
12564 Authorization: Requires MANAGER+ role.
12565*/
12566        pub async fn create_template(
12567            &mut self,
12568            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
12569        ) -> std::result::Result<
12570            tonic::Response<super::CreateTemplateResponse>,
12571            tonic::Status,
12572        > {
12573            self.inner
12574                .ready()
12575                .await
12576                .map_err(|e| {
12577                    tonic::Status::unknown(
12578                        format!("Service was not ready: {}", e.into()),
12579                    )
12580                })?;
12581            let codec = tonic_prost::ProstCodec::default();
12582            let path = http::uri::PathAndQuery::from_static(
12583                "/pidgr.v1.TemplateService/CreateTemplate",
12584            );
12585            let mut req = request.into_request();
12586            req.extensions_mut()
12587                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
12588            self.inner.unary(req, path, codec).await
12589        }
12590        /** Update an existing template, creating a new version.
12591 Authorization: Requires MANAGER+ role.
12592*/
12593        pub async fn update_template(
12594            &mut self,
12595            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
12596        ) -> std::result::Result<
12597            tonic::Response<super::UpdateTemplateResponse>,
12598            tonic::Status,
12599        > {
12600            self.inner
12601                .ready()
12602                .await
12603                .map_err(|e| {
12604                    tonic::Status::unknown(
12605                        format!("Service was not ready: {}", e.into()),
12606                    )
12607                })?;
12608            let codec = tonic_prost::ProstCodec::default();
12609            let path = http::uri::PathAndQuery::from_static(
12610                "/pidgr.v1.TemplateService/UpdateTemplate",
12611            );
12612            let mut req = request.into_request();
12613            req.extensions_mut()
12614                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
12615            self.inner.unary(req, path, codec).await
12616        }
12617        /** Retrieve a specific template by ID and optional version.
12618 Authorization: Authenticated user within the organization.
12619*/
12620        pub async fn get_template(
12621            &mut self,
12622            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
12623        ) -> std::result::Result<
12624            tonic::Response<super::GetTemplateResponse>,
12625            tonic::Status,
12626        > {
12627            self.inner
12628                .ready()
12629                .await
12630                .map_err(|e| {
12631                    tonic::Status::unknown(
12632                        format!("Service was not ready: {}", e.into()),
12633                    )
12634                })?;
12635            let codec = tonic_prost::ProstCodec::default();
12636            let path = http::uri::PathAndQuery::from_static(
12637                "/pidgr.v1.TemplateService/GetTemplate",
12638            );
12639            let mut req = request.into_request();
12640            req.extensions_mut()
12641                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
12642            self.inner.unary(req, path, codec).await
12643        }
12644        /** List all templates for the organization with pagination.
12645 Authorization: Authenticated user within the organization.
12646*/
12647        pub async fn list_templates(
12648            &mut self,
12649            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
12650        ) -> std::result::Result<
12651            tonic::Response<super::ListTemplatesResponse>,
12652            tonic::Status,
12653        > {
12654            self.inner
12655                .ready()
12656                .await
12657                .map_err(|e| {
12658                    tonic::Status::unknown(
12659                        format!("Service was not ready: {}", e.into()),
12660                    )
12661                })?;
12662            let codec = tonic_prost::ProstCodec::default();
12663            let path = http::uri::PathAndQuery::from_static(
12664                "/pidgr.v1.TemplateService/ListTemplates",
12665            );
12666            let mut req = request.into_request();
12667            req.extensions_mut()
12668                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
12669            self.inner.unary(req, path, codec).await
12670        }
12671        /** Create a locale-specific translation of a template.
12672 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12673*/
12674        pub async fn create_template_translation(
12675            &mut self,
12676            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
12677        ) -> std::result::Result<
12678            tonic::Response<super::CreateTemplateTranslationResponse>,
12679            tonic::Status,
12680        > {
12681            self.inner
12682                .ready()
12683                .await
12684                .map_err(|e| {
12685                    tonic::Status::unknown(
12686                        format!("Service was not ready: {}", e.into()),
12687                    )
12688                })?;
12689            let codec = tonic_prost::ProstCodec::default();
12690            let path = http::uri::PathAndQuery::from_static(
12691                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
12692            );
12693            let mut req = request.into_request();
12694            req.extensions_mut()
12695                .insert(
12696                    GrpcMethod::new(
12697                        "pidgr.v1.TemplateService",
12698                        "CreateTemplateTranslation",
12699                    ),
12700                );
12701            self.inner.unary(req, path, codec).await
12702        }
12703        /** Update an existing template translation.
12704 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12705*/
12706        pub async fn update_template_translation(
12707            &mut self,
12708            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
12709        ) -> std::result::Result<
12710            tonic::Response<super::UpdateTemplateTranslationResponse>,
12711            tonic::Status,
12712        > {
12713            self.inner
12714                .ready()
12715                .await
12716                .map_err(|e| {
12717                    tonic::Status::unknown(
12718                        format!("Service was not ready: {}", e.into()),
12719                    )
12720                })?;
12721            let codec = tonic_prost::ProstCodec::default();
12722            let path = http::uri::PathAndQuery::from_static(
12723                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
12724            );
12725            let mut req = request.into_request();
12726            req.extensions_mut()
12727                .insert(
12728                    GrpcMethod::new(
12729                        "pidgr.v1.TemplateService",
12730                        "UpdateTemplateTranslation",
12731                    ),
12732                );
12733            self.inner.unary(req, path, codec).await
12734        }
12735        /** List all translations for a template version.
12736 Authorization: Requires PERMISSION_TEMPLATES_READ.
12737*/
12738        pub async fn list_template_translations(
12739            &mut self,
12740            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
12741        ) -> std::result::Result<
12742            tonic::Response<super::ListTemplateTranslationsResponse>,
12743            tonic::Status,
12744        > {
12745            self.inner
12746                .ready()
12747                .await
12748                .map_err(|e| {
12749                    tonic::Status::unknown(
12750                        format!("Service was not ready: {}", e.into()),
12751                    )
12752                })?;
12753            let codec = tonic_prost::ProstCodec::default();
12754            let path = http::uri::PathAndQuery::from_static(
12755                "/pidgr.v1.TemplateService/ListTemplateTranslations",
12756            );
12757            let mut req = request.into_request();
12758            req.extensions_mut()
12759                .insert(
12760                    GrpcMethod::new(
12761                        "pidgr.v1.TemplateService",
12762                        "ListTemplateTranslations",
12763                    ),
12764                );
12765            self.inner.unary(req, path, codec).await
12766        }
12767        /** Approve a template translation for use in campaigns.
12768 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
12769*/
12770        pub async fn approve_template_translation(
12771            &mut self,
12772            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
12773        ) -> std::result::Result<
12774            tonic::Response<super::ApproveTemplateTranslationResponse>,
12775            tonic::Status,
12776        > {
12777            self.inner
12778                .ready()
12779                .await
12780                .map_err(|e| {
12781                    tonic::Status::unknown(
12782                        format!("Service was not ready: {}", e.into()),
12783                    )
12784                })?;
12785            let codec = tonic_prost::ProstCodec::default();
12786            let path = http::uri::PathAndQuery::from_static(
12787                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
12788            );
12789            let mut req = request.into_request();
12790            req.extensions_mut()
12791                .insert(
12792                    GrpcMethod::new(
12793                        "pidgr.v1.TemplateService",
12794                        "ApproveTemplateTranslation",
12795                    ),
12796                );
12797            self.inner.unary(req, path, codec).await
12798        }
12799    }
12800}
12801/// Generated server implementations.
12802pub mod template_service_server {
12803    #![allow(
12804        unused_variables,
12805        dead_code,
12806        missing_docs,
12807        clippy::wildcard_imports,
12808        clippy::let_unit_value,
12809    )]
12810    use tonic::codegen::*;
12811    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
12812    #[async_trait]
12813    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
12814        /** Create a new template with a body and variable definitions.
12815 Authorization: Requires MANAGER+ role.
12816*/
12817        async fn create_template(
12818            &self,
12819            request: tonic::Request<super::CreateTemplateRequest>,
12820        ) -> std::result::Result<
12821            tonic::Response<super::CreateTemplateResponse>,
12822            tonic::Status,
12823        >;
12824        /** Update an existing template, creating a new version.
12825 Authorization: Requires MANAGER+ role.
12826*/
12827        async fn update_template(
12828            &self,
12829            request: tonic::Request<super::UpdateTemplateRequest>,
12830        ) -> std::result::Result<
12831            tonic::Response<super::UpdateTemplateResponse>,
12832            tonic::Status,
12833        >;
12834        /** Retrieve a specific template by ID and optional version.
12835 Authorization: Authenticated user within the organization.
12836*/
12837        async fn get_template(
12838            &self,
12839            request: tonic::Request<super::GetTemplateRequest>,
12840        ) -> std::result::Result<
12841            tonic::Response<super::GetTemplateResponse>,
12842            tonic::Status,
12843        >;
12844        /** List all templates for the organization with pagination.
12845 Authorization: Authenticated user within the organization.
12846*/
12847        async fn list_templates(
12848            &self,
12849            request: tonic::Request<super::ListTemplatesRequest>,
12850        ) -> std::result::Result<
12851            tonic::Response<super::ListTemplatesResponse>,
12852            tonic::Status,
12853        >;
12854        /** Create a locale-specific translation of a template.
12855 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12856*/
12857        async fn create_template_translation(
12858            &self,
12859            request: tonic::Request<super::CreateTemplateTranslationRequest>,
12860        ) -> std::result::Result<
12861            tonic::Response<super::CreateTemplateTranslationResponse>,
12862            tonic::Status,
12863        >;
12864        /** Update an existing template translation.
12865 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12866*/
12867        async fn update_template_translation(
12868            &self,
12869            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
12870        ) -> std::result::Result<
12871            tonic::Response<super::UpdateTemplateTranslationResponse>,
12872            tonic::Status,
12873        >;
12874        /** List all translations for a template version.
12875 Authorization: Requires PERMISSION_TEMPLATES_READ.
12876*/
12877        async fn list_template_translations(
12878            &self,
12879            request: tonic::Request<super::ListTemplateTranslationsRequest>,
12880        ) -> std::result::Result<
12881            tonic::Response<super::ListTemplateTranslationsResponse>,
12882            tonic::Status,
12883        >;
12884        /** Approve a template translation for use in campaigns.
12885 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
12886*/
12887        async fn approve_template_translation(
12888            &self,
12889            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
12890        ) -> std::result::Result<
12891            tonic::Response<super::ApproveTemplateTranslationResponse>,
12892            tonic::Status,
12893        >;
12894    }
12895    /** Manages versioned message templates used by campaigns.
12896 Templates are append-only — updates create new versions while preserving history.
12897*/
12898    #[derive(Debug)]
12899    pub struct TemplateServiceServer<T> {
12900        inner: Arc<T>,
12901        accept_compression_encodings: EnabledCompressionEncodings,
12902        send_compression_encodings: EnabledCompressionEncodings,
12903        max_decoding_message_size: Option<usize>,
12904        max_encoding_message_size: Option<usize>,
12905    }
12906    impl<T> TemplateServiceServer<T> {
12907        pub fn new(inner: T) -> Self {
12908            Self::from_arc(Arc::new(inner))
12909        }
12910        pub fn from_arc(inner: Arc<T>) -> Self {
12911            Self {
12912                inner,
12913                accept_compression_encodings: Default::default(),
12914                send_compression_encodings: Default::default(),
12915                max_decoding_message_size: None,
12916                max_encoding_message_size: None,
12917            }
12918        }
12919        pub fn with_interceptor<F>(
12920            inner: T,
12921            interceptor: F,
12922        ) -> InterceptedService<Self, F>
12923        where
12924            F: tonic::service::Interceptor,
12925        {
12926            InterceptedService::new(Self::new(inner), interceptor)
12927        }
12928        /// Enable decompressing requests with the given encoding.
12929        #[must_use]
12930        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12931            self.accept_compression_encodings.enable(encoding);
12932            self
12933        }
12934        /// Compress responses with the given encoding, if the client supports it.
12935        #[must_use]
12936        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12937            self.send_compression_encodings.enable(encoding);
12938            self
12939        }
12940        /// Limits the maximum size of a decoded message.
12941        ///
12942        /// Default: `4MB`
12943        #[must_use]
12944        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12945            self.max_decoding_message_size = Some(limit);
12946            self
12947        }
12948        /// Limits the maximum size of an encoded message.
12949        ///
12950        /// Default: `usize::MAX`
12951        #[must_use]
12952        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12953            self.max_encoding_message_size = Some(limit);
12954            self
12955        }
12956    }
12957    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
12958    where
12959        T: TemplateService,
12960        B: Body + std::marker::Send + 'static,
12961        B::Error: Into<StdError> + std::marker::Send + 'static,
12962    {
12963        type Response = http::Response<tonic::body::Body>;
12964        type Error = std::convert::Infallible;
12965        type Future = BoxFuture<Self::Response, Self::Error>;
12966        fn poll_ready(
12967            &mut self,
12968            _cx: &mut Context<'_>,
12969        ) -> Poll<std::result::Result<(), Self::Error>> {
12970            Poll::Ready(Ok(()))
12971        }
12972        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12973            match req.uri().path() {
12974                "/pidgr.v1.TemplateService/CreateTemplate" => {
12975                    #[allow(non_camel_case_types)]
12976                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
12977                    impl<
12978                        T: TemplateService,
12979                    > tonic::server::UnaryService<super::CreateTemplateRequest>
12980                    for CreateTemplateSvc<T> {
12981                        type Response = super::CreateTemplateResponse;
12982                        type Future = BoxFuture<
12983                            tonic::Response<Self::Response>,
12984                            tonic::Status,
12985                        >;
12986                        fn call(
12987                            &mut self,
12988                            request: tonic::Request<super::CreateTemplateRequest>,
12989                        ) -> Self::Future {
12990                            let inner = Arc::clone(&self.0);
12991                            let fut = async move {
12992                                <T as TemplateService>::create_template(&inner, request)
12993                                    .await
12994                            };
12995                            Box::pin(fut)
12996                        }
12997                    }
12998                    let accept_compression_encodings = self.accept_compression_encodings;
12999                    let send_compression_encodings = self.send_compression_encodings;
13000                    let max_decoding_message_size = self.max_decoding_message_size;
13001                    let max_encoding_message_size = self.max_encoding_message_size;
13002                    let inner = self.inner.clone();
13003                    let fut = async move {
13004                        let method = CreateTemplateSvc(inner);
13005                        let codec = tonic_prost::ProstCodec::default();
13006                        let mut grpc = tonic::server::Grpc::new(codec)
13007                            .apply_compression_config(
13008                                accept_compression_encodings,
13009                                send_compression_encodings,
13010                            )
13011                            .apply_max_message_size_config(
13012                                max_decoding_message_size,
13013                                max_encoding_message_size,
13014                            );
13015                        let res = grpc.unary(method, req).await;
13016                        Ok(res)
13017                    };
13018                    Box::pin(fut)
13019                }
13020                "/pidgr.v1.TemplateService/UpdateTemplate" => {
13021                    #[allow(non_camel_case_types)]
13022                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
13023                    impl<
13024                        T: TemplateService,
13025                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
13026                    for UpdateTemplateSvc<T> {
13027                        type Response = super::UpdateTemplateResponse;
13028                        type Future = BoxFuture<
13029                            tonic::Response<Self::Response>,
13030                            tonic::Status,
13031                        >;
13032                        fn call(
13033                            &mut self,
13034                            request: tonic::Request<super::UpdateTemplateRequest>,
13035                        ) -> Self::Future {
13036                            let inner = Arc::clone(&self.0);
13037                            let fut = async move {
13038                                <T as TemplateService>::update_template(&inner, request)
13039                                    .await
13040                            };
13041                            Box::pin(fut)
13042                        }
13043                    }
13044                    let accept_compression_encodings = self.accept_compression_encodings;
13045                    let send_compression_encodings = self.send_compression_encodings;
13046                    let max_decoding_message_size = self.max_decoding_message_size;
13047                    let max_encoding_message_size = self.max_encoding_message_size;
13048                    let inner = self.inner.clone();
13049                    let fut = async move {
13050                        let method = UpdateTemplateSvc(inner);
13051                        let codec = tonic_prost::ProstCodec::default();
13052                        let mut grpc = tonic::server::Grpc::new(codec)
13053                            .apply_compression_config(
13054                                accept_compression_encodings,
13055                                send_compression_encodings,
13056                            )
13057                            .apply_max_message_size_config(
13058                                max_decoding_message_size,
13059                                max_encoding_message_size,
13060                            );
13061                        let res = grpc.unary(method, req).await;
13062                        Ok(res)
13063                    };
13064                    Box::pin(fut)
13065                }
13066                "/pidgr.v1.TemplateService/GetTemplate" => {
13067                    #[allow(non_camel_case_types)]
13068                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
13069                    impl<
13070                        T: TemplateService,
13071                    > tonic::server::UnaryService<super::GetTemplateRequest>
13072                    for GetTemplateSvc<T> {
13073                        type Response = super::GetTemplateResponse;
13074                        type Future = BoxFuture<
13075                            tonic::Response<Self::Response>,
13076                            tonic::Status,
13077                        >;
13078                        fn call(
13079                            &mut self,
13080                            request: tonic::Request<super::GetTemplateRequest>,
13081                        ) -> Self::Future {
13082                            let inner = Arc::clone(&self.0);
13083                            let fut = async move {
13084                                <T as TemplateService>::get_template(&inner, request).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 = GetTemplateSvc(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                "/pidgr.v1.TemplateService/ListTemplates" => {
13112                    #[allow(non_camel_case_types)]
13113                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
13114                    impl<
13115                        T: TemplateService,
13116                    > tonic::server::UnaryService<super::ListTemplatesRequest>
13117                    for ListTemplatesSvc<T> {
13118                        type Response = super::ListTemplatesResponse;
13119                        type Future = BoxFuture<
13120                            tonic::Response<Self::Response>,
13121                            tonic::Status,
13122                        >;
13123                        fn call(
13124                            &mut self,
13125                            request: tonic::Request<super::ListTemplatesRequest>,
13126                        ) -> Self::Future {
13127                            let inner = Arc::clone(&self.0);
13128                            let fut = async move {
13129                                <T as TemplateService>::list_templates(&inner, request)
13130                                    .await
13131                            };
13132                            Box::pin(fut)
13133                        }
13134                    }
13135                    let accept_compression_encodings = self.accept_compression_encodings;
13136                    let send_compression_encodings = self.send_compression_encodings;
13137                    let max_decoding_message_size = self.max_decoding_message_size;
13138                    let max_encoding_message_size = self.max_encoding_message_size;
13139                    let inner = self.inner.clone();
13140                    let fut = async move {
13141                        let method = ListTemplatesSvc(inner);
13142                        let codec = tonic_prost::ProstCodec::default();
13143                        let mut grpc = tonic::server::Grpc::new(codec)
13144                            .apply_compression_config(
13145                                accept_compression_encodings,
13146                                send_compression_encodings,
13147                            )
13148                            .apply_max_message_size_config(
13149                                max_decoding_message_size,
13150                                max_encoding_message_size,
13151                            );
13152                        let res = grpc.unary(method, req).await;
13153                        Ok(res)
13154                    };
13155                    Box::pin(fut)
13156                }
13157                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
13158                    #[allow(non_camel_case_types)]
13159                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13160                    impl<
13161                        T: TemplateService,
13162                    > tonic::server::UnaryService<
13163                        super::CreateTemplateTranslationRequest,
13164                    > for CreateTemplateTranslationSvc<T> {
13165                        type Response = super::CreateTemplateTranslationResponse;
13166                        type Future = BoxFuture<
13167                            tonic::Response<Self::Response>,
13168                            tonic::Status,
13169                        >;
13170                        fn call(
13171                            &mut self,
13172                            request: tonic::Request<
13173                                super::CreateTemplateTranslationRequest,
13174                            >,
13175                        ) -> Self::Future {
13176                            let inner = Arc::clone(&self.0);
13177                            let fut = async move {
13178                                <T as TemplateService>::create_template_translation(
13179                                        &inner,
13180                                        request,
13181                                    )
13182                                    .await
13183                            };
13184                            Box::pin(fut)
13185                        }
13186                    }
13187                    let accept_compression_encodings = self.accept_compression_encodings;
13188                    let send_compression_encodings = self.send_compression_encodings;
13189                    let max_decoding_message_size = self.max_decoding_message_size;
13190                    let max_encoding_message_size = self.max_encoding_message_size;
13191                    let inner = self.inner.clone();
13192                    let fut = async move {
13193                        let method = CreateTemplateTranslationSvc(inner);
13194                        let codec = tonic_prost::ProstCodec::default();
13195                        let mut grpc = tonic::server::Grpc::new(codec)
13196                            .apply_compression_config(
13197                                accept_compression_encodings,
13198                                send_compression_encodings,
13199                            )
13200                            .apply_max_message_size_config(
13201                                max_decoding_message_size,
13202                                max_encoding_message_size,
13203                            );
13204                        let res = grpc.unary(method, req).await;
13205                        Ok(res)
13206                    };
13207                    Box::pin(fut)
13208                }
13209                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
13210                    #[allow(non_camel_case_types)]
13211                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13212                    impl<
13213                        T: TemplateService,
13214                    > tonic::server::UnaryService<
13215                        super::UpdateTemplateTranslationRequest,
13216                    > for UpdateTemplateTranslationSvc<T> {
13217                        type Response = super::UpdateTemplateTranslationResponse;
13218                        type Future = BoxFuture<
13219                            tonic::Response<Self::Response>,
13220                            tonic::Status,
13221                        >;
13222                        fn call(
13223                            &mut self,
13224                            request: tonic::Request<
13225                                super::UpdateTemplateTranslationRequest,
13226                            >,
13227                        ) -> Self::Future {
13228                            let inner = Arc::clone(&self.0);
13229                            let fut = async move {
13230                                <T as TemplateService>::update_template_translation(
13231                                        &inner,
13232                                        request,
13233                                    )
13234                                    .await
13235                            };
13236                            Box::pin(fut)
13237                        }
13238                    }
13239                    let accept_compression_encodings = self.accept_compression_encodings;
13240                    let send_compression_encodings = self.send_compression_encodings;
13241                    let max_decoding_message_size = self.max_decoding_message_size;
13242                    let max_encoding_message_size = self.max_encoding_message_size;
13243                    let inner = self.inner.clone();
13244                    let fut = async move {
13245                        let method = UpdateTemplateTranslationSvc(inner);
13246                        let codec = tonic_prost::ProstCodec::default();
13247                        let mut grpc = tonic::server::Grpc::new(codec)
13248                            .apply_compression_config(
13249                                accept_compression_encodings,
13250                                send_compression_encodings,
13251                            )
13252                            .apply_max_message_size_config(
13253                                max_decoding_message_size,
13254                                max_encoding_message_size,
13255                            );
13256                        let res = grpc.unary(method, req).await;
13257                        Ok(res)
13258                    };
13259                    Box::pin(fut)
13260                }
13261                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
13262                    #[allow(non_camel_case_types)]
13263                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
13264                    impl<
13265                        T: TemplateService,
13266                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
13267                    for ListTemplateTranslationsSvc<T> {
13268                        type Response = super::ListTemplateTranslationsResponse;
13269                        type Future = BoxFuture<
13270                            tonic::Response<Self::Response>,
13271                            tonic::Status,
13272                        >;
13273                        fn call(
13274                            &mut self,
13275                            request: tonic::Request<
13276                                super::ListTemplateTranslationsRequest,
13277                            >,
13278                        ) -> Self::Future {
13279                            let inner = Arc::clone(&self.0);
13280                            let fut = async move {
13281                                <T as TemplateService>::list_template_translations(
13282                                        &inner,
13283                                        request,
13284                                    )
13285                                    .await
13286                            };
13287                            Box::pin(fut)
13288                        }
13289                    }
13290                    let accept_compression_encodings = self.accept_compression_encodings;
13291                    let send_compression_encodings = self.send_compression_encodings;
13292                    let max_decoding_message_size = self.max_decoding_message_size;
13293                    let max_encoding_message_size = self.max_encoding_message_size;
13294                    let inner = self.inner.clone();
13295                    let fut = async move {
13296                        let method = ListTemplateTranslationsSvc(inner);
13297                        let codec = tonic_prost::ProstCodec::default();
13298                        let mut grpc = tonic::server::Grpc::new(codec)
13299                            .apply_compression_config(
13300                                accept_compression_encodings,
13301                                send_compression_encodings,
13302                            )
13303                            .apply_max_message_size_config(
13304                                max_decoding_message_size,
13305                                max_encoding_message_size,
13306                            );
13307                        let res = grpc.unary(method, req).await;
13308                        Ok(res)
13309                    };
13310                    Box::pin(fut)
13311                }
13312                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
13313                    #[allow(non_camel_case_types)]
13314                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13315                    impl<
13316                        T: TemplateService,
13317                    > tonic::server::UnaryService<
13318                        super::ApproveTemplateTranslationRequest,
13319                    > for ApproveTemplateTranslationSvc<T> {
13320                        type Response = super::ApproveTemplateTranslationResponse;
13321                        type Future = BoxFuture<
13322                            tonic::Response<Self::Response>,
13323                            tonic::Status,
13324                        >;
13325                        fn call(
13326                            &mut self,
13327                            request: tonic::Request<
13328                                super::ApproveTemplateTranslationRequest,
13329                            >,
13330                        ) -> Self::Future {
13331                            let inner = Arc::clone(&self.0);
13332                            let fut = async move {
13333                                <T as TemplateService>::approve_template_translation(
13334                                        &inner,
13335                                        request,
13336                                    )
13337                                    .await
13338                            };
13339                            Box::pin(fut)
13340                        }
13341                    }
13342                    let accept_compression_encodings = self.accept_compression_encodings;
13343                    let send_compression_encodings = self.send_compression_encodings;
13344                    let max_decoding_message_size = self.max_decoding_message_size;
13345                    let max_encoding_message_size = self.max_encoding_message_size;
13346                    let inner = self.inner.clone();
13347                    let fut = async move {
13348                        let method = ApproveTemplateTranslationSvc(inner);
13349                        let codec = tonic_prost::ProstCodec::default();
13350                        let mut grpc = tonic::server::Grpc::new(codec)
13351                            .apply_compression_config(
13352                                accept_compression_encodings,
13353                                send_compression_encodings,
13354                            )
13355                            .apply_max_message_size_config(
13356                                max_decoding_message_size,
13357                                max_encoding_message_size,
13358                            );
13359                        let res = grpc.unary(method, req).await;
13360                        Ok(res)
13361                    };
13362                    Box::pin(fut)
13363                }
13364                _ => {
13365                    Box::pin(async move {
13366                        let mut response = http::Response::new(
13367                            tonic::body::Body::default(),
13368                        );
13369                        let headers = response.headers_mut();
13370                        headers
13371                            .insert(
13372                                tonic::Status::GRPC_STATUS,
13373                                (tonic::Code::Unimplemented as i32).into(),
13374                            );
13375                        headers
13376                            .insert(
13377                                http::header::CONTENT_TYPE,
13378                                tonic::metadata::GRPC_CONTENT_TYPE,
13379                            );
13380                        Ok(response)
13381                    })
13382                }
13383            }
13384        }
13385    }
13386    impl<T> Clone for TemplateServiceServer<T> {
13387        fn clone(&self) -> Self {
13388            let inner = self.inner.clone();
13389            Self {
13390                inner,
13391                accept_compression_encodings: self.accept_compression_encodings,
13392                send_compression_encodings: self.send_compression_encodings,
13393                max_decoding_message_size: self.max_decoding_message_size,
13394                max_encoding_message_size: self.max_encoding_message_size,
13395            }
13396        }
13397    }
13398    /// Generated gRPC service name
13399    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
13400    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
13401        const NAME: &'static str = SERVICE_NAME;
13402    }
13403}