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        /** Manually trigger the ML training pipeline for the caller's organization.
6383 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6384 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6385*/
6386        pub async fn trigger_ml_pipeline(
6387            &mut self,
6388            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
6389        ) -> std::result::Result<
6390            tonic::Response<super::TriggerMlPipelineResponse>,
6391            tonic::Status,
6392        > {
6393            self.inner
6394                .ready()
6395                .await
6396                .map_err(|e| {
6397                    tonic::Status::unknown(
6398                        format!("Service was not ready: {}", e.into()),
6399                    )
6400                })?;
6401            let codec = tonic_prost::ProstCodec::default();
6402            let path = http::uri::PathAndQuery::from_static(
6403                "/pidgr.v1.InsightsService/TriggerMLPipeline",
6404            );
6405            let mut req = request.into_request();
6406            req.extensions_mut()
6407                .insert(
6408                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
6409                );
6410            self.inner.unary(req, path, codec).await
6411        }
6412    }
6413}
6414/// Generated server implementations.
6415pub mod insights_service_server {
6416    #![allow(
6417        unused_variables,
6418        dead_code,
6419        missing_docs,
6420        clippy::wildcard_imports,
6421        clippy::let_unit_value,
6422    )]
6423    use tonic::codegen::*;
6424    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
6425    #[async_trait]
6426    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
6427        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6428 Returns empty archetypes if insufficient data (cold start).
6429 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6430*/
6431        async fn get_group_archetypes(
6432            &self,
6433            request: tonic::Request<super::GetGroupArchetypesRequest>,
6434        ) -> std::result::Result<
6435            tonic::Response<super::GetGroupArchetypesResponse>,
6436            tonic::Status,
6437        >;
6438        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6439 Returns a confidence interval that narrows as more campaign data accumulates.
6440 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6441*/
6442        async fn predict_campaign_ack(
6443            &self,
6444            request: tonic::Request<super::PredictCampaignAckRequest>,
6445        ) -> std::result::Result<
6446            tonic::Response<super::PredictCampaignAckResponse>,
6447            tonic::Status,
6448        >;
6449        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6450 Advisory is informational only — never drives automated decisions.
6451 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6452*/
6453        async fn get_campaign_advisory(
6454            &self,
6455            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6456        ) -> std::result::Result<
6457            tonic::Response<super::GetCampaignAdvisoryResponse>,
6458            tonic::Status,
6459        >;
6460        /** Generate an AI-powered narrative summary of a group's insights.
6461 Combines archetype, prediction, and campaign data into human-readable analysis.
6462 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6463*/
6464        async fn get_insight_narrative(
6465            &self,
6466            request: tonic::Request<super::GetInsightNarrativeRequest>,
6467        ) -> std::result::Result<
6468            tonic::Response<super::GetInsightNarrativeResponse>,
6469            tonic::Status,
6470        >;
6471        /** Manually trigger the ML training pipeline for the caller's organization.
6472 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6473 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6474*/
6475        async fn trigger_ml_pipeline(
6476            &self,
6477            request: tonic::Request<super::TriggerMlPipelineRequest>,
6478        ) -> std::result::Result<
6479            tonic::Response<super::TriggerMlPipelineResponse>,
6480            tonic::Status,
6481        >;
6482    }
6483    /** Provides cohort-level AI insights for campaign planning and optimization.
6484 All predictions are aggregate — no individual-level profiling.
6485 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6486 All RPCs operate within the caller's org (extracted from JWT).
6487*/
6488    #[derive(Debug)]
6489    pub struct InsightsServiceServer<T> {
6490        inner: Arc<T>,
6491        accept_compression_encodings: EnabledCompressionEncodings,
6492        send_compression_encodings: EnabledCompressionEncodings,
6493        max_decoding_message_size: Option<usize>,
6494        max_encoding_message_size: Option<usize>,
6495    }
6496    impl<T> InsightsServiceServer<T> {
6497        pub fn new(inner: T) -> Self {
6498            Self::from_arc(Arc::new(inner))
6499        }
6500        pub fn from_arc(inner: Arc<T>) -> Self {
6501            Self {
6502                inner,
6503                accept_compression_encodings: Default::default(),
6504                send_compression_encodings: Default::default(),
6505                max_decoding_message_size: None,
6506                max_encoding_message_size: None,
6507            }
6508        }
6509        pub fn with_interceptor<F>(
6510            inner: T,
6511            interceptor: F,
6512        ) -> InterceptedService<Self, F>
6513        where
6514            F: tonic::service::Interceptor,
6515        {
6516            InterceptedService::new(Self::new(inner), interceptor)
6517        }
6518        /// Enable decompressing requests with the given encoding.
6519        #[must_use]
6520        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6521            self.accept_compression_encodings.enable(encoding);
6522            self
6523        }
6524        /// Compress responses with the given encoding, if the client supports it.
6525        #[must_use]
6526        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6527            self.send_compression_encodings.enable(encoding);
6528            self
6529        }
6530        /// Limits the maximum size of a decoded message.
6531        ///
6532        /// Default: `4MB`
6533        #[must_use]
6534        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6535            self.max_decoding_message_size = Some(limit);
6536            self
6537        }
6538        /// Limits the maximum size of an encoded message.
6539        ///
6540        /// Default: `usize::MAX`
6541        #[must_use]
6542        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6543            self.max_encoding_message_size = Some(limit);
6544            self
6545        }
6546    }
6547    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
6548    where
6549        T: InsightsService,
6550        B: Body + std::marker::Send + 'static,
6551        B::Error: Into<StdError> + std::marker::Send + 'static,
6552    {
6553        type Response = http::Response<tonic::body::Body>;
6554        type Error = std::convert::Infallible;
6555        type Future = BoxFuture<Self::Response, Self::Error>;
6556        fn poll_ready(
6557            &mut self,
6558            _cx: &mut Context<'_>,
6559        ) -> Poll<std::result::Result<(), Self::Error>> {
6560            Poll::Ready(Ok(()))
6561        }
6562        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6563            match req.uri().path() {
6564                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
6565                    #[allow(non_camel_case_types)]
6566                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
6567                    impl<
6568                        T: InsightsService,
6569                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
6570                    for GetGroupArchetypesSvc<T> {
6571                        type Response = super::GetGroupArchetypesResponse;
6572                        type Future = BoxFuture<
6573                            tonic::Response<Self::Response>,
6574                            tonic::Status,
6575                        >;
6576                        fn call(
6577                            &mut self,
6578                            request: tonic::Request<super::GetGroupArchetypesRequest>,
6579                        ) -> Self::Future {
6580                            let inner = Arc::clone(&self.0);
6581                            let fut = async move {
6582                                <T as InsightsService>::get_group_archetypes(
6583                                        &inner,
6584                                        request,
6585                                    )
6586                                    .await
6587                            };
6588                            Box::pin(fut)
6589                        }
6590                    }
6591                    let accept_compression_encodings = self.accept_compression_encodings;
6592                    let send_compression_encodings = self.send_compression_encodings;
6593                    let max_decoding_message_size = self.max_decoding_message_size;
6594                    let max_encoding_message_size = self.max_encoding_message_size;
6595                    let inner = self.inner.clone();
6596                    let fut = async move {
6597                        let method = GetGroupArchetypesSvc(inner);
6598                        let codec = tonic_prost::ProstCodec::default();
6599                        let mut grpc = tonic::server::Grpc::new(codec)
6600                            .apply_compression_config(
6601                                accept_compression_encodings,
6602                                send_compression_encodings,
6603                            )
6604                            .apply_max_message_size_config(
6605                                max_decoding_message_size,
6606                                max_encoding_message_size,
6607                            );
6608                        let res = grpc.unary(method, req).await;
6609                        Ok(res)
6610                    };
6611                    Box::pin(fut)
6612                }
6613                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
6614                    #[allow(non_camel_case_types)]
6615                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
6616                    impl<
6617                        T: InsightsService,
6618                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
6619                    for PredictCampaignACKSvc<T> {
6620                        type Response = super::PredictCampaignAckResponse;
6621                        type Future = BoxFuture<
6622                            tonic::Response<Self::Response>,
6623                            tonic::Status,
6624                        >;
6625                        fn call(
6626                            &mut self,
6627                            request: tonic::Request<super::PredictCampaignAckRequest>,
6628                        ) -> Self::Future {
6629                            let inner = Arc::clone(&self.0);
6630                            let fut = async move {
6631                                <T as InsightsService>::predict_campaign_ack(
6632                                        &inner,
6633                                        request,
6634                                    )
6635                                    .await
6636                            };
6637                            Box::pin(fut)
6638                        }
6639                    }
6640                    let accept_compression_encodings = self.accept_compression_encodings;
6641                    let send_compression_encodings = self.send_compression_encodings;
6642                    let max_decoding_message_size = self.max_decoding_message_size;
6643                    let max_encoding_message_size = self.max_encoding_message_size;
6644                    let inner = self.inner.clone();
6645                    let fut = async move {
6646                        let method = PredictCampaignACKSvc(inner);
6647                        let codec = tonic_prost::ProstCodec::default();
6648                        let mut grpc = tonic::server::Grpc::new(codec)
6649                            .apply_compression_config(
6650                                accept_compression_encodings,
6651                                send_compression_encodings,
6652                            )
6653                            .apply_max_message_size_config(
6654                                max_decoding_message_size,
6655                                max_encoding_message_size,
6656                            );
6657                        let res = grpc.unary(method, req).await;
6658                        Ok(res)
6659                    };
6660                    Box::pin(fut)
6661                }
6662                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
6663                    #[allow(non_camel_case_types)]
6664                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
6665                    impl<
6666                        T: InsightsService,
6667                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
6668                    for GetCampaignAdvisorySvc<T> {
6669                        type Response = super::GetCampaignAdvisoryResponse;
6670                        type Future = BoxFuture<
6671                            tonic::Response<Self::Response>,
6672                            tonic::Status,
6673                        >;
6674                        fn call(
6675                            &mut self,
6676                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6677                        ) -> Self::Future {
6678                            let inner = Arc::clone(&self.0);
6679                            let fut = async move {
6680                                <T as InsightsService>::get_campaign_advisory(
6681                                        &inner,
6682                                        request,
6683                                    )
6684                                    .await
6685                            };
6686                            Box::pin(fut)
6687                        }
6688                    }
6689                    let accept_compression_encodings = self.accept_compression_encodings;
6690                    let send_compression_encodings = self.send_compression_encodings;
6691                    let max_decoding_message_size = self.max_decoding_message_size;
6692                    let max_encoding_message_size = self.max_encoding_message_size;
6693                    let inner = self.inner.clone();
6694                    let fut = async move {
6695                        let method = GetCampaignAdvisorySvc(inner);
6696                        let codec = tonic_prost::ProstCodec::default();
6697                        let mut grpc = tonic::server::Grpc::new(codec)
6698                            .apply_compression_config(
6699                                accept_compression_encodings,
6700                                send_compression_encodings,
6701                            )
6702                            .apply_max_message_size_config(
6703                                max_decoding_message_size,
6704                                max_encoding_message_size,
6705                            );
6706                        let res = grpc.unary(method, req).await;
6707                        Ok(res)
6708                    };
6709                    Box::pin(fut)
6710                }
6711                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
6712                    #[allow(non_camel_case_types)]
6713                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
6714                    impl<
6715                        T: InsightsService,
6716                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
6717                    for GetInsightNarrativeSvc<T> {
6718                        type Response = super::GetInsightNarrativeResponse;
6719                        type Future = BoxFuture<
6720                            tonic::Response<Self::Response>,
6721                            tonic::Status,
6722                        >;
6723                        fn call(
6724                            &mut self,
6725                            request: tonic::Request<super::GetInsightNarrativeRequest>,
6726                        ) -> Self::Future {
6727                            let inner = Arc::clone(&self.0);
6728                            let fut = async move {
6729                                <T as InsightsService>::get_insight_narrative(
6730                                        &inner,
6731                                        request,
6732                                    )
6733                                    .await
6734                            };
6735                            Box::pin(fut)
6736                        }
6737                    }
6738                    let accept_compression_encodings = self.accept_compression_encodings;
6739                    let send_compression_encodings = self.send_compression_encodings;
6740                    let max_decoding_message_size = self.max_decoding_message_size;
6741                    let max_encoding_message_size = self.max_encoding_message_size;
6742                    let inner = self.inner.clone();
6743                    let fut = async move {
6744                        let method = GetInsightNarrativeSvc(inner);
6745                        let codec = tonic_prost::ProstCodec::default();
6746                        let mut grpc = tonic::server::Grpc::new(codec)
6747                            .apply_compression_config(
6748                                accept_compression_encodings,
6749                                send_compression_encodings,
6750                            )
6751                            .apply_max_message_size_config(
6752                                max_decoding_message_size,
6753                                max_encoding_message_size,
6754                            );
6755                        let res = grpc.unary(method, req).await;
6756                        Ok(res)
6757                    };
6758                    Box::pin(fut)
6759                }
6760                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
6761                    #[allow(non_camel_case_types)]
6762                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
6763                    impl<
6764                        T: InsightsService,
6765                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
6766                    for TriggerMLPipelineSvc<T> {
6767                        type Response = super::TriggerMlPipelineResponse;
6768                        type Future = BoxFuture<
6769                            tonic::Response<Self::Response>,
6770                            tonic::Status,
6771                        >;
6772                        fn call(
6773                            &mut self,
6774                            request: tonic::Request<super::TriggerMlPipelineRequest>,
6775                        ) -> Self::Future {
6776                            let inner = Arc::clone(&self.0);
6777                            let fut = async move {
6778                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
6779                                    .await
6780                            };
6781                            Box::pin(fut)
6782                        }
6783                    }
6784                    let accept_compression_encodings = self.accept_compression_encodings;
6785                    let send_compression_encodings = self.send_compression_encodings;
6786                    let max_decoding_message_size = self.max_decoding_message_size;
6787                    let max_encoding_message_size = self.max_encoding_message_size;
6788                    let inner = self.inner.clone();
6789                    let fut = async move {
6790                        let method = TriggerMLPipelineSvc(inner);
6791                        let codec = tonic_prost::ProstCodec::default();
6792                        let mut grpc = tonic::server::Grpc::new(codec)
6793                            .apply_compression_config(
6794                                accept_compression_encodings,
6795                                send_compression_encodings,
6796                            )
6797                            .apply_max_message_size_config(
6798                                max_decoding_message_size,
6799                                max_encoding_message_size,
6800                            );
6801                        let res = grpc.unary(method, req).await;
6802                        Ok(res)
6803                    };
6804                    Box::pin(fut)
6805                }
6806                _ => {
6807                    Box::pin(async move {
6808                        let mut response = http::Response::new(
6809                            tonic::body::Body::default(),
6810                        );
6811                        let headers = response.headers_mut();
6812                        headers
6813                            .insert(
6814                                tonic::Status::GRPC_STATUS,
6815                                (tonic::Code::Unimplemented as i32).into(),
6816                            );
6817                        headers
6818                            .insert(
6819                                http::header::CONTENT_TYPE,
6820                                tonic::metadata::GRPC_CONTENT_TYPE,
6821                            );
6822                        Ok(response)
6823                    })
6824                }
6825            }
6826        }
6827    }
6828    impl<T> Clone for InsightsServiceServer<T> {
6829        fn clone(&self) -> Self {
6830            let inner = self.inner.clone();
6831            Self {
6832                inner,
6833                accept_compression_encodings: self.accept_compression_encodings,
6834                send_compression_encodings: self.send_compression_encodings,
6835                max_decoding_message_size: self.max_decoding_message_size,
6836                max_encoding_message_size: self.max_encoding_message_size,
6837            }
6838        }
6839    }
6840    /// Generated gRPC service name
6841    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
6842    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
6843        const NAME: &'static str = SERVICE_NAME;
6844    }
6845}
6846/// Generated client implementations.
6847pub mod invite_link_service_client {
6848    #![allow(
6849        unused_variables,
6850        dead_code,
6851        missing_docs,
6852        clippy::wildcard_imports,
6853        clippy::let_unit_value,
6854    )]
6855    use tonic::codegen::*;
6856    use tonic::codegen::http::Uri;
6857    /** Manages shareable invite links for organization self-join.
6858 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
6859 ValidateInviteLink is unauthenticated — the token IS the authorization.
6860 RedeemInviteLink requires a valid JWT.
6861*/
6862    #[derive(Debug, Clone)]
6863    pub struct InviteLinkServiceClient<T> {
6864        inner: tonic::client::Grpc<T>,
6865    }
6866    impl InviteLinkServiceClient<tonic::transport::Channel> {
6867        /// Attempt to create a new client by connecting to a given endpoint.
6868        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6869        where
6870            D: TryInto<tonic::transport::Endpoint>,
6871            D::Error: Into<StdError>,
6872        {
6873            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6874            Ok(Self::new(conn))
6875        }
6876    }
6877    impl<T> InviteLinkServiceClient<T>
6878    where
6879        T: tonic::client::GrpcService<tonic::body::Body>,
6880        T::Error: Into<StdError>,
6881        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6882        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6883    {
6884        pub fn new(inner: T) -> Self {
6885            let inner = tonic::client::Grpc::new(inner);
6886            Self { inner }
6887        }
6888        pub fn with_origin(inner: T, origin: Uri) -> Self {
6889            let inner = tonic::client::Grpc::with_origin(inner, origin);
6890            Self { inner }
6891        }
6892        pub fn with_interceptor<F>(
6893            inner: T,
6894            interceptor: F,
6895        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
6896        where
6897            F: tonic::service::Interceptor,
6898            T::ResponseBody: Default,
6899            T: tonic::codegen::Service<
6900                http::Request<tonic::body::Body>,
6901                Response = http::Response<
6902                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6903                >,
6904            >,
6905            <T as tonic::codegen::Service<
6906                http::Request<tonic::body::Body>,
6907            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6908        {
6909            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
6910        }
6911        /// Compress requests with the given encoding.
6912        ///
6913        /// This requires the server to support it otherwise it might respond with an
6914        /// error.
6915        #[must_use]
6916        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6917            self.inner = self.inner.send_compressed(encoding);
6918            self
6919        }
6920        /// Enable decompressing responses.
6921        #[must_use]
6922        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6923            self.inner = self.inner.accept_compressed(encoding);
6924            self
6925        }
6926        /// Limits the maximum size of a decoded message.
6927        ///
6928        /// Default: `4MB`
6929        #[must_use]
6930        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6931            self.inner = self.inner.max_decoding_message_size(limit);
6932            self
6933        }
6934        /// Limits the maximum size of an encoded message.
6935        ///
6936        /// Default: `usize::MAX`
6937        #[must_use]
6938        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6939            self.inner = self.inner.max_encoding_message_size(limit);
6940            self
6941        }
6942        /** Create a new shareable invite link for the organization.
6943 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6944*/
6945        pub async fn create_invite_link(
6946            &mut self,
6947            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
6948        ) -> std::result::Result<
6949            tonic::Response<super::CreateInviteLinkResponse>,
6950            tonic::Status,
6951        > {
6952            self.inner
6953                .ready()
6954                .await
6955                .map_err(|e| {
6956                    tonic::Status::unknown(
6957                        format!("Service was not ready: {}", e.into()),
6958                    )
6959                })?;
6960            let codec = tonic_prost::ProstCodec::default();
6961            let path = http::uri::PathAndQuery::from_static(
6962                "/pidgr.v1.InviteLinkService/CreateInviteLink",
6963            );
6964            let mut req = request.into_request();
6965            req.extensions_mut()
6966                .insert(
6967                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
6968                );
6969            self.inner.unary(req, path, codec).await
6970        }
6971        /** List all invite links for the organization.
6972 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6973*/
6974        pub async fn list_invite_links(
6975            &mut self,
6976            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
6977        ) -> std::result::Result<
6978            tonic::Response<super::ListInviteLinksResponse>,
6979            tonic::Status,
6980        > {
6981            self.inner
6982                .ready()
6983                .await
6984                .map_err(|e| {
6985                    tonic::Status::unknown(
6986                        format!("Service was not ready: {}", e.into()),
6987                    )
6988                })?;
6989            let codec = tonic_prost::ProstCodec::default();
6990            let path = http::uri::PathAndQuery::from_static(
6991                "/pidgr.v1.InviteLinkService/ListInviteLinks",
6992            );
6993            let mut req = request.into_request();
6994            req.extensions_mut()
6995                .insert(
6996                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
6997                );
6998            self.inner.unary(req, path, codec).await
6999        }
7000        /** Revoke an invite link, making it immediately unusable. Idempotent.
7001 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7002*/
7003        pub async fn revoke_invite_link(
7004            &mut self,
7005            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
7006        ) -> std::result::Result<
7007            tonic::Response<super::RevokeInviteLinkResponse>,
7008            tonic::Status,
7009        > {
7010            self.inner
7011                .ready()
7012                .await
7013                .map_err(|e| {
7014                    tonic::Status::unknown(
7015                        format!("Service was not ready: {}", e.into()),
7016                    )
7017                })?;
7018            let codec = tonic_prost::ProstCodec::default();
7019            let path = http::uri::PathAndQuery::from_static(
7020                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
7021            );
7022            let mut req = request.into_request();
7023            req.extensions_mut()
7024                .insert(
7025                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
7026                );
7027            self.inner.unary(req, path, codec).await
7028        }
7029        /** Validate an invite link and provision a user account if needed.
7030 This is a pre-authentication endpoint — no JWT required.
7031 Rate limited to 10 requests per minute per IP.
7032 Authorization: None (token-based).
7033*/
7034        pub async fn validate_invite_link(
7035            &mut self,
7036            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
7037        ) -> std::result::Result<
7038            tonic::Response<super::ValidateInviteLinkResponse>,
7039            tonic::Status,
7040        > {
7041            self.inner
7042                .ready()
7043                .await
7044                .map_err(|e| {
7045                    tonic::Status::unknown(
7046                        format!("Service was not ready: {}", e.into()),
7047                    )
7048                })?;
7049            let codec = tonic_prost::ProstCodec::default();
7050            let path = http::uri::PathAndQuery::from_static(
7051                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
7052            );
7053            let mut req = request.into_request();
7054            req.extensions_mut()
7055                .insert(
7056                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
7057                );
7058            self.inner.unary(req, path, codec).await
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        pub async fn redeem_invite_link(
7065            &mut self,
7066            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
7067        ) -> std::result::Result<
7068            tonic::Response<super::RedeemInviteLinkResponse>,
7069            tonic::Status,
7070        > {
7071            self.inner
7072                .ready()
7073                .await
7074                .map_err(|e| {
7075                    tonic::Status::unknown(
7076                        format!("Service was not ready: {}", e.into()),
7077                    )
7078                })?;
7079            let codec = tonic_prost::ProstCodec::default();
7080            let path = http::uri::PathAndQuery::from_static(
7081                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
7082            );
7083            let mut req = request.into_request();
7084            req.extensions_mut()
7085                .insert(
7086                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
7087                );
7088            self.inner.unary(req, path, codec).await
7089        }
7090    }
7091}
7092/// Generated server implementations.
7093pub mod invite_link_service_server {
7094    #![allow(
7095        unused_variables,
7096        dead_code,
7097        missing_docs,
7098        clippy::wildcard_imports,
7099        clippy::let_unit_value,
7100    )]
7101    use tonic::codegen::*;
7102    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
7103    #[async_trait]
7104    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
7105        /** Create a new shareable invite link for the organization.
7106 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7107*/
7108        async fn create_invite_link(
7109            &self,
7110            request: tonic::Request<super::CreateInviteLinkRequest>,
7111        ) -> std::result::Result<
7112            tonic::Response<super::CreateInviteLinkResponse>,
7113            tonic::Status,
7114        >;
7115        /** List all invite links for the organization.
7116 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7117*/
7118        async fn list_invite_links(
7119            &self,
7120            request: tonic::Request<super::ListInviteLinksRequest>,
7121        ) -> std::result::Result<
7122            tonic::Response<super::ListInviteLinksResponse>,
7123            tonic::Status,
7124        >;
7125        /** Revoke an invite link, making it immediately unusable. Idempotent.
7126 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7127*/
7128        async fn revoke_invite_link(
7129            &self,
7130            request: tonic::Request<super::RevokeInviteLinkRequest>,
7131        ) -> std::result::Result<
7132            tonic::Response<super::RevokeInviteLinkResponse>,
7133            tonic::Status,
7134        >;
7135        /** Validate an invite link and provision a user account if needed.
7136 This is a pre-authentication endpoint — no JWT required.
7137 Rate limited to 10 requests per minute per IP.
7138 Authorization: None (token-based).
7139*/
7140        async fn validate_invite_link(
7141            &self,
7142            request: tonic::Request<super::ValidateInviteLinkRequest>,
7143        ) -> std::result::Result<
7144            tonic::Response<super::ValidateInviteLinkResponse>,
7145            tonic::Status,
7146        >;
7147        /** Redeem an invite link to join an organization.
7148 Requires a valid JWT — the email is extracted from the token.
7149 Authorization: JWT required.
7150*/
7151        async fn redeem_invite_link(
7152            &self,
7153            request: tonic::Request<super::RedeemInviteLinkRequest>,
7154        ) -> std::result::Result<
7155            tonic::Response<super::RedeemInviteLinkResponse>,
7156            tonic::Status,
7157        >;
7158    }
7159    /** Manages shareable invite links for organization self-join.
7160 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
7161 ValidateInviteLink is unauthenticated — the token IS the authorization.
7162 RedeemInviteLink requires a valid JWT.
7163*/
7164    #[derive(Debug)]
7165    pub struct InviteLinkServiceServer<T> {
7166        inner: Arc<T>,
7167        accept_compression_encodings: EnabledCompressionEncodings,
7168        send_compression_encodings: EnabledCompressionEncodings,
7169        max_decoding_message_size: Option<usize>,
7170        max_encoding_message_size: Option<usize>,
7171    }
7172    impl<T> InviteLinkServiceServer<T> {
7173        pub fn new(inner: T) -> Self {
7174            Self::from_arc(Arc::new(inner))
7175        }
7176        pub fn from_arc(inner: Arc<T>) -> Self {
7177            Self {
7178                inner,
7179                accept_compression_encodings: Default::default(),
7180                send_compression_encodings: Default::default(),
7181                max_decoding_message_size: None,
7182                max_encoding_message_size: None,
7183            }
7184        }
7185        pub fn with_interceptor<F>(
7186            inner: T,
7187            interceptor: F,
7188        ) -> InterceptedService<Self, F>
7189        where
7190            F: tonic::service::Interceptor,
7191        {
7192            InterceptedService::new(Self::new(inner), interceptor)
7193        }
7194        /// Enable decompressing requests with the given encoding.
7195        #[must_use]
7196        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7197            self.accept_compression_encodings.enable(encoding);
7198            self
7199        }
7200        /// Compress responses with the given encoding, if the client supports it.
7201        #[must_use]
7202        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7203            self.send_compression_encodings.enable(encoding);
7204            self
7205        }
7206        /// Limits the maximum size of a decoded message.
7207        ///
7208        /// Default: `4MB`
7209        #[must_use]
7210        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7211            self.max_decoding_message_size = Some(limit);
7212            self
7213        }
7214        /// Limits the maximum size of an encoded message.
7215        ///
7216        /// Default: `usize::MAX`
7217        #[must_use]
7218        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7219            self.max_encoding_message_size = Some(limit);
7220            self
7221        }
7222    }
7223    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
7224    where
7225        T: InviteLinkService,
7226        B: Body + std::marker::Send + 'static,
7227        B::Error: Into<StdError> + std::marker::Send + 'static,
7228    {
7229        type Response = http::Response<tonic::body::Body>;
7230        type Error = std::convert::Infallible;
7231        type Future = BoxFuture<Self::Response, Self::Error>;
7232        fn poll_ready(
7233            &mut self,
7234            _cx: &mut Context<'_>,
7235        ) -> Poll<std::result::Result<(), Self::Error>> {
7236            Poll::Ready(Ok(()))
7237        }
7238        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7239            match req.uri().path() {
7240                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
7241                    #[allow(non_camel_case_types)]
7242                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7243                    impl<
7244                        T: InviteLinkService,
7245                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
7246                    for CreateInviteLinkSvc<T> {
7247                        type Response = super::CreateInviteLinkResponse;
7248                        type Future = BoxFuture<
7249                            tonic::Response<Self::Response>,
7250                            tonic::Status,
7251                        >;
7252                        fn call(
7253                            &mut self,
7254                            request: tonic::Request<super::CreateInviteLinkRequest>,
7255                        ) -> Self::Future {
7256                            let inner = Arc::clone(&self.0);
7257                            let fut = async move {
7258                                <T as InviteLinkService>::create_invite_link(
7259                                        &inner,
7260                                        request,
7261                                    )
7262                                    .await
7263                            };
7264                            Box::pin(fut)
7265                        }
7266                    }
7267                    let accept_compression_encodings = self.accept_compression_encodings;
7268                    let send_compression_encodings = self.send_compression_encodings;
7269                    let max_decoding_message_size = self.max_decoding_message_size;
7270                    let max_encoding_message_size = self.max_encoding_message_size;
7271                    let inner = self.inner.clone();
7272                    let fut = async move {
7273                        let method = CreateInviteLinkSvc(inner);
7274                        let codec = tonic_prost::ProstCodec::default();
7275                        let mut grpc = tonic::server::Grpc::new(codec)
7276                            .apply_compression_config(
7277                                accept_compression_encodings,
7278                                send_compression_encodings,
7279                            )
7280                            .apply_max_message_size_config(
7281                                max_decoding_message_size,
7282                                max_encoding_message_size,
7283                            );
7284                        let res = grpc.unary(method, req).await;
7285                        Ok(res)
7286                    };
7287                    Box::pin(fut)
7288                }
7289                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
7290                    #[allow(non_camel_case_types)]
7291                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
7292                    impl<
7293                        T: InviteLinkService,
7294                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
7295                    for ListInviteLinksSvc<T> {
7296                        type Response = super::ListInviteLinksResponse;
7297                        type Future = BoxFuture<
7298                            tonic::Response<Self::Response>,
7299                            tonic::Status,
7300                        >;
7301                        fn call(
7302                            &mut self,
7303                            request: tonic::Request<super::ListInviteLinksRequest>,
7304                        ) -> Self::Future {
7305                            let inner = Arc::clone(&self.0);
7306                            let fut = async move {
7307                                <T as InviteLinkService>::list_invite_links(&inner, request)
7308                                    .await
7309                            };
7310                            Box::pin(fut)
7311                        }
7312                    }
7313                    let accept_compression_encodings = self.accept_compression_encodings;
7314                    let send_compression_encodings = self.send_compression_encodings;
7315                    let max_decoding_message_size = self.max_decoding_message_size;
7316                    let max_encoding_message_size = self.max_encoding_message_size;
7317                    let inner = self.inner.clone();
7318                    let fut = async move {
7319                        let method = ListInviteLinksSvc(inner);
7320                        let codec = tonic_prost::ProstCodec::default();
7321                        let mut grpc = tonic::server::Grpc::new(codec)
7322                            .apply_compression_config(
7323                                accept_compression_encodings,
7324                                send_compression_encodings,
7325                            )
7326                            .apply_max_message_size_config(
7327                                max_decoding_message_size,
7328                                max_encoding_message_size,
7329                            );
7330                        let res = grpc.unary(method, req).await;
7331                        Ok(res)
7332                    };
7333                    Box::pin(fut)
7334                }
7335                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
7336                    #[allow(non_camel_case_types)]
7337                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7338                    impl<
7339                        T: InviteLinkService,
7340                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
7341                    for RevokeInviteLinkSvc<T> {
7342                        type Response = super::RevokeInviteLinkResponse;
7343                        type Future = BoxFuture<
7344                            tonic::Response<Self::Response>,
7345                            tonic::Status,
7346                        >;
7347                        fn call(
7348                            &mut self,
7349                            request: tonic::Request<super::RevokeInviteLinkRequest>,
7350                        ) -> Self::Future {
7351                            let inner = Arc::clone(&self.0);
7352                            let fut = async move {
7353                                <T as InviteLinkService>::revoke_invite_link(
7354                                        &inner,
7355                                        request,
7356                                    )
7357                                    .await
7358                            };
7359                            Box::pin(fut)
7360                        }
7361                    }
7362                    let accept_compression_encodings = self.accept_compression_encodings;
7363                    let send_compression_encodings = self.send_compression_encodings;
7364                    let max_decoding_message_size = self.max_decoding_message_size;
7365                    let max_encoding_message_size = self.max_encoding_message_size;
7366                    let inner = self.inner.clone();
7367                    let fut = async move {
7368                        let method = RevokeInviteLinkSvc(inner);
7369                        let codec = tonic_prost::ProstCodec::default();
7370                        let mut grpc = tonic::server::Grpc::new(codec)
7371                            .apply_compression_config(
7372                                accept_compression_encodings,
7373                                send_compression_encodings,
7374                            )
7375                            .apply_max_message_size_config(
7376                                max_decoding_message_size,
7377                                max_encoding_message_size,
7378                            );
7379                        let res = grpc.unary(method, req).await;
7380                        Ok(res)
7381                    };
7382                    Box::pin(fut)
7383                }
7384                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
7385                    #[allow(non_camel_case_types)]
7386                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7387                    impl<
7388                        T: InviteLinkService,
7389                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
7390                    for ValidateInviteLinkSvc<T> {
7391                        type Response = super::ValidateInviteLinkResponse;
7392                        type Future = BoxFuture<
7393                            tonic::Response<Self::Response>,
7394                            tonic::Status,
7395                        >;
7396                        fn call(
7397                            &mut self,
7398                            request: tonic::Request<super::ValidateInviteLinkRequest>,
7399                        ) -> Self::Future {
7400                            let inner = Arc::clone(&self.0);
7401                            let fut = async move {
7402                                <T as InviteLinkService>::validate_invite_link(
7403                                        &inner,
7404                                        request,
7405                                    )
7406                                    .await
7407                            };
7408                            Box::pin(fut)
7409                        }
7410                    }
7411                    let accept_compression_encodings = self.accept_compression_encodings;
7412                    let send_compression_encodings = self.send_compression_encodings;
7413                    let max_decoding_message_size = self.max_decoding_message_size;
7414                    let max_encoding_message_size = self.max_encoding_message_size;
7415                    let inner = self.inner.clone();
7416                    let fut = async move {
7417                        let method = ValidateInviteLinkSvc(inner);
7418                        let codec = tonic_prost::ProstCodec::default();
7419                        let mut grpc = tonic::server::Grpc::new(codec)
7420                            .apply_compression_config(
7421                                accept_compression_encodings,
7422                                send_compression_encodings,
7423                            )
7424                            .apply_max_message_size_config(
7425                                max_decoding_message_size,
7426                                max_encoding_message_size,
7427                            );
7428                        let res = grpc.unary(method, req).await;
7429                        Ok(res)
7430                    };
7431                    Box::pin(fut)
7432                }
7433                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
7434                    #[allow(non_camel_case_types)]
7435                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7436                    impl<
7437                        T: InviteLinkService,
7438                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
7439                    for RedeemInviteLinkSvc<T> {
7440                        type Response = super::RedeemInviteLinkResponse;
7441                        type Future = BoxFuture<
7442                            tonic::Response<Self::Response>,
7443                            tonic::Status,
7444                        >;
7445                        fn call(
7446                            &mut self,
7447                            request: tonic::Request<super::RedeemInviteLinkRequest>,
7448                        ) -> Self::Future {
7449                            let inner = Arc::clone(&self.0);
7450                            let fut = async move {
7451                                <T as InviteLinkService>::redeem_invite_link(
7452                                        &inner,
7453                                        request,
7454                                    )
7455                                    .await
7456                            };
7457                            Box::pin(fut)
7458                        }
7459                    }
7460                    let accept_compression_encodings = self.accept_compression_encodings;
7461                    let send_compression_encodings = self.send_compression_encodings;
7462                    let max_decoding_message_size = self.max_decoding_message_size;
7463                    let max_encoding_message_size = self.max_encoding_message_size;
7464                    let inner = self.inner.clone();
7465                    let fut = async move {
7466                        let method = RedeemInviteLinkSvc(inner);
7467                        let codec = tonic_prost::ProstCodec::default();
7468                        let mut grpc = tonic::server::Grpc::new(codec)
7469                            .apply_compression_config(
7470                                accept_compression_encodings,
7471                                send_compression_encodings,
7472                            )
7473                            .apply_max_message_size_config(
7474                                max_decoding_message_size,
7475                                max_encoding_message_size,
7476                            );
7477                        let res = grpc.unary(method, req).await;
7478                        Ok(res)
7479                    };
7480                    Box::pin(fut)
7481                }
7482                _ => {
7483                    Box::pin(async move {
7484                        let mut response = http::Response::new(
7485                            tonic::body::Body::default(),
7486                        );
7487                        let headers = response.headers_mut();
7488                        headers
7489                            .insert(
7490                                tonic::Status::GRPC_STATUS,
7491                                (tonic::Code::Unimplemented as i32).into(),
7492                            );
7493                        headers
7494                            .insert(
7495                                http::header::CONTENT_TYPE,
7496                                tonic::metadata::GRPC_CONTENT_TYPE,
7497                            );
7498                        Ok(response)
7499                    })
7500                }
7501            }
7502        }
7503    }
7504    impl<T> Clone for InviteLinkServiceServer<T> {
7505        fn clone(&self) -> Self {
7506            let inner = self.inner.clone();
7507            Self {
7508                inner,
7509                accept_compression_encodings: self.accept_compression_encodings,
7510                send_compression_encodings: self.send_compression_encodings,
7511                max_decoding_message_size: self.max_decoding_message_size,
7512                max_encoding_message_size: self.max_encoding_message_size,
7513            }
7514        }
7515    }
7516    /// Generated gRPC service name
7517    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
7518    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
7519        const NAME: &'static str = SERVICE_NAME;
7520    }
7521}
7522/// Generated client implementations.
7523pub mod member_service_client {
7524    #![allow(
7525        unused_variables,
7526        dead_code,
7527        missing_docs,
7528        clippy::wildcard_imports,
7529        clippy::let_unit_value,
7530    )]
7531    use tonic::codegen::*;
7532    use tonic::codegen::http::Uri;
7533    /** Manages members (users) within an organization.
7534 All RPCs operate within the caller's org (extracted from JWT).
7535*/
7536    #[derive(Debug, Clone)]
7537    pub struct MemberServiceClient<T> {
7538        inner: tonic::client::Grpc<T>,
7539    }
7540    impl MemberServiceClient<tonic::transport::Channel> {
7541        /// Attempt to create a new client by connecting to a given endpoint.
7542        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7543        where
7544            D: TryInto<tonic::transport::Endpoint>,
7545            D::Error: Into<StdError>,
7546        {
7547            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7548            Ok(Self::new(conn))
7549        }
7550    }
7551    impl<T> MemberServiceClient<T>
7552    where
7553        T: tonic::client::GrpcService<tonic::body::Body>,
7554        T::Error: Into<StdError>,
7555        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7556        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7557    {
7558        pub fn new(inner: T) -> Self {
7559            let inner = tonic::client::Grpc::new(inner);
7560            Self { inner }
7561        }
7562        pub fn with_origin(inner: T, origin: Uri) -> Self {
7563            let inner = tonic::client::Grpc::with_origin(inner, origin);
7564            Self { inner }
7565        }
7566        pub fn with_interceptor<F>(
7567            inner: T,
7568            interceptor: F,
7569        ) -> MemberServiceClient<InterceptedService<T, F>>
7570        where
7571            F: tonic::service::Interceptor,
7572            T::ResponseBody: Default,
7573            T: tonic::codegen::Service<
7574                http::Request<tonic::body::Body>,
7575                Response = http::Response<
7576                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7577                >,
7578            >,
7579            <T as tonic::codegen::Service<
7580                http::Request<tonic::body::Body>,
7581            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7582        {
7583            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
7584        }
7585        /// Compress requests with the given encoding.
7586        ///
7587        /// This requires the server to support it otherwise it might respond with an
7588        /// error.
7589        #[must_use]
7590        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7591            self.inner = self.inner.send_compressed(encoding);
7592            self
7593        }
7594        /// Enable decompressing responses.
7595        #[must_use]
7596        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7597            self.inner = self.inner.accept_compressed(encoding);
7598            self
7599        }
7600        /// Limits the maximum size of a decoded message.
7601        ///
7602        /// Default: `4MB`
7603        #[must_use]
7604        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7605            self.inner = self.inner.max_decoding_message_size(limit);
7606            self
7607        }
7608        /// Limits the maximum size of an encoded message.
7609        ///
7610        /// Default: `usize::MAX`
7611        #[must_use]
7612        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7613            self.inner = self.inner.max_encoding_message_size(limit);
7614            self
7615        }
7616        /** Invite a new user to the organization via email.
7617 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7618*/
7619        pub async fn invite_user(
7620            &mut self,
7621            request: impl tonic::IntoRequest<super::InviteUserRequest>,
7622        ) -> std::result::Result<
7623            tonic::Response<super::InviteUserResponse>,
7624            tonic::Status,
7625        > {
7626            self.inner
7627                .ready()
7628                .await
7629                .map_err(|e| {
7630                    tonic::Status::unknown(
7631                        format!("Service was not ready: {}", e.into()),
7632                    )
7633                })?;
7634            let codec = tonic_prost::ProstCodec::default();
7635            let path = http::uri::PathAndQuery::from_static(
7636                "/pidgr.v1.MemberService/InviteUser",
7637            );
7638            let mut req = request.into_request();
7639            req.extensions_mut()
7640                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
7641            self.inner.unary(req, path, codec).await
7642        }
7643        /** Retrieve a user by ID within the organization.
7644 Self-lookup (empty user_id) is allowed for any authenticated user.
7645 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
7646*/
7647        pub async fn get_user(
7648            &mut self,
7649            request: impl tonic::IntoRequest<super::GetUserRequest>,
7650        ) -> std::result::Result<
7651            tonic::Response<super::GetUserResponse>,
7652            tonic::Status,
7653        > {
7654            self.inner
7655                .ready()
7656                .await
7657                .map_err(|e| {
7658                    tonic::Status::unknown(
7659                        format!("Service was not ready: {}", e.into()),
7660                    )
7661                })?;
7662            let codec = tonic_prost::ProstCodec::default();
7663            let path = http::uri::PathAndQuery::from_static(
7664                "/pidgr.v1.MemberService/GetUser",
7665            );
7666            let mut req = request.into_request();
7667            req.extensions_mut()
7668                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
7669            self.inner.unary(req, path, codec).await
7670        }
7671        /** List all users in the organization with pagination.
7672 Authorization: Requires PERMISSION_MEMBERS_READ.
7673*/
7674        pub async fn list_users(
7675            &mut self,
7676            request: impl tonic::IntoRequest<super::ListUsersRequest>,
7677        ) -> std::result::Result<
7678            tonic::Response<super::ListUsersResponse>,
7679            tonic::Status,
7680        > {
7681            self.inner
7682                .ready()
7683                .await
7684                .map_err(|e| {
7685                    tonic::Status::unknown(
7686                        format!("Service was not ready: {}", e.into()),
7687                    )
7688                })?;
7689            let codec = tonic_prost::ProstCodec::default();
7690            let path = http::uri::PathAndQuery::from_static(
7691                "/pidgr.v1.MemberService/ListUsers",
7692            );
7693            let mut req = request.into_request();
7694            req.extensions_mut()
7695                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
7696            self.inner.unary(req, path, codec).await
7697        }
7698        /** Change a user's role within the organization.
7699 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7700*/
7701        pub async fn update_user_role(
7702            &mut self,
7703            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
7704        ) -> std::result::Result<
7705            tonic::Response<super::UpdateUserRoleResponse>,
7706            tonic::Status,
7707        > {
7708            self.inner
7709                .ready()
7710                .await
7711                .map_err(|e| {
7712                    tonic::Status::unknown(
7713                        format!("Service was not ready: {}", e.into()),
7714                    )
7715                })?;
7716            let codec = tonic_prost::ProstCodec::default();
7717            let path = http::uri::PathAndQuery::from_static(
7718                "/pidgr.v1.MemberService/UpdateUserRole",
7719            );
7720            let mut req = request.into_request();
7721            req.extensions_mut()
7722                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
7723            self.inner.unary(req, path, codec).await
7724        }
7725        /** Deactivate a user within the organization.
7726 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7727*/
7728        pub async fn deactivate_user(
7729            &mut self,
7730            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
7731        ) -> std::result::Result<
7732            tonic::Response<super::DeactivateUserResponse>,
7733            tonic::Status,
7734        > {
7735            self.inner
7736                .ready()
7737                .await
7738                .map_err(|e| {
7739                    tonic::Status::unknown(
7740                        format!("Service was not ready: {}", e.into()),
7741                    )
7742                })?;
7743            let codec = tonic_prost::ProstCodec::default();
7744            let path = http::uri::PathAndQuery::from_static(
7745                "/pidgr.v1.MemberService/DeactivateUser",
7746            );
7747            let mut req = request.into_request();
7748            req.extensions_mut()
7749                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
7750            self.inner.unary(req, path, codec).await
7751        }
7752        /** Reactivate a deactivated user, restoring their status to INVITED.
7753 The user must complete the invite link flow again to become ACTIVE.
7754 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7755*/
7756        pub async fn reactivate_user(
7757            &mut self,
7758            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
7759        ) -> std::result::Result<
7760            tonic::Response<super::ReactivateUserResponse>,
7761            tonic::Status,
7762        > {
7763            self.inner
7764                .ready()
7765                .await
7766                .map_err(|e| {
7767                    tonic::Status::unknown(
7768                        format!("Service was not ready: {}", e.into()),
7769                    )
7770                })?;
7771            let codec = tonic_prost::ProstCodec::default();
7772            let path = http::uri::PathAndQuery::from_static(
7773                "/pidgr.v1.MemberService/ReactivateUser",
7774            );
7775            let mut req = request.into_request();
7776            req.extensions_mut()
7777                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
7778            self.inner.unary(req, path, codec).await
7779        }
7780        /** Revoke an invitation for a user who has not yet completed registration.
7781 Hard-deletes the user record (INVITED users have no data to preserve).
7782 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7783*/
7784        pub async fn revoke_invite(
7785            &mut self,
7786            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
7787        ) -> std::result::Result<
7788            tonic::Response<super::RevokeInviteResponse>,
7789            tonic::Status,
7790        > {
7791            self.inner
7792                .ready()
7793                .await
7794                .map_err(|e| {
7795                    tonic::Status::unknown(
7796                        format!("Service was not ready: {}", e.into()),
7797                    )
7798                })?;
7799            let codec = tonic_prost::ProstCodec::default();
7800            let path = http::uri::PathAndQuery::from_static(
7801                "/pidgr.v1.MemberService/RevokeInvite",
7802            );
7803            let mut req = request.into_request();
7804            req.extensions_mut()
7805                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
7806            self.inner.unary(req, path, codec).await
7807        }
7808        /** Update a user's profile attributes (department, title, etc.).
7809 Self-update (empty user_id or matching JWT sub) requires no special permission.
7810 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7811*/
7812        pub async fn update_user_profile(
7813            &mut self,
7814            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
7815        ) -> std::result::Result<
7816            tonic::Response<super::UpdateUserProfileResponse>,
7817            tonic::Status,
7818        > {
7819            self.inner
7820                .ready()
7821                .await
7822                .map_err(|e| {
7823                    tonic::Status::unknown(
7824                        format!("Service was not ready: {}", e.into()),
7825                    )
7826                })?;
7827            let codec = tonic_prost::ProstCodec::default();
7828            let path = http::uri::PathAndQuery::from_static(
7829                "/pidgr.v1.MemberService/UpdateUserProfile",
7830            );
7831            let mut req = request.into_request();
7832            req.extensions_mut()
7833                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
7834            self.inner.unary(req, path, codec).await
7835        }
7836        /** Retrieve the caller's platform settings (theme, etc.).
7837 Authorization: Any authenticated user (self-only).
7838*/
7839        pub async fn get_user_settings(
7840            &mut self,
7841            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
7842        ) -> std::result::Result<
7843            tonic::Response<super::GetUserSettingsResponse>,
7844            tonic::Status,
7845        > {
7846            self.inner
7847                .ready()
7848                .await
7849                .map_err(|e| {
7850                    tonic::Status::unknown(
7851                        format!("Service was not ready: {}", e.into()),
7852                    )
7853                })?;
7854            let codec = tonic_prost::ProstCodec::default();
7855            let path = http::uri::PathAndQuery::from_static(
7856                "/pidgr.v1.MemberService/GetUserSettings",
7857            );
7858            let mut req = request.into_request();
7859            req.extensions_mut()
7860                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
7861            self.inner.unary(req, path, codec).await
7862        }
7863        /** Update the caller's platform settings.
7864 Only fields with non-default values are applied; others are left unchanged.
7865 Authorization: Any authenticated user (self-only).
7866*/
7867        pub async fn update_user_settings(
7868            &mut self,
7869            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
7870        ) -> std::result::Result<
7871            tonic::Response<super::UpdateUserSettingsResponse>,
7872            tonic::Status,
7873        > {
7874            self.inner
7875                .ready()
7876                .await
7877                .map_err(|e| {
7878                    tonic::Status::unknown(
7879                        format!("Service was not ready: {}", e.into()),
7880                    )
7881                })?;
7882            let codec = tonic_prost::ProstCodec::default();
7883            let path = http::uri::PathAndQuery::from_static(
7884                "/pidgr.v1.MemberService/UpdateUserSettings",
7885            );
7886            let mut req = request.into_request();
7887            req.extensions_mut()
7888                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
7889            self.inner.unary(req, path, codec).await
7890        }
7891        /** Invite multiple users to the organization in a single call.
7892 Emails are deduplicated. Each email is processed independently — individual
7893 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
7894 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7895*/
7896        pub async fn bulk_invite_users(
7897            &mut self,
7898            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
7899        ) -> std::result::Result<
7900            tonic::Response<super::BulkInviteUsersResponse>,
7901            tonic::Status,
7902        > {
7903            self.inner
7904                .ready()
7905                .await
7906                .map_err(|e| {
7907                    tonic::Status::unknown(
7908                        format!("Service was not ready: {}", e.into()),
7909                    )
7910                })?;
7911            let codec = tonic_prost::ProstCodec::default();
7912            let path = http::uri::PathAndQuery::from_static(
7913                "/pidgr.v1.MemberService/BulkInviteUsers",
7914            );
7915            let mut req = request.into_request();
7916            req.extensions_mut()
7917                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
7918            self.inner.unary(req, path, codec).await
7919        }
7920        /** Confirm passkey enrollment after client-side WebAuthn registration.
7921 Verifies the caller has at least one registered credential server-side,
7922 then marks the user as passkey-enrolled in the identity provider.
7923 Authorization: Any authenticated user (self-only, no permission required).
7924*/
7925        pub async fn confirm_passkey_enrollment(
7926            &mut self,
7927            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
7928        ) -> std::result::Result<
7929            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7930            tonic::Status,
7931        > {
7932            self.inner
7933                .ready()
7934                .await
7935                .map_err(|e| {
7936                    tonic::Status::unknown(
7937                        format!("Service was not ready: {}", e.into()),
7938                    )
7939                })?;
7940            let codec = tonic_prost::ProstCodec::default();
7941            let path = http::uri::PathAndQuery::from_static(
7942                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
7943            );
7944            let mut req = request.into_request();
7945            req.extensions_mut()
7946                .insert(
7947                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
7948                );
7949            self.inner.unary(req, path, codec).await
7950        }
7951        /** Update the data governance region for a user. Triggers a data migration
7952 workflow if the region changed. Admin-only operation.
7953 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7954*/
7955        pub async fn update_user_region(
7956            &mut self,
7957            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
7958        ) -> std::result::Result<
7959            tonic::Response<super::UpdateUserRegionResponse>,
7960            tonic::Status,
7961        > {
7962            self.inner
7963                .ready()
7964                .await
7965                .map_err(|e| {
7966                    tonic::Status::unknown(
7967                        format!("Service was not ready: {}", e.into()),
7968                    )
7969                })?;
7970            let codec = tonic_prost::ProstCodec::default();
7971            let path = http::uri::PathAndQuery::from_static(
7972                "/pidgr.v1.MemberService/UpdateUserRegion",
7973            );
7974            let mut req = request.into_request();
7975            req.extensions_mut()
7976                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
7977            self.inner.unary(req, path, codec).await
7978        }
7979    }
7980}
7981/// Generated server implementations.
7982pub mod member_service_server {
7983    #![allow(
7984        unused_variables,
7985        dead_code,
7986        missing_docs,
7987        clippy::wildcard_imports,
7988        clippy::let_unit_value,
7989    )]
7990    use tonic::codegen::*;
7991    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
7992    #[async_trait]
7993    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
7994        /** Invite a new user to the organization via email.
7995 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7996*/
7997        async fn invite_user(
7998            &self,
7999            request: tonic::Request<super::InviteUserRequest>,
8000        ) -> std::result::Result<
8001            tonic::Response<super::InviteUserResponse>,
8002            tonic::Status,
8003        >;
8004        /** Retrieve a user by ID within the organization.
8005 Self-lookup (empty user_id) is allowed for any authenticated user.
8006 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
8007*/
8008        async fn get_user(
8009            &self,
8010            request: tonic::Request<super::GetUserRequest>,
8011        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
8012        /** List all users in the organization with pagination.
8013 Authorization: Requires PERMISSION_MEMBERS_READ.
8014*/
8015        async fn list_users(
8016            &self,
8017            request: tonic::Request<super::ListUsersRequest>,
8018        ) -> std::result::Result<
8019            tonic::Response<super::ListUsersResponse>,
8020            tonic::Status,
8021        >;
8022        /** Change a user's role within the organization.
8023 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8024*/
8025        async fn update_user_role(
8026            &self,
8027            request: tonic::Request<super::UpdateUserRoleRequest>,
8028        ) -> std::result::Result<
8029            tonic::Response<super::UpdateUserRoleResponse>,
8030            tonic::Status,
8031        >;
8032        /** Deactivate a user within the organization.
8033 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8034*/
8035        async fn deactivate_user(
8036            &self,
8037            request: tonic::Request<super::DeactivateUserRequest>,
8038        ) -> std::result::Result<
8039            tonic::Response<super::DeactivateUserResponse>,
8040            tonic::Status,
8041        >;
8042        /** Reactivate a deactivated user, restoring their status to INVITED.
8043 The user must complete the invite link flow again to become ACTIVE.
8044 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8045*/
8046        async fn reactivate_user(
8047            &self,
8048            request: tonic::Request<super::ReactivateUserRequest>,
8049        ) -> std::result::Result<
8050            tonic::Response<super::ReactivateUserResponse>,
8051            tonic::Status,
8052        >;
8053        /** Revoke an invitation for a user who has not yet completed registration.
8054 Hard-deletes the user record (INVITED users have no data to preserve).
8055 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8056*/
8057        async fn revoke_invite(
8058            &self,
8059            request: tonic::Request<super::RevokeInviteRequest>,
8060        ) -> std::result::Result<
8061            tonic::Response<super::RevokeInviteResponse>,
8062            tonic::Status,
8063        >;
8064        /** Update a user's profile attributes (department, title, etc.).
8065 Self-update (empty user_id or matching JWT sub) requires no special permission.
8066 Updating another user requires PERMISSION_MEMBERS_MANAGE.
8067*/
8068        async fn update_user_profile(
8069            &self,
8070            request: tonic::Request<super::UpdateUserProfileRequest>,
8071        ) -> std::result::Result<
8072            tonic::Response<super::UpdateUserProfileResponse>,
8073            tonic::Status,
8074        >;
8075        /** Retrieve the caller's platform settings (theme, etc.).
8076 Authorization: Any authenticated user (self-only).
8077*/
8078        async fn get_user_settings(
8079            &self,
8080            request: tonic::Request<super::GetUserSettingsRequest>,
8081        ) -> std::result::Result<
8082            tonic::Response<super::GetUserSettingsResponse>,
8083            tonic::Status,
8084        >;
8085        /** Update the caller's platform settings.
8086 Only fields with non-default values are applied; others are left unchanged.
8087 Authorization: Any authenticated user (self-only).
8088*/
8089        async fn update_user_settings(
8090            &self,
8091            request: tonic::Request<super::UpdateUserSettingsRequest>,
8092        ) -> std::result::Result<
8093            tonic::Response<super::UpdateUserSettingsResponse>,
8094            tonic::Status,
8095        >;
8096        /** Invite multiple users to the organization in a single call.
8097 Emails are deduplicated. Each email is processed independently — individual
8098 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
8099 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8100*/
8101        async fn bulk_invite_users(
8102            &self,
8103            request: tonic::Request<super::BulkInviteUsersRequest>,
8104        ) -> std::result::Result<
8105            tonic::Response<super::BulkInviteUsersResponse>,
8106            tonic::Status,
8107        >;
8108        /** Confirm passkey enrollment after client-side WebAuthn registration.
8109 Verifies the caller has at least one registered credential server-side,
8110 then marks the user as passkey-enrolled in the identity provider.
8111 Authorization: Any authenticated user (self-only, no permission required).
8112*/
8113        async fn confirm_passkey_enrollment(
8114            &self,
8115            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
8116        ) -> std::result::Result<
8117            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8118            tonic::Status,
8119        >;
8120        /** Update the data governance region for a user. Triggers a data migration
8121 workflow if the region changed. Admin-only operation.
8122 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8123*/
8124        async fn update_user_region(
8125            &self,
8126            request: tonic::Request<super::UpdateUserRegionRequest>,
8127        ) -> std::result::Result<
8128            tonic::Response<super::UpdateUserRegionResponse>,
8129            tonic::Status,
8130        >;
8131    }
8132    /** Manages members (users) within an organization.
8133 All RPCs operate within the caller's org (extracted from JWT).
8134*/
8135    #[derive(Debug)]
8136    pub struct MemberServiceServer<T> {
8137        inner: Arc<T>,
8138        accept_compression_encodings: EnabledCompressionEncodings,
8139        send_compression_encodings: EnabledCompressionEncodings,
8140        max_decoding_message_size: Option<usize>,
8141        max_encoding_message_size: Option<usize>,
8142    }
8143    impl<T> MemberServiceServer<T> {
8144        pub fn new(inner: T) -> Self {
8145            Self::from_arc(Arc::new(inner))
8146        }
8147        pub fn from_arc(inner: Arc<T>) -> Self {
8148            Self {
8149                inner,
8150                accept_compression_encodings: Default::default(),
8151                send_compression_encodings: Default::default(),
8152                max_decoding_message_size: None,
8153                max_encoding_message_size: None,
8154            }
8155        }
8156        pub fn with_interceptor<F>(
8157            inner: T,
8158            interceptor: F,
8159        ) -> InterceptedService<Self, F>
8160        where
8161            F: tonic::service::Interceptor,
8162        {
8163            InterceptedService::new(Self::new(inner), interceptor)
8164        }
8165        /// Enable decompressing requests with the given encoding.
8166        #[must_use]
8167        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8168            self.accept_compression_encodings.enable(encoding);
8169            self
8170        }
8171        /// Compress responses with the given encoding, if the client supports it.
8172        #[must_use]
8173        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8174            self.send_compression_encodings.enable(encoding);
8175            self
8176        }
8177        /// Limits the maximum size of a decoded message.
8178        ///
8179        /// Default: `4MB`
8180        #[must_use]
8181        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8182            self.max_decoding_message_size = Some(limit);
8183            self
8184        }
8185        /// Limits the maximum size of an encoded message.
8186        ///
8187        /// Default: `usize::MAX`
8188        #[must_use]
8189        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8190            self.max_encoding_message_size = Some(limit);
8191            self
8192        }
8193    }
8194    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
8195    where
8196        T: MemberService,
8197        B: Body + std::marker::Send + 'static,
8198        B::Error: Into<StdError> + std::marker::Send + 'static,
8199    {
8200        type Response = http::Response<tonic::body::Body>;
8201        type Error = std::convert::Infallible;
8202        type Future = BoxFuture<Self::Response, Self::Error>;
8203        fn poll_ready(
8204            &mut self,
8205            _cx: &mut Context<'_>,
8206        ) -> Poll<std::result::Result<(), Self::Error>> {
8207            Poll::Ready(Ok(()))
8208        }
8209        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8210            match req.uri().path() {
8211                "/pidgr.v1.MemberService/InviteUser" => {
8212                    #[allow(non_camel_case_types)]
8213                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
8214                    impl<
8215                        T: MemberService,
8216                    > tonic::server::UnaryService<super::InviteUserRequest>
8217                    for InviteUserSvc<T> {
8218                        type Response = super::InviteUserResponse;
8219                        type Future = BoxFuture<
8220                            tonic::Response<Self::Response>,
8221                            tonic::Status,
8222                        >;
8223                        fn call(
8224                            &mut self,
8225                            request: tonic::Request<super::InviteUserRequest>,
8226                        ) -> Self::Future {
8227                            let inner = Arc::clone(&self.0);
8228                            let fut = async move {
8229                                <T as MemberService>::invite_user(&inner, request).await
8230                            };
8231                            Box::pin(fut)
8232                        }
8233                    }
8234                    let accept_compression_encodings = self.accept_compression_encodings;
8235                    let send_compression_encodings = self.send_compression_encodings;
8236                    let max_decoding_message_size = self.max_decoding_message_size;
8237                    let max_encoding_message_size = self.max_encoding_message_size;
8238                    let inner = self.inner.clone();
8239                    let fut = async move {
8240                        let method = InviteUserSvc(inner);
8241                        let codec = tonic_prost::ProstCodec::default();
8242                        let mut grpc = tonic::server::Grpc::new(codec)
8243                            .apply_compression_config(
8244                                accept_compression_encodings,
8245                                send_compression_encodings,
8246                            )
8247                            .apply_max_message_size_config(
8248                                max_decoding_message_size,
8249                                max_encoding_message_size,
8250                            );
8251                        let res = grpc.unary(method, req).await;
8252                        Ok(res)
8253                    };
8254                    Box::pin(fut)
8255                }
8256                "/pidgr.v1.MemberService/GetUser" => {
8257                    #[allow(non_camel_case_types)]
8258                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
8259                    impl<
8260                        T: MemberService,
8261                    > tonic::server::UnaryService<super::GetUserRequest>
8262                    for GetUserSvc<T> {
8263                        type Response = super::GetUserResponse;
8264                        type Future = BoxFuture<
8265                            tonic::Response<Self::Response>,
8266                            tonic::Status,
8267                        >;
8268                        fn call(
8269                            &mut self,
8270                            request: tonic::Request<super::GetUserRequest>,
8271                        ) -> Self::Future {
8272                            let inner = Arc::clone(&self.0);
8273                            let fut = async move {
8274                                <T as MemberService>::get_user(&inner, request).await
8275                            };
8276                            Box::pin(fut)
8277                        }
8278                    }
8279                    let accept_compression_encodings = self.accept_compression_encodings;
8280                    let send_compression_encodings = self.send_compression_encodings;
8281                    let max_decoding_message_size = self.max_decoding_message_size;
8282                    let max_encoding_message_size = self.max_encoding_message_size;
8283                    let inner = self.inner.clone();
8284                    let fut = async move {
8285                        let method = GetUserSvc(inner);
8286                        let codec = tonic_prost::ProstCodec::default();
8287                        let mut grpc = tonic::server::Grpc::new(codec)
8288                            .apply_compression_config(
8289                                accept_compression_encodings,
8290                                send_compression_encodings,
8291                            )
8292                            .apply_max_message_size_config(
8293                                max_decoding_message_size,
8294                                max_encoding_message_size,
8295                            );
8296                        let res = grpc.unary(method, req).await;
8297                        Ok(res)
8298                    };
8299                    Box::pin(fut)
8300                }
8301                "/pidgr.v1.MemberService/ListUsers" => {
8302                    #[allow(non_camel_case_types)]
8303                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
8304                    impl<
8305                        T: MemberService,
8306                    > tonic::server::UnaryService<super::ListUsersRequest>
8307                    for ListUsersSvc<T> {
8308                        type Response = super::ListUsersResponse;
8309                        type Future = BoxFuture<
8310                            tonic::Response<Self::Response>,
8311                            tonic::Status,
8312                        >;
8313                        fn call(
8314                            &mut self,
8315                            request: tonic::Request<super::ListUsersRequest>,
8316                        ) -> Self::Future {
8317                            let inner = Arc::clone(&self.0);
8318                            let fut = async move {
8319                                <T as MemberService>::list_users(&inner, request).await
8320                            };
8321                            Box::pin(fut)
8322                        }
8323                    }
8324                    let accept_compression_encodings = self.accept_compression_encodings;
8325                    let send_compression_encodings = self.send_compression_encodings;
8326                    let max_decoding_message_size = self.max_decoding_message_size;
8327                    let max_encoding_message_size = self.max_encoding_message_size;
8328                    let inner = self.inner.clone();
8329                    let fut = async move {
8330                        let method = ListUsersSvc(inner);
8331                        let codec = tonic_prost::ProstCodec::default();
8332                        let mut grpc = tonic::server::Grpc::new(codec)
8333                            .apply_compression_config(
8334                                accept_compression_encodings,
8335                                send_compression_encodings,
8336                            )
8337                            .apply_max_message_size_config(
8338                                max_decoding_message_size,
8339                                max_encoding_message_size,
8340                            );
8341                        let res = grpc.unary(method, req).await;
8342                        Ok(res)
8343                    };
8344                    Box::pin(fut)
8345                }
8346                "/pidgr.v1.MemberService/UpdateUserRole" => {
8347                    #[allow(non_camel_case_types)]
8348                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
8349                    impl<
8350                        T: MemberService,
8351                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
8352                    for UpdateUserRoleSvc<T> {
8353                        type Response = super::UpdateUserRoleResponse;
8354                        type Future = BoxFuture<
8355                            tonic::Response<Self::Response>,
8356                            tonic::Status,
8357                        >;
8358                        fn call(
8359                            &mut self,
8360                            request: tonic::Request<super::UpdateUserRoleRequest>,
8361                        ) -> Self::Future {
8362                            let inner = Arc::clone(&self.0);
8363                            let fut = async move {
8364                                <T as MemberService>::update_user_role(&inner, request)
8365                                    .await
8366                            };
8367                            Box::pin(fut)
8368                        }
8369                    }
8370                    let accept_compression_encodings = self.accept_compression_encodings;
8371                    let send_compression_encodings = self.send_compression_encodings;
8372                    let max_decoding_message_size = self.max_decoding_message_size;
8373                    let max_encoding_message_size = self.max_encoding_message_size;
8374                    let inner = self.inner.clone();
8375                    let fut = async move {
8376                        let method = UpdateUserRoleSvc(inner);
8377                        let codec = tonic_prost::ProstCodec::default();
8378                        let mut grpc = tonic::server::Grpc::new(codec)
8379                            .apply_compression_config(
8380                                accept_compression_encodings,
8381                                send_compression_encodings,
8382                            )
8383                            .apply_max_message_size_config(
8384                                max_decoding_message_size,
8385                                max_encoding_message_size,
8386                            );
8387                        let res = grpc.unary(method, req).await;
8388                        Ok(res)
8389                    };
8390                    Box::pin(fut)
8391                }
8392                "/pidgr.v1.MemberService/DeactivateUser" => {
8393                    #[allow(non_camel_case_types)]
8394                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
8395                    impl<
8396                        T: MemberService,
8397                    > tonic::server::UnaryService<super::DeactivateUserRequest>
8398                    for DeactivateUserSvc<T> {
8399                        type Response = super::DeactivateUserResponse;
8400                        type Future = BoxFuture<
8401                            tonic::Response<Self::Response>,
8402                            tonic::Status,
8403                        >;
8404                        fn call(
8405                            &mut self,
8406                            request: tonic::Request<super::DeactivateUserRequest>,
8407                        ) -> Self::Future {
8408                            let inner = Arc::clone(&self.0);
8409                            let fut = async move {
8410                                <T as MemberService>::deactivate_user(&inner, request).await
8411                            };
8412                            Box::pin(fut)
8413                        }
8414                    }
8415                    let accept_compression_encodings = self.accept_compression_encodings;
8416                    let send_compression_encodings = self.send_compression_encodings;
8417                    let max_decoding_message_size = self.max_decoding_message_size;
8418                    let max_encoding_message_size = self.max_encoding_message_size;
8419                    let inner = self.inner.clone();
8420                    let fut = async move {
8421                        let method = DeactivateUserSvc(inner);
8422                        let codec = tonic_prost::ProstCodec::default();
8423                        let mut grpc = tonic::server::Grpc::new(codec)
8424                            .apply_compression_config(
8425                                accept_compression_encodings,
8426                                send_compression_encodings,
8427                            )
8428                            .apply_max_message_size_config(
8429                                max_decoding_message_size,
8430                                max_encoding_message_size,
8431                            );
8432                        let res = grpc.unary(method, req).await;
8433                        Ok(res)
8434                    };
8435                    Box::pin(fut)
8436                }
8437                "/pidgr.v1.MemberService/ReactivateUser" => {
8438                    #[allow(non_camel_case_types)]
8439                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
8440                    impl<
8441                        T: MemberService,
8442                    > tonic::server::UnaryService<super::ReactivateUserRequest>
8443                    for ReactivateUserSvc<T> {
8444                        type Response = super::ReactivateUserResponse;
8445                        type Future = BoxFuture<
8446                            tonic::Response<Self::Response>,
8447                            tonic::Status,
8448                        >;
8449                        fn call(
8450                            &mut self,
8451                            request: tonic::Request<super::ReactivateUserRequest>,
8452                        ) -> Self::Future {
8453                            let inner = Arc::clone(&self.0);
8454                            let fut = async move {
8455                                <T as MemberService>::reactivate_user(&inner, request).await
8456                            };
8457                            Box::pin(fut)
8458                        }
8459                    }
8460                    let accept_compression_encodings = self.accept_compression_encodings;
8461                    let send_compression_encodings = self.send_compression_encodings;
8462                    let max_decoding_message_size = self.max_decoding_message_size;
8463                    let max_encoding_message_size = self.max_encoding_message_size;
8464                    let inner = self.inner.clone();
8465                    let fut = async move {
8466                        let method = ReactivateUserSvc(inner);
8467                        let codec = tonic_prost::ProstCodec::default();
8468                        let mut grpc = tonic::server::Grpc::new(codec)
8469                            .apply_compression_config(
8470                                accept_compression_encodings,
8471                                send_compression_encodings,
8472                            )
8473                            .apply_max_message_size_config(
8474                                max_decoding_message_size,
8475                                max_encoding_message_size,
8476                            );
8477                        let res = grpc.unary(method, req).await;
8478                        Ok(res)
8479                    };
8480                    Box::pin(fut)
8481                }
8482                "/pidgr.v1.MemberService/RevokeInvite" => {
8483                    #[allow(non_camel_case_types)]
8484                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
8485                    impl<
8486                        T: MemberService,
8487                    > tonic::server::UnaryService<super::RevokeInviteRequest>
8488                    for RevokeInviteSvc<T> {
8489                        type Response = super::RevokeInviteResponse;
8490                        type Future = BoxFuture<
8491                            tonic::Response<Self::Response>,
8492                            tonic::Status,
8493                        >;
8494                        fn call(
8495                            &mut self,
8496                            request: tonic::Request<super::RevokeInviteRequest>,
8497                        ) -> Self::Future {
8498                            let inner = Arc::clone(&self.0);
8499                            let fut = async move {
8500                                <T as MemberService>::revoke_invite(&inner, request).await
8501                            };
8502                            Box::pin(fut)
8503                        }
8504                    }
8505                    let accept_compression_encodings = self.accept_compression_encodings;
8506                    let send_compression_encodings = self.send_compression_encodings;
8507                    let max_decoding_message_size = self.max_decoding_message_size;
8508                    let max_encoding_message_size = self.max_encoding_message_size;
8509                    let inner = self.inner.clone();
8510                    let fut = async move {
8511                        let method = RevokeInviteSvc(inner);
8512                        let codec = tonic_prost::ProstCodec::default();
8513                        let mut grpc = tonic::server::Grpc::new(codec)
8514                            .apply_compression_config(
8515                                accept_compression_encodings,
8516                                send_compression_encodings,
8517                            )
8518                            .apply_max_message_size_config(
8519                                max_decoding_message_size,
8520                                max_encoding_message_size,
8521                            );
8522                        let res = grpc.unary(method, req).await;
8523                        Ok(res)
8524                    };
8525                    Box::pin(fut)
8526                }
8527                "/pidgr.v1.MemberService/UpdateUserProfile" => {
8528                    #[allow(non_camel_case_types)]
8529                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
8530                    impl<
8531                        T: MemberService,
8532                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
8533                    for UpdateUserProfileSvc<T> {
8534                        type Response = super::UpdateUserProfileResponse;
8535                        type Future = BoxFuture<
8536                            tonic::Response<Self::Response>,
8537                            tonic::Status,
8538                        >;
8539                        fn call(
8540                            &mut self,
8541                            request: tonic::Request<super::UpdateUserProfileRequest>,
8542                        ) -> Self::Future {
8543                            let inner = Arc::clone(&self.0);
8544                            let fut = async move {
8545                                <T as MemberService>::update_user_profile(&inner, request)
8546                                    .await
8547                            };
8548                            Box::pin(fut)
8549                        }
8550                    }
8551                    let accept_compression_encodings = self.accept_compression_encodings;
8552                    let send_compression_encodings = self.send_compression_encodings;
8553                    let max_decoding_message_size = self.max_decoding_message_size;
8554                    let max_encoding_message_size = self.max_encoding_message_size;
8555                    let inner = self.inner.clone();
8556                    let fut = async move {
8557                        let method = UpdateUserProfileSvc(inner);
8558                        let codec = tonic_prost::ProstCodec::default();
8559                        let mut grpc = tonic::server::Grpc::new(codec)
8560                            .apply_compression_config(
8561                                accept_compression_encodings,
8562                                send_compression_encodings,
8563                            )
8564                            .apply_max_message_size_config(
8565                                max_decoding_message_size,
8566                                max_encoding_message_size,
8567                            );
8568                        let res = grpc.unary(method, req).await;
8569                        Ok(res)
8570                    };
8571                    Box::pin(fut)
8572                }
8573                "/pidgr.v1.MemberService/GetUserSettings" => {
8574                    #[allow(non_camel_case_types)]
8575                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
8576                    impl<
8577                        T: MemberService,
8578                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
8579                    for GetUserSettingsSvc<T> {
8580                        type Response = super::GetUserSettingsResponse;
8581                        type Future = BoxFuture<
8582                            tonic::Response<Self::Response>,
8583                            tonic::Status,
8584                        >;
8585                        fn call(
8586                            &mut self,
8587                            request: tonic::Request<super::GetUserSettingsRequest>,
8588                        ) -> Self::Future {
8589                            let inner = Arc::clone(&self.0);
8590                            let fut = async move {
8591                                <T as MemberService>::get_user_settings(&inner, request)
8592                                    .await
8593                            };
8594                            Box::pin(fut)
8595                        }
8596                    }
8597                    let accept_compression_encodings = self.accept_compression_encodings;
8598                    let send_compression_encodings = self.send_compression_encodings;
8599                    let max_decoding_message_size = self.max_decoding_message_size;
8600                    let max_encoding_message_size = self.max_encoding_message_size;
8601                    let inner = self.inner.clone();
8602                    let fut = async move {
8603                        let method = GetUserSettingsSvc(inner);
8604                        let codec = tonic_prost::ProstCodec::default();
8605                        let mut grpc = tonic::server::Grpc::new(codec)
8606                            .apply_compression_config(
8607                                accept_compression_encodings,
8608                                send_compression_encodings,
8609                            )
8610                            .apply_max_message_size_config(
8611                                max_decoding_message_size,
8612                                max_encoding_message_size,
8613                            );
8614                        let res = grpc.unary(method, req).await;
8615                        Ok(res)
8616                    };
8617                    Box::pin(fut)
8618                }
8619                "/pidgr.v1.MemberService/UpdateUserSettings" => {
8620                    #[allow(non_camel_case_types)]
8621                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
8622                    impl<
8623                        T: MemberService,
8624                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
8625                    for UpdateUserSettingsSvc<T> {
8626                        type Response = super::UpdateUserSettingsResponse;
8627                        type Future = BoxFuture<
8628                            tonic::Response<Self::Response>,
8629                            tonic::Status,
8630                        >;
8631                        fn call(
8632                            &mut self,
8633                            request: tonic::Request<super::UpdateUserSettingsRequest>,
8634                        ) -> Self::Future {
8635                            let inner = Arc::clone(&self.0);
8636                            let fut = async move {
8637                                <T as MemberService>::update_user_settings(&inner, request)
8638                                    .await
8639                            };
8640                            Box::pin(fut)
8641                        }
8642                    }
8643                    let accept_compression_encodings = self.accept_compression_encodings;
8644                    let send_compression_encodings = self.send_compression_encodings;
8645                    let max_decoding_message_size = self.max_decoding_message_size;
8646                    let max_encoding_message_size = self.max_encoding_message_size;
8647                    let inner = self.inner.clone();
8648                    let fut = async move {
8649                        let method = UpdateUserSettingsSvc(inner);
8650                        let codec = tonic_prost::ProstCodec::default();
8651                        let mut grpc = tonic::server::Grpc::new(codec)
8652                            .apply_compression_config(
8653                                accept_compression_encodings,
8654                                send_compression_encodings,
8655                            )
8656                            .apply_max_message_size_config(
8657                                max_decoding_message_size,
8658                                max_encoding_message_size,
8659                            );
8660                        let res = grpc.unary(method, req).await;
8661                        Ok(res)
8662                    };
8663                    Box::pin(fut)
8664                }
8665                "/pidgr.v1.MemberService/BulkInviteUsers" => {
8666                    #[allow(non_camel_case_types)]
8667                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
8668                    impl<
8669                        T: MemberService,
8670                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
8671                    for BulkInviteUsersSvc<T> {
8672                        type Response = super::BulkInviteUsersResponse;
8673                        type Future = BoxFuture<
8674                            tonic::Response<Self::Response>,
8675                            tonic::Status,
8676                        >;
8677                        fn call(
8678                            &mut self,
8679                            request: tonic::Request<super::BulkInviteUsersRequest>,
8680                        ) -> Self::Future {
8681                            let inner = Arc::clone(&self.0);
8682                            let fut = async move {
8683                                <T as MemberService>::bulk_invite_users(&inner, request)
8684                                    .await
8685                            };
8686                            Box::pin(fut)
8687                        }
8688                    }
8689                    let accept_compression_encodings = self.accept_compression_encodings;
8690                    let send_compression_encodings = self.send_compression_encodings;
8691                    let max_decoding_message_size = self.max_decoding_message_size;
8692                    let max_encoding_message_size = self.max_encoding_message_size;
8693                    let inner = self.inner.clone();
8694                    let fut = async move {
8695                        let method = BulkInviteUsersSvc(inner);
8696                        let codec = tonic_prost::ProstCodec::default();
8697                        let mut grpc = tonic::server::Grpc::new(codec)
8698                            .apply_compression_config(
8699                                accept_compression_encodings,
8700                                send_compression_encodings,
8701                            )
8702                            .apply_max_message_size_config(
8703                                max_decoding_message_size,
8704                                max_encoding_message_size,
8705                            );
8706                        let res = grpc.unary(method, req).await;
8707                        Ok(res)
8708                    };
8709                    Box::pin(fut)
8710                }
8711                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
8712                    #[allow(non_camel_case_types)]
8713                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
8714                    impl<
8715                        T: MemberService,
8716                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
8717                    for ConfirmPasskeyEnrollmentSvc<T> {
8718                        type Response = super::ConfirmPasskeyEnrollmentResponse;
8719                        type Future = BoxFuture<
8720                            tonic::Response<Self::Response>,
8721                            tonic::Status,
8722                        >;
8723                        fn call(
8724                            &mut self,
8725                            request: tonic::Request<
8726                                super::ConfirmPasskeyEnrollmentRequest,
8727                            >,
8728                        ) -> Self::Future {
8729                            let inner = Arc::clone(&self.0);
8730                            let fut = async move {
8731                                <T as MemberService>::confirm_passkey_enrollment(
8732                                        &inner,
8733                                        request,
8734                                    )
8735                                    .await
8736                            };
8737                            Box::pin(fut)
8738                        }
8739                    }
8740                    let accept_compression_encodings = self.accept_compression_encodings;
8741                    let send_compression_encodings = self.send_compression_encodings;
8742                    let max_decoding_message_size = self.max_decoding_message_size;
8743                    let max_encoding_message_size = self.max_encoding_message_size;
8744                    let inner = self.inner.clone();
8745                    let fut = async move {
8746                        let method = ConfirmPasskeyEnrollmentSvc(inner);
8747                        let codec = tonic_prost::ProstCodec::default();
8748                        let mut grpc = tonic::server::Grpc::new(codec)
8749                            .apply_compression_config(
8750                                accept_compression_encodings,
8751                                send_compression_encodings,
8752                            )
8753                            .apply_max_message_size_config(
8754                                max_decoding_message_size,
8755                                max_encoding_message_size,
8756                            );
8757                        let res = grpc.unary(method, req).await;
8758                        Ok(res)
8759                    };
8760                    Box::pin(fut)
8761                }
8762                "/pidgr.v1.MemberService/UpdateUserRegion" => {
8763                    #[allow(non_camel_case_types)]
8764                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
8765                    impl<
8766                        T: MemberService,
8767                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
8768                    for UpdateUserRegionSvc<T> {
8769                        type Response = super::UpdateUserRegionResponse;
8770                        type Future = BoxFuture<
8771                            tonic::Response<Self::Response>,
8772                            tonic::Status,
8773                        >;
8774                        fn call(
8775                            &mut self,
8776                            request: tonic::Request<super::UpdateUserRegionRequest>,
8777                        ) -> Self::Future {
8778                            let inner = Arc::clone(&self.0);
8779                            let fut = async move {
8780                                <T as MemberService>::update_user_region(&inner, request)
8781                                    .await
8782                            };
8783                            Box::pin(fut)
8784                        }
8785                    }
8786                    let accept_compression_encodings = self.accept_compression_encodings;
8787                    let send_compression_encodings = self.send_compression_encodings;
8788                    let max_decoding_message_size = self.max_decoding_message_size;
8789                    let max_encoding_message_size = self.max_encoding_message_size;
8790                    let inner = self.inner.clone();
8791                    let fut = async move {
8792                        let method = UpdateUserRegionSvc(inner);
8793                        let codec = tonic_prost::ProstCodec::default();
8794                        let mut grpc = tonic::server::Grpc::new(codec)
8795                            .apply_compression_config(
8796                                accept_compression_encodings,
8797                                send_compression_encodings,
8798                            )
8799                            .apply_max_message_size_config(
8800                                max_decoding_message_size,
8801                                max_encoding_message_size,
8802                            );
8803                        let res = grpc.unary(method, req).await;
8804                        Ok(res)
8805                    };
8806                    Box::pin(fut)
8807                }
8808                _ => {
8809                    Box::pin(async move {
8810                        let mut response = http::Response::new(
8811                            tonic::body::Body::default(),
8812                        );
8813                        let headers = response.headers_mut();
8814                        headers
8815                            .insert(
8816                                tonic::Status::GRPC_STATUS,
8817                                (tonic::Code::Unimplemented as i32).into(),
8818                            );
8819                        headers
8820                            .insert(
8821                                http::header::CONTENT_TYPE,
8822                                tonic::metadata::GRPC_CONTENT_TYPE,
8823                            );
8824                        Ok(response)
8825                    })
8826                }
8827            }
8828        }
8829    }
8830    impl<T> Clone for MemberServiceServer<T> {
8831        fn clone(&self) -> Self {
8832            let inner = self.inner.clone();
8833            Self {
8834                inner,
8835                accept_compression_encodings: self.accept_compression_encodings,
8836                send_compression_encodings: self.send_compression_encodings,
8837                max_decoding_message_size: self.max_decoding_message_size,
8838                max_encoding_message_size: self.max_encoding_message_size,
8839            }
8840        }
8841    }
8842    /// Generated gRPC service name
8843    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
8844    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
8845        const NAME: &'static str = SERVICE_NAME;
8846    }
8847}
8848/// Generated client implementations.
8849pub mod organization_service_client {
8850    #![allow(
8851        unused_variables,
8852        dead_code,
8853        missing_docs,
8854        clippy::wildcard_imports,
8855        clippy::let_unit_value,
8856    )]
8857    use tonic::codegen::*;
8858    use tonic::codegen::http::Uri;
8859    /** Manages organizations (tenants) in the Pidgr platform.
8860 Most RPCs operate within the caller's org (extracted from JWT).
8861 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
8862*/
8863    #[derive(Debug, Clone)]
8864    pub struct OrganizationServiceClient<T> {
8865        inner: tonic::client::Grpc<T>,
8866    }
8867    impl OrganizationServiceClient<tonic::transport::Channel> {
8868        /// Attempt to create a new client by connecting to a given endpoint.
8869        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8870        where
8871            D: TryInto<tonic::transport::Endpoint>,
8872            D::Error: Into<StdError>,
8873        {
8874            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8875            Ok(Self::new(conn))
8876        }
8877    }
8878    impl<T> OrganizationServiceClient<T>
8879    where
8880        T: tonic::client::GrpcService<tonic::body::Body>,
8881        T::Error: Into<StdError>,
8882        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8883        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8884    {
8885        pub fn new(inner: T) -> Self {
8886            let inner = tonic::client::Grpc::new(inner);
8887            Self { inner }
8888        }
8889        pub fn with_origin(inner: T, origin: Uri) -> Self {
8890            let inner = tonic::client::Grpc::with_origin(inner, origin);
8891            Self { inner }
8892        }
8893        pub fn with_interceptor<F>(
8894            inner: T,
8895            interceptor: F,
8896        ) -> OrganizationServiceClient<InterceptedService<T, F>>
8897        where
8898            F: tonic::service::Interceptor,
8899            T::ResponseBody: Default,
8900            T: tonic::codegen::Service<
8901                http::Request<tonic::body::Body>,
8902                Response = http::Response<
8903                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8904                >,
8905            >,
8906            <T as tonic::codegen::Service<
8907                http::Request<tonic::body::Body>,
8908            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8909        {
8910            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
8911        }
8912        /// Compress requests with the given encoding.
8913        ///
8914        /// This requires the server to support it otherwise it might respond with an
8915        /// error.
8916        #[must_use]
8917        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8918            self.inner = self.inner.send_compressed(encoding);
8919            self
8920        }
8921        /// Enable decompressing responses.
8922        #[must_use]
8923        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8924            self.inner = self.inner.accept_compressed(encoding);
8925            self
8926        }
8927        /// Limits the maximum size of a decoded message.
8928        ///
8929        /// Default: `4MB`
8930        #[must_use]
8931        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8932            self.inner = self.inner.max_decoding_message_size(limit);
8933            self
8934        }
8935        /// Limits the maximum size of an encoded message.
8936        ///
8937        /// Default: `usize::MAX`
8938        #[must_use]
8939        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8940            self.inner = self.inner.max_encoding_message_size(limit);
8941            self
8942        }
8943        /** Create a new organization with an initial admin user.
8944 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
8945*/
8946        pub async fn create_organization(
8947            &mut self,
8948            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
8949        ) -> std::result::Result<
8950            tonic::Response<super::CreateOrganizationResponse>,
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/CreateOrganization",
8964            );
8965            let mut req = request.into_request();
8966            req.extensions_mut()
8967                .insert(
8968                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
8969                );
8970            self.inner.unary(req, path, codec).await
8971        }
8972        /** Retrieve the organization for the authenticated user.
8973 Authorization: Requires PERMISSION_ORG_READ.
8974*/
8975        pub async fn get_organization(
8976            &mut self,
8977            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
8978        ) -> std::result::Result<
8979            tonic::Response<super::GetOrganizationResponse>,
8980            tonic::Status,
8981        > {
8982            self.inner
8983                .ready()
8984                .await
8985                .map_err(|e| {
8986                    tonic::Status::unknown(
8987                        format!("Service was not ready: {}", e.into()),
8988                    )
8989                })?;
8990            let codec = tonic_prost::ProstCodec::default();
8991            let path = http::uri::PathAndQuery::from_static(
8992                "/pidgr.v1.OrganizationService/GetOrganization",
8993            );
8994            let mut req = request.into_request();
8995            req.extensions_mut()
8996                .insert(
8997                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
8998                );
8999            self.inner.unary(req, path, codec).await
9000        }
9001        /** Update organization settings (name, default workflow, industry, company size).
9002 Authorization: Requires PERMISSION_ORG_WRITE.
9003*/
9004        pub async fn update_organization(
9005            &mut self,
9006            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
9007        ) -> std::result::Result<
9008            tonic::Response<super::UpdateOrganizationResponse>,
9009            tonic::Status,
9010        > {
9011            self.inner
9012                .ready()
9013                .await
9014                .map_err(|e| {
9015                    tonic::Status::unknown(
9016                        format!("Service was not ready: {}", e.into()),
9017                    )
9018                })?;
9019            let codec = tonic_prost::ProstCodec::default();
9020            let path = http::uri::PathAndQuery::from_static(
9021                "/pidgr.v1.OrganizationService/UpdateOrganization",
9022            );
9023            let mut req = request.into_request();
9024            req.extensions_mut()
9025                .insert(
9026                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
9027                );
9028            self.inner.unary(req, path, codec).await
9029        }
9030        /** Replace all SSO attribute mappings for the organization.
9031 Authorization: Requires PERMISSION_ORG_WRITE.
9032*/
9033        pub async fn update_sso_attribute_mappings(
9034            &mut self,
9035            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
9036        ) -> std::result::Result<
9037            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9038            tonic::Status,
9039        > {
9040            self.inner
9041                .ready()
9042                .await
9043                .map_err(|e| {
9044                    tonic::Status::unknown(
9045                        format!("Service was not ready: {}", e.into()),
9046                    )
9047                })?;
9048            let codec = tonic_prost::ProstCodec::default();
9049            let path = http::uri::PathAndQuery::from_static(
9050                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
9051            );
9052            let mut req = request.into_request();
9053            req.extensions_mut()
9054                .insert(
9055                    GrpcMethod::new(
9056                        "pidgr.v1.OrganizationService",
9057                        "UpdateSsoAttributeMappings",
9058                    ),
9059                );
9060            self.inner.unary(req, path, codec).await
9061        }
9062        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9063 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9064*/
9065        pub async fn rotate_analytics_salt(
9066            &mut self,
9067            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
9068        ) -> std::result::Result<
9069            tonic::Response<super::RotateAnalyticsSaltResponse>,
9070            tonic::Status,
9071        > {
9072            self.inner
9073                .ready()
9074                .await
9075                .map_err(|e| {
9076                    tonic::Status::unknown(
9077                        format!("Service was not ready: {}", e.into()),
9078                    )
9079                })?;
9080            let codec = tonic_prost::ProstCodec::default();
9081            let path = http::uri::PathAndQuery::from_static(
9082                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
9083            );
9084            let mut req = request.into_request();
9085            req.extensions_mut()
9086                .insert(
9087                    GrpcMethod::new(
9088                        "pidgr.v1.OrganizationService",
9089                        "RotateAnalyticsSalt",
9090                    ),
9091                );
9092            self.inner.unary(req, path, codec).await
9093        }
9094        /** Update the differential privacy epsilon parameter.
9095 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9096*/
9097        pub async fn update_analytics_epsilon(
9098            &mut self,
9099            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
9100        ) -> std::result::Result<
9101            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9102            tonic::Status,
9103        > {
9104            self.inner
9105                .ready()
9106                .await
9107                .map_err(|e| {
9108                    tonic::Status::unknown(
9109                        format!("Service was not ready: {}", e.into()),
9110                    )
9111                })?;
9112            let codec = tonic_prost::ProstCodec::default();
9113            let path = http::uri::PathAndQuery::from_static(
9114                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
9115            );
9116            let mut req = request.into_request();
9117            req.extensions_mut()
9118                .insert(
9119                    GrpcMethod::new(
9120                        "pidgr.v1.OrganizationService",
9121                        "UpdateAnalyticsEpsilon",
9122                    ),
9123                );
9124            self.inner.unary(req, path, codec).await
9125        }
9126        /** Create a sandbox organization for testing configurations.
9127 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
9128 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
9129 per user to prevent abuse.
9130*/
9131        pub async fn create_sandbox_organization(
9132            &mut self,
9133            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
9134        ) -> std::result::Result<
9135            tonic::Response<super::CreateSandboxOrganizationResponse>,
9136            tonic::Status,
9137        > {
9138            self.inner
9139                .ready()
9140                .await
9141                .map_err(|e| {
9142                    tonic::Status::unknown(
9143                        format!("Service was not ready: {}", e.into()),
9144                    )
9145                })?;
9146            let codec = tonic_prost::ProstCodec::default();
9147            let path = http::uri::PathAndQuery::from_static(
9148                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
9149            );
9150            let mut req = request.into_request();
9151            req.extensions_mut()
9152                .insert(
9153                    GrpcMethod::new(
9154                        "pidgr.v1.OrganizationService",
9155                        "CreateSandboxOrganization",
9156                    ),
9157                );
9158            self.inner.unary(req, path, codec).await
9159        }
9160        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
9161 which handles cleanup across DB, Cognito, S3, Temporal, and regional
9162 content stores.
9163 Authorization: Super admin of the target sandbox OR its creator.
9164*/
9165        pub async fn delete_sandbox_organization(
9166            &mut self,
9167            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
9168        ) -> std::result::Result<
9169            tonic::Response<super::DeleteSandboxOrganizationResponse>,
9170            tonic::Status,
9171        > {
9172            self.inner
9173                .ready()
9174                .await
9175                .map_err(|e| {
9176                    tonic::Status::unknown(
9177                        format!("Service was not ready: {}", e.into()),
9178                    )
9179                })?;
9180            let codec = tonic_prost::ProstCodec::default();
9181            let path = http::uri::PathAndQuery::from_static(
9182                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
9183            );
9184            let mut req = request.into_request();
9185            req.extensions_mut()
9186                .insert(
9187                    GrpcMethod::new(
9188                        "pidgr.v1.OrganizationService",
9189                        "DeleteSandboxOrganization",
9190                    ),
9191                );
9192            self.inner.unary(req, path, codec).await
9193        }
9194        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
9195 is backend-owned; admin UI populates the "fill with sample data" checkbox
9196 or dropdown from this response.
9197 Authorization: Any authenticated user.
9198*/
9199        pub async fn list_sandbox_fixtures(
9200            &mut self,
9201            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
9202        ) -> std::result::Result<
9203            tonic::Response<super::ListSandboxFixturesResponse>,
9204            tonic::Status,
9205        > {
9206            self.inner
9207                .ready()
9208                .await
9209                .map_err(|e| {
9210                    tonic::Status::unknown(
9211                        format!("Service was not ready: {}", e.into()),
9212                    )
9213                })?;
9214            let codec = tonic_prost::ProstCodec::default();
9215            let path = http::uri::PathAndQuery::from_static(
9216                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
9217            );
9218            let mut req = request.into_request();
9219            req.extensions_mut()
9220                .insert(
9221                    GrpcMethod::new(
9222                        "pidgr.v1.OrganizationService",
9223                        "ListSandboxFixtures",
9224                    ),
9225                );
9226            self.inner.unary(req, path, codec).await
9227        }
9228        /** List all organizations the authenticated user belongs to.
9229 Org-exempt: callable without org context (only requires valid JWT).
9230 Used by the admin org switcher to discover available orgs.
9231 Excludes expired sandbox organizations.
9232 Authorization: Authenticated user (no specific permission required).
9233*/
9234        pub async fn list_user_organizations(
9235            &mut self,
9236            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
9237        ) -> std::result::Result<
9238            tonic::Response<super::ListUserOrganizationsResponse>,
9239            tonic::Status,
9240        > {
9241            self.inner
9242                .ready()
9243                .await
9244                .map_err(|e| {
9245                    tonic::Status::unknown(
9246                        format!("Service was not ready: {}", e.into()),
9247                    )
9248                })?;
9249            let codec = tonic_prost::ProstCodec::default();
9250            let path = http::uri::PathAndQuery::from_static(
9251                "/pidgr.v1.OrganizationService/ListUserOrganizations",
9252            );
9253            let mut req = request.into_request();
9254            req.extensions_mut()
9255                .insert(
9256                    GrpcMethod::new(
9257                        "pidgr.v1.OrganizationService",
9258                        "ListUserOrganizations",
9259                    ),
9260                );
9261            self.inner.unary(req, path, codec).await
9262        }
9263    }
9264}
9265/// Generated server implementations.
9266pub mod organization_service_server {
9267    #![allow(
9268        unused_variables,
9269        dead_code,
9270        missing_docs,
9271        clippy::wildcard_imports,
9272        clippy::let_unit_value,
9273    )]
9274    use tonic::codegen::*;
9275    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
9276    #[async_trait]
9277    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
9278        /** Create a new organization with an initial admin user.
9279 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
9280*/
9281        async fn create_organization(
9282            &self,
9283            request: tonic::Request<super::CreateOrganizationRequest>,
9284        ) -> std::result::Result<
9285            tonic::Response<super::CreateOrganizationResponse>,
9286            tonic::Status,
9287        >;
9288        /** Retrieve the organization for the authenticated user.
9289 Authorization: Requires PERMISSION_ORG_READ.
9290*/
9291        async fn get_organization(
9292            &self,
9293            request: tonic::Request<super::GetOrganizationRequest>,
9294        ) -> std::result::Result<
9295            tonic::Response<super::GetOrganizationResponse>,
9296            tonic::Status,
9297        >;
9298        /** Update organization settings (name, default workflow, industry, company size).
9299 Authorization: Requires PERMISSION_ORG_WRITE.
9300*/
9301        async fn update_organization(
9302            &self,
9303            request: tonic::Request<super::UpdateOrganizationRequest>,
9304        ) -> std::result::Result<
9305            tonic::Response<super::UpdateOrganizationResponse>,
9306            tonic::Status,
9307        >;
9308        /** Replace all SSO attribute mappings for the organization.
9309 Authorization: Requires PERMISSION_ORG_WRITE.
9310*/
9311        async fn update_sso_attribute_mappings(
9312            &self,
9313            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
9314        ) -> std::result::Result<
9315            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9316            tonic::Status,
9317        >;
9318        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9319 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9320*/
9321        async fn rotate_analytics_salt(
9322            &self,
9323            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9324        ) -> std::result::Result<
9325            tonic::Response<super::RotateAnalyticsSaltResponse>,
9326            tonic::Status,
9327        >;
9328        /** Update the differential privacy epsilon parameter.
9329 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9330*/
9331        async fn update_analytics_epsilon(
9332            &self,
9333            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9334        ) -> std::result::Result<
9335            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9336            tonic::Status,
9337        >;
9338        /** Create a sandbox organization for testing configurations.
9339 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
9340 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
9341 per user to prevent abuse.
9342*/
9343        async fn create_sandbox_organization(
9344            &self,
9345            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
9346        ) -> std::result::Result<
9347            tonic::Response<super::CreateSandboxOrganizationResponse>,
9348            tonic::Status,
9349        >;
9350        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
9351 which handles cleanup across DB, Cognito, S3, Temporal, and regional
9352 content stores.
9353 Authorization: Super admin of the target sandbox OR its creator.
9354*/
9355        async fn delete_sandbox_organization(
9356            &self,
9357            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
9358        ) -> std::result::Result<
9359            tonic::Response<super::DeleteSandboxOrganizationResponse>,
9360            tonic::Status,
9361        >;
9362        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
9363 is backend-owned; admin UI populates the "fill with sample data" checkbox
9364 or dropdown from this response.
9365 Authorization: Any authenticated user.
9366*/
9367        async fn list_sandbox_fixtures(
9368            &self,
9369            request: tonic::Request<super::ListSandboxFixturesRequest>,
9370        ) -> std::result::Result<
9371            tonic::Response<super::ListSandboxFixturesResponse>,
9372            tonic::Status,
9373        >;
9374        /** List all organizations the authenticated user belongs to.
9375 Org-exempt: callable without org context (only requires valid JWT).
9376 Used by the admin org switcher to discover available orgs.
9377 Excludes expired sandbox organizations.
9378 Authorization: Authenticated user (no specific permission required).
9379*/
9380        async fn list_user_organizations(
9381            &self,
9382            request: tonic::Request<super::ListUserOrganizationsRequest>,
9383        ) -> std::result::Result<
9384            tonic::Response<super::ListUserOrganizationsResponse>,
9385            tonic::Status,
9386        >;
9387    }
9388    /** Manages organizations (tenants) in the Pidgr platform.
9389 Most RPCs operate within the caller's org (extracted from JWT).
9390 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
9391*/
9392    #[derive(Debug)]
9393    pub struct OrganizationServiceServer<T> {
9394        inner: Arc<T>,
9395        accept_compression_encodings: EnabledCompressionEncodings,
9396        send_compression_encodings: EnabledCompressionEncodings,
9397        max_decoding_message_size: Option<usize>,
9398        max_encoding_message_size: Option<usize>,
9399    }
9400    impl<T> OrganizationServiceServer<T> {
9401        pub fn new(inner: T) -> Self {
9402            Self::from_arc(Arc::new(inner))
9403        }
9404        pub fn from_arc(inner: Arc<T>) -> Self {
9405            Self {
9406                inner,
9407                accept_compression_encodings: Default::default(),
9408                send_compression_encodings: Default::default(),
9409                max_decoding_message_size: None,
9410                max_encoding_message_size: None,
9411            }
9412        }
9413        pub fn with_interceptor<F>(
9414            inner: T,
9415            interceptor: F,
9416        ) -> InterceptedService<Self, F>
9417        where
9418            F: tonic::service::Interceptor,
9419        {
9420            InterceptedService::new(Self::new(inner), interceptor)
9421        }
9422        /// Enable decompressing requests with the given encoding.
9423        #[must_use]
9424        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9425            self.accept_compression_encodings.enable(encoding);
9426            self
9427        }
9428        /// Compress responses with the given encoding, if the client supports it.
9429        #[must_use]
9430        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9431            self.send_compression_encodings.enable(encoding);
9432            self
9433        }
9434        /// Limits the maximum size of a decoded message.
9435        ///
9436        /// Default: `4MB`
9437        #[must_use]
9438        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9439            self.max_decoding_message_size = Some(limit);
9440            self
9441        }
9442        /// Limits the maximum size of an encoded message.
9443        ///
9444        /// Default: `usize::MAX`
9445        #[must_use]
9446        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9447            self.max_encoding_message_size = Some(limit);
9448            self
9449        }
9450    }
9451    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
9452    where
9453        T: OrganizationService,
9454        B: Body + std::marker::Send + 'static,
9455        B::Error: Into<StdError> + std::marker::Send + 'static,
9456    {
9457        type Response = http::Response<tonic::body::Body>;
9458        type Error = std::convert::Infallible;
9459        type Future = BoxFuture<Self::Response, Self::Error>;
9460        fn poll_ready(
9461            &mut self,
9462            _cx: &mut Context<'_>,
9463        ) -> Poll<std::result::Result<(), Self::Error>> {
9464            Poll::Ready(Ok(()))
9465        }
9466        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9467            match req.uri().path() {
9468                "/pidgr.v1.OrganizationService/CreateOrganization" => {
9469                    #[allow(non_camel_case_types)]
9470                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9471                    impl<
9472                        T: OrganizationService,
9473                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
9474                    for CreateOrganizationSvc<T> {
9475                        type Response = super::CreateOrganizationResponse;
9476                        type Future = BoxFuture<
9477                            tonic::Response<Self::Response>,
9478                            tonic::Status,
9479                        >;
9480                        fn call(
9481                            &mut self,
9482                            request: tonic::Request<super::CreateOrganizationRequest>,
9483                        ) -> Self::Future {
9484                            let inner = Arc::clone(&self.0);
9485                            let fut = async move {
9486                                <T as OrganizationService>::create_organization(
9487                                        &inner,
9488                                        request,
9489                                    )
9490                                    .await
9491                            };
9492                            Box::pin(fut)
9493                        }
9494                    }
9495                    let accept_compression_encodings = self.accept_compression_encodings;
9496                    let send_compression_encodings = self.send_compression_encodings;
9497                    let max_decoding_message_size = self.max_decoding_message_size;
9498                    let max_encoding_message_size = self.max_encoding_message_size;
9499                    let inner = self.inner.clone();
9500                    let fut = async move {
9501                        let method = CreateOrganizationSvc(inner);
9502                        let codec = tonic_prost::ProstCodec::default();
9503                        let mut grpc = tonic::server::Grpc::new(codec)
9504                            .apply_compression_config(
9505                                accept_compression_encodings,
9506                                send_compression_encodings,
9507                            )
9508                            .apply_max_message_size_config(
9509                                max_decoding_message_size,
9510                                max_encoding_message_size,
9511                            );
9512                        let res = grpc.unary(method, req).await;
9513                        Ok(res)
9514                    };
9515                    Box::pin(fut)
9516                }
9517                "/pidgr.v1.OrganizationService/GetOrganization" => {
9518                    #[allow(non_camel_case_types)]
9519                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9520                    impl<
9521                        T: OrganizationService,
9522                    > tonic::server::UnaryService<super::GetOrganizationRequest>
9523                    for GetOrganizationSvc<T> {
9524                        type Response = super::GetOrganizationResponse;
9525                        type Future = BoxFuture<
9526                            tonic::Response<Self::Response>,
9527                            tonic::Status,
9528                        >;
9529                        fn call(
9530                            &mut self,
9531                            request: tonic::Request<super::GetOrganizationRequest>,
9532                        ) -> Self::Future {
9533                            let inner = Arc::clone(&self.0);
9534                            let fut = async move {
9535                                <T as OrganizationService>::get_organization(
9536                                        &inner,
9537                                        request,
9538                                    )
9539                                    .await
9540                            };
9541                            Box::pin(fut)
9542                        }
9543                    }
9544                    let accept_compression_encodings = self.accept_compression_encodings;
9545                    let send_compression_encodings = self.send_compression_encodings;
9546                    let max_decoding_message_size = self.max_decoding_message_size;
9547                    let max_encoding_message_size = self.max_encoding_message_size;
9548                    let inner = self.inner.clone();
9549                    let fut = async move {
9550                        let method = GetOrganizationSvc(inner);
9551                        let codec = tonic_prost::ProstCodec::default();
9552                        let mut grpc = tonic::server::Grpc::new(codec)
9553                            .apply_compression_config(
9554                                accept_compression_encodings,
9555                                send_compression_encodings,
9556                            )
9557                            .apply_max_message_size_config(
9558                                max_decoding_message_size,
9559                                max_encoding_message_size,
9560                            );
9561                        let res = grpc.unary(method, req).await;
9562                        Ok(res)
9563                    };
9564                    Box::pin(fut)
9565                }
9566                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
9567                    #[allow(non_camel_case_types)]
9568                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9569                    impl<
9570                        T: OrganizationService,
9571                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
9572                    for UpdateOrganizationSvc<T> {
9573                        type Response = super::UpdateOrganizationResponse;
9574                        type Future = BoxFuture<
9575                            tonic::Response<Self::Response>,
9576                            tonic::Status,
9577                        >;
9578                        fn call(
9579                            &mut self,
9580                            request: tonic::Request<super::UpdateOrganizationRequest>,
9581                        ) -> Self::Future {
9582                            let inner = Arc::clone(&self.0);
9583                            let fut = async move {
9584                                <T as OrganizationService>::update_organization(
9585                                        &inner,
9586                                        request,
9587                                    )
9588                                    .await
9589                            };
9590                            Box::pin(fut)
9591                        }
9592                    }
9593                    let accept_compression_encodings = self.accept_compression_encodings;
9594                    let send_compression_encodings = self.send_compression_encodings;
9595                    let max_decoding_message_size = self.max_decoding_message_size;
9596                    let max_encoding_message_size = self.max_encoding_message_size;
9597                    let inner = self.inner.clone();
9598                    let fut = async move {
9599                        let method = UpdateOrganizationSvc(inner);
9600                        let codec = tonic_prost::ProstCodec::default();
9601                        let mut grpc = tonic::server::Grpc::new(codec)
9602                            .apply_compression_config(
9603                                accept_compression_encodings,
9604                                send_compression_encodings,
9605                            )
9606                            .apply_max_message_size_config(
9607                                max_decoding_message_size,
9608                                max_encoding_message_size,
9609                            );
9610                        let res = grpc.unary(method, req).await;
9611                        Ok(res)
9612                    };
9613                    Box::pin(fut)
9614                }
9615                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
9616                    #[allow(non_camel_case_types)]
9617                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
9618                        pub Arc<T>,
9619                    );
9620                    impl<
9621                        T: OrganizationService,
9622                    > tonic::server::UnaryService<
9623                        super::UpdateSsoAttributeMappingsRequest,
9624                    > for UpdateSsoAttributeMappingsSvc<T> {
9625                        type Response = super::UpdateSsoAttributeMappingsResponse;
9626                        type Future = BoxFuture<
9627                            tonic::Response<Self::Response>,
9628                            tonic::Status,
9629                        >;
9630                        fn call(
9631                            &mut self,
9632                            request: tonic::Request<
9633                                super::UpdateSsoAttributeMappingsRequest,
9634                            >,
9635                        ) -> Self::Future {
9636                            let inner = Arc::clone(&self.0);
9637                            let fut = async move {
9638                                <T as OrganizationService>::update_sso_attribute_mappings(
9639                                        &inner,
9640                                        request,
9641                                    )
9642                                    .await
9643                            };
9644                            Box::pin(fut)
9645                        }
9646                    }
9647                    let accept_compression_encodings = self.accept_compression_encodings;
9648                    let send_compression_encodings = self.send_compression_encodings;
9649                    let max_decoding_message_size = self.max_decoding_message_size;
9650                    let max_encoding_message_size = self.max_encoding_message_size;
9651                    let inner = self.inner.clone();
9652                    let fut = async move {
9653                        let method = UpdateSsoAttributeMappingsSvc(inner);
9654                        let codec = tonic_prost::ProstCodec::default();
9655                        let mut grpc = tonic::server::Grpc::new(codec)
9656                            .apply_compression_config(
9657                                accept_compression_encodings,
9658                                send_compression_encodings,
9659                            )
9660                            .apply_max_message_size_config(
9661                                max_decoding_message_size,
9662                                max_encoding_message_size,
9663                            );
9664                        let res = grpc.unary(method, req).await;
9665                        Ok(res)
9666                    };
9667                    Box::pin(fut)
9668                }
9669                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
9670                    #[allow(non_camel_case_types)]
9671                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
9672                    impl<
9673                        T: OrganizationService,
9674                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
9675                    for RotateAnalyticsSaltSvc<T> {
9676                        type Response = super::RotateAnalyticsSaltResponse;
9677                        type Future = BoxFuture<
9678                            tonic::Response<Self::Response>,
9679                            tonic::Status,
9680                        >;
9681                        fn call(
9682                            &mut self,
9683                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9684                        ) -> Self::Future {
9685                            let inner = Arc::clone(&self.0);
9686                            let fut = async move {
9687                                <T as OrganizationService>::rotate_analytics_salt(
9688                                        &inner,
9689                                        request,
9690                                    )
9691                                    .await
9692                            };
9693                            Box::pin(fut)
9694                        }
9695                    }
9696                    let accept_compression_encodings = self.accept_compression_encodings;
9697                    let send_compression_encodings = self.send_compression_encodings;
9698                    let max_decoding_message_size = self.max_decoding_message_size;
9699                    let max_encoding_message_size = self.max_encoding_message_size;
9700                    let inner = self.inner.clone();
9701                    let fut = async move {
9702                        let method = RotateAnalyticsSaltSvc(inner);
9703                        let codec = tonic_prost::ProstCodec::default();
9704                        let mut grpc = tonic::server::Grpc::new(codec)
9705                            .apply_compression_config(
9706                                accept_compression_encodings,
9707                                send_compression_encodings,
9708                            )
9709                            .apply_max_message_size_config(
9710                                max_decoding_message_size,
9711                                max_encoding_message_size,
9712                            );
9713                        let res = grpc.unary(method, req).await;
9714                        Ok(res)
9715                    };
9716                    Box::pin(fut)
9717                }
9718                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
9719                    #[allow(non_camel_case_types)]
9720                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
9721                    impl<
9722                        T: OrganizationService,
9723                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
9724                    for UpdateAnalyticsEpsilonSvc<T> {
9725                        type Response = super::UpdateAnalyticsEpsilonResponse;
9726                        type Future = BoxFuture<
9727                            tonic::Response<Self::Response>,
9728                            tonic::Status,
9729                        >;
9730                        fn call(
9731                            &mut self,
9732                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9733                        ) -> Self::Future {
9734                            let inner = Arc::clone(&self.0);
9735                            let fut = async move {
9736                                <T as OrganizationService>::update_analytics_epsilon(
9737                                        &inner,
9738                                        request,
9739                                    )
9740                                    .await
9741                            };
9742                            Box::pin(fut)
9743                        }
9744                    }
9745                    let accept_compression_encodings = self.accept_compression_encodings;
9746                    let send_compression_encodings = self.send_compression_encodings;
9747                    let max_decoding_message_size = self.max_decoding_message_size;
9748                    let max_encoding_message_size = self.max_encoding_message_size;
9749                    let inner = self.inner.clone();
9750                    let fut = async move {
9751                        let method = UpdateAnalyticsEpsilonSvc(inner);
9752                        let codec = tonic_prost::ProstCodec::default();
9753                        let mut grpc = tonic::server::Grpc::new(codec)
9754                            .apply_compression_config(
9755                                accept_compression_encodings,
9756                                send_compression_encodings,
9757                            )
9758                            .apply_max_message_size_config(
9759                                max_decoding_message_size,
9760                                max_encoding_message_size,
9761                            );
9762                        let res = grpc.unary(method, req).await;
9763                        Ok(res)
9764                    };
9765                    Box::pin(fut)
9766                }
9767                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
9768                    #[allow(non_camel_case_types)]
9769                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
9770                        pub Arc<T>,
9771                    );
9772                    impl<
9773                        T: OrganizationService,
9774                    > tonic::server::UnaryService<
9775                        super::CreateSandboxOrganizationRequest,
9776                    > for CreateSandboxOrganizationSvc<T> {
9777                        type Response = super::CreateSandboxOrganizationResponse;
9778                        type Future = BoxFuture<
9779                            tonic::Response<Self::Response>,
9780                            tonic::Status,
9781                        >;
9782                        fn call(
9783                            &mut self,
9784                            request: tonic::Request<
9785                                super::CreateSandboxOrganizationRequest,
9786                            >,
9787                        ) -> Self::Future {
9788                            let inner = Arc::clone(&self.0);
9789                            let fut = async move {
9790                                <T as OrganizationService>::create_sandbox_organization(
9791                                        &inner,
9792                                        request,
9793                                    )
9794                                    .await
9795                            };
9796                            Box::pin(fut)
9797                        }
9798                    }
9799                    let accept_compression_encodings = self.accept_compression_encodings;
9800                    let send_compression_encodings = self.send_compression_encodings;
9801                    let max_decoding_message_size = self.max_decoding_message_size;
9802                    let max_encoding_message_size = self.max_encoding_message_size;
9803                    let inner = self.inner.clone();
9804                    let fut = async move {
9805                        let method = CreateSandboxOrganizationSvc(inner);
9806                        let codec = tonic_prost::ProstCodec::default();
9807                        let mut grpc = tonic::server::Grpc::new(codec)
9808                            .apply_compression_config(
9809                                accept_compression_encodings,
9810                                send_compression_encodings,
9811                            )
9812                            .apply_max_message_size_config(
9813                                max_decoding_message_size,
9814                                max_encoding_message_size,
9815                            );
9816                        let res = grpc.unary(method, req).await;
9817                        Ok(res)
9818                    };
9819                    Box::pin(fut)
9820                }
9821                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
9822                    #[allow(non_camel_case_types)]
9823                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
9824                        pub Arc<T>,
9825                    );
9826                    impl<
9827                        T: OrganizationService,
9828                    > tonic::server::UnaryService<
9829                        super::DeleteSandboxOrganizationRequest,
9830                    > for DeleteSandboxOrganizationSvc<T> {
9831                        type Response = super::DeleteSandboxOrganizationResponse;
9832                        type Future = BoxFuture<
9833                            tonic::Response<Self::Response>,
9834                            tonic::Status,
9835                        >;
9836                        fn call(
9837                            &mut self,
9838                            request: tonic::Request<
9839                                super::DeleteSandboxOrganizationRequest,
9840                            >,
9841                        ) -> Self::Future {
9842                            let inner = Arc::clone(&self.0);
9843                            let fut = async move {
9844                                <T as OrganizationService>::delete_sandbox_organization(
9845                                        &inner,
9846                                        request,
9847                                    )
9848                                    .await
9849                            };
9850                            Box::pin(fut)
9851                        }
9852                    }
9853                    let accept_compression_encodings = self.accept_compression_encodings;
9854                    let send_compression_encodings = self.send_compression_encodings;
9855                    let max_decoding_message_size = self.max_decoding_message_size;
9856                    let max_encoding_message_size = self.max_encoding_message_size;
9857                    let inner = self.inner.clone();
9858                    let fut = async move {
9859                        let method = DeleteSandboxOrganizationSvc(inner);
9860                        let codec = tonic_prost::ProstCodec::default();
9861                        let mut grpc = tonic::server::Grpc::new(codec)
9862                            .apply_compression_config(
9863                                accept_compression_encodings,
9864                                send_compression_encodings,
9865                            )
9866                            .apply_max_message_size_config(
9867                                max_decoding_message_size,
9868                                max_encoding_message_size,
9869                            );
9870                        let res = grpc.unary(method, req).await;
9871                        Ok(res)
9872                    };
9873                    Box::pin(fut)
9874                }
9875                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
9876                    #[allow(non_camel_case_types)]
9877                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
9878                    impl<
9879                        T: OrganizationService,
9880                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
9881                    for ListSandboxFixturesSvc<T> {
9882                        type Response = super::ListSandboxFixturesResponse;
9883                        type Future = BoxFuture<
9884                            tonic::Response<Self::Response>,
9885                            tonic::Status,
9886                        >;
9887                        fn call(
9888                            &mut self,
9889                            request: tonic::Request<super::ListSandboxFixturesRequest>,
9890                        ) -> Self::Future {
9891                            let inner = Arc::clone(&self.0);
9892                            let fut = async move {
9893                                <T as OrganizationService>::list_sandbox_fixtures(
9894                                        &inner,
9895                                        request,
9896                                    )
9897                                    .await
9898                            };
9899                            Box::pin(fut)
9900                        }
9901                    }
9902                    let accept_compression_encodings = self.accept_compression_encodings;
9903                    let send_compression_encodings = self.send_compression_encodings;
9904                    let max_decoding_message_size = self.max_decoding_message_size;
9905                    let max_encoding_message_size = self.max_encoding_message_size;
9906                    let inner = self.inner.clone();
9907                    let fut = async move {
9908                        let method = ListSandboxFixturesSvc(inner);
9909                        let codec = tonic_prost::ProstCodec::default();
9910                        let mut grpc = tonic::server::Grpc::new(codec)
9911                            .apply_compression_config(
9912                                accept_compression_encodings,
9913                                send_compression_encodings,
9914                            )
9915                            .apply_max_message_size_config(
9916                                max_decoding_message_size,
9917                                max_encoding_message_size,
9918                            );
9919                        let res = grpc.unary(method, req).await;
9920                        Ok(res)
9921                    };
9922                    Box::pin(fut)
9923                }
9924                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
9925                    #[allow(non_camel_case_types)]
9926                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
9927                    impl<
9928                        T: OrganizationService,
9929                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
9930                    for ListUserOrganizationsSvc<T> {
9931                        type Response = super::ListUserOrganizationsResponse;
9932                        type Future = BoxFuture<
9933                            tonic::Response<Self::Response>,
9934                            tonic::Status,
9935                        >;
9936                        fn call(
9937                            &mut self,
9938                            request: tonic::Request<super::ListUserOrganizationsRequest>,
9939                        ) -> Self::Future {
9940                            let inner = Arc::clone(&self.0);
9941                            let fut = async move {
9942                                <T as OrganizationService>::list_user_organizations(
9943                                        &inner,
9944                                        request,
9945                                    )
9946                                    .await
9947                            };
9948                            Box::pin(fut)
9949                        }
9950                    }
9951                    let accept_compression_encodings = self.accept_compression_encodings;
9952                    let send_compression_encodings = self.send_compression_encodings;
9953                    let max_decoding_message_size = self.max_decoding_message_size;
9954                    let max_encoding_message_size = self.max_encoding_message_size;
9955                    let inner = self.inner.clone();
9956                    let fut = async move {
9957                        let method = ListUserOrganizationsSvc(inner);
9958                        let codec = tonic_prost::ProstCodec::default();
9959                        let mut grpc = tonic::server::Grpc::new(codec)
9960                            .apply_compression_config(
9961                                accept_compression_encodings,
9962                                send_compression_encodings,
9963                            )
9964                            .apply_max_message_size_config(
9965                                max_decoding_message_size,
9966                                max_encoding_message_size,
9967                            );
9968                        let res = grpc.unary(method, req).await;
9969                        Ok(res)
9970                    };
9971                    Box::pin(fut)
9972                }
9973                _ => {
9974                    Box::pin(async move {
9975                        let mut response = http::Response::new(
9976                            tonic::body::Body::default(),
9977                        );
9978                        let headers = response.headers_mut();
9979                        headers
9980                            .insert(
9981                                tonic::Status::GRPC_STATUS,
9982                                (tonic::Code::Unimplemented as i32).into(),
9983                            );
9984                        headers
9985                            .insert(
9986                                http::header::CONTENT_TYPE,
9987                                tonic::metadata::GRPC_CONTENT_TYPE,
9988                            );
9989                        Ok(response)
9990                    })
9991                }
9992            }
9993        }
9994    }
9995    impl<T> Clone for OrganizationServiceServer<T> {
9996        fn clone(&self) -> Self {
9997            let inner = self.inner.clone();
9998            Self {
9999                inner,
10000                accept_compression_encodings: self.accept_compression_encodings,
10001                send_compression_encodings: self.send_compression_encodings,
10002                max_decoding_message_size: self.max_decoding_message_size,
10003                max_encoding_message_size: self.max_encoding_message_size,
10004            }
10005        }
10006    }
10007    /// Generated gRPC service name
10008    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
10009    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
10010        const NAME: &'static str = SERVICE_NAME;
10011    }
10012}
10013/// Generated client implementations.
10014pub mod render_service_client {
10015    #![allow(
10016        unused_variables,
10017        dead_code,
10018        missing_docs,
10019        clippy::wildcard_imports,
10020        clippy::let_unit_value,
10021    )]
10022    use tonic::codegen::*;
10023    use tonic::codegen::http::Uri;
10024    /** Internal service for batch template rendering.
10025*/
10026    #[derive(Debug, Clone)]
10027    pub struct RenderServiceClient<T> {
10028        inner: tonic::client::Grpc<T>,
10029    }
10030    impl RenderServiceClient<tonic::transport::Channel> {
10031        /// Attempt to create a new client by connecting to a given endpoint.
10032        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10033        where
10034            D: TryInto<tonic::transport::Endpoint>,
10035            D::Error: Into<StdError>,
10036        {
10037            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10038            Ok(Self::new(conn))
10039        }
10040    }
10041    impl<T> RenderServiceClient<T>
10042    where
10043        T: tonic::client::GrpcService<tonic::body::Body>,
10044        T::Error: Into<StdError>,
10045        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10046        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10047    {
10048        pub fn new(inner: T) -> Self {
10049            let inner = tonic::client::Grpc::new(inner);
10050            Self { inner }
10051        }
10052        pub fn with_origin(inner: T, origin: Uri) -> Self {
10053            let inner = tonic::client::Grpc::with_origin(inner, origin);
10054            Self { inner }
10055        }
10056        pub fn with_interceptor<F>(
10057            inner: T,
10058            interceptor: F,
10059        ) -> RenderServiceClient<InterceptedService<T, F>>
10060        where
10061            F: tonic::service::Interceptor,
10062            T::ResponseBody: Default,
10063            T: tonic::codegen::Service<
10064                http::Request<tonic::body::Body>,
10065                Response = http::Response<
10066                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10067                >,
10068            >,
10069            <T as tonic::codegen::Service<
10070                http::Request<tonic::body::Body>,
10071            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10072        {
10073            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
10074        }
10075        /// Compress requests with the given encoding.
10076        ///
10077        /// This requires the server to support it otherwise it might respond with an
10078        /// error.
10079        #[must_use]
10080        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10081            self.inner = self.inner.send_compressed(encoding);
10082            self
10083        }
10084        /// Enable decompressing responses.
10085        #[must_use]
10086        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10087            self.inner = self.inner.accept_compressed(encoding);
10088            self
10089        }
10090        /// Limits the maximum size of a decoded message.
10091        ///
10092        /// Default: `4MB`
10093        #[must_use]
10094        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10095            self.inner = self.inner.max_decoding_message_size(limit);
10096            self
10097        }
10098        /// Limits the maximum size of an encoded message.
10099        ///
10100        /// Default: `usize::MAX`
10101        #[must_use]
10102        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10103            self.inner = self.inner.max_encoding_message_size(limit);
10104            self
10105        }
10106        /** Render a template for multiple users, streaming results as each completes.
10107 Authorization: Internal server-to-server only. Not exposed to external clients.
10108*/
10109        pub async fn render_batch(
10110            &mut self,
10111            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
10112        ) -> std::result::Result<
10113            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
10114            tonic::Status,
10115        > {
10116            self.inner
10117                .ready()
10118                .await
10119                .map_err(|e| {
10120                    tonic::Status::unknown(
10121                        format!("Service was not ready: {}", e.into()),
10122                    )
10123                })?;
10124            let codec = tonic_prost::ProstCodec::default();
10125            let path = http::uri::PathAndQuery::from_static(
10126                "/pidgr.v1.RenderService/RenderBatch",
10127            );
10128            let mut req = request.into_request();
10129            req.extensions_mut()
10130                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
10131            self.inner.server_streaming(req, path, codec).await
10132        }
10133    }
10134}
10135/// Generated server implementations.
10136pub mod render_service_server {
10137    #![allow(
10138        unused_variables,
10139        dead_code,
10140        missing_docs,
10141        clippy::wildcard_imports,
10142        clippy::let_unit_value,
10143    )]
10144    use tonic::codegen::*;
10145    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
10146    #[async_trait]
10147    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
10148        /// Server streaming response type for the RenderBatch method.
10149        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
10150                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
10151            >
10152            + std::marker::Send
10153            + 'static;
10154        /** Render a template for multiple users, streaming results as each completes.
10155 Authorization: Internal server-to-server only. Not exposed to external clients.
10156*/
10157        async fn render_batch(
10158            &self,
10159            request: tonic::Request<super::RenderBatchRequest>,
10160        ) -> std::result::Result<
10161            tonic::Response<Self::RenderBatchStream>,
10162            tonic::Status,
10163        >;
10164    }
10165    /** Internal service for batch template rendering.
10166*/
10167    #[derive(Debug)]
10168    pub struct RenderServiceServer<T> {
10169        inner: Arc<T>,
10170        accept_compression_encodings: EnabledCompressionEncodings,
10171        send_compression_encodings: EnabledCompressionEncodings,
10172        max_decoding_message_size: Option<usize>,
10173        max_encoding_message_size: Option<usize>,
10174    }
10175    impl<T> RenderServiceServer<T> {
10176        pub fn new(inner: T) -> Self {
10177            Self::from_arc(Arc::new(inner))
10178        }
10179        pub fn from_arc(inner: Arc<T>) -> Self {
10180            Self {
10181                inner,
10182                accept_compression_encodings: Default::default(),
10183                send_compression_encodings: Default::default(),
10184                max_decoding_message_size: None,
10185                max_encoding_message_size: None,
10186            }
10187        }
10188        pub fn with_interceptor<F>(
10189            inner: T,
10190            interceptor: F,
10191        ) -> InterceptedService<Self, F>
10192        where
10193            F: tonic::service::Interceptor,
10194        {
10195            InterceptedService::new(Self::new(inner), interceptor)
10196        }
10197        /// Enable decompressing requests with the given encoding.
10198        #[must_use]
10199        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10200            self.accept_compression_encodings.enable(encoding);
10201            self
10202        }
10203        /// Compress responses with the given encoding, if the client supports it.
10204        #[must_use]
10205        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10206            self.send_compression_encodings.enable(encoding);
10207            self
10208        }
10209        /// Limits the maximum size of a decoded message.
10210        ///
10211        /// Default: `4MB`
10212        #[must_use]
10213        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10214            self.max_decoding_message_size = Some(limit);
10215            self
10216        }
10217        /// Limits the maximum size of an encoded message.
10218        ///
10219        /// Default: `usize::MAX`
10220        #[must_use]
10221        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10222            self.max_encoding_message_size = Some(limit);
10223            self
10224        }
10225    }
10226    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
10227    where
10228        T: RenderService,
10229        B: Body + std::marker::Send + 'static,
10230        B::Error: Into<StdError> + std::marker::Send + 'static,
10231    {
10232        type Response = http::Response<tonic::body::Body>;
10233        type Error = std::convert::Infallible;
10234        type Future = BoxFuture<Self::Response, Self::Error>;
10235        fn poll_ready(
10236            &mut self,
10237            _cx: &mut Context<'_>,
10238        ) -> Poll<std::result::Result<(), Self::Error>> {
10239            Poll::Ready(Ok(()))
10240        }
10241        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10242            match req.uri().path() {
10243                "/pidgr.v1.RenderService/RenderBatch" => {
10244                    #[allow(non_camel_case_types)]
10245                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
10246                    impl<
10247                        T: RenderService,
10248                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
10249                    for RenderBatchSvc<T> {
10250                        type Response = super::RenderBatchResponse;
10251                        type ResponseStream = T::RenderBatchStream;
10252                        type Future = BoxFuture<
10253                            tonic::Response<Self::ResponseStream>,
10254                            tonic::Status,
10255                        >;
10256                        fn call(
10257                            &mut self,
10258                            request: tonic::Request<super::RenderBatchRequest>,
10259                        ) -> Self::Future {
10260                            let inner = Arc::clone(&self.0);
10261                            let fut = async move {
10262                                <T as RenderService>::render_batch(&inner, request).await
10263                            };
10264                            Box::pin(fut)
10265                        }
10266                    }
10267                    let accept_compression_encodings = self.accept_compression_encodings;
10268                    let send_compression_encodings = self.send_compression_encodings;
10269                    let max_decoding_message_size = self.max_decoding_message_size;
10270                    let max_encoding_message_size = self.max_encoding_message_size;
10271                    let inner = self.inner.clone();
10272                    let fut = async move {
10273                        let method = RenderBatchSvc(inner);
10274                        let codec = tonic_prost::ProstCodec::default();
10275                        let mut grpc = tonic::server::Grpc::new(codec)
10276                            .apply_compression_config(
10277                                accept_compression_encodings,
10278                                send_compression_encodings,
10279                            )
10280                            .apply_max_message_size_config(
10281                                max_decoding_message_size,
10282                                max_encoding_message_size,
10283                            );
10284                        let res = grpc.server_streaming(method, req).await;
10285                        Ok(res)
10286                    };
10287                    Box::pin(fut)
10288                }
10289                _ => {
10290                    Box::pin(async move {
10291                        let mut response = http::Response::new(
10292                            tonic::body::Body::default(),
10293                        );
10294                        let headers = response.headers_mut();
10295                        headers
10296                            .insert(
10297                                tonic::Status::GRPC_STATUS,
10298                                (tonic::Code::Unimplemented as i32).into(),
10299                            );
10300                        headers
10301                            .insert(
10302                                http::header::CONTENT_TYPE,
10303                                tonic::metadata::GRPC_CONTENT_TYPE,
10304                            );
10305                        Ok(response)
10306                    })
10307                }
10308            }
10309        }
10310    }
10311    impl<T> Clone for RenderServiceServer<T> {
10312        fn clone(&self) -> Self {
10313            let inner = self.inner.clone();
10314            Self {
10315                inner,
10316                accept_compression_encodings: self.accept_compression_encodings,
10317                send_compression_encodings: self.send_compression_encodings,
10318                max_decoding_message_size: self.max_decoding_message_size,
10319                max_encoding_message_size: self.max_encoding_message_size,
10320            }
10321        }
10322    }
10323    /// Generated gRPC service name
10324    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
10325    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
10326        const NAME: &'static str = SERVICE_NAME;
10327    }
10328}
10329/// Generated client implementations.
10330pub mod replay_service_client {
10331    #![allow(
10332        unused_variables,
10333        dead_code,
10334        missing_docs,
10335        clippy::wildcard_imports,
10336        clippy::let_unit_value,
10337    )]
10338    use tonic::codegen::*;
10339    use tonic::codegen::http::Uri;
10340    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10341 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10342*/
10343    #[derive(Debug, Clone)]
10344    pub struct ReplayServiceClient<T> {
10345        inner: tonic::client::Grpc<T>,
10346    }
10347    impl ReplayServiceClient<tonic::transport::Channel> {
10348        /// Attempt to create a new client by connecting to a given endpoint.
10349        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10350        where
10351            D: TryInto<tonic::transport::Endpoint>,
10352            D::Error: Into<StdError>,
10353        {
10354            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10355            Ok(Self::new(conn))
10356        }
10357    }
10358    impl<T> ReplayServiceClient<T>
10359    where
10360        T: tonic::client::GrpcService<tonic::body::Body>,
10361        T::Error: Into<StdError>,
10362        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10363        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10364    {
10365        pub fn new(inner: T) -> Self {
10366            let inner = tonic::client::Grpc::new(inner);
10367            Self { inner }
10368        }
10369        pub fn with_origin(inner: T, origin: Uri) -> Self {
10370            let inner = tonic::client::Grpc::with_origin(inner, origin);
10371            Self { inner }
10372        }
10373        pub fn with_interceptor<F>(
10374            inner: T,
10375            interceptor: F,
10376        ) -> ReplayServiceClient<InterceptedService<T, F>>
10377        where
10378            F: tonic::service::Interceptor,
10379            T::ResponseBody: Default,
10380            T: tonic::codegen::Service<
10381                http::Request<tonic::body::Body>,
10382                Response = http::Response<
10383                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10384                >,
10385            >,
10386            <T as tonic::codegen::Service<
10387                http::Request<tonic::body::Body>,
10388            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10389        {
10390            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
10391        }
10392        /// Compress requests with the given encoding.
10393        ///
10394        /// This requires the server to support it otherwise it might respond with an
10395        /// error.
10396        #[must_use]
10397        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10398            self.inner = self.inner.send_compressed(encoding);
10399            self
10400        }
10401        /// Enable decompressing responses.
10402        #[must_use]
10403        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10404            self.inner = self.inner.accept_compressed(encoding);
10405            self
10406        }
10407        /// Limits the maximum size of a decoded message.
10408        ///
10409        /// Default: `4MB`
10410        #[must_use]
10411        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10412            self.inner = self.inner.max_decoding_message_size(limit);
10413            self
10414        }
10415        /// Limits the maximum size of an encoded message.
10416        ///
10417        /// Default: `usize::MAX`
10418        #[must_use]
10419        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10420            self.inner = self.inner.max_encoding_message_size(limit);
10421            self
10422        }
10423        /** List recent session recordings with optional campaign and time range filters.
10424 Authorization: Requires CAMPAIGNS_READ permission.
10425*/
10426        pub async fn list_session_recordings(
10427            &mut self,
10428            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
10429        ) -> std::result::Result<
10430            tonic::Response<super::ListSessionRecordingsResponse>,
10431            tonic::Status,
10432        > {
10433            self.inner
10434                .ready()
10435                .await
10436                .map_err(|e| {
10437                    tonic::Status::unknown(
10438                        format!("Service was not ready: {}", e.into()),
10439                    )
10440                })?;
10441            let codec = tonic_prost::ProstCodec::default();
10442            let path = http::uri::PathAndQuery::from_static(
10443                "/pidgr.v1.ReplayService/ListSessionRecordings",
10444            );
10445            let mut req = request.into_request();
10446            req.extensions_mut()
10447                .insert(
10448                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
10449                );
10450            self.inner.unary(req, path, codec).await
10451        }
10452        /** Fetch the full rrweb snapshot data for a single recording.
10453 Authorization: Requires CAMPAIGNS_READ permission.
10454*/
10455        pub async fn get_session_snapshots(
10456            &mut self,
10457            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
10458        ) -> std::result::Result<
10459            tonic::Response<super::GetSessionSnapshotsResponse>,
10460            tonic::Status,
10461        > {
10462            self.inner
10463                .ready()
10464                .await
10465                .map_err(|e| {
10466                    tonic::Status::unknown(
10467                        format!("Service was not ready: {}", e.into()),
10468                    )
10469                })?;
10470            let codec = tonic_prost::ProstCodec::default();
10471            let path = http::uri::PathAndQuery::from_static(
10472                "/pidgr.v1.ReplayService/GetSessionSnapshots",
10473            );
10474            let mut req = request.into_request();
10475            req.extensions_mut()
10476                .insert(
10477                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
10478                );
10479            self.inner.unary(req, path, codec).await
10480        }
10481    }
10482}
10483/// Generated server implementations.
10484pub mod replay_service_server {
10485    #![allow(
10486        unused_variables,
10487        dead_code,
10488        missing_docs,
10489        clippy::wildcard_imports,
10490        clippy::let_unit_value,
10491    )]
10492    use tonic::codegen::*;
10493    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
10494    #[async_trait]
10495    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
10496        /** List recent session recordings with optional campaign and time range filters.
10497 Authorization: Requires CAMPAIGNS_READ permission.
10498*/
10499        async fn list_session_recordings(
10500            &self,
10501            request: tonic::Request<super::ListSessionRecordingsRequest>,
10502        ) -> std::result::Result<
10503            tonic::Response<super::ListSessionRecordingsResponse>,
10504            tonic::Status,
10505        >;
10506        /** Fetch the full rrweb snapshot data for a single recording.
10507 Authorization: Requires CAMPAIGNS_READ permission.
10508*/
10509        async fn get_session_snapshots(
10510            &self,
10511            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10512        ) -> std::result::Result<
10513            tonic::Response<super::GetSessionSnapshotsResponse>,
10514            tonic::Status,
10515        >;
10516    }
10517    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10518 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10519*/
10520    #[derive(Debug)]
10521    pub struct ReplayServiceServer<T> {
10522        inner: Arc<T>,
10523        accept_compression_encodings: EnabledCompressionEncodings,
10524        send_compression_encodings: EnabledCompressionEncodings,
10525        max_decoding_message_size: Option<usize>,
10526        max_encoding_message_size: Option<usize>,
10527    }
10528    impl<T> ReplayServiceServer<T> {
10529        pub fn new(inner: T) -> Self {
10530            Self::from_arc(Arc::new(inner))
10531        }
10532        pub fn from_arc(inner: Arc<T>) -> Self {
10533            Self {
10534                inner,
10535                accept_compression_encodings: Default::default(),
10536                send_compression_encodings: Default::default(),
10537                max_decoding_message_size: None,
10538                max_encoding_message_size: None,
10539            }
10540        }
10541        pub fn with_interceptor<F>(
10542            inner: T,
10543            interceptor: F,
10544        ) -> InterceptedService<Self, F>
10545        where
10546            F: tonic::service::Interceptor,
10547        {
10548            InterceptedService::new(Self::new(inner), interceptor)
10549        }
10550        /// Enable decompressing requests with the given encoding.
10551        #[must_use]
10552        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10553            self.accept_compression_encodings.enable(encoding);
10554            self
10555        }
10556        /// Compress responses with the given encoding, if the client supports it.
10557        #[must_use]
10558        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10559            self.send_compression_encodings.enable(encoding);
10560            self
10561        }
10562        /// Limits the maximum size of a decoded message.
10563        ///
10564        /// Default: `4MB`
10565        #[must_use]
10566        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10567            self.max_decoding_message_size = Some(limit);
10568            self
10569        }
10570        /// Limits the maximum size of an encoded message.
10571        ///
10572        /// Default: `usize::MAX`
10573        #[must_use]
10574        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10575            self.max_encoding_message_size = Some(limit);
10576            self
10577        }
10578    }
10579    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
10580    where
10581        T: ReplayService,
10582        B: Body + std::marker::Send + 'static,
10583        B::Error: Into<StdError> + std::marker::Send + 'static,
10584    {
10585        type Response = http::Response<tonic::body::Body>;
10586        type Error = std::convert::Infallible;
10587        type Future = BoxFuture<Self::Response, Self::Error>;
10588        fn poll_ready(
10589            &mut self,
10590            _cx: &mut Context<'_>,
10591        ) -> Poll<std::result::Result<(), Self::Error>> {
10592            Poll::Ready(Ok(()))
10593        }
10594        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10595            match req.uri().path() {
10596                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
10597                    #[allow(non_camel_case_types)]
10598                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
10599                    impl<
10600                        T: ReplayService,
10601                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
10602                    for ListSessionRecordingsSvc<T> {
10603                        type Response = super::ListSessionRecordingsResponse;
10604                        type Future = BoxFuture<
10605                            tonic::Response<Self::Response>,
10606                            tonic::Status,
10607                        >;
10608                        fn call(
10609                            &mut self,
10610                            request: tonic::Request<super::ListSessionRecordingsRequest>,
10611                        ) -> Self::Future {
10612                            let inner = Arc::clone(&self.0);
10613                            let fut = async move {
10614                                <T as ReplayService>::list_session_recordings(
10615                                        &inner,
10616                                        request,
10617                                    )
10618                                    .await
10619                            };
10620                            Box::pin(fut)
10621                        }
10622                    }
10623                    let accept_compression_encodings = self.accept_compression_encodings;
10624                    let send_compression_encodings = self.send_compression_encodings;
10625                    let max_decoding_message_size = self.max_decoding_message_size;
10626                    let max_encoding_message_size = self.max_encoding_message_size;
10627                    let inner = self.inner.clone();
10628                    let fut = async move {
10629                        let method = ListSessionRecordingsSvc(inner);
10630                        let codec = tonic_prost::ProstCodec::default();
10631                        let mut grpc = tonic::server::Grpc::new(codec)
10632                            .apply_compression_config(
10633                                accept_compression_encodings,
10634                                send_compression_encodings,
10635                            )
10636                            .apply_max_message_size_config(
10637                                max_decoding_message_size,
10638                                max_encoding_message_size,
10639                            );
10640                        let res = grpc.unary(method, req).await;
10641                        Ok(res)
10642                    };
10643                    Box::pin(fut)
10644                }
10645                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
10646                    #[allow(non_camel_case_types)]
10647                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
10648                    impl<
10649                        T: ReplayService,
10650                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
10651                    for GetSessionSnapshotsSvc<T> {
10652                        type Response = super::GetSessionSnapshotsResponse;
10653                        type Future = BoxFuture<
10654                            tonic::Response<Self::Response>,
10655                            tonic::Status,
10656                        >;
10657                        fn call(
10658                            &mut self,
10659                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10660                        ) -> Self::Future {
10661                            let inner = Arc::clone(&self.0);
10662                            let fut = async move {
10663                                <T as ReplayService>::get_session_snapshots(&inner, request)
10664                                    .await
10665                            };
10666                            Box::pin(fut)
10667                        }
10668                    }
10669                    let accept_compression_encodings = self.accept_compression_encodings;
10670                    let send_compression_encodings = self.send_compression_encodings;
10671                    let max_decoding_message_size = self.max_decoding_message_size;
10672                    let max_encoding_message_size = self.max_encoding_message_size;
10673                    let inner = self.inner.clone();
10674                    let fut = async move {
10675                        let method = GetSessionSnapshotsSvc(inner);
10676                        let codec = tonic_prost::ProstCodec::default();
10677                        let mut grpc = tonic::server::Grpc::new(codec)
10678                            .apply_compression_config(
10679                                accept_compression_encodings,
10680                                send_compression_encodings,
10681                            )
10682                            .apply_max_message_size_config(
10683                                max_decoding_message_size,
10684                                max_encoding_message_size,
10685                            );
10686                        let res = grpc.unary(method, req).await;
10687                        Ok(res)
10688                    };
10689                    Box::pin(fut)
10690                }
10691                _ => {
10692                    Box::pin(async move {
10693                        let mut response = http::Response::new(
10694                            tonic::body::Body::default(),
10695                        );
10696                        let headers = response.headers_mut();
10697                        headers
10698                            .insert(
10699                                tonic::Status::GRPC_STATUS,
10700                                (tonic::Code::Unimplemented as i32).into(),
10701                            );
10702                        headers
10703                            .insert(
10704                                http::header::CONTENT_TYPE,
10705                                tonic::metadata::GRPC_CONTENT_TYPE,
10706                            );
10707                        Ok(response)
10708                    })
10709                }
10710            }
10711        }
10712    }
10713    impl<T> Clone for ReplayServiceServer<T> {
10714        fn clone(&self) -> Self {
10715            let inner = self.inner.clone();
10716            Self {
10717                inner,
10718                accept_compression_encodings: self.accept_compression_encodings,
10719                send_compression_encodings: self.send_compression_encodings,
10720                max_decoding_message_size: self.max_decoding_message_size,
10721                max_encoding_message_size: self.max_encoding_message_size,
10722            }
10723        }
10724    }
10725    /// Generated gRPC service name
10726    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
10727    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
10728        const NAME: &'static str = SERVICE_NAME;
10729    }
10730}
10731/// Generated client implementations.
10732pub mod role_service_client {
10733    #![allow(
10734        unused_variables,
10735        dead_code,
10736        missing_docs,
10737        clippy::wildcard_imports,
10738        clippy::let_unit_value,
10739    )]
10740    use tonic::codegen::*;
10741    use tonic::codegen::http::Uri;
10742    /** Manages roles and their permissions within an organization.
10743 All RPCs operate within the caller's org (extracted from JWT).
10744*/
10745    #[derive(Debug, Clone)]
10746    pub struct RoleServiceClient<T> {
10747        inner: tonic::client::Grpc<T>,
10748    }
10749    impl RoleServiceClient<tonic::transport::Channel> {
10750        /// Attempt to create a new client by connecting to a given endpoint.
10751        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10752        where
10753            D: TryInto<tonic::transport::Endpoint>,
10754            D::Error: Into<StdError>,
10755        {
10756            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10757            Ok(Self::new(conn))
10758        }
10759    }
10760    impl<T> RoleServiceClient<T>
10761    where
10762        T: tonic::client::GrpcService<tonic::body::Body>,
10763        T::Error: Into<StdError>,
10764        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10765        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10766    {
10767        pub fn new(inner: T) -> Self {
10768            let inner = tonic::client::Grpc::new(inner);
10769            Self { inner }
10770        }
10771        pub fn with_origin(inner: T, origin: Uri) -> Self {
10772            let inner = tonic::client::Grpc::with_origin(inner, origin);
10773            Self { inner }
10774        }
10775        pub fn with_interceptor<F>(
10776            inner: T,
10777            interceptor: F,
10778        ) -> RoleServiceClient<InterceptedService<T, F>>
10779        where
10780            F: tonic::service::Interceptor,
10781            T::ResponseBody: Default,
10782            T: tonic::codegen::Service<
10783                http::Request<tonic::body::Body>,
10784                Response = http::Response<
10785                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10786                >,
10787            >,
10788            <T as tonic::codegen::Service<
10789                http::Request<tonic::body::Body>,
10790            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10791        {
10792            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
10793        }
10794        /// Compress requests with the given encoding.
10795        ///
10796        /// This requires the server to support it otherwise it might respond with an
10797        /// error.
10798        #[must_use]
10799        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10800            self.inner = self.inner.send_compressed(encoding);
10801            self
10802        }
10803        /// Enable decompressing responses.
10804        #[must_use]
10805        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10806            self.inner = self.inner.accept_compressed(encoding);
10807            self
10808        }
10809        /// Limits the maximum size of a decoded message.
10810        ///
10811        /// Default: `4MB`
10812        #[must_use]
10813        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10814            self.inner = self.inner.max_decoding_message_size(limit);
10815            self
10816        }
10817        /// Limits the maximum size of an encoded message.
10818        ///
10819        /// Default: `usize::MAX`
10820        #[must_use]
10821        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10822            self.inner = self.inner.max_encoding_message_size(limit);
10823            self
10824        }
10825        /** List all roles in the organization with their permission sets.
10826 Authorization: Requires PERMISSION_ORG_READ.
10827*/
10828        pub async fn list_roles(
10829            &mut self,
10830            request: impl tonic::IntoRequest<super::ListRolesRequest>,
10831        ) -> std::result::Result<
10832            tonic::Response<super::ListRolesResponse>,
10833            tonic::Status,
10834        > {
10835            self.inner
10836                .ready()
10837                .await
10838                .map_err(|e| {
10839                    tonic::Status::unknown(
10840                        format!("Service was not ready: {}", e.into()),
10841                    )
10842                })?;
10843            let codec = tonic_prost::ProstCodec::default();
10844            let path = http::uri::PathAndQuery::from_static(
10845                "/pidgr.v1.RoleService/ListRoles",
10846            );
10847            let mut req = request.into_request();
10848            req.extensions_mut()
10849                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
10850            self.inner.unary(req, path, codec).await
10851        }
10852        /** Create a new custom role with a name and initial permissions.
10853 Slug is auto-generated from the name and immutable after creation.
10854 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10855*/
10856        pub async fn create_role(
10857            &mut self,
10858            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
10859        ) -> std::result::Result<
10860            tonic::Response<super::CreateRoleResponse>,
10861            tonic::Status,
10862        > {
10863            self.inner
10864                .ready()
10865                .await
10866                .map_err(|e| {
10867                    tonic::Status::unknown(
10868                        format!("Service was not ready: {}", e.into()),
10869                    )
10870                })?;
10871            let codec = tonic_prost::ProstCodec::default();
10872            let path = http::uri::PathAndQuery::from_static(
10873                "/pidgr.v1.RoleService/CreateRole",
10874            );
10875            let mut req = request.into_request();
10876            req.extensions_mut()
10877                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
10878            self.inner.unary(req, path, codec).await
10879        }
10880        /** Update a role's name and/or permissions.
10881 System roles (is_system=true) cannot be updated.
10882 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10883*/
10884        pub async fn update_role(
10885            &mut self,
10886            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
10887        ) -> std::result::Result<
10888            tonic::Response<super::UpdateRoleResponse>,
10889            tonic::Status,
10890        > {
10891            self.inner
10892                .ready()
10893                .await
10894                .map_err(|e| {
10895                    tonic::Status::unknown(
10896                        format!("Service was not ready: {}", e.into()),
10897                    )
10898                })?;
10899            let codec = tonic_prost::ProstCodec::default();
10900            let path = http::uri::PathAndQuery::from_static(
10901                "/pidgr.v1.RoleService/UpdateRole",
10902            );
10903            let mut req = request.into_request();
10904            req.extensions_mut()
10905                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
10906            self.inner.unary(req, path, codec).await
10907        }
10908        /** Delete a role. Fails if any users are assigned to it.
10909 System roles (is_system=true) cannot be deleted.
10910 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10911*/
10912        pub async fn delete_role(
10913            &mut self,
10914            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
10915        ) -> std::result::Result<
10916            tonic::Response<super::DeleteRoleResponse>,
10917            tonic::Status,
10918        > {
10919            self.inner
10920                .ready()
10921                .await
10922                .map_err(|e| {
10923                    tonic::Status::unknown(
10924                        format!("Service was not ready: {}", e.into()),
10925                    )
10926                })?;
10927            let codec = tonic_prost::ProstCodec::default();
10928            let path = http::uri::PathAndQuery::from_static(
10929                "/pidgr.v1.RoleService/DeleteRole",
10930            );
10931            let mut req = request.into_request();
10932            req.extensions_mut()
10933                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
10934            self.inner.unary(req, path, codec).await
10935        }
10936    }
10937}
10938/// Generated server implementations.
10939pub mod role_service_server {
10940    #![allow(
10941        unused_variables,
10942        dead_code,
10943        missing_docs,
10944        clippy::wildcard_imports,
10945        clippy::let_unit_value,
10946    )]
10947    use tonic::codegen::*;
10948    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
10949    #[async_trait]
10950    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
10951        /** List all roles in the organization with their permission sets.
10952 Authorization: Requires PERMISSION_ORG_READ.
10953*/
10954        async fn list_roles(
10955            &self,
10956            request: tonic::Request<super::ListRolesRequest>,
10957        ) -> std::result::Result<
10958            tonic::Response<super::ListRolesResponse>,
10959            tonic::Status,
10960        >;
10961        /** Create a new custom role with a name and initial permissions.
10962 Slug is auto-generated from the name and immutable after creation.
10963 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10964*/
10965        async fn create_role(
10966            &self,
10967            request: tonic::Request<super::CreateRoleRequest>,
10968        ) -> std::result::Result<
10969            tonic::Response<super::CreateRoleResponse>,
10970            tonic::Status,
10971        >;
10972        /** Update a role's name and/or permissions.
10973 System roles (is_system=true) cannot be updated.
10974 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10975*/
10976        async fn update_role(
10977            &self,
10978            request: tonic::Request<super::UpdateRoleRequest>,
10979        ) -> std::result::Result<
10980            tonic::Response<super::UpdateRoleResponse>,
10981            tonic::Status,
10982        >;
10983        /** Delete a role. Fails if any users are assigned to it.
10984 System roles (is_system=true) cannot be deleted.
10985 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10986*/
10987        async fn delete_role(
10988            &self,
10989            request: tonic::Request<super::DeleteRoleRequest>,
10990        ) -> std::result::Result<
10991            tonic::Response<super::DeleteRoleResponse>,
10992            tonic::Status,
10993        >;
10994    }
10995    /** Manages roles and their permissions within an organization.
10996 All RPCs operate within the caller's org (extracted from JWT).
10997*/
10998    #[derive(Debug)]
10999    pub struct RoleServiceServer<T> {
11000        inner: Arc<T>,
11001        accept_compression_encodings: EnabledCompressionEncodings,
11002        send_compression_encodings: EnabledCompressionEncodings,
11003        max_decoding_message_size: Option<usize>,
11004        max_encoding_message_size: Option<usize>,
11005    }
11006    impl<T> RoleServiceServer<T> {
11007        pub fn new(inner: T) -> Self {
11008            Self::from_arc(Arc::new(inner))
11009        }
11010        pub fn from_arc(inner: Arc<T>) -> Self {
11011            Self {
11012                inner,
11013                accept_compression_encodings: Default::default(),
11014                send_compression_encodings: Default::default(),
11015                max_decoding_message_size: None,
11016                max_encoding_message_size: None,
11017            }
11018        }
11019        pub fn with_interceptor<F>(
11020            inner: T,
11021            interceptor: F,
11022        ) -> InterceptedService<Self, F>
11023        where
11024            F: tonic::service::Interceptor,
11025        {
11026            InterceptedService::new(Self::new(inner), interceptor)
11027        }
11028        /// Enable decompressing requests with the given encoding.
11029        #[must_use]
11030        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11031            self.accept_compression_encodings.enable(encoding);
11032            self
11033        }
11034        /// Compress responses with the given encoding, if the client supports it.
11035        #[must_use]
11036        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11037            self.send_compression_encodings.enable(encoding);
11038            self
11039        }
11040        /// Limits the maximum size of a decoded message.
11041        ///
11042        /// Default: `4MB`
11043        #[must_use]
11044        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11045            self.max_decoding_message_size = Some(limit);
11046            self
11047        }
11048        /// Limits the maximum size of an encoded message.
11049        ///
11050        /// Default: `usize::MAX`
11051        #[must_use]
11052        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11053            self.max_encoding_message_size = Some(limit);
11054            self
11055        }
11056    }
11057    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
11058    where
11059        T: RoleService,
11060        B: Body + std::marker::Send + 'static,
11061        B::Error: Into<StdError> + std::marker::Send + 'static,
11062    {
11063        type Response = http::Response<tonic::body::Body>;
11064        type Error = std::convert::Infallible;
11065        type Future = BoxFuture<Self::Response, Self::Error>;
11066        fn poll_ready(
11067            &mut self,
11068            _cx: &mut Context<'_>,
11069        ) -> Poll<std::result::Result<(), Self::Error>> {
11070            Poll::Ready(Ok(()))
11071        }
11072        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11073            match req.uri().path() {
11074                "/pidgr.v1.RoleService/ListRoles" => {
11075                    #[allow(non_camel_case_types)]
11076                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
11077                    impl<
11078                        T: RoleService,
11079                    > tonic::server::UnaryService<super::ListRolesRequest>
11080                    for ListRolesSvc<T> {
11081                        type Response = super::ListRolesResponse;
11082                        type Future = BoxFuture<
11083                            tonic::Response<Self::Response>,
11084                            tonic::Status,
11085                        >;
11086                        fn call(
11087                            &mut self,
11088                            request: tonic::Request<super::ListRolesRequest>,
11089                        ) -> Self::Future {
11090                            let inner = Arc::clone(&self.0);
11091                            let fut = async move {
11092                                <T as RoleService>::list_roles(&inner, request).await
11093                            };
11094                            Box::pin(fut)
11095                        }
11096                    }
11097                    let accept_compression_encodings = self.accept_compression_encodings;
11098                    let send_compression_encodings = self.send_compression_encodings;
11099                    let max_decoding_message_size = self.max_decoding_message_size;
11100                    let max_encoding_message_size = self.max_encoding_message_size;
11101                    let inner = self.inner.clone();
11102                    let fut = async move {
11103                        let method = ListRolesSvc(inner);
11104                        let codec = tonic_prost::ProstCodec::default();
11105                        let mut grpc = tonic::server::Grpc::new(codec)
11106                            .apply_compression_config(
11107                                accept_compression_encodings,
11108                                send_compression_encodings,
11109                            )
11110                            .apply_max_message_size_config(
11111                                max_decoding_message_size,
11112                                max_encoding_message_size,
11113                            );
11114                        let res = grpc.unary(method, req).await;
11115                        Ok(res)
11116                    };
11117                    Box::pin(fut)
11118                }
11119                "/pidgr.v1.RoleService/CreateRole" => {
11120                    #[allow(non_camel_case_types)]
11121                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
11122                    impl<
11123                        T: RoleService,
11124                    > tonic::server::UnaryService<super::CreateRoleRequest>
11125                    for CreateRoleSvc<T> {
11126                        type Response = super::CreateRoleResponse;
11127                        type Future = BoxFuture<
11128                            tonic::Response<Self::Response>,
11129                            tonic::Status,
11130                        >;
11131                        fn call(
11132                            &mut self,
11133                            request: tonic::Request<super::CreateRoleRequest>,
11134                        ) -> Self::Future {
11135                            let inner = Arc::clone(&self.0);
11136                            let fut = async move {
11137                                <T as RoleService>::create_role(&inner, request).await
11138                            };
11139                            Box::pin(fut)
11140                        }
11141                    }
11142                    let accept_compression_encodings = self.accept_compression_encodings;
11143                    let send_compression_encodings = self.send_compression_encodings;
11144                    let max_decoding_message_size = self.max_decoding_message_size;
11145                    let max_encoding_message_size = self.max_encoding_message_size;
11146                    let inner = self.inner.clone();
11147                    let fut = async move {
11148                        let method = CreateRoleSvc(inner);
11149                        let codec = tonic_prost::ProstCodec::default();
11150                        let mut grpc = tonic::server::Grpc::new(codec)
11151                            .apply_compression_config(
11152                                accept_compression_encodings,
11153                                send_compression_encodings,
11154                            )
11155                            .apply_max_message_size_config(
11156                                max_decoding_message_size,
11157                                max_encoding_message_size,
11158                            );
11159                        let res = grpc.unary(method, req).await;
11160                        Ok(res)
11161                    };
11162                    Box::pin(fut)
11163                }
11164                "/pidgr.v1.RoleService/UpdateRole" => {
11165                    #[allow(non_camel_case_types)]
11166                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
11167                    impl<
11168                        T: RoleService,
11169                    > tonic::server::UnaryService<super::UpdateRoleRequest>
11170                    for UpdateRoleSvc<T> {
11171                        type Response = super::UpdateRoleResponse;
11172                        type Future = BoxFuture<
11173                            tonic::Response<Self::Response>,
11174                            tonic::Status,
11175                        >;
11176                        fn call(
11177                            &mut self,
11178                            request: tonic::Request<super::UpdateRoleRequest>,
11179                        ) -> Self::Future {
11180                            let inner = Arc::clone(&self.0);
11181                            let fut = async move {
11182                                <T as RoleService>::update_role(&inner, request).await
11183                            };
11184                            Box::pin(fut)
11185                        }
11186                    }
11187                    let accept_compression_encodings = self.accept_compression_encodings;
11188                    let send_compression_encodings = self.send_compression_encodings;
11189                    let max_decoding_message_size = self.max_decoding_message_size;
11190                    let max_encoding_message_size = self.max_encoding_message_size;
11191                    let inner = self.inner.clone();
11192                    let fut = async move {
11193                        let method = UpdateRoleSvc(inner);
11194                        let codec = tonic_prost::ProstCodec::default();
11195                        let mut grpc = tonic::server::Grpc::new(codec)
11196                            .apply_compression_config(
11197                                accept_compression_encodings,
11198                                send_compression_encodings,
11199                            )
11200                            .apply_max_message_size_config(
11201                                max_decoding_message_size,
11202                                max_encoding_message_size,
11203                            );
11204                        let res = grpc.unary(method, req).await;
11205                        Ok(res)
11206                    };
11207                    Box::pin(fut)
11208                }
11209                "/pidgr.v1.RoleService/DeleteRole" => {
11210                    #[allow(non_camel_case_types)]
11211                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
11212                    impl<
11213                        T: RoleService,
11214                    > tonic::server::UnaryService<super::DeleteRoleRequest>
11215                    for DeleteRoleSvc<T> {
11216                        type Response = super::DeleteRoleResponse;
11217                        type Future = BoxFuture<
11218                            tonic::Response<Self::Response>,
11219                            tonic::Status,
11220                        >;
11221                        fn call(
11222                            &mut self,
11223                            request: tonic::Request<super::DeleteRoleRequest>,
11224                        ) -> Self::Future {
11225                            let inner = Arc::clone(&self.0);
11226                            let fut = async move {
11227                                <T as RoleService>::delete_role(&inner, request).await
11228                            };
11229                            Box::pin(fut)
11230                        }
11231                    }
11232                    let accept_compression_encodings = self.accept_compression_encodings;
11233                    let send_compression_encodings = self.send_compression_encodings;
11234                    let max_decoding_message_size = self.max_decoding_message_size;
11235                    let max_encoding_message_size = self.max_encoding_message_size;
11236                    let inner = self.inner.clone();
11237                    let fut = async move {
11238                        let method = DeleteRoleSvc(inner);
11239                        let codec = tonic_prost::ProstCodec::default();
11240                        let mut grpc = tonic::server::Grpc::new(codec)
11241                            .apply_compression_config(
11242                                accept_compression_encodings,
11243                                send_compression_encodings,
11244                            )
11245                            .apply_max_message_size_config(
11246                                max_decoding_message_size,
11247                                max_encoding_message_size,
11248                            );
11249                        let res = grpc.unary(method, req).await;
11250                        Ok(res)
11251                    };
11252                    Box::pin(fut)
11253                }
11254                _ => {
11255                    Box::pin(async move {
11256                        let mut response = http::Response::new(
11257                            tonic::body::Body::default(),
11258                        );
11259                        let headers = response.headers_mut();
11260                        headers
11261                            .insert(
11262                                tonic::Status::GRPC_STATUS,
11263                                (tonic::Code::Unimplemented as i32).into(),
11264                            );
11265                        headers
11266                            .insert(
11267                                http::header::CONTENT_TYPE,
11268                                tonic::metadata::GRPC_CONTENT_TYPE,
11269                            );
11270                        Ok(response)
11271                    })
11272                }
11273            }
11274        }
11275    }
11276    impl<T> Clone for RoleServiceServer<T> {
11277        fn clone(&self) -> Self {
11278            let inner = self.inner.clone();
11279            Self {
11280                inner,
11281                accept_compression_encodings: self.accept_compression_encodings,
11282                send_compression_encodings: self.send_compression_encodings,
11283                max_decoding_message_size: self.max_decoding_message_size,
11284                max_encoding_message_size: self.max_encoding_message_size,
11285            }
11286        }
11287    }
11288    /// Generated gRPC service name
11289    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
11290    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
11291        const NAME: &'static str = SERVICE_NAME;
11292    }
11293}
11294/// Generated client implementations.
11295pub mod sso_service_client {
11296    #![allow(
11297        unused_variables,
11298        dead_code,
11299        missing_docs,
11300        clippy::wildcard_imports,
11301        clippy::let_unit_value,
11302    )]
11303    use tonic::codegen::*;
11304    use tonic::codegen::http::Uri;
11305    /** Manages SSO identity provider configuration for organizations.
11306*/
11307    #[derive(Debug, Clone)]
11308    pub struct SsoServiceClient<T> {
11309        inner: tonic::client::Grpc<T>,
11310    }
11311    impl SsoServiceClient<tonic::transport::Channel> {
11312        /// Attempt to create a new client by connecting to a given endpoint.
11313        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11314        where
11315            D: TryInto<tonic::transport::Endpoint>,
11316            D::Error: Into<StdError>,
11317        {
11318            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11319            Ok(Self::new(conn))
11320        }
11321    }
11322    impl<T> SsoServiceClient<T>
11323    where
11324        T: tonic::client::GrpcService<tonic::body::Body>,
11325        T::Error: Into<StdError>,
11326        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11327        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11328    {
11329        pub fn new(inner: T) -> Self {
11330            let inner = tonic::client::Grpc::new(inner);
11331            Self { inner }
11332        }
11333        pub fn with_origin(inner: T, origin: Uri) -> Self {
11334            let inner = tonic::client::Grpc::with_origin(inner, origin);
11335            Self { inner }
11336        }
11337        pub fn with_interceptor<F>(
11338            inner: T,
11339            interceptor: F,
11340        ) -> SsoServiceClient<InterceptedService<T, F>>
11341        where
11342            F: tonic::service::Interceptor,
11343            T::ResponseBody: Default,
11344            T: tonic::codegen::Service<
11345                http::Request<tonic::body::Body>,
11346                Response = http::Response<
11347                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11348                >,
11349            >,
11350            <T as tonic::codegen::Service<
11351                http::Request<tonic::body::Body>,
11352            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11353        {
11354            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
11355        }
11356        /// Compress requests with the given encoding.
11357        ///
11358        /// This requires the server to support it otherwise it might respond with an
11359        /// error.
11360        #[must_use]
11361        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11362            self.inner = self.inner.send_compressed(encoding);
11363            self
11364        }
11365        /// Enable decompressing responses.
11366        #[must_use]
11367        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11368            self.inner = self.inner.accept_compressed(encoding);
11369            self
11370        }
11371        /// Limits the maximum size of a decoded message.
11372        ///
11373        /// Default: `4MB`
11374        #[must_use]
11375        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11376            self.inner = self.inner.max_decoding_message_size(limit);
11377            self
11378        }
11379        /// Limits the maximum size of an encoded message.
11380        ///
11381        /// Default: `usize::MAX`
11382        #[must_use]
11383        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11384            self.inner = self.inner.max_encoding_message_size(limit);
11385            self
11386        }
11387        /** Check if an email domain has SSO configured.
11388 This is a pre-authentication endpoint — no JWT required.
11389 Authorization: None (public).
11390*/
11391        pub async fn check_sso_by_domain(
11392            &mut self,
11393            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
11394        ) -> std::result::Result<
11395            tonic::Response<super::CheckSsoByDomainResponse>,
11396            tonic::Status,
11397        > {
11398            self.inner
11399                .ready()
11400                .await
11401                .map_err(|e| {
11402                    tonic::Status::unknown(
11403                        format!("Service was not ready: {}", e.into()),
11404                    )
11405                })?;
11406            let codec = tonic_prost::ProstCodec::default();
11407            let path = http::uri::PathAndQuery::from_static(
11408                "/pidgr.v1.SSOService/CheckSSOByDomain",
11409            );
11410            let mut req = request.into_request();
11411            req.extensions_mut()
11412                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
11413            self.inner.unary(req, path, codec).await
11414        }
11415        /** Create an SSO provider for the organization.
11416 Validates the metadata URL before saving.
11417 Creates the corresponding identity provider in the auth service.
11418 Authorization: Requires PERMISSION_ORG_WRITE.
11419*/
11420        pub async fn create_sso_provider(
11421            &mut self,
11422            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
11423        ) -> std::result::Result<
11424            tonic::Response<super::CreateSsoProviderResponse>,
11425            tonic::Status,
11426        > {
11427            self.inner
11428                .ready()
11429                .await
11430                .map_err(|e| {
11431                    tonic::Status::unknown(
11432                        format!("Service was not ready: {}", e.into()),
11433                    )
11434                })?;
11435            let codec = tonic_prost::ProstCodec::default();
11436            let path = http::uri::PathAndQuery::from_static(
11437                "/pidgr.v1.SSOService/CreateSSOProvider",
11438            );
11439            let mut req = request.into_request();
11440            req.extensions_mut()
11441                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
11442            self.inner.unary(req, path, codec).await
11443        }
11444        /** Get the organization's SSO provider configuration.
11445 Authorization: Requires PERMISSION_ORG_READ.
11446*/
11447        pub async fn get_sso_provider(
11448            &mut self,
11449            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
11450        ) -> std::result::Result<
11451            tonic::Response<super::GetSsoProviderResponse>,
11452            tonic::Status,
11453        > {
11454            self.inner
11455                .ready()
11456                .await
11457                .map_err(|e| {
11458                    tonic::Status::unknown(
11459                        format!("Service was not ready: {}", e.into()),
11460                    )
11461                })?;
11462            let codec = tonic_prost::ProstCodec::default();
11463            let path = http::uri::PathAndQuery::from_static(
11464                "/pidgr.v1.SSOService/GetSSOProvider",
11465            );
11466            let mut req = request.into_request();
11467            req.extensions_mut()
11468                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
11469            self.inner.unary(req, path, codec).await
11470        }
11471        /** Delete the organization's SSO provider.
11472 Deletes the corresponding identity provider from the auth service.
11473 Users with that domain fall back to passkey/OTP.
11474 Authorization: Requires PERMISSION_ORG_WRITE.
11475*/
11476        pub async fn delete_sso_provider(
11477            &mut self,
11478            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
11479        ) -> std::result::Result<
11480            tonic::Response<super::DeleteSsoProviderResponse>,
11481            tonic::Status,
11482        > {
11483            self.inner
11484                .ready()
11485                .await
11486                .map_err(|e| {
11487                    tonic::Status::unknown(
11488                        format!("Service was not ready: {}", e.into()),
11489                    )
11490                })?;
11491            let codec = tonic_prost::ProstCodec::default();
11492            let path = http::uri::PathAndQuery::from_static(
11493                "/pidgr.v1.SSOService/DeleteSSOProvider",
11494            );
11495            let mut req = request.into_request();
11496            req.extensions_mut()
11497                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
11498            self.inner.unary(req, path, codec).await
11499        }
11500    }
11501}
11502/// Generated server implementations.
11503pub mod sso_service_server {
11504    #![allow(
11505        unused_variables,
11506        dead_code,
11507        missing_docs,
11508        clippy::wildcard_imports,
11509        clippy::let_unit_value,
11510    )]
11511    use tonic::codegen::*;
11512    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
11513    #[async_trait]
11514    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
11515        /** Check if an email domain has SSO configured.
11516 This is a pre-authentication endpoint — no JWT required.
11517 Authorization: None (public).
11518*/
11519        async fn check_sso_by_domain(
11520            &self,
11521            request: tonic::Request<super::CheckSsoByDomainRequest>,
11522        ) -> std::result::Result<
11523            tonic::Response<super::CheckSsoByDomainResponse>,
11524            tonic::Status,
11525        >;
11526        /** Create an SSO provider for the organization.
11527 Validates the metadata URL before saving.
11528 Creates the corresponding identity provider in the auth service.
11529 Authorization: Requires PERMISSION_ORG_WRITE.
11530*/
11531        async fn create_sso_provider(
11532            &self,
11533            request: tonic::Request<super::CreateSsoProviderRequest>,
11534        ) -> std::result::Result<
11535            tonic::Response<super::CreateSsoProviderResponse>,
11536            tonic::Status,
11537        >;
11538        /** Get the organization's SSO provider configuration.
11539 Authorization: Requires PERMISSION_ORG_READ.
11540*/
11541        async fn get_sso_provider(
11542            &self,
11543            request: tonic::Request<super::GetSsoProviderRequest>,
11544        ) -> std::result::Result<
11545            tonic::Response<super::GetSsoProviderResponse>,
11546            tonic::Status,
11547        >;
11548        /** Delete the organization's SSO provider.
11549 Deletes the corresponding identity provider from the auth service.
11550 Users with that domain fall back to passkey/OTP.
11551 Authorization: Requires PERMISSION_ORG_WRITE.
11552*/
11553        async fn delete_sso_provider(
11554            &self,
11555            request: tonic::Request<super::DeleteSsoProviderRequest>,
11556        ) -> std::result::Result<
11557            tonic::Response<super::DeleteSsoProviderResponse>,
11558            tonic::Status,
11559        >;
11560    }
11561    /** Manages SSO identity provider configuration for organizations.
11562*/
11563    #[derive(Debug)]
11564    pub struct SsoServiceServer<T> {
11565        inner: Arc<T>,
11566        accept_compression_encodings: EnabledCompressionEncodings,
11567        send_compression_encodings: EnabledCompressionEncodings,
11568        max_decoding_message_size: Option<usize>,
11569        max_encoding_message_size: Option<usize>,
11570    }
11571    impl<T> SsoServiceServer<T> {
11572        pub fn new(inner: T) -> Self {
11573            Self::from_arc(Arc::new(inner))
11574        }
11575        pub fn from_arc(inner: Arc<T>) -> Self {
11576            Self {
11577                inner,
11578                accept_compression_encodings: Default::default(),
11579                send_compression_encodings: Default::default(),
11580                max_decoding_message_size: None,
11581                max_encoding_message_size: None,
11582            }
11583        }
11584        pub fn with_interceptor<F>(
11585            inner: T,
11586            interceptor: F,
11587        ) -> InterceptedService<Self, F>
11588        where
11589            F: tonic::service::Interceptor,
11590        {
11591            InterceptedService::new(Self::new(inner), interceptor)
11592        }
11593        /// Enable decompressing requests with the given encoding.
11594        #[must_use]
11595        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11596            self.accept_compression_encodings.enable(encoding);
11597            self
11598        }
11599        /// Compress responses with the given encoding, if the client supports it.
11600        #[must_use]
11601        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11602            self.send_compression_encodings.enable(encoding);
11603            self
11604        }
11605        /// Limits the maximum size of a decoded message.
11606        ///
11607        /// Default: `4MB`
11608        #[must_use]
11609        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11610            self.max_decoding_message_size = Some(limit);
11611            self
11612        }
11613        /// Limits the maximum size of an encoded message.
11614        ///
11615        /// Default: `usize::MAX`
11616        #[must_use]
11617        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11618            self.max_encoding_message_size = Some(limit);
11619            self
11620        }
11621    }
11622    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
11623    where
11624        T: SsoService,
11625        B: Body + std::marker::Send + 'static,
11626        B::Error: Into<StdError> + std::marker::Send + 'static,
11627    {
11628        type Response = http::Response<tonic::body::Body>;
11629        type Error = std::convert::Infallible;
11630        type Future = BoxFuture<Self::Response, Self::Error>;
11631        fn poll_ready(
11632            &mut self,
11633            _cx: &mut Context<'_>,
11634        ) -> Poll<std::result::Result<(), Self::Error>> {
11635            Poll::Ready(Ok(()))
11636        }
11637        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11638            match req.uri().path() {
11639                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
11640                    #[allow(non_camel_case_types)]
11641                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
11642                    impl<
11643                        T: SsoService,
11644                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
11645                    for CheckSSOByDomainSvc<T> {
11646                        type Response = super::CheckSsoByDomainResponse;
11647                        type Future = BoxFuture<
11648                            tonic::Response<Self::Response>,
11649                            tonic::Status,
11650                        >;
11651                        fn call(
11652                            &mut self,
11653                            request: tonic::Request<super::CheckSsoByDomainRequest>,
11654                        ) -> Self::Future {
11655                            let inner = Arc::clone(&self.0);
11656                            let fut = async move {
11657                                <T as SsoService>::check_sso_by_domain(&inner, request)
11658                                    .await
11659                            };
11660                            Box::pin(fut)
11661                        }
11662                    }
11663                    let accept_compression_encodings = self.accept_compression_encodings;
11664                    let send_compression_encodings = self.send_compression_encodings;
11665                    let max_decoding_message_size = self.max_decoding_message_size;
11666                    let max_encoding_message_size = self.max_encoding_message_size;
11667                    let inner = self.inner.clone();
11668                    let fut = async move {
11669                        let method = CheckSSOByDomainSvc(inner);
11670                        let codec = tonic_prost::ProstCodec::default();
11671                        let mut grpc = tonic::server::Grpc::new(codec)
11672                            .apply_compression_config(
11673                                accept_compression_encodings,
11674                                send_compression_encodings,
11675                            )
11676                            .apply_max_message_size_config(
11677                                max_decoding_message_size,
11678                                max_encoding_message_size,
11679                            );
11680                        let res = grpc.unary(method, req).await;
11681                        Ok(res)
11682                    };
11683                    Box::pin(fut)
11684                }
11685                "/pidgr.v1.SSOService/CreateSSOProvider" => {
11686                    #[allow(non_camel_case_types)]
11687                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
11688                    impl<
11689                        T: SsoService,
11690                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
11691                    for CreateSSOProviderSvc<T> {
11692                        type Response = super::CreateSsoProviderResponse;
11693                        type Future = BoxFuture<
11694                            tonic::Response<Self::Response>,
11695                            tonic::Status,
11696                        >;
11697                        fn call(
11698                            &mut self,
11699                            request: tonic::Request<super::CreateSsoProviderRequest>,
11700                        ) -> Self::Future {
11701                            let inner = Arc::clone(&self.0);
11702                            let fut = async move {
11703                                <T as SsoService>::create_sso_provider(&inner, request)
11704                                    .await
11705                            };
11706                            Box::pin(fut)
11707                        }
11708                    }
11709                    let accept_compression_encodings = self.accept_compression_encodings;
11710                    let send_compression_encodings = self.send_compression_encodings;
11711                    let max_decoding_message_size = self.max_decoding_message_size;
11712                    let max_encoding_message_size = self.max_encoding_message_size;
11713                    let inner = self.inner.clone();
11714                    let fut = async move {
11715                        let method = CreateSSOProviderSvc(inner);
11716                        let codec = tonic_prost::ProstCodec::default();
11717                        let mut grpc = tonic::server::Grpc::new(codec)
11718                            .apply_compression_config(
11719                                accept_compression_encodings,
11720                                send_compression_encodings,
11721                            )
11722                            .apply_max_message_size_config(
11723                                max_decoding_message_size,
11724                                max_encoding_message_size,
11725                            );
11726                        let res = grpc.unary(method, req).await;
11727                        Ok(res)
11728                    };
11729                    Box::pin(fut)
11730                }
11731                "/pidgr.v1.SSOService/GetSSOProvider" => {
11732                    #[allow(non_camel_case_types)]
11733                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
11734                    impl<
11735                        T: SsoService,
11736                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
11737                    for GetSSOProviderSvc<T> {
11738                        type Response = super::GetSsoProviderResponse;
11739                        type Future = BoxFuture<
11740                            tonic::Response<Self::Response>,
11741                            tonic::Status,
11742                        >;
11743                        fn call(
11744                            &mut self,
11745                            request: tonic::Request<super::GetSsoProviderRequest>,
11746                        ) -> Self::Future {
11747                            let inner = Arc::clone(&self.0);
11748                            let fut = async move {
11749                                <T as SsoService>::get_sso_provider(&inner, request).await
11750                            };
11751                            Box::pin(fut)
11752                        }
11753                    }
11754                    let accept_compression_encodings = self.accept_compression_encodings;
11755                    let send_compression_encodings = self.send_compression_encodings;
11756                    let max_decoding_message_size = self.max_decoding_message_size;
11757                    let max_encoding_message_size = self.max_encoding_message_size;
11758                    let inner = self.inner.clone();
11759                    let fut = async move {
11760                        let method = GetSSOProviderSvc(inner);
11761                        let codec = tonic_prost::ProstCodec::default();
11762                        let mut grpc = tonic::server::Grpc::new(codec)
11763                            .apply_compression_config(
11764                                accept_compression_encodings,
11765                                send_compression_encodings,
11766                            )
11767                            .apply_max_message_size_config(
11768                                max_decoding_message_size,
11769                                max_encoding_message_size,
11770                            );
11771                        let res = grpc.unary(method, req).await;
11772                        Ok(res)
11773                    };
11774                    Box::pin(fut)
11775                }
11776                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
11777                    #[allow(non_camel_case_types)]
11778                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
11779                    impl<
11780                        T: SsoService,
11781                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
11782                    for DeleteSSOProviderSvc<T> {
11783                        type Response = super::DeleteSsoProviderResponse;
11784                        type Future = BoxFuture<
11785                            tonic::Response<Self::Response>,
11786                            tonic::Status,
11787                        >;
11788                        fn call(
11789                            &mut self,
11790                            request: tonic::Request<super::DeleteSsoProviderRequest>,
11791                        ) -> Self::Future {
11792                            let inner = Arc::clone(&self.0);
11793                            let fut = async move {
11794                                <T as SsoService>::delete_sso_provider(&inner, request)
11795                                    .await
11796                            };
11797                            Box::pin(fut)
11798                        }
11799                    }
11800                    let accept_compression_encodings = self.accept_compression_encodings;
11801                    let send_compression_encodings = self.send_compression_encodings;
11802                    let max_decoding_message_size = self.max_decoding_message_size;
11803                    let max_encoding_message_size = self.max_encoding_message_size;
11804                    let inner = self.inner.clone();
11805                    let fut = async move {
11806                        let method = DeleteSSOProviderSvc(inner);
11807                        let codec = tonic_prost::ProstCodec::default();
11808                        let mut grpc = tonic::server::Grpc::new(codec)
11809                            .apply_compression_config(
11810                                accept_compression_encodings,
11811                                send_compression_encodings,
11812                            )
11813                            .apply_max_message_size_config(
11814                                max_decoding_message_size,
11815                                max_encoding_message_size,
11816                            );
11817                        let res = grpc.unary(method, req).await;
11818                        Ok(res)
11819                    };
11820                    Box::pin(fut)
11821                }
11822                _ => {
11823                    Box::pin(async move {
11824                        let mut response = http::Response::new(
11825                            tonic::body::Body::default(),
11826                        );
11827                        let headers = response.headers_mut();
11828                        headers
11829                            .insert(
11830                                tonic::Status::GRPC_STATUS,
11831                                (tonic::Code::Unimplemented as i32).into(),
11832                            );
11833                        headers
11834                            .insert(
11835                                http::header::CONTENT_TYPE,
11836                                tonic::metadata::GRPC_CONTENT_TYPE,
11837                            );
11838                        Ok(response)
11839                    })
11840                }
11841            }
11842        }
11843    }
11844    impl<T> Clone for SsoServiceServer<T> {
11845        fn clone(&self) -> Self {
11846            let inner = self.inner.clone();
11847            Self {
11848                inner,
11849                accept_compression_encodings: self.accept_compression_encodings,
11850                send_compression_encodings: self.send_compression_encodings,
11851                max_decoding_message_size: self.max_decoding_message_size,
11852                max_encoding_message_size: self.max_encoding_message_size,
11853            }
11854        }
11855    }
11856    /// Generated gRPC service name
11857    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
11858    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
11859        const NAME: &'static str = SERVICE_NAME;
11860    }
11861}
11862/// Generated client implementations.
11863pub mod team_service_client {
11864    #![allow(
11865        unused_variables,
11866        dead_code,
11867        missing_docs,
11868        clippy::wildcard_imports,
11869        clippy::let_unit_value,
11870    )]
11871    use tonic::codegen::*;
11872    use tonic::codegen::http::Uri;
11873    /** Manages organizational teams (departments, divisions) within an organization.
11874 Teams represent the organizational structure and can serve as sender identity.
11875 All RPCs operate within the caller's org (extracted from JWT).
11876*/
11877    #[derive(Debug, Clone)]
11878    pub struct TeamServiceClient<T> {
11879        inner: tonic::client::Grpc<T>,
11880    }
11881    impl TeamServiceClient<tonic::transport::Channel> {
11882        /// Attempt to create a new client by connecting to a given endpoint.
11883        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11884        where
11885            D: TryInto<tonic::transport::Endpoint>,
11886            D::Error: Into<StdError>,
11887        {
11888            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11889            Ok(Self::new(conn))
11890        }
11891    }
11892    impl<T> TeamServiceClient<T>
11893    where
11894        T: tonic::client::GrpcService<tonic::body::Body>,
11895        T::Error: Into<StdError>,
11896        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11897        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11898    {
11899        pub fn new(inner: T) -> Self {
11900            let inner = tonic::client::Grpc::new(inner);
11901            Self { inner }
11902        }
11903        pub fn with_origin(inner: T, origin: Uri) -> Self {
11904            let inner = tonic::client::Grpc::with_origin(inner, origin);
11905            Self { inner }
11906        }
11907        pub fn with_interceptor<F>(
11908            inner: T,
11909            interceptor: F,
11910        ) -> TeamServiceClient<InterceptedService<T, F>>
11911        where
11912            F: tonic::service::Interceptor,
11913            T::ResponseBody: Default,
11914            T: tonic::codegen::Service<
11915                http::Request<tonic::body::Body>,
11916                Response = http::Response<
11917                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11918                >,
11919            >,
11920            <T as tonic::codegen::Service<
11921                http::Request<tonic::body::Body>,
11922            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11923        {
11924            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
11925        }
11926        /// Compress requests with the given encoding.
11927        ///
11928        /// This requires the server to support it otherwise it might respond with an
11929        /// error.
11930        #[must_use]
11931        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11932            self.inner = self.inner.send_compressed(encoding);
11933            self
11934        }
11935        /// Enable decompressing responses.
11936        #[must_use]
11937        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11938            self.inner = self.inner.accept_compressed(encoding);
11939            self
11940        }
11941        /// Limits the maximum size of a decoded message.
11942        ///
11943        /// Default: `4MB`
11944        #[must_use]
11945        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11946            self.inner = self.inner.max_decoding_message_size(limit);
11947            self
11948        }
11949        /// Limits the maximum size of an encoded message.
11950        ///
11951        /// Default: `usize::MAX`
11952        #[must_use]
11953        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11954            self.inner = self.inner.max_encoding_message_size(limit);
11955            self
11956        }
11957        /** Create a new team in the organization.
11958 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11959*/
11960        pub async fn create_team(
11961            &mut self,
11962            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
11963        ) -> std::result::Result<
11964            tonic::Response<super::CreateTeamResponse>,
11965            tonic::Status,
11966        > {
11967            self.inner
11968                .ready()
11969                .await
11970                .map_err(|e| {
11971                    tonic::Status::unknown(
11972                        format!("Service was not ready: {}", e.into()),
11973                    )
11974                })?;
11975            let codec = tonic_prost::ProstCodec::default();
11976            let path = http::uri::PathAndQuery::from_static(
11977                "/pidgr.v1.TeamService/CreateTeam",
11978            );
11979            let mut req = request.into_request();
11980            req.extensions_mut()
11981                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
11982            self.inner.unary(req, path, codec).await
11983        }
11984        /** Retrieve a team by ID.
11985 Authorization: Caller must be a member of the team, or have
11986 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11987*/
11988        pub async fn get_team(
11989            &mut self,
11990            request: impl tonic::IntoRequest<super::GetTeamRequest>,
11991        ) -> std::result::Result<
11992            tonic::Response<super::GetTeamResponse>,
11993            tonic::Status,
11994        > {
11995            self.inner
11996                .ready()
11997                .await
11998                .map_err(|e| {
11999                    tonic::Status::unknown(
12000                        format!("Service was not ready: {}", e.into()),
12001                    )
12002                })?;
12003            let codec = tonic_prost::ProstCodec::default();
12004            let path = http::uri::PathAndQuery::from_static(
12005                "/pidgr.v1.TeamService/GetTeam",
12006            );
12007            let mut req = request.into_request();
12008            req.extensions_mut()
12009                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
12010            self.inner.unary(req, path, codec).await
12011        }
12012        /** List teams in the organization with pagination.
12013 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12014*/
12015        pub async fn list_teams(
12016            &mut self,
12017            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
12018        ) -> std::result::Result<
12019            tonic::Response<super::ListTeamsResponse>,
12020            tonic::Status,
12021        > {
12022            self.inner
12023                .ready()
12024                .await
12025                .map_err(|e| {
12026                    tonic::Status::unknown(
12027                        format!("Service was not ready: {}", e.into()),
12028                    )
12029                })?;
12030            let codec = tonic_prost::ProstCodec::default();
12031            let path = http::uri::PathAndQuery::from_static(
12032                "/pidgr.v1.TeamService/ListTeams",
12033            );
12034            let mut req = request.into_request();
12035            req.extensions_mut()
12036                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
12037            self.inner.unary(req, path, codec).await
12038        }
12039        /** Update a team's name and/or description.
12040 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12041*/
12042        pub async fn update_team(
12043            &mut self,
12044            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
12045        ) -> std::result::Result<
12046            tonic::Response<super::UpdateTeamResponse>,
12047            tonic::Status,
12048        > {
12049            self.inner
12050                .ready()
12051                .await
12052                .map_err(|e| {
12053                    tonic::Status::unknown(
12054                        format!("Service was not ready: {}", e.into()),
12055                    )
12056                })?;
12057            let codec = tonic_prost::ProstCodec::default();
12058            let path = http::uri::PathAndQuery::from_static(
12059                "/pidgr.v1.TeamService/UpdateTeam",
12060            );
12061            let mut req = request.into_request();
12062            req.extensions_mut()
12063                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
12064            self.inner.unary(req, path, codec).await
12065        }
12066        /** Delete a team and all its membership records. Default teams cannot be deleted.
12067 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12068*/
12069        pub async fn delete_team(
12070            &mut self,
12071            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
12072        ) -> std::result::Result<
12073            tonic::Response<super::DeleteTeamResponse>,
12074            tonic::Status,
12075        > {
12076            self.inner
12077                .ready()
12078                .await
12079                .map_err(|e| {
12080                    tonic::Status::unknown(
12081                        format!("Service was not ready: {}", e.into()),
12082                    )
12083                })?;
12084            let codec = tonic_prost::ProstCodec::default();
12085            let path = http::uri::PathAndQuery::from_static(
12086                "/pidgr.v1.TeamService/DeleteTeam",
12087            );
12088            let mut req = request.into_request();
12089            req.extensions_mut()
12090                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
12091            self.inner.unary(req, path, codec).await
12092        }
12093        /** Add one or more users to a team (idempotent).
12094 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12095*/
12096        pub async fn add_team_members(
12097            &mut self,
12098            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
12099        ) -> std::result::Result<
12100            tonic::Response<super::AddTeamMembersResponse>,
12101            tonic::Status,
12102        > {
12103            self.inner
12104                .ready()
12105                .await
12106                .map_err(|e| {
12107                    tonic::Status::unknown(
12108                        format!("Service was not ready: {}", e.into()),
12109                    )
12110                })?;
12111            let codec = tonic_prost::ProstCodec::default();
12112            let path = http::uri::PathAndQuery::from_static(
12113                "/pidgr.v1.TeamService/AddTeamMembers",
12114            );
12115            let mut req = request.into_request();
12116            req.extensions_mut()
12117                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
12118            self.inner.unary(req, path, codec).await
12119        }
12120        /** Remove one or more users from a team (idempotent).
12121 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12122*/
12123        pub async fn remove_team_members(
12124            &mut self,
12125            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
12126        ) -> std::result::Result<
12127            tonic::Response<super::RemoveTeamMembersResponse>,
12128            tonic::Status,
12129        > {
12130            self.inner
12131                .ready()
12132                .await
12133                .map_err(|e| {
12134                    tonic::Status::unknown(
12135                        format!("Service was not ready: {}", e.into()),
12136                    )
12137                })?;
12138            let codec = tonic_prost::ProstCodec::default();
12139            let path = http::uri::PathAndQuery::from_static(
12140                "/pidgr.v1.TeamService/RemoveTeamMembers",
12141            );
12142            let mut req = request.into_request();
12143            req.extensions_mut()
12144                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
12145            self.inner.unary(req, path, codec).await
12146        }
12147        /** List members of a team with pagination.
12148 Authorization: Caller must be a member of the team, or have
12149 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12150*/
12151        pub async fn list_team_members(
12152            &mut self,
12153            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
12154        ) -> std::result::Result<
12155            tonic::Response<super::ListTeamMembersResponse>,
12156            tonic::Status,
12157        > {
12158            self.inner
12159                .ready()
12160                .await
12161                .map_err(|e| {
12162                    tonic::Status::unknown(
12163                        format!("Service was not ready: {}", e.into()),
12164                    )
12165                })?;
12166            let codec = tonic_prost::ProstCodec::default();
12167            let path = http::uri::PathAndQuery::from_static(
12168                "/pidgr.v1.TeamService/ListTeamMembers",
12169            );
12170            let mut req = request.into_request();
12171            req.extensions_mut()
12172                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
12173            self.inner.unary(req, path, codec).await
12174        }
12175    }
12176}
12177/// Generated server implementations.
12178pub mod team_service_server {
12179    #![allow(
12180        unused_variables,
12181        dead_code,
12182        missing_docs,
12183        clippy::wildcard_imports,
12184        clippy::let_unit_value,
12185    )]
12186    use tonic::codegen::*;
12187    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
12188    #[async_trait]
12189    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
12190        /** Create a new team in the organization.
12191 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
12192*/
12193        async fn create_team(
12194            &self,
12195            request: tonic::Request<super::CreateTeamRequest>,
12196        ) -> std::result::Result<
12197            tonic::Response<super::CreateTeamResponse>,
12198            tonic::Status,
12199        >;
12200        /** Retrieve a team by ID.
12201 Authorization: Caller must be a member of the team, or have
12202 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12203*/
12204        async fn get_team(
12205            &self,
12206            request: tonic::Request<super::GetTeamRequest>,
12207        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
12208        /** List teams in the organization with pagination.
12209 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12210*/
12211        async fn list_teams(
12212            &self,
12213            request: tonic::Request<super::ListTeamsRequest>,
12214        ) -> std::result::Result<
12215            tonic::Response<super::ListTeamsResponse>,
12216            tonic::Status,
12217        >;
12218        /** Update a team's name and/or description.
12219 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12220*/
12221        async fn update_team(
12222            &self,
12223            request: tonic::Request<super::UpdateTeamRequest>,
12224        ) -> std::result::Result<
12225            tonic::Response<super::UpdateTeamResponse>,
12226            tonic::Status,
12227        >;
12228        /** Delete a team and all its membership records. Default teams cannot be deleted.
12229 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12230*/
12231        async fn delete_team(
12232            &self,
12233            request: tonic::Request<super::DeleteTeamRequest>,
12234        ) -> std::result::Result<
12235            tonic::Response<super::DeleteTeamResponse>,
12236            tonic::Status,
12237        >;
12238        /** Add one or more users to a team (idempotent).
12239 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12240*/
12241        async fn add_team_members(
12242            &self,
12243            request: tonic::Request<super::AddTeamMembersRequest>,
12244        ) -> std::result::Result<
12245            tonic::Response<super::AddTeamMembersResponse>,
12246            tonic::Status,
12247        >;
12248        /** Remove one or more users from a team (idempotent).
12249 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12250*/
12251        async fn remove_team_members(
12252            &self,
12253            request: tonic::Request<super::RemoveTeamMembersRequest>,
12254        ) -> std::result::Result<
12255            tonic::Response<super::RemoveTeamMembersResponse>,
12256            tonic::Status,
12257        >;
12258        /** List members of a team with pagination.
12259 Authorization: Caller must be a member of the team, or have
12260 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12261*/
12262        async fn list_team_members(
12263            &self,
12264            request: tonic::Request<super::ListTeamMembersRequest>,
12265        ) -> std::result::Result<
12266            tonic::Response<super::ListTeamMembersResponse>,
12267            tonic::Status,
12268        >;
12269    }
12270    /** Manages organizational teams (departments, divisions) within an organization.
12271 Teams represent the organizational structure and can serve as sender identity.
12272 All RPCs operate within the caller's org (extracted from JWT).
12273*/
12274    #[derive(Debug)]
12275    pub struct TeamServiceServer<T> {
12276        inner: Arc<T>,
12277        accept_compression_encodings: EnabledCompressionEncodings,
12278        send_compression_encodings: EnabledCompressionEncodings,
12279        max_decoding_message_size: Option<usize>,
12280        max_encoding_message_size: Option<usize>,
12281    }
12282    impl<T> TeamServiceServer<T> {
12283        pub fn new(inner: T) -> Self {
12284            Self::from_arc(Arc::new(inner))
12285        }
12286        pub fn from_arc(inner: Arc<T>) -> Self {
12287            Self {
12288                inner,
12289                accept_compression_encodings: Default::default(),
12290                send_compression_encodings: Default::default(),
12291                max_decoding_message_size: None,
12292                max_encoding_message_size: None,
12293            }
12294        }
12295        pub fn with_interceptor<F>(
12296            inner: T,
12297            interceptor: F,
12298        ) -> InterceptedService<Self, F>
12299        where
12300            F: tonic::service::Interceptor,
12301        {
12302            InterceptedService::new(Self::new(inner), interceptor)
12303        }
12304        /// Enable decompressing requests with the given encoding.
12305        #[must_use]
12306        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12307            self.accept_compression_encodings.enable(encoding);
12308            self
12309        }
12310        /// Compress responses with the given encoding, if the client supports it.
12311        #[must_use]
12312        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12313            self.send_compression_encodings.enable(encoding);
12314            self
12315        }
12316        /// Limits the maximum size of a decoded message.
12317        ///
12318        /// Default: `4MB`
12319        #[must_use]
12320        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12321            self.max_decoding_message_size = Some(limit);
12322            self
12323        }
12324        /// Limits the maximum size of an encoded message.
12325        ///
12326        /// Default: `usize::MAX`
12327        #[must_use]
12328        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12329            self.max_encoding_message_size = Some(limit);
12330            self
12331        }
12332    }
12333    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
12334    where
12335        T: TeamService,
12336        B: Body + std::marker::Send + 'static,
12337        B::Error: Into<StdError> + std::marker::Send + 'static,
12338    {
12339        type Response = http::Response<tonic::body::Body>;
12340        type Error = std::convert::Infallible;
12341        type Future = BoxFuture<Self::Response, Self::Error>;
12342        fn poll_ready(
12343            &mut self,
12344            _cx: &mut Context<'_>,
12345        ) -> Poll<std::result::Result<(), Self::Error>> {
12346            Poll::Ready(Ok(()))
12347        }
12348        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12349            match req.uri().path() {
12350                "/pidgr.v1.TeamService/CreateTeam" => {
12351                    #[allow(non_camel_case_types)]
12352                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
12353                    impl<
12354                        T: TeamService,
12355                    > tonic::server::UnaryService<super::CreateTeamRequest>
12356                    for CreateTeamSvc<T> {
12357                        type Response = super::CreateTeamResponse;
12358                        type Future = BoxFuture<
12359                            tonic::Response<Self::Response>,
12360                            tonic::Status,
12361                        >;
12362                        fn call(
12363                            &mut self,
12364                            request: tonic::Request<super::CreateTeamRequest>,
12365                        ) -> Self::Future {
12366                            let inner = Arc::clone(&self.0);
12367                            let fut = async move {
12368                                <T as TeamService>::create_team(&inner, request).await
12369                            };
12370                            Box::pin(fut)
12371                        }
12372                    }
12373                    let accept_compression_encodings = self.accept_compression_encodings;
12374                    let send_compression_encodings = self.send_compression_encodings;
12375                    let max_decoding_message_size = self.max_decoding_message_size;
12376                    let max_encoding_message_size = self.max_encoding_message_size;
12377                    let inner = self.inner.clone();
12378                    let fut = async move {
12379                        let method = CreateTeamSvc(inner);
12380                        let codec = tonic_prost::ProstCodec::default();
12381                        let mut grpc = tonic::server::Grpc::new(codec)
12382                            .apply_compression_config(
12383                                accept_compression_encodings,
12384                                send_compression_encodings,
12385                            )
12386                            .apply_max_message_size_config(
12387                                max_decoding_message_size,
12388                                max_encoding_message_size,
12389                            );
12390                        let res = grpc.unary(method, req).await;
12391                        Ok(res)
12392                    };
12393                    Box::pin(fut)
12394                }
12395                "/pidgr.v1.TeamService/GetTeam" => {
12396                    #[allow(non_camel_case_types)]
12397                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
12398                    impl<
12399                        T: TeamService,
12400                    > tonic::server::UnaryService<super::GetTeamRequest>
12401                    for GetTeamSvc<T> {
12402                        type Response = super::GetTeamResponse;
12403                        type Future = BoxFuture<
12404                            tonic::Response<Self::Response>,
12405                            tonic::Status,
12406                        >;
12407                        fn call(
12408                            &mut self,
12409                            request: tonic::Request<super::GetTeamRequest>,
12410                        ) -> Self::Future {
12411                            let inner = Arc::clone(&self.0);
12412                            let fut = async move {
12413                                <T as TeamService>::get_team(&inner, request).await
12414                            };
12415                            Box::pin(fut)
12416                        }
12417                    }
12418                    let accept_compression_encodings = self.accept_compression_encodings;
12419                    let send_compression_encodings = self.send_compression_encodings;
12420                    let max_decoding_message_size = self.max_decoding_message_size;
12421                    let max_encoding_message_size = self.max_encoding_message_size;
12422                    let inner = self.inner.clone();
12423                    let fut = async move {
12424                        let method = GetTeamSvc(inner);
12425                        let codec = tonic_prost::ProstCodec::default();
12426                        let mut grpc = tonic::server::Grpc::new(codec)
12427                            .apply_compression_config(
12428                                accept_compression_encodings,
12429                                send_compression_encodings,
12430                            )
12431                            .apply_max_message_size_config(
12432                                max_decoding_message_size,
12433                                max_encoding_message_size,
12434                            );
12435                        let res = grpc.unary(method, req).await;
12436                        Ok(res)
12437                    };
12438                    Box::pin(fut)
12439                }
12440                "/pidgr.v1.TeamService/ListTeams" => {
12441                    #[allow(non_camel_case_types)]
12442                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
12443                    impl<
12444                        T: TeamService,
12445                    > tonic::server::UnaryService<super::ListTeamsRequest>
12446                    for ListTeamsSvc<T> {
12447                        type Response = super::ListTeamsResponse;
12448                        type Future = BoxFuture<
12449                            tonic::Response<Self::Response>,
12450                            tonic::Status,
12451                        >;
12452                        fn call(
12453                            &mut self,
12454                            request: tonic::Request<super::ListTeamsRequest>,
12455                        ) -> Self::Future {
12456                            let inner = Arc::clone(&self.0);
12457                            let fut = async move {
12458                                <T as TeamService>::list_teams(&inner, request).await
12459                            };
12460                            Box::pin(fut)
12461                        }
12462                    }
12463                    let accept_compression_encodings = self.accept_compression_encodings;
12464                    let send_compression_encodings = self.send_compression_encodings;
12465                    let max_decoding_message_size = self.max_decoding_message_size;
12466                    let max_encoding_message_size = self.max_encoding_message_size;
12467                    let inner = self.inner.clone();
12468                    let fut = async move {
12469                        let method = ListTeamsSvc(inner);
12470                        let codec = tonic_prost::ProstCodec::default();
12471                        let mut grpc = tonic::server::Grpc::new(codec)
12472                            .apply_compression_config(
12473                                accept_compression_encodings,
12474                                send_compression_encodings,
12475                            )
12476                            .apply_max_message_size_config(
12477                                max_decoding_message_size,
12478                                max_encoding_message_size,
12479                            );
12480                        let res = grpc.unary(method, req).await;
12481                        Ok(res)
12482                    };
12483                    Box::pin(fut)
12484                }
12485                "/pidgr.v1.TeamService/UpdateTeam" => {
12486                    #[allow(non_camel_case_types)]
12487                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
12488                    impl<
12489                        T: TeamService,
12490                    > tonic::server::UnaryService<super::UpdateTeamRequest>
12491                    for UpdateTeamSvc<T> {
12492                        type Response = super::UpdateTeamResponse;
12493                        type Future = BoxFuture<
12494                            tonic::Response<Self::Response>,
12495                            tonic::Status,
12496                        >;
12497                        fn call(
12498                            &mut self,
12499                            request: tonic::Request<super::UpdateTeamRequest>,
12500                        ) -> Self::Future {
12501                            let inner = Arc::clone(&self.0);
12502                            let fut = async move {
12503                                <T as TeamService>::update_team(&inner, request).await
12504                            };
12505                            Box::pin(fut)
12506                        }
12507                    }
12508                    let accept_compression_encodings = self.accept_compression_encodings;
12509                    let send_compression_encodings = self.send_compression_encodings;
12510                    let max_decoding_message_size = self.max_decoding_message_size;
12511                    let max_encoding_message_size = self.max_encoding_message_size;
12512                    let inner = self.inner.clone();
12513                    let fut = async move {
12514                        let method = UpdateTeamSvc(inner);
12515                        let codec = tonic_prost::ProstCodec::default();
12516                        let mut grpc = tonic::server::Grpc::new(codec)
12517                            .apply_compression_config(
12518                                accept_compression_encodings,
12519                                send_compression_encodings,
12520                            )
12521                            .apply_max_message_size_config(
12522                                max_decoding_message_size,
12523                                max_encoding_message_size,
12524                            );
12525                        let res = grpc.unary(method, req).await;
12526                        Ok(res)
12527                    };
12528                    Box::pin(fut)
12529                }
12530                "/pidgr.v1.TeamService/DeleteTeam" => {
12531                    #[allow(non_camel_case_types)]
12532                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
12533                    impl<
12534                        T: TeamService,
12535                    > tonic::server::UnaryService<super::DeleteTeamRequest>
12536                    for DeleteTeamSvc<T> {
12537                        type Response = super::DeleteTeamResponse;
12538                        type Future = BoxFuture<
12539                            tonic::Response<Self::Response>,
12540                            tonic::Status,
12541                        >;
12542                        fn call(
12543                            &mut self,
12544                            request: tonic::Request<super::DeleteTeamRequest>,
12545                        ) -> Self::Future {
12546                            let inner = Arc::clone(&self.0);
12547                            let fut = async move {
12548                                <T as TeamService>::delete_team(&inner, request).await
12549                            };
12550                            Box::pin(fut)
12551                        }
12552                    }
12553                    let accept_compression_encodings = self.accept_compression_encodings;
12554                    let send_compression_encodings = self.send_compression_encodings;
12555                    let max_decoding_message_size = self.max_decoding_message_size;
12556                    let max_encoding_message_size = self.max_encoding_message_size;
12557                    let inner = self.inner.clone();
12558                    let fut = async move {
12559                        let method = DeleteTeamSvc(inner);
12560                        let codec = tonic_prost::ProstCodec::default();
12561                        let mut grpc = tonic::server::Grpc::new(codec)
12562                            .apply_compression_config(
12563                                accept_compression_encodings,
12564                                send_compression_encodings,
12565                            )
12566                            .apply_max_message_size_config(
12567                                max_decoding_message_size,
12568                                max_encoding_message_size,
12569                            );
12570                        let res = grpc.unary(method, req).await;
12571                        Ok(res)
12572                    };
12573                    Box::pin(fut)
12574                }
12575                "/pidgr.v1.TeamService/AddTeamMembers" => {
12576                    #[allow(non_camel_case_types)]
12577                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
12578                    impl<
12579                        T: TeamService,
12580                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
12581                    for AddTeamMembersSvc<T> {
12582                        type Response = super::AddTeamMembersResponse;
12583                        type Future = BoxFuture<
12584                            tonic::Response<Self::Response>,
12585                            tonic::Status,
12586                        >;
12587                        fn call(
12588                            &mut self,
12589                            request: tonic::Request<super::AddTeamMembersRequest>,
12590                        ) -> Self::Future {
12591                            let inner = Arc::clone(&self.0);
12592                            let fut = async move {
12593                                <T as TeamService>::add_team_members(&inner, request).await
12594                            };
12595                            Box::pin(fut)
12596                        }
12597                    }
12598                    let accept_compression_encodings = self.accept_compression_encodings;
12599                    let send_compression_encodings = self.send_compression_encodings;
12600                    let max_decoding_message_size = self.max_decoding_message_size;
12601                    let max_encoding_message_size = self.max_encoding_message_size;
12602                    let inner = self.inner.clone();
12603                    let fut = async move {
12604                        let method = AddTeamMembersSvc(inner);
12605                        let codec = tonic_prost::ProstCodec::default();
12606                        let mut grpc = tonic::server::Grpc::new(codec)
12607                            .apply_compression_config(
12608                                accept_compression_encodings,
12609                                send_compression_encodings,
12610                            )
12611                            .apply_max_message_size_config(
12612                                max_decoding_message_size,
12613                                max_encoding_message_size,
12614                            );
12615                        let res = grpc.unary(method, req).await;
12616                        Ok(res)
12617                    };
12618                    Box::pin(fut)
12619                }
12620                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
12621                    #[allow(non_camel_case_types)]
12622                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
12623                    impl<
12624                        T: TeamService,
12625                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
12626                    for RemoveTeamMembersSvc<T> {
12627                        type Response = super::RemoveTeamMembersResponse;
12628                        type Future = BoxFuture<
12629                            tonic::Response<Self::Response>,
12630                            tonic::Status,
12631                        >;
12632                        fn call(
12633                            &mut self,
12634                            request: tonic::Request<super::RemoveTeamMembersRequest>,
12635                        ) -> Self::Future {
12636                            let inner = Arc::clone(&self.0);
12637                            let fut = async move {
12638                                <T as TeamService>::remove_team_members(&inner, request)
12639                                    .await
12640                            };
12641                            Box::pin(fut)
12642                        }
12643                    }
12644                    let accept_compression_encodings = self.accept_compression_encodings;
12645                    let send_compression_encodings = self.send_compression_encodings;
12646                    let max_decoding_message_size = self.max_decoding_message_size;
12647                    let max_encoding_message_size = self.max_encoding_message_size;
12648                    let inner = self.inner.clone();
12649                    let fut = async move {
12650                        let method = RemoveTeamMembersSvc(inner);
12651                        let codec = tonic_prost::ProstCodec::default();
12652                        let mut grpc = tonic::server::Grpc::new(codec)
12653                            .apply_compression_config(
12654                                accept_compression_encodings,
12655                                send_compression_encodings,
12656                            )
12657                            .apply_max_message_size_config(
12658                                max_decoding_message_size,
12659                                max_encoding_message_size,
12660                            );
12661                        let res = grpc.unary(method, req).await;
12662                        Ok(res)
12663                    };
12664                    Box::pin(fut)
12665                }
12666                "/pidgr.v1.TeamService/ListTeamMembers" => {
12667                    #[allow(non_camel_case_types)]
12668                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
12669                    impl<
12670                        T: TeamService,
12671                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
12672                    for ListTeamMembersSvc<T> {
12673                        type Response = super::ListTeamMembersResponse;
12674                        type Future = BoxFuture<
12675                            tonic::Response<Self::Response>,
12676                            tonic::Status,
12677                        >;
12678                        fn call(
12679                            &mut self,
12680                            request: tonic::Request<super::ListTeamMembersRequest>,
12681                        ) -> Self::Future {
12682                            let inner = Arc::clone(&self.0);
12683                            let fut = async move {
12684                                <T as TeamService>::list_team_members(&inner, request).await
12685                            };
12686                            Box::pin(fut)
12687                        }
12688                    }
12689                    let accept_compression_encodings = self.accept_compression_encodings;
12690                    let send_compression_encodings = self.send_compression_encodings;
12691                    let max_decoding_message_size = self.max_decoding_message_size;
12692                    let max_encoding_message_size = self.max_encoding_message_size;
12693                    let inner = self.inner.clone();
12694                    let fut = async move {
12695                        let method = ListTeamMembersSvc(inner);
12696                        let codec = tonic_prost::ProstCodec::default();
12697                        let mut grpc = tonic::server::Grpc::new(codec)
12698                            .apply_compression_config(
12699                                accept_compression_encodings,
12700                                send_compression_encodings,
12701                            )
12702                            .apply_max_message_size_config(
12703                                max_decoding_message_size,
12704                                max_encoding_message_size,
12705                            );
12706                        let res = grpc.unary(method, req).await;
12707                        Ok(res)
12708                    };
12709                    Box::pin(fut)
12710                }
12711                _ => {
12712                    Box::pin(async move {
12713                        let mut response = http::Response::new(
12714                            tonic::body::Body::default(),
12715                        );
12716                        let headers = response.headers_mut();
12717                        headers
12718                            .insert(
12719                                tonic::Status::GRPC_STATUS,
12720                                (tonic::Code::Unimplemented as i32).into(),
12721                            );
12722                        headers
12723                            .insert(
12724                                http::header::CONTENT_TYPE,
12725                                tonic::metadata::GRPC_CONTENT_TYPE,
12726                            );
12727                        Ok(response)
12728                    })
12729                }
12730            }
12731        }
12732    }
12733    impl<T> Clone for TeamServiceServer<T> {
12734        fn clone(&self) -> Self {
12735            let inner = self.inner.clone();
12736            Self {
12737                inner,
12738                accept_compression_encodings: self.accept_compression_encodings,
12739                send_compression_encodings: self.send_compression_encodings,
12740                max_decoding_message_size: self.max_decoding_message_size,
12741                max_encoding_message_size: self.max_encoding_message_size,
12742            }
12743        }
12744    }
12745    /// Generated gRPC service name
12746    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
12747    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
12748        const NAME: &'static str = SERVICE_NAME;
12749    }
12750}
12751/// Generated client implementations.
12752pub mod template_service_client {
12753    #![allow(
12754        unused_variables,
12755        dead_code,
12756        missing_docs,
12757        clippy::wildcard_imports,
12758        clippy::let_unit_value,
12759    )]
12760    use tonic::codegen::*;
12761    use tonic::codegen::http::Uri;
12762    /** Manages versioned message templates used by campaigns.
12763 Templates are append-only — updates create new versions while preserving history.
12764*/
12765    #[derive(Debug, Clone)]
12766    pub struct TemplateServiceClient<T> {
12767        inner: tonic::client::Grpc<T>,
12768    }
12769    impl TemplateServiceClient<tonic::transport::Channel> {
12770        /// Attempt to create a new client by connecting to a given endpoint.
12771        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12772        where
12773            D: TryInto<tonic::transport::Endpoint>,
12774            D::Error: Into<StdError>,
12775        {
12776            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12777            Ok(Self::new(conn))
12778        }
12779    }
12780    impl<T> TemplateServiceClient<T>
12781    where
12782        T: tonic::client::GrpcService<tonic::body::Body>,
12783        T::Error: Into<StdError>,
12784        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12785        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12786    {
12787        pub fn new(inner: T) -> Self {
12788            let inner = tonic::client::Grpc::new(inner);
12789            Self { inner }
12790        }
12791        pub fn with_origin(inner: T, origin: Uri) -> Self {
12792            let inner = tonic::client::Grpc::with_origin(inner, origin);
12793            Self { inner }
12794        }
12795        pub fn with_interceptor<F>(
12796            inner: T,
12797            interceptor: F,
12798        ) -> TemplateServiceClient<InterceptedService<T, F>>
12799        where
12800            F: tonic::service::Interceptor,
12801            T::ResponseBody: Default,
12802            T: tonic::codegen::Service<
12803                http::Request<tonic::body::Body>,
12804                Response = http::Response<
12805                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12806                >,
12807            >,
12808            <T as tonic::codegen::Service<
12809                http::Request<tonic::body::Body>,
12810            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12811        {
12812            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
12813        }
12814        /// Compress requests with the given encoding.
12815        ///
12816        /// This requires the server to support it otherwise it might respond with an
12817        /// error.
12818        #[must_use]
12819        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12820            self.inner = self.inner.send_compressed(encoding);
12821            self
12822        }
12823        /// Enable decompressing responses.
12824        #[must_use]
12825        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12826            self.inner = self.inner.accept_compressed(encoding);
12827            self
12828        }
12829        /// Limits the maximum size of a decoded message.
12830        ///
12831        /// Default: `4MB`
12832        #[must_use]
12833        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12834            self.inner = self.inner.max_decoding_message_size(limit);
12835            self
12836        }
12837        /// Limits the maximum size of an encoded message.
12838        ///
12839        /// Default: `usize::MAX`
12840        #[must_use]
12841        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12842            self.inner = self.inner.max_encoding_message_size(limit);
12843            self
12844        }
12845        /** Create a new template with a body and variable definitions.
12846 Authorization: Requires MANAGER+ role.
12847*/
12848        pub async fn create_template(
12849            &mut self,
12850            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
12851        ) -> std::result::Result<
12852            tonic::Response<super::CreateTemplateResponse>,
12853            tonic::Status,
12854        > {
12855            self.inner
12856                .ready()
12857                .await
12858                .map_err(|e| {
12859                    tonic::Status::unknown(
12860                        format!("Service was not ready: {}", e.into()),
12861                    )
12862                })?;
12863            let codec = tonic_prost::ProstCodec::default();
12864            let path = http::uri::PathAndQuery::from_static(
12865                "/pidgr.v1.TemplateService/CreateTemplate",
12866            );
12867            let mut req = request.into_request();
12868            req.extensions_mut()
12869                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
12870            self.inner.unary(req, path, codec).await
12871        }
12872        /** Update an existing template, creating a new version.
12873 Authorization: Requires MANAGER+ role.
12874*/
12875        pub async fn update_template(
12876            &mut self,
12877            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
12878        ) -> std::result::Result<
12879            tonic::Response<super::UpdateTemplateResponse>,
12880            tonic::Status,
12881        > {
12882            self.inner
12883                .ready()
12884                .await
12885                .map_err(|e| {
12886                    tonic::Status::unknown(
12887                        format!("Service was not ready: {}", e.into()),
12888                    )
12889                })?;
12890            let codec = tonic_prost::ProstCodec::default();
12891            let path = http::uri::PathAndQuery::from_static(
12892                "/pidgr.v1.TemplateService/UpdateTemplate",
12893            );
12894            let mut req = request.into_request();
12895            req.extensions_mut()
12896                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
12897            self.inner.unary(req, path, codec).await
12898        }
12899        /** Retrieve a specific template by ID and optional version.
12900 Authorization: Authenticated user within the organization.
12901*/
12902        pub async fn get_template(
12903            &mut self,
12904            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
12905        ) -> std::result::Result<
12906            tonic::Response<super::GetTemplateResponse>,
12907            tonic::Status,
12908        > {
12909            self.inner
12910                .ready()
12911                .await
12912                .map_err(|e| {
12913                    tonic::Status::unknown(
12914                        format!("Service was not ready: {}", e.into()),
12915                    )
12916                })?;
12917            let codec = tonic_prost::ProstCodec::default();
12918            let path = http::uri::PathAndQuery::from_static(
12919                "/pidgr.v1.TemplateService/GetTemplate",
12920            );
12921            let mut req = request.into_request();
12922            req.extensions_mut()
12923                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
12924            self.inner.unary(req, path, codec).await
12925        }
12926        /** List all templates for the organization with pagination.
12927 Authorization: Authenticated user within the organization.
12928*/
12929        pub async fn list_templates(
12930            &mut self,
12931            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
12932        ) -> std::result::Result<
12933            tonic::Response<super::ListTemplatesResponse>,
12934            tonic::Status,
12935        > {
12936            self.inner
12937                .ready()
12938                .await
12939                .map_err(|e| {
12940                    tonic::Status::unknown(
12941                        format!("Service was not ready: {}", e.into()),
12942                    )
12943                })?;
12944            let codec = tonic_prost::ProstCodec::default();
12945            let path = http::uri::PathAndQuery::from_static(
12946                "/pidgr.v1.TemplateService/ListTemplates",
12947            );
12948            let mut req = request.into_request();
12949            req.extensions_mut()
12950                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
12951            self.inner.unary(req, path, codec).await
12952        }
12953        /** Create a locale-specific translation of a template.
12954 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12955*/
12956        pub async fn create_template_translation(
12957            &mut self,
12958            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
12959        ) -> std::result::Result<
12960            tonic::Response<super::CreateTemplateTranslationResponse>,
12961            tonic::Status,
12962        > {
12963            self.inner
12964                .ready()
12965                .await
12966                .map_err(|e| {
12967                    tonic::Status::unknown(
12968                        format!("Service was not ready: {}", e.into()),
12969                    )
12970                })?;
12971            let codec = tonic_prost::ProstCodec::default();
12972            let path = http::uri::PathAndQuery::from_static(
12973                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
12974            );
12975            let mut req = request.into_request();
12976            req.extensions_mut()
12977                .insert(
12978                    GrpcMethod::new(
12979                        "pidgr.v1.TemplateService",
12980                        "CreateTemplateTranslation",
12981                    ),
12982                );
12983            self.inner.unary(req, path, codec).await
12984        }
12985        /** Update an existing template translation.
12986 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12987*/
12988        pub async fn update_template_translation(
12989            &mut self,
12990            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
12991        ) -> std::result::Result<
12992            tonic::Response<super::UpdateTemplateTranslationResponse>,
12993            tonic::Status,
12994        > {
12995            self.inner
12996                .ready()
12997                .await
12998                .map_err(|e| {
12999                    tonic::Status::unknown(
13000                        format!("Service was not ready: {}", e.into()),
13001                    )
13002                })?;
13003            let codec = tonic_prost::ProstCodec::default();
13004            let path = http::uri::PathAndQuery::from_static(
13005                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
13006            );
13007            let mut req = request.into_request();
13008            req.extensions_mut()
13009                .insert(
13010                    GrpcMethod::new(
13011                        "pidgr.v1.TemplateService",
13012                        "UpdateTemplateTranslation",
13013                    ),
13014                );
13015            self.inner.unary(req, path, codec).await
13016        }
13017        /** List all translations for a template version.
13018 Authorization: Requires PERMISSION_TEMPLATES_READ.
13019*/
13020        pub async fn list_template_translations(
13021            &mut self,
13022            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
13023        ) -> std::result::Result<
13024            tonic::Response<super::ListTemplateTranslationsResponse>,
13025            tonic::Status,
13026        > {
13027            self.inner
13028                .ready()
13029                .await
13030                .map_err(|e| {
13031                    tonic::Status::unknown(
13032                        format!("Service was not ready: {}", e.into()),
13033                    )
13034                })?;
13035            let codec = tonic_prost::ProstCodec::default();
13036            let path = http::uri::PathAndQuery::from_static(
13037                "/pidgr.v1.TemplateService/ListTemplateTranslations",
13038            );
13039            let mut req = request.into_request();
13040            req.extensions_mut()
13041                .insert(
13042                    GrpcMethod::new(
13043                        "pidgr.v1.TemplateService",
13044                        "ListTemplateTranslations",
13045                    ),
13046                );
13047            self.inner.unary(req, path, codec).await
13048        }
13049        /** Approve a template translation for use in campaigns.
13050 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13051*/
13052        pub async fn approve_template_translation(
13053            &mut self,
13054            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
13055        ) -> std::result::Result<
13056            tonic::Response<super::ApproveTemplateTranslationResponse>,
13057            tonic::Status,
13058        > {
13059            self.inner
13060                .ready()
13061                .await
13062                .map_err(|e| {
13063                    tonic::Status::unknown(
13064                        format!("Service was not ready: {}", e.into()),
13065                    )
13066                })?;
13067            let codec = tonic_prost::ProstCodec::default();
13068            let path = http::uri::PathAndQuery::from_static(
13069                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
13070            );
13071            let mut req = request.into_request();
13072            req.extensions_mut()
13073                .insert(
13074                    GrpcMethod::new(
13075                        "pidgr.v1.TemplateService",
13076                        "ApproveTemplateTranslation",
13077                    ),
13078                );
13079            self.inner.unary(req, path, codec).await
13080        }
13081    }
13082}
13083/// Generated server implementations.
13084pub mod template_service_server {
13085    #![allow(
13086        unused_variables,
13087        dead_code,
13088        missing_docs,
13089        clippy::wildcard_imports,
13090        clippy::let_unit_value,
13091    )]
13092    use tonic::codegen::*;
13093    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
13094    #[async_trait]
13095    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
13096        /** Create a new template with a body and variable definitions.
13097 Authorization: Requires MANAGER+ role.
13098*/
13099        async fn create_template(
13100            &self,
13101            request: tonic::Request<super::CreateTemplateRequest>,
13102        ) -> std::result::Result<
13103            tonic::Response<super::CreateTemplateResponse>,
13104            tonic::Status,
13105        >;
13106        /** Update an existing template, creating a new version.
13107 Authorization: Requires MANAGER+ role.
13108*/
13109        async fn update_template(
13110            &self,
13111            request: tonic::Request<super::UpdateTemplateRequest>,
13112        ) -> std::result::Result<
13113            tonic::Response<super::UpdateTemplateResponse>,
13114            tonic::Status,
13115        >;
13116        /** Retrieve a specific template by ID and optional version.
13117 Authorization: Authenticated user within the organization.
13118*/
13119        async fn get_template(
13120            &self,
13121            request: tonic::Request<super::GetTemplateRequest>,
13122        ) -> std::result::Result<
13123            tonic::Response<super::GetTemplateResponse>,
13124            tonic::Status,
13125        >;
13126        /** List all templates for the organization with pagination.
13127 Authorization: Authenticated user within the organization.
13128*/
13129        async fn list_templates(
13130            &self,
13131            request: tonic::Request<super::ListTemplatesRequest>,
13132        ) -> std::result::Result<
13133            tonic::Response<super::ListTemplatesResponse>,
13134            tonic::Status,
13135        >;
13136        /** Create a locale-specific translation of a template.
13137 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13138*/
13139        async fn create_template_translation(
13140            &self,
13141            request: tonic::Request<super::CreateTemplateTranslationRequest>,
13142        ) -> std::result::Result<
13143            tonic::Response<super::CreateTemplateTranslationResponse>,
13144            tonic::Status,
13145        >;
13146        /** Update an existing template translation.
13147 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13148*/
13149        async fn update_template_translation(
13150            &self,
13151            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
13152        ) -> std::result::Result<
13153            tonic::Response<super::UpdateTemplateTranslationResponse>,
13154            tonic::Status,
13155        >;
13156        /** List all translations for a template version.
13157 Authorization: Requires PERMISSION_TEMPLATES_READ.
13158*/
13159        async fn list_template_translations(
13160            &self,
13161            request: tonic::Request<super::ListTemplateTranslationsRequest>,
13162        ) -> std::result::Result<
13163            tonic::Response<super::ListTemplateTranslationsResponse>,
13164            tonic::Status,
13165        >;
13166        /** Approve a template translation for use in campaigns.
13167 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13168*/
13169        async fn approve_template_translation(
13170            &self,
13171            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
13172        ) -> std::result::Result<
13173            tonic::Response<super::ApproveTemplateTranslationResponse>,
13174            tonic::Status,
13175        >;
13176    }
13177    /** Manages versioned message templates used by campaigns.
13178 Templates are append-only — updates create new versions while preserving history.
13179*/
13180    #[derive(Debug)]
13181    pub struct TemplateServiceServer<T> {
13182        inner: Arc<T>,
13183        accept_compression_encodings: EnabledCompressionEncodings,
13184        send_compression_encodings: EnabledCompressionEncodings,
13185        max_decoding_message_size: Option<usize>,
13186        max_encoding_message_size: Option<usize>,
13187    }
13188    impl<T> TemplateServiceServer<T> {
13189        pub fn new(inner: T) -> Self {
13190            Self::from_arc(Arc::new(inner))
13191        }
13192        pub fn from_arc(inner: Arc<T>) -> Self {
13193            Self {
13194                inner,
13195                accept_compression_encodings: Default::default(),
13196                send_compression_encodings: Default::default(),
13197                max_decoding_message_size: None,
13198                max_encoding_message_size: None,
13199            }
13200        }
13201        pub fn with_interceptor<F>(
13202            inner: T,
13203            interceptor: F,
13204        ) -> InterceptedService<Self, F>
13205        where
13206            F: tonic::service::Interceptor,
13207        {
13208            InterceptedService::new(Self::new(inner), interceptor)
13209        }
13210        /// Enable decompressing requests with the given encoding.
13211        #[must_use]
13212        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13213            self.accept_compression_encodings.enable(encoding);
13214            self
13215        }
13216        /// Compress responses with the given encoding, if the client supports it.
13217        #[must_use]
13218        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13219            self.send_compression_encodings.enable(encoding);
13220            self
13221        }
13222        /// Limits the maximum size of a decoded message.
13223        ///
13224        /// Default: `4MB`
13225        #[must_use]
13226        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13227            self.max_decoding_message_size = Some(limit);
13228            self
13229        }
13230        /// Limits the maximum size of an encoded message.
13231        ///
13232        /// Default: `usize::MAX`
13233        #[must_use]
13234        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13235            self.max_encoding_message_size = Some(limit);
13236            self
13237        }
13238    }
13239    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
13240    where
13241        T: TemplateService,
13242        B: Body + std::marker::Send + 'static,
13243        B::Error: Into<StdError> + std::marker::Send + 'static,
13244    {
13245        type Response = http::Response<tonic::body::Body>;
13246        type Error = std::convert::Infallible;
13247        type Future = BoxFuture<Self::Response, Self::Error>;
13248        fn poll_ready(
13249            &mut self,
13250            _cx: &mut Context<'_>,
13251        ) -> Poll<std::result::Result<(), Self::Error>> {
13252            Poll::Ready(Ok(()))
13253        }
13254        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13255            match req.uri().path() {
13256                "/pidgr.v1.TemplateService/CreateTemplate" => {
13257                    #[allow(non_camel_case_types)]
13258                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
13259                    impl<
13260                        T: TemplateService,
13261                    > tonic::server::UnaryService<super::CreateTemplateRequest>
13262                    for CreateTemplateSvc<T> {
13263                        type Response = super::CreateTemplateResponse;
13264                        type Future = BoxFuture<
13265                            tonic::Response<Self::Response>,
13266                            tonic::Status,
13267                        >;
13268                        fn call(
13269                            &mut self,
13270                            request: tonic::Request<super::CreateTemplateRequest>,
13271                        ) -> Self::Future {
13272                            let inner = Arc::clone(&self.0);
13273                            let fut = async move {
13274                                <T as TemplateService>::create_template(&inner, request)
13275                                    .await
13276                            };
13277                            Box::pin(fut)
13278                        }
13279                    }
13280                    let accept_compression_encodings = self.accept_compression_encodings;
13281                    let send_compression_encodings = self.send_compression_encodings;
13282                    let max_decoding_message_size = self.max_decoding_message_size;
13283                    let max_encoding_message_size = self.max_encoding_message_size;
13284                    let inner = self.inner.clone();
13285                    let fut = async move {
13286                        let method = CreateTemplateSvc(inner);
13287                        let codec = tonic_prost::ProstCodec::default();
13288                        let mut grpc = tonic::server::Grpc::new(codec)
13289                            .apply_compression_config(
13290                                accept_compression_encodings,
13291                                send_compression_encodings,
13292                            )
13293                            .apply_max_message_size_config(
13294                                max_decoding_message_size,
13295                                max_encoding_message_size,
13296                            );
13297                        let res = grpc.unary(method, req).await;
13298                        Ok(res)
13299                    };
13300                    Box::pin(fut)
13301                }
13302                "/pidgr.v1.TemplateService/UpdateTemplate" => {
13303                    #[allow(non_camel_case_types)]
13304                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
13305                    impl<
13306                        T: TemplateService,
13307                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
13308                    for UpdateTemplateSvc<T> {
13309                        type Response = super::UpdateTemplateResponse;
13310                        type Future = BoxFuture<
13311                            tonic::Response<Self::Response>,
13312                            tonic::Status,
13313                        >;
13314                        fn call(
13315                            &mut self,
13316                            request: tonic::Request<super::UpdateTemplateRequest>,
13317                        ) -> Self::Future {
13318                            let inner = Arc::clone(&self.0);
13319                            let fut = async move {
13320                                <T as TemplateService>::update_template(&inner, request)
13321                                    .await
13322                            };
13323                            Box::pin(fut)
13324                        }
13325                    }
13326                    let accept_compression_encodings = self.accept_compression_encodings;
13327                    let send_compression_encodings = self.send_compression_encodings;
13328                    let max_decoding_message_size = self.max_decoding_message_size;
13329                    let max_encoding_message_size = self.max_encoding_message_size;
13330                    let inner = self.inner.clone();
13331                    let fut = async move {
13332                        let method = UpdateTemplateSvc(inner);
13333                        let codec = tonic_prost::ProstCodec::default();
13334                        let mut grpc = tonic::server::Grpc::new(codec)
13335                            .apply_compression_config(
13336                                accept_compression_encodings,
13337                                send_compression_encodings,
13338                            )
13339                            .apply_max_message_size_config(
13340                                max_decoding_message_size,
13341                                max_encoding_message_size,
13342                            );
13343                        let res = grpc.unary(method, req).await;
13344                        Ok(res)
13345                    };
13346                    Box::pin(fut)
13347                }
13348                "/pidgr.v1.TemplateService/GetTemplate" => {
13349                    #[allow(non_camel_case_types)]
13350                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
13351                    impl<
13352                        T: TemplateService,
13353                    > tonic::server::UnaryService<super::GetTemplateRequest>
13354                    for GetTemplateSvc<T> {
13355                        type Response = super::GetTemplateResponse;
13356                        type Future = BoxFuture<
13357                            tonic::Response<Self::Response>,
13358                            tonic::Status,
13359                        >;
13360                        fn call(
13361                            &mut self,
13362                            request: tonic::Request<super::GetTemplateRequest>,
13363                        ) -> Self::Future {
13364                            let inner = Arc::clone(&self.0);
13365                            let fut = async move {
13366                                <T as TemplateService>::get_template(&inner, request).await
13367                            };
13368                            Box::pin(fut)
13369                        }
13370                    }
13371                    let accept_compression_encodings = self.accept_compression_encodings;
13372                    let send_compression_encodings = self.send_compression_encodings;
13373                    let max_decoding_message_size = self.max_decoding_message_size;
13374                    let max_encoding_message_size = self.max_encoding_message_size;
13375                    let inner = self.inner.clone();
13376                    let fut = async move {
13377                        let method = GetTemplateSvc(inner);
13378                        let codec = tonic_prost::ProstCodec::default();
13379                        let mut grpc = tonic::server::Grpc::new(codec)
13380                            .apply_compression_config(
13381                                accept_compression_encodings,
13382                                send_compression_encodings,
13383                            )
13384                            .apply_max_message_size_config(
13385                                max_decoding_message_size,
13386                                max_encoding_message_size,
13387                            );
13388                        let res = grpc.unary(method, req).await;
13389                        Ok(res)
13390                    };
13391                    Box::pin(fut)
13392                }
13393                "/pidgr.v1.TemplateService/ListTemplates" => {
13394                    #[allow(non_camel_case_types)]
13395                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
13396                    impl<
13397                        T: TemplateService,
13398                    > tonic::server::UnaryService<super::ListTemplatesRequest>
13399                    for ListTemplatesSvc<T> {
13400                        type Response = super::ListTemplatesResponse;
13401                        type Future = BoxFuture<
13402                            tonic::Response<Self::Response>,
13403                            tonic::Status,
13404                        >;
13405                        fn call(
13406                            &mut self,
13407                            request: tonic::Request<super::ListTemplatesRequest>,
13408                        ) -> Self::Future {
13409                            let inner = Arc::clone(&self.0);
13410                            let fut = async move {
13411                                <T as TemplateService>::list_templates(&inner, request)
13412                                    .await
13413                            };
13414                            Box::pin(fut)
13415                        }
13416                    }
13417                    let accept_compression_encodings = self.accept_compression_encodings;
13418                    let send_compression_encodings = self.send_compression_encodings;
13419                    let max_decoding_message_size = self.max_decoding_message_size;
13420                    let max_encoding_message_size = self.max_encoding_message_size;
13421                    let inner = self.inner.clone();
13422                    let fut = async move {
13423                        let method = ListTemplatesSvc(inner);
13424                        let codec = tonic_prost::ProstCodec::default();
13425                        let mut grpc = tonic::server::Grpc::new(codec)
13426                            .apply_compression_config(
13427                                accept_compression_encodings,
13428                                send_compression_encodings,
13429                            )
13430                            .apply_max_message_size_config(
13431                                max_decoding_message_size,
13432                                max_encoding_message_size,
13433                            );
13434                        let res = grpc.unary(method, req).await;
13435                        Ok(res)
13436                    };
13437                    Box::pin(fut)
13438                }
13439                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
13440                    #[allow(non_camel_case_types)]
13441                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13442                    impl<
13443                        T: TemplateService,
13444                    > tonic::server::UnaryService<
13445                        super::CreateTemplateTranslationRequest,
13446                    > for CreateTemplateTranslationSvc<T> {
13447                        type Response = super::CreateTemplateTranslationResponse;
13448                        type Future = BoxFuture<
13449                            tonic::Response<Self::Response>,
13450                            tonic::Status,
13451                        >;
13452                        fn call(
13453                            &mut self,
13454                            request: tonic::Request<
13455                                super::CreateTemplateTranslationRequest,
13456                            >,
13457                        ) -> Self::Future {
13458                            let inner = Arc::clone(&self.0);
13459                            let fut = async move {
13460                                <T as TemplateService>::create_template_translation(
13461                                        &inner,
13462                                        request,
13463                                    )
13464                                    .await
13465                            };
13466                            Box::pin(fut)
13467                        }
13468                    }
13469                    let accept_compression_encodings = self.accept_compression_encodings;
13470                    let send_compression_encodings = self.send_compression_encodings;
13471                    let max_decoding_message_size = self.max_decoding_message_size;
13472                    let max_encoding_message_size = self.max_encoding_message_size;
13473                    let inner = self.inner.clone();
13474                    let fut = async move {
13475                        let method = CreateTemplateTranslationSvc(inner);
13476                        let codec = tonic_prost::ProstCodec::default();
13477                        let mut grpc = tonic::server::Grpc::new(codec)
13478                            .apply_compression_config(
13479                                accept_compression_encodings,
13480                                send_compression_encodings,
13481                            )
13482                            .apply_max_message_size_config(
13483                                max_decoding_message_size,
13484                                max_encoding_message_size,
13485                            );
13486                        let res = grpc.unary(method, req).await;
13487                        Ok(res)
13488                    };
13489                    Box::pin(fut)
13490                }
13491                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
13492                    #[allow(non_camel_case_types)]
13493                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13494                    impl<
13495                        T: TemplateService,
13496                    > tonic::server::UnaryService<
13497                        super::UpdateTemplateTranslationRequest,
13498                    > for UpdateTemplateTranslationSvc<T> {
13499                        type Response = super::UpdateTemplateTranslationResponse;
13500                        type Future = BoxFuture<
13501                            tonic::Response<Self::Response>,
13502                            tonic::Status,
13503                        >;
13504                        fn call(
13505                            &mut self,
13506                            request: tonic::Request<
13507                                super::UpdateTemplateTranslationRequest,
13508                            >,
13509                        ) -> Self::Future {
13510                            let inner = Arc::clone(&self.0);
13511                            let fut = async move {
13512                                <T as TemplateService>::update_template_translation(
13513                                        &inner,
13514                                        request,
13515                                    )
13516                                    .await
13517                            };
13518                            Box::pin(fut)
13519                        }
13520                    }
13521                    let accept_compression_encodings = self.accept_compression_encodings;
13522                    let send_compression_encodings = self.send_compression_encodings;
13523                    let max_decoding_message_size = self.max_decoding_message_size;
13524                    let max_encoding_message_size = self.max_encoding_message_size;
13525                    let inner = self.inner.clone();
13526                    let fut = async move {
13527                        let method = UpdateTemplateTranslationSvc(inner);
13528                        let codec = tonic_prost::ProstCodec::default();
13529                        let mut grpc = tonic::server::Grpc::new(codec)
13530                            .apply_compression_config(
13531                                accept_compression_encodings,
13532                                send_compression_encodings,
13533                            )
13534                            .apply_max_message_size_config(
13535                                max_decoding_message_size,
13536                                max_encoding_message_size,
13537                            );
13538                        let res = grpc.unary(method, req).await;
13539                        Ok(res)
13540                    };
13541                    Box::pin(fut)
13542                }
13543                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
13544                    #[allow(non_camel_case_types)]
13545                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
13546                    impl<
13547                        T: TemplateService,
13548                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
13549                    for ListTemplateTranslationsSvc<T> {
13550                        type Response = super::ListTemplateTranslationsResponse;
13551                        type Future = BoxFuture<
13552                            tonic::Response<Self::Response>,
13553                            tonic::Status,
13554                        >;
13555                        fn call(
13556                            &mut self,
13557                            request: tonic::Request<
13558                                super::ListTemplateTranslationsRequest,
13559                            >,
13560                        ) -> Self::Future {
13561                            let inner = Arc::clone(&self.0);
13562                            let fut = async move {
13563                                <T as TemplateService>::list_template_translations(
13564                                        &inner,
13565                                        request,
13566                                    )
13567                                    .await
13568                            };
13569                            Box::pin(fut)
13570                        }
13571                    }
13572                    let accept_compression_encodings = self.accept_compression_encodings;
13573                    let send_compression_encodings = self.send_compression_encodings;
13574                    let max_decoding_message_size = self.max_decoding_message_size;
13575                    let max_encoding_message_size = self.max_encoding_message_size;
13576                    let inner = self.inner.clone();
13577                    let fut = async move {
13578                        let method = ListTemplateTranslationsSvc(inner);
13579                        let codec = tonic_prost::ProstCodec::default();
13580                        let mut grpc = tonic::server::Grpc::new(codec)
13581                            .apply_compression_config(
13582                                accept_compression_encodings,
13583                                send_compression_encodings,
13584                            )
13585                            .apply_max_message_size_config(
13586                                max_decoding_message_size,
13587                                max_encoding_message_size,
13588                            );
13589                        let res = grpc.unary(method, req).await;
13590                        Ok(res)
13591                    };
13592                    Box::pin(fut)
13593                }
13594                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
13595                    #[allow(non_camel_case_types)]
13596                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13597                    impl<
13598                        T: TemplateService,
13599                    > tonic::server::UnaryService<
13600                        super::ApproveTemplateTranslationRequest,
13601                    > for ApproveTemplateTranslationSvc<T> {
13602                        type Response = super::ApproveTemplateTranslationResponse;
13603                        type Future = BoxFuture<
13604                            tonic::Response<Self::Response>,
13605                            tonic::Status,
13606                        >;
13607                        fn call(
13608                            &mut self,
13609                            request: tonic::Request<
13610                                super::ApproveTemplateTranslationRequest,
13611                            >,
13612                        ) -> Self::Future {
13613                            let inner = Arc::clone(&self.0);
13614                            let fut = async move {
13615                                <T as TemplateService>::approve_template_translation(
13616                                        &inner,
13617                                        request,
13618                                    )
13619                                    .await
13620                            };
13621                            Box::pin(fut)
13622                        }
13623                    }
13624                    let accept_compression_encodings = self.accept_compression_encodings;
13625                    let send_compression_encodings = self.send_compression_encodings;
13626                    let max_decoding_message_size = self.max_decoding_message_size;
13627                    let max_encoding_message_size = self.max_encoding_message_size;
13628                    let inner = self.inner.clone();
13629                    let fut = async move {
13630                        let method = ApproveTemplateTranslationSvc(inner);
13631                        let codec = tonic_prost::ProstCodec::default();
13632                        let mut grpc = tonic::server::Grpc::new(codec)
13633                            .apply_compression_config(
13634                                accept_compression_encodings,
13635                                send_compression_encodings,
13636                            )
13637                            .apply_max_message_size_config(
13638                                max_decoding_message_size,
13639                                max_encoding_message_size,
13640                            );
13641                        let res = grpc.unary(method, req).await;
13642                        Ok(res)
13643                    };
13644                    Box::pin(fut)
13645                }
13646                _ => {
13647                    Box::pin(async move {
13648                        let mut response = http::Response::new(
13649                            tonic::body::Body::default(),
13650                        );
13651                        let headers = response.headers_mut();
13652                        headers
13653                            .insert(
13654                                tonic::Status::GRPC_STATUS,
13655                                (tonic::Code::Unimplemented as i32).into(),
13656                            );
13657                        headers
13658                            .insert(
13659                                http::header::CONTENT_TYPE,
13660                                tonic::metadata::GRPC_CONTENT_TYPE,
13661                            );
13662                        Ok(response)
13663                    })
13664                }
13665            }
13666        }
13667    }
13668    impl<T> Clone for TemplateServiceServer<T> {
13669        fn clone(&self) -> Self {
13670            let inner = self.inner.clone();
13671            Self {
13672                inner,
13673                accept_compression_encodings: self.accept_compression_encodings,
13674                send_compression_encodings: self.send_compression_encodings,
13675                max_decoding_message_size: self.max_decoding_message_size,
13676                max_encoding_message_size: self.max_encoding_message_size,
13677            }
13678        }
13679    }
13680    /// Generated gRPC service name
13681    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
13682    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
13683        const NAME: &'static str = SERVICE_NAME;
13684    }
13685}